DC_PUBLIC static size_t type##_hash_fnv1a(type
const* key) { \
DC_STATIC_ASSERT(sizeof(type) <= sizeof(uint64_t), \
"fnv integer hashing only supports up to size_t integers"); \
if (sizeof(type) <= sizeof(uint32_t)) { \
uint32_t value = (uint32_t)(*key); \
} \
uint64_t value = (uint64_t)(*key); \
}
static DC_PUBLIC uint64_t dc_fnv1a_u32(uint32_t const *v)
static DC_PUBLIC uint64_t dc_fnv1a_u64(uint64_t const *v)
Applying the fnv1a hash for the size of the integer.
55#define FNV1A_INTEGER(type, ...) \
56 DC_PUBLIC static size_t type##_hash_fnv1a(type const* key) { \
57 DC_STATIC_ASSERT(sizeof(type) <= sizeof(uint64_t), \
58 "fnv integer hashing only supports up to size_t integers"); \
59 if (sizeof(type) <= sizeof(uint32_t)) { \
60 uint32_t value = (uint32_t)(*key); \
61 return dc_fnv1a_u32(&value); \
62 } \
63 uint64_t value = (uint64_t)(*key); \
64 return dc_fnv1a_u64(&value); \
65 }