summaryrefslogtreecommitdiffstats
path: root/src/libutil/uthash_strcase.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-17 16:11:12 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-05-17 16:11:12 +0100
commit940ac5134d8d0a296b30ef880223a29da91299eb (patch)
treeaabf106a909efb2cb26f8f1fa05a4404990df4dc /src/libutil/uthash_strcase.h
parent0f38bb097e151109c163f9b56db824f39788097e (diff)
downloadrspamd-940ac5134d8d0a296b30ef880223a29da91299eb.tar.gz
rspamd-940ac5134d8d0a296b30ef880223a29da91299eb.zip
Adopt xxhash invocation.
Diffstat (limited to 'src/libutil/uthash_strcase.h')
-rw-r--r--src/libutil/uthash_strcase.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libutil/uthash_strcase.h b/src/libutil/uthash_strcase.h
index 4e28f3110..55fae4d7e 100644
--- a/src/libutil/uthash_strcase.h
+++ b/src/libutil/uthash_strcase.h
@@ -36,13 +36,14 @@
#define HASH_KEYCMP(a,b,len) memcmp(a,b,len)
#else
#define HASH_FUNCTION(key,keylen,num_bkts,hashv,bkt) do {\
- void *xxh = XXH32_init(0xdead); \
+ XXH32_state_t xxh; \
+ XXH32_reset(&xxh, 0xdead); \
unsigned char *p = (unsigned char *)key, t; \
for (unsigned int i = 0; i < keylen; i ++) { \
t = g_ascii_tolower(p[i]); \
- XXH32_update(xxh, &t, 1); \
+ XXH32_update(&xxh, &t, 1); \
} \
- hashv = XXH32_digest(xxh); \
+ hashv = XXH32_digest(&xxh); \
bkt = (hashv) & (num_bkts-1); \
} while (0)
#define HASH_KEYCMP(a,b,len) strncasecmp(a,b,len)