diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-17 16:11:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-05-17 16:11:12 +0100 |
commit | 940ac5134d8d0a296b30ef880223a29da91299eb (patch) | |
tree | aabf106a909efb2cb26f8f1fa05a4404990df4dc /src/libutil/uthash_strcase.h | |
parent | 0f38bb097e151109c163f9b56db824f39788097e (diff) | |
download | rspamd-940ac5134d8d0a296b30ef880223a29da91299eb.tar.gz rspamd-940ac5134d8d0a296b30ef880223a29da91299eb.zip |
Adopt xxhash invocation.
Diffstat (limited to 'src/libutil/uthash_strcase.h')
-rw-r--r-- | src/libutil/uthash_strcase.h | 7 |
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) |