Changeset 1926 in kBuild
- Timestamp:
- Oct 24, 2008 4:49:58 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/function.c
r1915 r1926 334 334 335 335 #if defined (CONFIG_WITH_OPTIMIZATION_HACKS) || defined (CONFIG_WITH_VALUE_LENGTH) 336 /* The maximum length of a function, once reached there is 337 it can't be function and we can skip the hash lookup drop out. */ 338 339 # define MAX_FUNCTION_LENGTH 12 340 # define MIN_FUNCTION_LENGTH 2 341 342 /* char map containing the valid function name characters. */ 343 static char func_char_map[256]; 336 337 /* Char map containing the valid function name characters. */ 338 char func_char_map[256]; 344 339 345 340 /* Do the hash table lookup. */ … … 411 406 e++; 412 407 } 413 if (ch == '\0' || isblank ( (unsigned char)ch))408 if (ch == '\0' || isblank (ch)) 414 409 return lookup_function_in_hash_tab (s, e - s); 415 410 return 0; … … 4296 4291 4297 4292 4298 int /* bird split it up */4293 int /* bird split it up and hacked it. */ 4299 4294 #ifndef CONFIG_WITH_VALUE_LENGTH 4300 4295 handle_function (char **op, const char **stringp) … … 4306 4301 } 4307 4302 #else /* CONFIG_WITH_VALUE_LENGTH */ 4308 handle_function (char **op, const char **stringp, const char * eol)4303 handle_function (char **op, const char **stringp, const char *nameend, const char *eol) 4309 4304 { 4310 4305 const char *fname = *stringp + 1; 4311 const struct function_table_entry *entry_p = lookup_function (fname, eol - fname); 4306 const struct function_table_entry *entry_p = 4307 lookup_function_in_hash_tab (fname, nameend - fname); 4312 4308 if (!entry_p) 4313 4309 return 0; … … 4489 4485 { 4490 4486 unsigned int i; 4491 for (i = 'a'; i <= 'z'; i++)4492 func_char_map[i] = 1;4493 func_char_map[(unsigned int)'-'] = 1;4494 4495 4487 for (i = 0; i < FUNCTION_TABLE_ENTRIES; i++) 4496 4488 { 4489 const char *fn = function_table_init[i].name; 4490 while (*fn) 4491 { 4492 func_char_map[(int)*fn] = 1; 4493 fn++; 4494 } 4497 4495 assert (function_table_init[i].len <= MAX_FUNCTION_LENGTH); 4498 4496 assert (function_table_init[i].len >= MIN_FUNCTION_LENGTH);
Note:
See TracChangeset
for help on using the changeset viewer.