X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=hash.h;h=d227b938a246881229ab5d5e304427da8f03cff3;hp=1d7608beb40500dba75541f374b815f88672eadb;hb=d22e2fc8834280e5ee789e2a1e2b23ebbbeabb7e;hpb=3bf80dad77448afcb18148e72dc6cfe04bcf7e57 diff --git a/hash.h b/hash.h index 1d7608be..d227b938 100644 --- a/hash.h +++ b/hash.h @@ -44,15 +44,15 @@ #define GOLDEN_RATIO_32 0x61C88647 #define GOLDEN_RATIO_64 0x61C8864680B583EBull -static inline unsigned long __hash_long(unsigned long val) +static inline unsigned long __hash_long(uint64_t val) { - unsigned long hash = val; + uint64_t hash = val; #if BITS_PER_LONG == 64 hash *= GOLDEN_RATIO_64; #else /* Sigh, gcc can't optimise this alone like it does for 32 bits. */ - unsigned long n = hash; + uint64_t n = hash; n <<= 18; hash -= n; n <<= 33;