summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2006-02-10 05:29:00 +0000
committerPaul Smith <psmith@gnu.org>2006-02-10 05:29:00 +0000
commit5a7a42cfce638f52f702b4d317c45c7186b8c0b4 (patch)
treef212e35eac087bedeb88d64d96fb5a4c8c25d08c /hash.c
parentd0c4e92f1145110793ffb04596019a864c88d2fc (diff)
downloadgunmake-5a7a42cfce638f52f702b4d317c45c7186b8c0b4.tar.gz
- New code capability: a read-only string cache. Start of solution for
Savannah bug #15182, but not much uses it yet. Coming shortly. - Added short-circuiting $(and ..) and $(or ...) functions.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hash.c b/hash.c
index 5eed69c..f8b6530 100644
--- a/hash.c
+++ b/hash.c
@@ -126,18 +126,18 @@ hash_find_item (struct hash_table *ht, const void *key)
}
void *
-hash_insert (struct hash_table *ht, void *item)
+hash_insert (struct hash_table *ht, const void *item)
{
void **slot = hash_find_slot (ht, item);
- void *old_item = slot ? *slot : 0;
+ const void *old_item = slot ? *slot : 0;
hash_insert_at (ht, item, slot);
- return ((HASH_VACANT (old_item)) ? 0 : old_item);
+ return (void *)((HASH_VACANT (old_item)) ? 0 : old_item);
}
void *
-hash_insert_at (struct hash_table *ht, void *item, const void *slot)
+hash_insert_at (struct hash_table *ht, const void *item, const void *slot)
{
- void *old_item = *(void **) slot;
+ const void *old_item = *(void **) slot;
if (HASH_VACANT (old_item))
{
ht->ht_fill++;