diff options
author | DJ Delorie <dj@redhat.com> | 2005-05-24 21:01:33 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2005-05-24 21:01:33 +0000 |
commit | abf6a75b428517d9caaf9155212b0b10e0379a99 (patch) | |
tree | 3476694dba1d2c731deb2a131b0d8d6c5dcb0cd3 /libiberty/hashtab.c | |
parent | f127898a4db12540b9898e25777c6c3725d119bf (diff) | |
download | gdb-abf6a75b428517d9caaf9155212b0b10e0379a99.zip gdb-abf6a75b428517d9caaf9155212b0b10e0379a99.tar.gz gdb-abf6a75b428517d9caaf9155212b0b10e0379a99.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty/hashtab.c')
-rw-r--r-- | libiberty/hashtab.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index f8a1ea7..5557e0a 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -216,20 +216,30 @@ eq_pointer (const PTR p1, const PTR p2) return p1 == p2; } -/* Return the current size of given hash table. */ -inline size_t -htab_size (htab_t htab) +/* The parens around the function names in the next two definitions + are essential in order to prevent macro expansions of the name. + The bodies, however, are expanded as expected, so they are not + recursive definitions. */ + +/* Return the current size of given hash table. */ + +#define htab_size(htab) ((htab)->size) + +size_t +(htab_size) (htab_t htab) { - return htab->size; + return htab_size (htab); } /* Return the current number of elements in given hash table. */ -inline size_t -htab_elements (htab_t htab) +#define htab_elements(htab) ((htab)->n_elements - (htab)->n_deleted) + +size_t +(htab_elements) (htab_t htab) { - return htab->n_elements - htab->n_deleted; + return htab_elements (htab); } /* Return X % Y. */ @@ -317,15 +327,10 @@ htab_create_alloc (size_t size, htab_hash hash_f, htab_eq eq_f, an extra argument. */ htab_t -htab_create_alloc_ex (size, hash_f, eq_f, del_f, alloc_arg, alloc_f, - free_f) - size_t size; - htab_hash hash_f; - htab_eq eq_f; - htab_del del_f; - PTR alloc_arg; - htab_alloc_with_arg alloc_f; - htab_free_with_arg free_f; +htab_create_alloc_ex (size_t size, htab_hash hash_f, htab_eq eq_f, + htab_del del_f, void *alloc_arg, + htab_alloc_with_arg alloc_f, + htab_free_with_arg free_f) { htab_t result; unsigned int size_prime_index; |