Changeset 1800 in kBuild for trunk/src/kmk
- Timestamp:
- Sep 21, 2008 1:43:59 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/incdep.c
r1799 r1800 499 499 500 500 incdep_initialized = 0; 501 } 502 503 /* A quick wrapper around strcache_add_len which avoid the unnecessary 504 copying of the string in order to terminate it. The incdep buffer is 505 always writable, but the eval function like to use const char to avoid 506 silly mistakes and encourage compiler optimizations. */ 507 static char * 508 incdep_strcache_add_len (const char *str, int len) 509 { 510 #if 1 511 char *ret; 512 char ch = str[len]; 513 ((char *)str)[len] = '\0'; 514 ret = strcache_add_len (str, len); 515 ((char *)str)[len] = ch; 516 return ret; 517 #else 518 return strcache_add_len (str, len); 519 #endif 501 520 } 502 521 … … 597 616 break; 598 617 } 599 var = strcache_add_len (cur, var_len);618 var = incdep_strcache_add_len (cur, var_len); 600 619 601 620 /* find the end of the variable. */ … … 759 778 break; 760 779 } 761 var = strcache_add_len (cur, var_len);780 var = incdep_strcache_add_len (cur, var_len); 762 781 763 782 /* find the start of the value. */ … … 882 901 filenames = xmalloc (sizeof (struct nameseq)); 883 902 memset (filenames, 0, sizeof (*filenames)); 884 filenames->name = strcache_add_len (cur, endp - cur);903 filenames->name = incdep_strcache_add_len (cur, endp - cur); 885 904 886 905 /* parse any dependencies. */ … … 921 940 /* add it to the list. */ 922 941 *nextdep = dep = alloc_dep (); 923 dep->name = strcache_add_len (cur, endp - cur);942 dep->name = incdep_strcache_add_len (cur, endp - cur); 924 943 nextdep = &dep->next; 925 944
Note:
See TracChangeset
for help on using the changeset viewer.