From 0ddf0885b9560de1b242bc58d27033e069555707 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Fri, 11 Nov 2011 12:11:07 +1000 Subject: Cleanup hash table interfaces Remove const-ness of hash table keys Also consolidate string hashtable ops Signed-off-by: Steve Bennett --- jim.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'jim.h') diff --git a/jim.h b/jim.h index b3f1651..5aa4060 100644 --- a/jim.h +++ b/jim.h @@ -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) \ -- cgit v1.1