summaryrefslogtreecommitdiff
path: root/src/basic/hashmap.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-10-06 18:12:25 +0200
committerDaniel Mack <github@zonque.org>2015-10-06 18:12:25 +0200
commitac773fd8d56cafe29e9fedecb02655d86bd3fe30 (patch)
tree975b63290cb0075a64e319a572a5086ba0ada268 /src/basic/hashmap.c
parent8c60d978bd3453659bfa7f4d90a17ba5fa3e0774 (diff)
parent17010c230edf9933176948934276cf18007ccadb (diff)
Merge pull request #1474 from teg/siphash24
siphash: style fixes
Diffstat (limited to 'src/basic/hashmap.c')
-rw-r--r--src/basic/hashmap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c
index 3e17ed30df..20e7e51d9e 100644
--- a/src/basic/hashmap.c
+++ b/src/basic/hashmap.c
@@ -372,12 +372,15 @@ static uint8_t *hash_key(HashmapBase *h) {
static unsigned base_bucket_hash(HashmapBase *h, const void *p) {
struct siphash state;
+ uint64_t hash;
- siphash_init(&state, hash_key(h));
+ siphash24_init(&state, hash_key(h));
h->hash_ops->hash(p, &state);
- return (unsigned) (siphash24_finalize(&state) % n_buckets(h));
+ siphash24_finalize((uint8_t*)&hash, &state);
+
+ return (unsigned) (hash % n_buckets(h));
}
#define bucket_hash(h, p) base_bucket_hash(HASHMAP_BASE(h), p)