X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Fjenkins_hash.c;h=e4aa4f19da0b4535535260516ed0c670c43679a5;hb=0b42f8e5f8c456f836ec68a0287109fa25f1c242;hp=262ff937bbcf300e59fbf346a9c1329f7c32df0c;hpb=9305ec5d145420ca109cc1e0fb26d87565749f8a;p=m6w6%2Flibmemcached diff --git a/libmemcached/jenkins_hash.c b/libmemcached/jenkins_hash.c index 262ff937..e4aa4f19 100644 --- a/libmemcached/jenkins_hash.c +++ b/libmemcached/jenkins_hash.c @@ -63,7 +63,7 @@ uint32_t jenkins_hash(const void *key, size_t length, uint32_t initval) a = b = c = 0xdeadbeef + ((uint32_t)length) + initval; u.ptr = key; -#ifdef BYTEORDER_LITTLE_ENDIAN +#ifndef WORDS_BIGENDIAN if ((u.i & 0x3) == 0) { const uint32_t *k = (const uint32_t *)key; /* read 32-bit chunks */ @@ -104,6 +104,7 @@ uint32_t jenkins_hash(const void *key, size_t length, uint32_t initval) case 2 : a+=k[0]&0xffff; break; case 1 : a+=k[0]&0xff; break; case 0 : return c; /* zero length strings require no mixing */ + default: return c; } } @@ -153,6 +154,7 @@ uint32_t jenkins_hash(const void *key, size_t length, uint32_t initval) case 1 : a+=k8[0]; break; case 0 : return c; /* zero length requires no mixing */ + default: return c; } } @@ -198,8 +200,9 @@ uint32_t jenkins_hash(const void *key, size_t length, uint32_t initval) case 1 : a+=k[0]; break; case 0 : return c; + default : return c; } -#ifdef BYTEORDER_LITTLE_ENDIAN +#ifndef WORDS_BIGENDIAN } #endif