X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=lib%2Fhashfunc.h;h=5f40c3d6783eb6c7346451a813170ca442347599;hb=c47f8dd7a1e5a7fface9512f578b3451e16f7e04;hp=fc836b3848588a7945b26380caa65dbac4355580;hpb=47a0795e8a28e8ad6ff55cda89e300267d9e590c;p=libucw.git diff --git a/lib/hashfunc.h b/lib/hashfunc.h index fc836b38..5f40c3d6 100644 --- a/lib/hashfunc.h +++ b/lib/hashfunc.h @@ -38,6 +38,6 @@ uns hash_string_nocase(const byte *str) PURE; */ static inline uns CONST hash_u32(uns x) { return 0x01008041*x; } static inline uns CONST hash_u64(u64 x) { return hash_u32((uns)x ^ (uns)(x >> 32)); } -static inline uns CONST hash_pointer(void *x) { return ((sizeof(x) <= 4) ? hash_u32((uns)(addr_int_t)x) : hash_u64((u64)(addr_int_t)x)); } +static inline uns CONST hash_pointer(void *x) { return ((sizeof(x) <= 4) ? hash_u32((uns)(uintptr_t)x) : hash_u64((u64)(uintptr_t)x)); } #endif