X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libhashkit%2Ffnv.c;h=fffb94a492aebf86815942322d9511f0825a7506;hb=aeb7c171a08d06ae366d752061a8e8f1b14beb08;hp=c4ad06683839a33eb97e50df2ff8ed33ec16c72b;hpb=118defb3246857a80d36ee1a8ee8b2b789fb6f09;p=m6w6%2Flibmemcached diff --git a/libhashkit/fnv.c b/libhashkit/fnv.c index c4ad0668..fffb94a4 100644 --- a/libhashkit/fnv.c +++ b/libhashkit/fnv.c @@ -6,7 +6,7 @@ * the COPYING file in the parent directory for full text. */ -#include "common.h" +#include /* FNV hash'es lifted from Dustin Sallings work */ static uint64_t FNV_64_INIT= UINT64_C(0xcbf29ce484222325); @@ -14,10 +14,11 @@ static uint64_t FNV_64_PRIME= UINT64_C(0x100000001b3); static uint32_t FNV_32_INIT= 2166136261UL; static uint32_t FNV_32_PRIME= 16777619; -uint32_t hashkit_fnv1_64(const char *key, size_t key_length) +uint32_t hashkit_fnv1_64(const char *key, size_t key_length, void *context) { /* Thanks to pierre@demartines.com for the pointer */ uint64_t hash= FNV_64_INIT; + (void)context; for (size_t x= 0; x < key_length; x++) { @@ -28,9 +29,10 @@ uint32_t hashkit_fnv1_64(const char *key, size_t key_length) return (uint32_t)hash; } -uint32_t hashkit_fnv1a_64(const char *key, size_t key_length) +uint32_t hashkit_fnv1a_64(const char *key, size_t key_length, void *context) { uint32_t hash= (uint32_t) FNV_64_INIT; + (void)context; for (size_t x= 0; x < key_length; x++) { @@ -42,9 +44,10 @@ uint32_t hashkit_fnv1a_64(const char *key, size_t key_length) return hash; } -uint32_t hashkit_fnv1_32(const char *key, size_t key_length) +uint32_t hashkit_fnv1_32(const char *key, size_t key_length, void *context) { uint32_t hash= FNV_32_INIT; + (void)context; for (size_t x= 0; x < key_length; x++) { @@ -56,9 +59,10 @@ uint32_t hashkit_fnv1_32(const char *key, size_t key_length) return hash; } -uint32_t hashkit_fnv1a_32(const char *key, size_t key_length) +uint32_t hashkit_fnv1a_32(const char *key, size_t key_length, void *context) { uint32_t hash= FNV_32_INIT; + (void)context; for (size_t x= 0; x < key_length; x++) {