comparison vector.c @ 2:ec2f8f6f1dc9

Cleanup pass #1: Get rid of some ancient K&R-isms.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 24 Feb 2015 20:28:57 +0200
parents 4410c9c7750d
children a2a81589380d
comparison
equal deleted inserted replaced
1:cfcae2ef1c2b 2:ec2f8f6f1dc9
38 #include "options.h" 38 #include "options.h"
39 39
40 unsigned WordCount = 0; 40 unsigned WordCount = 0;
41 words *WordTable = NULL; 41 words *WordTable = NULL;
42 42
43 void AddWordEntry PROTO((ADDR_T start, ADDR_T end));
44 43
45 #ifndef __STDC__
46 void
47 AddWordEntry (start, end)
48 ADDR_T start;
49 ADDR_T end;
50 #else
51 void AddWordEntry (ADDR_T start, ADDR_T end) 44 void AddWordEntry (ADDR_T start, ADDR_T end)
52 #endif
53 { 45 {
54 words *entry; 46 words *entry;
55 47
56 entry = WordCount ? 48 entry = WordCount ?
57 realloc (WordTable, (WordCount + 1) * sizeof *entry) : 49 realloc (WordTable, (WordCount + 1) * sizeof *entry) :
63 entry += WordCount++; 55 entry += WordCount++;
64 entry->start = start; 56 entry->start = start;
65 entry->end = end; 57 entry->end = end;
66 } 58 }
67 59
68 #ifndef __STDC__ 60
69 ADDR_T
70 WordTableEnd (start)
71 ADDR_T start;
72 #else
73 ADDR_T WordTableEnd (ADDR_T start) 61 ADDR_T WordTableEnd (ADDR_T start)
74 #endif
75 { 62 {
76 words *entry; 63 words *entry;
77 64
78 if (!((entry = &WordTable[WordCount]))) 65 if (!((entry = &WordTable[WordCount])))
79 return start; 66 return start;
83 return entry->end; 70 return entry->end;
84 71
85 return start; 72 return start;
86 } 73 }
87 74
88 #ifndef __STDC__ 75
89 void
90 SearchVectors ()
91 #else
92 void SearchVectors (void) 76 void SearchVectors (void)
93 #endif
94 { 77 {
95 ADDR_T start, end, address; 78 ADDR_T start, end, address;
96 79
97 if ((Options & M_ADR_TABLES) == O_TBL_IGNORE) return; 80 if ((Options & M_ADR_TABLES) == O_TBL_IGNORE) return;
98 81