diff options
Diffstat (limited to 'generic/tcl.h')
-rw-r--r-- | generic/tcl.h | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index a8f4dd1..5035365 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -959,13 +959,11 @@ struct Tcl_HashEntry { Tcl_HashEntry *nextPtr; /* Pointer to next entry in this hash bucket, * or NULL for end of chain. */ Tcl_HashTable *tablePtr; /* Pointer to table containing entry. */ - void *hash; /* Hash value, stored as pointer to ensure - * that the offsets of the fields in this - * structure are not changed. */ + size_t hash; /* Hash value */ ClientData clientData; /* Application stores something here with * Tcl_SetHashValue. */ union { /* Key has one of these forms: */ - char *oneWordValue; /* One-word value for key. */ + const void *oneWordValue; /* One-word value for key. */ Tcl_Obj *objPtr; /* Tcl_Obj * key value. */ int words[1]; /* Multiple integer words for key. The actual * size will be as large as necessary for this @@ -998,6 +996,7 @@ struct Tcl_HashEntry { */ #define TCL_HASH_KEY_TYPE_VERSION 1 + struct Tcl_HashKeyType { int version; /* Version of the table. If this structure is * extended in future then the version can be @@ -1050,23 +1049,23 @@ struct Tcl_HashTable { Tcl_HashEntry *staticBuckets[TCL_SMALL_HASH_TABLE]; /* Bucket array used for small tables (to * avoid mallocs and frees). */ - int numBuckets; /* Total number of buckets allocated at + size_t numBuckets; /* Total number of buckets allocated at * **bucketPtr. */ - int numEntries; /* Total number of entries present in + size_t numEntries; /* Total number of entries present in * table. */ - int rebuildSize; /* Enlarge table when numEntries gets to be + size_t rebuildSize; /* Enlarge table when numEntries gets to be * this large. */ + size_t mask; /* Mask value used in hashing function. */ int downShift; /* Shift count used in hashing function. * Designed to use high-order bits of * randomized keys. */ - int mask; /* Mask value used in hashing function. */ int keyType; /* Type of keys used in this table. It's * either TCL_CUSTOM_KEYS, TCL_STRING_KEYS, * TCL_ONE_WORD_KEYS, or an integer giving the * number of ints that is the size of the * key. */ - Tcl_HashEntry *(*findProc) (Tcl_HashTable *tablePtr, const char *key); - Tcl_HashEntry *(*createProc) (Tcl_HashTable *tablePtr, const char *key, + Tcl_HashEntry *(*findProc) (Tcl_HashTable *tablePtr, const void *key); + Tcl_HashEntry *(*createProc) (Tcl_HashTable *tablePtr, const void *key, int *newPtr); const Tcl_HashKeyType *typePtr; /* Type of the keys used in the @@ -1080,7 +1079,7 @@ struct Tcl_HashTable { typedef struct Tcl_HashSearch { Tcl_HashTable *tablePtr; /* Table being searched. */ - int nextIndex; /* Index of next bucket to be enumerated after + size_t nextIndex; /* Index of next bucket to be enumerated after * present one. */ Tcl_HashEntry *nextEntryPtr;/* Next entry to be enumerated in the current * bucket. */ @@ -2364,9 +2363,9 @@ TCLAPI void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); */ #define Tcl_FindHashEntry(tablePtr, key) \ - (*((tablePtr)->findProc))(tablePtr, (const char *)(key)) + (*((tablePtr)->findProc))(tablePtr, key) #define Tcl_CreateHashEntry(tablePtr, key, newPtr) \ - (*((tablePtr)->createProc))(tablePtr, (const char *)(key), newPtr) + (*((tablePtr)->createProc))(tablePtr, key, newPtr) /* *---------------------------------------------------------------------------- |