* http://www.azillionmonkeys.com/qed/hash.html
*/
-#include "common.h"
+#include <libhashkit/common.h>
#undef get16bits
#if (defined(__GNUC__) && defined(__i386__))
{
case 3: hash += get16bits (key);
hash ^= hash << 16;
- hash ^= key[sizeof (uint16_t)] << 18;
+ hash ^= (uint32_t)key[sizeof (uint16_t)] << 18;
hash += hash >> 11;
break;
case 2: hash += get16bits (key);
hash ^= hash << 11;
hash += hash >> 17;
break;
- case 1: hash += *key;
+ case 1: hash += (unsigned char)(*key);
hash ^= hash << 10;
hash += hash >> 1;
+ default:
+ break;
}
/* Force "avalanching" of final 127 bits */