diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | generic/tclHash.c | 32 |
2 files changed, 39 insertions, 2 deletions
@@ -1,3 +1,12 @@ +2010-03-25 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tclHash.c: [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) + 2011-03-24 Donal K. Fellows <dkf@users.sf.net> * generic/tclFCmd.c (TclFileAttrsCmd): Ensure that any reference to 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; |