diff options
author | jan <jan> | 2011-03-25 21:16:15 (GMT) |
---|---|---|
committer | jan <jan> | 2011-03-25 21:16:15 (GMT) |
commit | 5964f0af379da6d133cf236fa9ad9eb9a7fc39fb (patch) | |
tree | 47fc9b18491d0cc32c1fbd116fbe9c665475ac58 /generic/tclHash.c | |
parent | 7f62526237f1fbba269a64a7a4c8a369d7b5e388 (diff) | |
download | tcl-5964f0af379da6d133cf236fa9ad9eb9a7fc39fb.zip tcl-5964f0af379da6d133cf236fa9ad9eb9a7fc39fb.tar.gz tcl-5964f0af379da6d133cf236fa9ad9eb9a7fc39fb.tar.bz2 |
[Bug 3007895]: Tcl_(Find|Create)HashEntry
stub entries can never be called. They still cannot be called
(no change in functionality), but at least they now do
exactly the same as the Tcl_(Find|Create)HashEntry macro's,
so the confusion addressed in this Bug report is gone.
Merged --cherrypick from Tcl8.5 (2010-12-31,e75735ef76)
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r-- | generic/tclHash.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c index 716d251..53d9919 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -90,6 +90,11 @@ static Tcl_HashEntry * BogusFind _ANSI_ARGS_((Tcl_HashTable *tablePtr, CONST char *key)); static Tcl_HashEntry * BogusCreate _ANSI_ARGS_((Tcl_HashTable *tablePtr, CONST char *key, int *newPtr)); +static Tcl_HashEntry * FindHashEntry _ANSI_ARGS_((Tcl_HashTable *tablePtr, + CONST char *key)); +static Tcl_HashEntry * CreateHashEntry _ANSI_ARGS_((Tcl_HashTable *tablePtr, + CONST char *key, int *newPtr)); + #endif static void RebuildTable _ANSI_ARGS_((Tcl_HashTable *tablePtr)); @@ -204,8 +209,8 @@ Tcl_InitCustomHashTable(tablePtr, keyType, typePtr) tablePtr->mask = 3; tablePtr->keyType = keyType; #if TCL_PRESERVE_BINARY_COMPATABILITY - tablePtr->findProc = Tcl_FindHashEntry; - tablePtr->createProc = Tcl_CreateHashEntry; + tablePtr->findProc = FindHashEntry; + tablePtr->createProc = CreateHashEntry; if (typePtr == NULL) { /* @@ -272,6 +277,16 @@ Tcl_HashEntry * Tcl_FindHashEntry(tablePtr, key) Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ CONST char *key; /* Key to use to find matching entry. */ +#if TCL_PRESERVE_BINARY_COMPATABILITY +{ + return tablePtr->findProc(tablePtr, key); +} + +static Tcl_HashEntry * +FindHashEntry(tablePtr, key) + Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ + CONST char *key; /* Key to use to find matching entry. */ +#endif /* TCL_PRESERVE_BINARY_COMPATABILITY */ { register Tcl_HashEntry *hPtr; Tcl_HashKeyType *typePtr; @@ -371,6 +386,19 @@ Tcl_CreateHashEntry(tablePtr, key, newPtr) * entry. */ int *newPtr; /* Store info here telling whether a new * entry was created. */ +#if TCL_PRESERVE_BINARY_COMPATABILITY +{ + return tablePtr->createProc(tablePtr, key, newPtr); +} + +static Tcl_HashEntry * +CreateHashEntry(tablePtr, key, newPtr) + Tcl_HashTable *tablePtr; /* Table in which to lookup entry. */ + CONST char *key; /* Key to use to find or create matching + * entry. */ + int *newPtr; /* Store info here telling whether a new + * entry was created. */ +#endif /* TCL_PRESERVE_BINARY_COMPATABILITY */ { register Tcl_HashEntry *hPtr; Tcl_HashKeyType *typePtr; |