Changeset 1902 for trunk/src/kmk/file.c
- Timestamp:
- Oct 21, 2008, 5:57:00 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/file.c
r1901 r1902 41 41 /* Hash table of files the makefile knows how to make. */ 42 42 43 #ifndef CONFIG_WITH_STRCACHE2 43 44 static unsigned long 44 45 file_hash_1 (const void *key) 45 46 { 46 #ifndef CONFIG_WITH_STRCACHE247 47 return_ISTRING_HASH_1 (((struct file const *) key)->hname); 48 #else /* CONFIG_WITH_STRCACHE2 */49 return strcache2_get_ptr_hash (&file_strcache, ((struct file const *) key)->hname);50 #endif /* CONFIG_WITH_STRCACHE2 */51 48 } 52 49 … … 54 51 file_hash_2 (const void *key) 55 52 { 56 #ifndef CONFIG_WITH_STRCACHE257 53 return_ISTRING_HASH_2 (((struct file const *) key)->hname); 58 #else /* CONFIG_WITH_STRCACHE2 */ 59 return strcache2_get_ptr_hash (&file_strcache, ((struct file const *) key)->hname); 60 #endif /* CONFIG_WITH_STRCACHE2 */ 61 } 54 } 55 #endif /* !CONFIG_WITH_STRCACHE2 */ 62 56 63 57 static int … … 148 142 file_key.hname = strcache2_lookup (&file_strcache, name, strlen (name)); 149 143 if (file_key.hname) 150 f = hash_find_item (&files, &file_key);144 f = hash_find_item_strcached (&files, &file_key); 151 145 else 152 146 f = NULL; … … 155 149 { 156 150 file_key.hname = name; 157 f = hash_find_item (&files, &file_key);151 f = hash_find_item_strcached (&files, &file_key); 158 152 } 159 153 … … 296 290 297 291 /* Remove the "from" file from the hash. */ 292 #ifndef CONFIG_WITH_STRCACHE2 298 293 deleted_file = hash_delete (&files, from_file); 294 #else 295 deleted_file = hash_delete_strcached (&files, from_file); 296 #endif 299 297 if (deleted_file != from_file) 300 298 /* from_file isn't the one stored in files */ … … 1343 1341 init_hash_files (void) 1344 1342 { 1345 #ifdef KMK 1343 #ifndef CONFIG_WITH_STRCACHE2 1344 # ifdef KMK 1346 1345 hash_init (&files, /*65535*/ 32755, file_hash_1, file_hash_2, file_hash_cmp); 1346 # else 1347 hash_init (&files, 1000, file_hash_1, file_hash_2, file_hash_cmp); 1348 # endif 1347 1349 #else 1348 hash_init (&files, 1000, file_hash_1, file_hash_2, file_hash_cmp); 1350 # ifdef KMK 1351 hash_init_strcached (&files, 32755, &file_strcache, 1352 offsetof (struct file, hname)); 1353 # else 1354 hash_init_strcached (&files, 1000, &file_strcache, 1355 offsetof (struct file, hname)); 1356 # endif 1349 1357 #endif 1350 1358 }
Note:
See TracChangeset
for help on using the changeset viewer.