X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/68bd3b6bfa120d0775bbac310c8a047a31c07886..29e8831621af57c5056380b68a96337e7647b850:/lib/hash.c diff --git a/lib/hash.c b/lib/hash.c index c066c639..060fd388 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -1,5 +1,5 @@ /* hash.c -- hash table maintenance - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright 1995, 2001 Free Software Foundation, Inc. Written by Greg McGary This program is free software; you can redistribute it and/or modify @@ -120,17 +120,17 @@ hash_find_item (struct hash_table* ht, void const *key) return ((HASH_VACANT (*slot)) ? 0 : *slot); } -void * +const void * hash_insert (struct hash_table* ht, void *item) { void **slot = hash_find_slot (ht, item); return hash_insert_at (ht, item, slot); } -void * +const void * hash_insert_at (struct hash_table* ht, void *item, void const *slot) { - void *old_item = *(void **) slot; + const void *old_item = *(const void **) slot; if (HASH_VACANT (old_item)) { ht->ht_fill++; @@ -142,17 +142,17 @@ hash_insert_at (struct hash_table* ht, void *item, void const *slot) return old_item; } -void * +const void * hash_delete (struct hash_table* ht, void const *item) { void **slot = hash_find_slot (ht, item); return hash_delete_at (ht, slot); } -void * +const void * hash_delete_at (struct hash_table* ht, void const *slot) { - void *item = *(void **) slot; + const void *item = *(const void **) slot; if (!HASH_VACANT (item)) { *(void const **) slot = hash_deleted_item;