X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libhashkit%2Fcrc32.c;h=f07958ca7493476a3f7be6fd6577ecd8da375eef;hb=f40a312c617295543fb09864a8be80cc027cac79;hp=6db04783acd5ed3e139d11b0e59737730f0416b7;hpb=ec35c1ba09b8eb49505d32d23a2b679be3c45add;p=m6w6%2Flibmemcached diff --git a/libhashkit/crc32.c b/libhashkit/crc32.c index 6db04783..f07958ca 100644 --- a/libhashkit/crc32.c +++ b/libhashkit/crc32.c @@ -4,7 +4,7 @@ * src/usr.bin/cksum/crc32.c. */ -#include "common.h" +#include static const uint32_t crc32tab[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, @@ -73,10 +73,11 @@ static const uint32_t crc32tab[256] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -uint32_t hashkit_crc32(const char *key, size_t key_length, void *context __attribute__((unused))) +uint32_t hashkit_crc32(const char *key, size_t key_length, void *context) { uint64_t x; uint32_t crc= UINT32_MAX; + (void)context; for (x= 0; x < key_length; x++) crc= (crc >> 8) ^ crc32tab[(crc ^ (uint64_t)key[x]) & 0xff];