summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan <jan>2011-03-25 21:16:15 (GMT)
committerjan <jan>2011-03-25 21:16:15 (GMT)
commitfa88a4aa6f60b8656205b3a635dcb45a19111a0a (patch)
tree47fc9b18491d0cc32c1fbd116fbe9c665475ac58 /generic
parent94f7f25a26dfb0f41665539c100091a24c299744 (diff)
downloadtcl-fa88a4aa6f60b8656205b3a635dcb45a19111a0a.zip
tcl-fa88a4aa6f60b8656205b3a635dcb45a19111a0a.tar.gz
tcl-fa88a4aa6f60b8656205b3a635dcb45a19111a0a.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')
-rw-r--r--generic/tclHash.c32
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;