projects
/
oweals
/
minetest.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d565783
)
Fix MurmurHash implementation to really be unaligned (#7482)
author
sfan5
<sfan5@live.de>
Mon, 25 Jun 2018 23:12:09 +0000
(
01:12
+0200)
committer
Paramat
<paramat@users.noreply.github.com>
Mon, 25 Jun 2018 23:12:09 +0000
(
00:12
+0100)
src/util/numeric.cpp
patch
|
blob
|
history
diff --git
a/src/util/numeric.cpp
b/src/util/numeric.cpp
index d878a3f6043be5734d861d7183816da0f176b275..a120e32076190b7d0abea79feaa5301e7607030f 100644
(file)
--- a/
src/util/numeric.cpp
+++ b/
src/util/numeric.cpp
@@
-61,13
+61,13
@@
u64 murmur_hash_64_ua(const void *key, int len, unsigned int seed)
const int r = 47;
u64 h = seed ^ (len * m);
- const u
64 *data = (const u64
*)key;
- const u
64 *end = data + (len / 8)
;
+ const u
8 *data = (const u8
*)key;
+ const u
8 *end = data + (len / 8) * 8
;
while (data != end) {
u64 k;
memcpy(&k, data, sizeof(u64));
- data
++
;
+ data
+= sizeof(u64)
;
k *= m;
k ^= k >> r;