Fix hash function.
This commit is contained in:
1 parent
2b27d36692
commit
c9f05c21da
1 file changed
+3
-3
@@ -144,13 +144,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#define TUPLE_DEFINE_HASH(name, ...) \
|
#define TUPLE_DEFINE_HASH(name, ...) \
|
||||||
static inline unsigned long M_C(name, _hash)(M_C(name,_t) const e1) { \
|
static inline size_t M_C(name, _hash)(M_C(name,_t) const e1) { \
|
||||||
unsigned long hash = 0; \
|
M_HASH_DECL(hash); \
|
||||||
M_MAP(TUPLE_DEFINE_HASH_FUNC , __VA_ARGS__) \
|
M_MAP(TUPLE_DEFINE_HASH_FUNC , __VA_ARGS__) \
|
||||||
return hash; \
|
return hash; \
|
||||||
}
|
}
|
||||||
#define TUPLE_DEFINE_HASH_FUNC(a) \
|
#define TUPLE_DEFINE_HASH_FUNC(a) \
|
||||||
hash = hash * 31421ul + TUPLE_GET_HASH a ( e1 -> TUPLE_GET_FIELD a);
|
M_HASH_UP(hash, TUPLE_GET_HASH a ( e1 -> TUPLE_GET_FIELD a) );
|
||||||
|
|
||||||
|
|
||||||
#define TUPLE_DEFINE_GET_STR(name, ...) \
|
#define TUPLE_DEFINE_GET_STR(name, ...) \
|
||||||
|
|||||||
Reference in new issue
Block a user