diff options
| author | Tyge Løvset <[email protected]> | 2021-11-23 08:26:45 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2021-11-23 08:26:45 +0100 |
| commit | 7d98bb163c9c1db7bf352f63deb8e186ac212676 (patch) | |
| tree | 49b581d019e1edb7d91cda67f00c3d04bd9f75dc /include | |
| parent | 083b37734c8cdfa285dcf2c665e172244dc23313 (diff) | |
| download | STC-modified-7d98bb163c9c1db7bf352f63deb8e186ac212676.tar.gz STC-modified-7d98bb163c9c1db7bf352f63deb8e186ac212676.zip | |
Renamed c_default_hash32/64 to c_hash32/64. Old are deprecated (still available).
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/ccommon.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index f71660b8..acf09dde 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -130,10 +130,12 @@ STC_INLINE uint64_t c_default_hash(const void* key, size_t len) { while (--len) h = (h << 10) - h + *x++;
return _c_rotl(h, 26) ^ h;
}
-#define c_default_hash32(data, len_is_4) \
+#define c_hash32(data, len_is_4) \
((*(const uint32_t*)data * 0xc6a4a7935bd1e99d) >> 15)
-#define c_default_hash64(data, len_is_8) \
+#define c_hash64(data, len_is_8) \
(*(const uint64_t *)data * 0xc6a4a7935bd1e99d)
+#define c_default_hash32 c_hash32 // [deprecated]
+#define c_default_hash64 c_hash64 // [deprecated]
#define c_foreach(...) c_MACRO_OVERLOAD(c_foreach, __VA_ARGS__)
#define c_foreach_3(it, CX, cnt) \
|
