ck_ht: Fix alignment issues in MurmurHash.

Patch submitted by Olivier Houchard <cognet@FreeBSD>.
ck_pring
Samy Al Bahra 11 years ago
parent 3c089d55e5
commit cfd8fd8d4b

@ -32,6 +32,7 @@
*/
#include <ck_stdint.h>
#include <string.h>
//-----------------------------------------------------------------------------
// MurmurHash3 was written by Austin Appleby, and is placed in the public
@ -173,7 +174,14 @@ static inline uint64_t MurmurHash64A ( const void * key, int len, uint64_t seed
while(data != end)
{
uint64_t k = *data++;
uint64_t k;
if (!((uintptr_t)data & 0x7))
k = *data++;
else {
memcpy(&k, (void *)data, sizeof(k));
data++;
}
k *= m;
k ^= k >> r;

Loading…
Cancel
Save