summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-11-06 17:23:35 -0800
committerEric Anholt <eric@anholt.net>2012-11-06 17:26:52 -0800
commitae79c77c2d18214a6680623bdadbb566c4c7adfd (patch)
treea1a6bfe9d3dad6b0d71449c1a997e137f4d98c59
parentc2a4a1c274559d479ec14bea8f412e422db6b6b5 (diff)
Fix the prototype of fnv1_hash_string().
-rw-r--r--fnv_hash.c10
-rw-r--r--fnv_hash.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/fnv_hash.c b/fnv_hash.c
index d34bf81..8ca4cd8 100644
--- a/fnv_hash.c
+++ b/fnv_hash.c
@@ -36,15 +36,15 @@
#include "fnv_hash.h"
uint32_t
-fnv1_hash_string(const void *key)
+fnv1_hash_string(const char *key)
{
uint32_t hash = 2166136261ul;
- const unsigned char *str = key;
+ const uint8_t *bytes = (uint8_t *)key;
- while (*str != 0) {
- hash ^= *str;
+ while (*bytes != 0) {
+ hash ^= *bytes;
hash = hash * 0x01000193;
- str++;
+ bytes++;
}
return hash;
diff --git a/fnv_hash.h b/fnv_hash.h
index 08a3b51..12ced2d 100644
--- a/fnv_hash.h
+++ b/fnv_hash.h
@@ -30,5 +30,5 @@
#include <inttypes.h>
-uint32_t fnv1_hash_string(const void *key);
+uint32_t fnv1_hash_string(const char *key);
int string_key_equals(const void *a, const void *b);