aboutsummaryrefslogtreecommitdiff
path: root/jim.h
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-11-11 12:11:07 +1000
committerSteve Bennett <steveb@workware.net.au>2011-11-18 07:57:03 +1000
commit0ddf0885b9560de1b242bc58d27033e069555707 (patch)
tree34e1969ddabb51aefa18adbc9afe7bc01c4ca108 /jim.h
parent8ca0b5227f362c9ab3e4e507c0a41be609c449d5 (diff)
downloadjimtcl-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.h8
1 files changed, 4 insertions, 4 deletions
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) \