diff options
author | Eric Anholt <eric@anholt.net> | 2012-11-06 17:23:35 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2012-11-06 17:26:52 -0800 |
commit | ae79c77c2d18214a6680623bdadbb566c4c7adfd (patch) | |
tree | a1a6bfe9d3dad6b0d71449c1a997e137f4d98c59 | |
parent | c2a4a1c274559d479ec14bea8f412e422db6b6b5 (diff) |
Fix the prototype of fnv1_hash_string().
-rw-r--r-- | fnv_hash.c | 10 | ||||
-rw-r--r-- | fnv_hash.h | 2 |
2 files changed, 6 insertions, 6 deletions
@@ -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; @@ -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); |