diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-09-09 19:40:31 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-09-11 09:07:27 +0200 |
commit | 84a6621c78efefbfbc1d8f5d52295287c1454357 (patch) | |
tree | 1d8f11c3e991925dc4049cbae8a9c5e216fc3db8 /src | |
parent | 06a273625bdc34275483626e6f653be24d510093 (diff) | |
download | bison-84a6621c78efefbfbc1d8f5d52295287c1454357.tar.gz |
gnulib: update
Contains the creation of the xhash module.
https://lists.gnu.org/archive/html/bug-gnulib/2019-09/msg00046.html
* src/muscle-tab.c, src/state.c, src/symtab.c, src/uniqstr.c:
Use hash_xinitialize.
Diffstat (limited to 'src')
-rw-r--r-- | src/muscle-tab.c | 6 | ||||
-rw-r--r-- | src/state.c | 12 | ||||
-rw-r--r-- | src/symtab.c | 24 | ||||
-rw-r--r-- | src/uniqstr.c | 12 |
4 files changed, 22 insertions, 32 deletions
diff --git a/src/muscle-tab.c b/src/muscle-tab.c index d3e358e6..91a45737 100644 --- a/src/muscle-tab.c +++ b/src/muscle-tab.c @@ -126,10 +126,8 @@ muscle_init (void) /* Initialize the muscle obstack. */ obstack_init (&muscle_obstack); - muscle_table = hash_initialize (HT_INITIAL_CAPACITY, NULL, hash_muscle, - hash_compare_muscles, muscle_entry_free); - if (!muscle_table) - xalloc_die (); + muscle_table = hash_xinitialize (HT_INITIAL_CAPACITY, NULL, hash_muscle, + hash_compare_muscles, muscle_entry_free); /* Version and input file. */ MUSCLE_INSERT_STRING ("version", VERSION); diff --git a/src/state.c b/src/state.c index 64bb256c..418f3fab 100644 --- a/src/state.c +++ b/src/state.c @@ -359,13 +359,11 @@ state_hasher (void const *s, size_t tablesize) void state_hash_new (void) { - state_table = hash_initialize (HT_INITIAL_CAPACITY, - NULL, - state_hasher, - state_comparator, - NULL); - if (!state_table) - xalloc_die (); + state_table = hash_xinitialize (HT_INITIAL_CAPACITY, + NULL, + state_hasher, + state_comparator, + NULL); } diff --git a/src/symtab.c b/src/symtab.c index 7b0439ad..417b71e4 100644 --- a/src/symtab.c +++ b/src/symtab.c @@ -779,20 +779,16 @@ hash_semantic_type_hasher (void const *m, size_t tablesize) void symbols_new (void) { - symbol_table = hash_initialize (HT_INITIAL_CAPACITY, - NULL, - hash_symbol_hasher, - hash_symbol_comparator, - symbol_free); - if (!symbol_table) - xalloc_die (); - semantic_type_table = hash_initialize (HT_INITIAL_CAPACITY, - NULL, - hash_semantic_type_hasher, - hash_semantic_type_comparator, - free); - if (!semantic_type_table) - xalloc_die (); + symbol_table = hash_xinitialize (HT_INITIAL_CAPACITY, + NULL, + hash_symbol_hasher, + hash_symbol_comparator, + symbol_free); + semantic_type_table = hash_xinitialize (HT_INITIAL_CAPACITY, + NULL, + hash_semantic_type_hasher, + hash_semantic_type_comparator, + free); } diff --git a/src/uniqstr.c b/src/uniqstr.c index d5c66846..3833b841 100644 --- a/src/uniqstr.c +++ b/src/uniqstr.c @@ -157,13 +157,11 @@ hash_uniqstr (void const *m, size_t tablesize) void uniqstrs_new (void) { - uniqstrs_table = hash_initialize (HT_INITIAL_CAPACITY, - NULL, - hash_uniqstr, - hash_compare_uniqstr, - free); - if (!uniqstrs_table) - xalloc_die (); + uniqstrs_table = hash_xinitialize (HT_INITIAL_CAPACITY, + NULL, + hash_uniqstr, + hash_compare_uniqstr, + free); } |