diff options
Diffstat (limited to 'int_array.c')
-rw-r--r-- | int_array.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/int_array.c b/int_array.c index 3a1c5966..9a982fb8 100644 --- a/int_array.c +++ b/int_array.c @@ -312,7 +312,7 @@ static NODE ** int_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED) { unsigned long i; - int j; + size_t j; BUCKET *b, *next; NODE *r; @@ -354,7 +354,7 @@ int_remove(NODE *symbol, NODE *subs) uint32_t hash1; BUCKET *b, *prev = NULL; long k; - int i; + size_t i; NODE *xn = symbol->xarray; if (symbol->table_size == 0 || symbol->buckets == NULL) @@ -447,9 +447,9 @@ removed: static NODE ** int_copy(NODE *symbol, NODE *newsymb) { - BUCKET **old, **new, **pnew; + BUCKET **old, **newtab, **pnew; BUCKET *chain, *newchain; - int j; + size_t j; unsigned long i, cursize; assert(symbol->buckets != NULL); @@ -458,12 +458,12 @@ int_copy(NODE *symbol, NODE *newsymb) cursize = symbol->array_size; /* allocate new table */ - ezalloc(new, BUCKET **, cursize * sizeof(BUCKET *), "int_copy"); + ezalloc(newtab, BUCKET **, cursize * sizeof(BUCKET *), "int_copy"); old = symbol->buckets; for (i = 0; i < cursize; i++) { - for (chain = old[i], pnew = & new[i]; chain != NULL; + for (chain = old[i], pnew = & newtab[i]; chain != NULL; chain = chain->ainext ) { getbucket(newchain); @@ -507,7 +507,7 @@ int_copy(NODE *symbol, NODE *newsymb) newsymb->xarray = NULL; newsymb->table_size = symbol->table_size; - newsymb->buckets = new; + newsymb->buckets = newtab; newsymb->array_size = cursize; newsymb->flags = symbol->flags; @@ -521,10 +521,12 @@ static NODE** int_list(NODE *symbol, NODE *t) { NODE **list = NULL; - unsigned long num_elems, list_size, i, k = 0; + unsigned long list_size, i, k = 0; + long num_elems; BUCKET *b; NODE *r, *subs, *xn; - int j, elem_size = 1; + int elem_size = 1; + size_t j; long num; static char buf[100]; assoc_kind_t assoc_kind; @@ -758,7 +760,7 @@ static inline NODE ** int_find(NODE *symbol, long k, uint32_t hash1) { BUCKET *b; - int i; + size_t i; assert(symbol->buckets != NULL); for (b = symbol->buckets[hash1]; b != NULL; b = b->ainext) { @@ -803,9 +805,9 @@ int_insert(NODE *symbol, long k, uint32_t hash1) static void grow_int_table(NODE *symbol) { - BUCKET **old, **new; + BUCKET **old, **newtab; BUCKET *chain, *next; - int i, j; + size_t i, j; unsigned long oldsize, newsize, k; /* @@ -841,10 +843,10 @@ grow_int_table(NODE *symbol) } /* allocate new table */ - ezalloc(new, BUCKET **, newsize * sizeof(BUCKET *), "grow_int_table"); + ezalloc(newtab, BUCKET **, newsize * sizeof(BUCKET *), "grow_int_table"); old = symbol->buckets; - symbol->buckets = new; + symbol->buckets = newtab; symbol->array_size = newsize; /* brand new hash table */ |