Changeset 3138 for vendor/gnumake/current/hash.c
- Timestamp:
- Mar 12, 2018, 8:32:29 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/hash.c
r2596 r3138 15 15 this program. If not, see <http://www.gnu.org/licenses/>. */ 16 16 17 #include "make .h"17 #include "makeint.h" 18 18 #include "hash.h" 19 19 20 #define CALLOC(t, n) ((t *) calloc (sizeof (t),(n)))20 #define CALLOC(t, n) ((t *) xcalloc (sizeof (t) * (n))) 21 21 #define MALLOC(t, n) ((t *) xmalloc (sizeof (t) * (n))) 22 22 #define REALLOC(o, t, n) ((t *) xrealloc ((o), sizeof (t) * (n))) … … 27 27 28 28 /* Implement double hashing with open addressing. The table size is 29 always a power of two. The secondary ( `increment') hash function29 always a power of two. The secondary ('increment') hash function 30 30 is forced to return an odd-value, in order to be relatively prime 31 31 to the table size. This guarantees that the increment can … … 49 49 fprintf (stderr, _("can't allocate %lu bytes for hash table: memory exhausted"), 50 50 ht->ht_size * (unsigned long) sizeof (struct token *)); 51 exit ( 1);51 exit (MAKE_TROUBLE); 52 52 } 53 53 … … 62 62 } 63 63 64 /* Load an array of items into `ht'. */64 /* Load an array of items into 'ht'. */ 65 65 66 66 void … … 76 76 } 77 77 78 /* Returns the address of the table slot matching `key'. If `key' is78 /* Returns the address of the table slot matching 'key'. If 'key' is 79 79 not found, return the address of an empty slot suitable for 80 inserting `key'. The caller is responsible for incrementing80 inserting 'key'. The caller is responsible for incrementing 81 81 ht_fill on insertion. */ 82 82
Note:
See TracChangeset
for help on using the changeset viewer.