summaryrefslogtreecommitdiffhomepage
path: root/include/stc/ccommon.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-09-05 13:01:50 +0200
committerTyge Løvset <[email protected]>2023-09-05 13:01:50 +0200
commit3628e4389ef9455960c42466487385fc228566c3 (patch)
treebf77c960cc44640485a47efb01d80a430747d586 /include/stc/ccommon.h
parent5e38c27f35d8916770a5e1f9a586c7d73e27bad1 (diff)
downloadSTC-modified-3628e4389ef9455960c42466487385fc228566c3.tar.gz
STC-modified-3628e4389ef9455960c42466487385fc228566c3.zip
Renamed (half) internal function cfasthash() => cbytehash().
Fixed missing parameter in call of i_hash().
Diffstat (limited to 'include/stc/ccommon.h')
-rw-r--r--include/stc/ccommon.h6
1 files changed, 3 insertions, 3 deletions
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) {