Skip to content

Commit

Permalink
fixed bitset index: hash function now builds on 32bit platform
Browse files Browse the repository at this point in the history
  • Loading branch information
alyapunov committed Sep 22, 2015
1 parent 3ecbe5f commit 7142aad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/box/memtx_bitset.cc
Expand Up @@ -46,7 +46,11 @@ struct bitset_hash_entry {
#define mh_int_t uint32_t
#define mh_arg_t int

#define mh_hash_key(a, arg) ((uint32_t)(((uintptr_t)(a)) >> 33^((uintptr_t)(a)) ^ ((uintptr_t)(a)) << 11));
#if UINTPTR_MAX == 0xffffffff
#define mh_hash_key(a, arg) ((uintptr_t)(a))
#else
#define mh_hash_key(a, arg) ((uint32_t)(((uintptr_t)(a)) >> 33 ^ ((uintptr_t)(a)) ^ ((uintptr_t)(a)) << 11))
#endif
#define mh_hash(a, arg) mh_hash_key((a)->tuple, arg)
#define mh_cmp(a, b, arg) ((a)->tuple != (b)->tuple)
#define mh_cmp_key(a, b, arg) ((a) != (b)->tuple)
Expand Down

0 comments on commit 7142aad

Please sign in to comment.