summaryrefslogtreecommitdiffstats
path: root/libiberty
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-05-10 17:31:24 +0200
committerMartin Liska <mliska@suse.cz>2022-05-10 17:32:44 +0200
commit5dac43b43c3999f94b451cd7925e24d8e7c38a7a (patch)
tree3674ce830052366b1f9886e11b9a668c93370075 /libiberty
parentlibiberty: fix bad replacement. (diff)
downloadgcc-5dac43b43c3999f94b451cd7925e24d8e7c38a7a.tar.gz
gcc-5dac43b43c3999f94b451cd7925e24d8e7c38a7a.tar.bz2
gcc-5dac43b43c3999f94b451cd7925e24d8e7c38a7a.tar.xz
libiberty: fix type in allocation
The allocation function alloc_f is called for nsize items where each is of type void *. libiberty/ChangeLog: * hashtab.c (htab_empty): Use void * type instead of void **. (htab_expand): Likewise. Co-Authored-By: Alan Modra <amodra@gmail.com>
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/hashtab.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index f7621cd47e5..470d3e66c32 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -458,9 +458,9 @@ htab_empty (htab_t htab)
458 (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries); 458 (*htab->free_with_arg_f) (htab->alloc_arg, htab->entries);
459 if (htab->alloc_with_arg_f != NULL) 459 if (htab->alloc_with_arg_f != NULL)
460 htab->entries = (void **) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, 460 htab->entries = (void **) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize,
461 sizeof (void **)); 461 sizeof (void *));
462 else 462 else
463 htab->entries = (void **) (*htab->alloc_f) (nsize, sizeof (void **)); 463 htab->entries = (void **) (*htab->alloc_f) (nsize, sizeof (void *));
464 htab->size = nsize; 464 htab->size = nsize;
465 htab->size_prime_index = nindex; 465 htab->size_prime_index = nindex;
466 } 466 }
@@ -544,9 +544,9 @@ htab_expand (htab_t htab)
544 544
545 if (htab->alloc_with_arg_f != NULL) 545 if (htab->alloc_with_arg_f != NULL)
546 nentries = (void **) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize, 546 nentries = (void **) (*htab->alloc_with_arg_f) (htab->alloc_arg, nsize,
547 sizeof (void **)); 547 sizeof (void *));
548 else 548 else
549 nentries = (void **) (*htab->alloc_f) (nsize, sizeof (void **)); 549 nentries = (void **) (*htab->alloc_f) (nsize, sizeof (void *));
550 if (nentries == NULL) 550 if (nentries == NULL)
551 return 0; 551 return 0;
552 htab->entries = nentries; 552 htab->entries = nentries;