summaryrefslogtreecommitdiff
path: root/lib/hash.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-02-19 15:51:16 +0100
committerJan Moskyto Matejka <mq@ucw.cz>2016-02-19 16:33:07 +0100
commita815d62d5902fb84c28c77726dbe94fc7528bf36 (patch)
tree1855611655b573ef3a96ff8f7e5cd22477a98a17 /lib/hash.h
parent9a74622ca1994669cdb3bac0bb2f6df2febd2744 (diff)
Hash: typecast error fix
Diffstat (limited to 'lib/hash.h')
-rw-r--r--lib/hash.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/hash.h b/lib/hash.h
index f4a953a3..b0641466 100644
--- a/lib/hash.h
+++ b/lib/hash.h
@@ -184,7 +184,8 @@ mem_hash(void *p, int s)
const char *pp = p;
const u64 multiplier = 0xb38bc09a61202731ULL;
u64 value = 0x001047d54778bcafULL;
- for (int i=0;i<s;i++)
+ int i;
+ for (i=0;i<s;i++)
value = value*multiplier + pp[i];
return ((value >> 32) ^ (value & 0xffffffff));