X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=hash.h;h=d227b938a246881229ab5d5e304427da8f03cff3;hp=1d7608beb40500dba75541f374b815f88672eadb;hb=1bd4cb6b62903c7785d6891d8b40a745b52c609f;hpb=97e1fe78db572a48a44c2a8511f8393a8643fc28 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;