diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/stc/carc.h | 2 | ||||
| -rw-r--r-- | include/stc/cbox.h | 2 | ||||
| -rw-r--r-- | include/stc/ccommon.h | 6 | ||||
| -rw-r--r-- | include/stc/crawstr.h | 2 | ||||
| -rw-r--r-- | include/stc/cstr.h | 2 | ||||
| -rw-r--r-- | include/stc/csview.h | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/include/stc/carc.h b/include/stc/carc.h index 1b1c22eb..b617e1ca 100644 --- a/include/stc/carc.h +++ b/include/stc/carc.h @@ -200,7 +200,7 @@ STC_INLINE void _cx_MEMB(_assign)(_cx_Self* self, _cx_Self ptr) { { return i_hash(rx); } STC_INLINE uint64_t _cx_MEMB(_hash)(const _cx_Self* self) - { _cx_raw rx = i_keyto(self->get); return i_hash(&rx); } + { _cx_raw rx = i_keyto(self->get); return i_hash((&rx)); } #endif // i_no_hash #else diff --git a/include/stc/cbox.h b/include/stc/cbox.h index 37daa69e..55ce9711 100644 --- a/include/stc/cbox.h +++ b/include/stc/cbox.h @@ -180,7 +180,7 @@ STC_INLINE void _cx_MEMB(_assign)(_cx_Self* self, _cx_Self* moved) { { return i_hash(rx); } STC_INLINE uint64_t _cx_MEMB(_hash)(const _cx_Self* self) - { _cx_raw rx = i_keyto(self->get); return i_hash(&rx); } + { _cx_raw rx = i_keyto(self->get); return i_hash((&rx)); } #endif // i_no_hash #else diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index ad92212a..8363fbe5 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -103,7 +103,7 @@ typedef long long _llong; #define c_default_less(x, y) (*(x) < *(y)) #define c_default_eq(x, y) (*(x) == *(y)) #define c_memcmp_eq(x, y) (memcmp(x, y, sizeof *(x)) == 0) -#define c_default_hash(x) cfasthash(x, c_sizeof(*(x))) +#define c_default_hash(x) cbytehash(x, c_sizeof(*(x))) #define c_default_clone(v) (v) #define c_default_toraw(vp) (*(vp)) @@ -138,7 +138,7 @@ typedef const char* ccharptr; #define c_ROTL(x, k) (x << (k) | x >> (8*sizeof(x) - (k))) -STC_INLINE uint64_t cfasthash(const void* key, intptr_t len) { +STC_INLINE uint64_t cbytehash(const void* key, intptr_t len) { uint32_t u4; uint64_t u8; switch (len) { case 8: memcpy(&u8, key, 8); return u8*0xc6a4a7935bd1e99d; @@ -157,7 +157,7 @@ STC_INLINE uint64_t cfasthash(const void* key, intptr_t len) { } STC_INLINE uint64_t cstrhash(const char *str) - { return cfasthash(str, c_strlen(str)); } + { return cbytehash(str, c_strlen(str)); } STC_INLINE char* cstrnstrn(const char *str, const char *needle, intptr_t slen, const intptr_t nlen) { diff --git a/include/stc/crawstr.h b/include/stc/crawstr.h index 0395c8c6..a244397d 100644 --- a/include/stc/crawstr.h +++ b/include/stc/crawstr.h @@ -98,7 +98,7 @@ STC_INLINE bool crawstr_eq(const crawstr* x, const crawstr* y) { return x->size == y->size && !c_memcmp(x->str, y->str, x->size); } STC_INLINE uint64_t crawstr_hash(const crawstr *self) - { return cfasthash(self->str, self->size); } + { return cbytehash(self->str, self->size); } #endif // CRAWSTR_H_INCLUDED #undef i_static diff --git a/include/stc/cstr.h b/include/stc/cstr.h index f0974865..51519d82 100644 --- a/include/stc/cstr.h +++ b/include/stc/cstr.h @@ -450,7 +450,7 @@ bool cstr_valid_utf8(const cstr* self) STC_DEF uint64_t cstr_hash(const cstr *self) { csview sv = cstr_sv(self); - return cfasthash(sv.buf, sv.size); + return cbytehash(sv.buf, sv.size); } STC_DEF intptr_t cstr_find_sv(const cstr* self, csview search) { diff --git a/include/stc/csview.h b/include/stc/csview.h index a2d1e9f0..005f27de 100644 --- a/include/stc/csview.h +++ b/include/stc/csview.h @@ -170,7 +170,7 @@ STC_DEF intptr_t csview_find_sv(csview sv, csview search) { } STC_DEF uint64_t csview_hash(const csview *self) - { return cfasthash(self->buf, self->size); } + { return cbytehash(self->buf, self->size); } STC_DEF csview csview_substr_ex(csview sv, intptr_t pos, intptr_t n) { if (pos < 0) { |
