summaryrefslogtreecommitdiff
path: root/zaphod32_hash.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2018-02-24 17:42:00 +0100
committerYves Orton <demerphq@gmail.com>2018-02-24 17:42:00 +0100
commite5a551284a63f7f984d48babddbc0b25cf95058a (patch)
tree26b10f3df8cf10227eef3503959a009b6d161212 /zaphod32_hash.h
parent02c84d7f0f97e083f5d8ea9856488f3ede09364f (diff)
downloadperl-e5a551284a63f7f984d48babddbc0b25cf95058a.tar.gz
silence warnings when using zaphod32 on 64 bit builds
if STRLEN is 64 bit, then there is truncation when using key_len to initialize the state. This causes problems with windows compilers especially. See comments from bulk88 in perl #132860 (which is not directly related to this patch, but is where it was discussed)
Diffstat (limited to 'zaphod32_hash.h')
-rw-r--r--zaphod32_hash.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/zaphod32_hash.h b/zaphod32_hash.h
index bdbaa9a415..c9b60ccb32 100644
--- a/zaphod32_hash.h
+++ b/zaphod32_hash.h
@@ -218,7 +218,7 @@ U32 zaphod32_hash_with_state(
STRLEN len = key_len;
U32 v0= state[0];
U32 v1= state[1];
- U32 v2= state[2] ^ (0xC41A7AB1 * (key_len + 1));
+ U32 v2= state[2] ^ (0xC41A7AB1 * ((U32)key_len + 1));
ZAPHOD32_WARN4("v0=%08x v1=%08x v2=%08x ln=%08x HASH START\n",
(unsigned int)state[0], (unsigned int)state[1],