diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-08-23 23:49:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2013-08-23 23:49:48 +0100 |
commit | 5787cb059702f2677c0ec6abc87f3d1de5d1aff9 (patch) | |
tree | 10c6c19ff11c04685018252ef5b01c071fe49cee /contrib/uthash | |
parent | fa8ab8833f3a0b660585a3edc09d33246efffd13 (diff) | |
download | rspamd-5787cb059702f2677c0ec6abc87f3d1de5d1aff9.tar.gz rspamd-5787cb059702f2677c0ec6abc87f3d1de5d1aff9.zip |
Keys in hash table are const pointers.
Diffstat (limited to 'contrib/uthash')
-rw-r--r-- | contrib/uthash/uthash.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/uthash/uthash.h b/contrib/uthash/uthash.h index 915a8254e..79c3328e6 100644 --- a/contrib/uthash/uthash.h +++ b/contrib/uthash/uthash.h @@ -174,7 +174,7 @@ do { do { \ unsigned _ha_bkt; \ (add)->hh.next = NULL; \ - (add)->hh.key = (char*)keyptr; \ + (add)->hh.key = (const char*)keyptr; \ (add)->hh.keylen = (unsigned)keylen_in; \ if (!(head)) { \ head = (add); \ @@ -416,7 +416,7 @@ do { #define HASH_JEN(key,keylen,num_bkts,hashv,bkt) \ do { \ unsigned _hj_i,_hj_j,_hj_k; \ - unsigned char *_hj_key=(unsigned char*)(key); \ + unsigned const char *_hj_key=(unsigned const char*)(key); \ hashv = 0xfeedbeef; \ _hj_i = _hj_j = 0x9e3779b9; \ _hj_k = (unsigned)keylen; \ @@ -467,7 +467,7 @@ do { #endif #define HASH_SFH(key,keylen,num_bkts,hashv,bkt) \ do { \ - unsigned char *_sfh_key=(unsigned char*)(key); \ + unsigned const char *_sfh_key=(unsigned const char*)(key); \ uint32_t _sfh_tmp, _sfh_len = keylen; \ \ int _sfh_rem = _sfh_len & 3; \ @@ -940,7 +940,7 @@ typedef struct UT_hash_handle { void *next; /* next element in app order */ struct UT_hash_handle *hh_prev; /* previous hh in bucket order */ struct UT_hash_handle *hh_next; /* next hh in bucket order */ - void *key; /* ptr to enclosing struct's key */ + const void *key; /* ptr to enclosing struct's key */ unsigned keylen; /* enclosing struct's key len */ unsigned hashv; /* result of hash-fcn(key) */ } UT_hash_handle; |