diff options
author | Steve Bennett <steveb@workware.net.au> | 2011-11-11 12:11:07 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2011-11-18 07:57:03 +1000 |
commit | 0ddf0885b9560de1b242bc58d27033e069555707 (patch) | |
tree | 34e1969ddabb51aefa18adbc9afe7bc01c4ca108 /jim.h | |
parent | 8ca0b5227f362c9ab3e4e507c0a41be609c449d5 (diff) | |
download | jimtcl-0ddf0885b9560de1b242bc58d27033e069555707.zip jimtcl-0ddf0885b9560de1b242bc58d27033e069555707.tar.gz jimtcl-0ddf0885b9560de1b242bc58d27033e069555707.tar.bz2 |
Cleanup hash table interfaces
Remove const-ness of hash table keys
Also consolidate string hashtable ops
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim.h')
-rw-r--r-- | jim.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -193,7 +193,7 @@ typedef struct Jim_Stack { * ---------------------------------------------------------------------------*/ typedef struct Jim_HashEntry { - const void *key; + void *key; union { void *val; int intval; @@ -203,10 +203,10 @@ typedef struct Jim_HashEntry { typedef struct Jim_HashTableType { unsigned int (*hashFunction)(const void *key); - const void *(*keyDup)(void *privdata, const void *key); + void *(*keyDup)(void *privdata, const void *key); void *(*valDup)(void *privdata, const void *obj); int (*keyCompare)(void *privdata, const void *key1, const void *key2); - void (*keyDestructor)(void *privdata, const void *key); + void (*keyDestructor)(void *privdata, void *key); void (*valDestructor)(void *privdata, void *obj); } Jim_HashTableType; @@ -249,7 +249,7 @@ typedef struct Jim_HashTableIterator { if ((ht)->type->keyDup) \ entry->key = (ht)->type->keyDup((ht)->privdata, _key_); \ else \ - entry->key = (_key_); \ + entry->key = (void *)(_key_); \ } while(0) #define Jim_CompareHashKeys(ht, key1, key2) \ |