comparison macro.c @ 191:c8d4ab9aeff0

don't use "remove" as a local variable; fails on gcc4.1 (because of remove() in stdio.h)
author David A. Holland
date Fri, 12 Jun 2015 20:06:55 -0400
parents d359d9b86327
children 255db24bc29b
comparison
equal deleted inserted replaced
190:6947cd2cde79 191:c8d4ab9aeff0
338 macroarrayarray_cleanup(&macros); 338 macroarrayarray_cleanup(&macros);
339 } 339 }
340 340
341 static 341 static
342 struct macro * 342 struct macro *
343 macrotable_findlen(const char *name, size_t len, bool remove) 343 macrotable_findlen(const char *name, size_t len, bool remove_it)
344 { 344 {
345 unsigned hash; 345 unsigned hash;
346 struct macroarray *bucket; 346 struct macroarray *bucket;
347 struct macro *m, *m2; 347 struct macro *m, *m2;
348 unsigned i, num; 348 unsigned i, num;
359 if (hash != m->hash) { 359 if (hash != m->hash) {
360 continue; 360 continue;
361 } 361 }
362 mlen = strlen(m->name); 362 mlen = strlen(m->name);
363 if (len == mlen && !memcmp(name, m->name, len)) { 363 if (len == mlen && !memcmp(name, m->name, len)) {
364 if (remove) { 364 if (remove_it) {
365 if (i < num-1) { 365 if (i < num-1) {
366 m2 = macroarray_get(bucket, num-1); 366 m2 = macroarray_get(bucket, num-1);
367 macroarray_set(bucket, i, m2); 367 macroarray_set(bucket, i, m2);
368 } 368 }
369 macroarray_setsize(bucket, num-1); 369 macroarray_setsize(bucket, num-1);
375 return NULL; 375 return NULL;
376 } 376 }
377 377
378 static 378 static
379 struct macro * 379 struct macro *
380 macrotable_find(const char *name, bool remove) 380 macrotable_find(const char *name, bool remove_it)
381 { 381 {
382 return macrotable_findlen(name, strlen(name), remove); 382 return macrotable_findlen(name, strlen(name), remove_it);
383 } 383 }
384 384
385 static 385 static
386 void 386 void
387 macrotable_rehash(void) 387 macrotable_rehash(void)