Tcl Source Code

Artifact [faf834dd84]
Login

Artifact faf834dd84ac5e51eef2968ba672020e2ff2b7f4:

Attachment "hash.patch" to ticket [3009403fff] added by nijtmans 2010-05-31 16:49:31.
Index: doc/Hash.3
===================================================================
RCS file: /cvsroot/tcl/tcl/doc/Hash.3,v
retrieving revision 1.33
diff -u -r1.33 Hash.3
--- doc/Hash.3	10 Jan 2010 20:36:49 -0000	1.33
+++ doc/Hash.3	31 May 2010 09:17:58 -0000
@@ -37,7 +37,7 @@
 .sp
 \fBTcl_SetHashValue\fR(\fIentryPtr, value\fR)
 .sp
-char *
+void *
 \fBTcl_GetHashKey\fR(\fItablePtr, entryPtr\fR)
 .sp
 Tcl_HashEntry *
@@ -60,7 +60,7 @@
 \fBTCL_CUSTOM_PTR_KEYS\fR, or an integer value greater than 1.
 .AP Tcl_HashKeyType *typePtr in
 Address of structure which defines the behaviour of the hash table.
-.AP "const char" *key in
+.AP "const void" *key in
 Key to use for probe into table.  Exact form depends on
 \fIkeyType\fR used to create table.
 .AP int *newPtr out
Index: generic/tcl.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.h,v
retrieving revision 1.306
diff -u -r1.306 tcl.h
--- generic/tcl.h	30 Apr 2010 21:15:42 -0000	1.306
+++ generic/tcl.h	31 May 2010 09:18:01 -0000
@@ -2494,7 +2494,7 @@
 #define Tcl_GetHashValue(h) ((h)->clientData)
 #define Tcl_SetHashValue(h, value) ((h)->clientData = (ClientData) (value))
 #define Tcl_GetHashKey(tablePtr, h) \
-	((char *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
+	((void *) (((tablePtr)->keyType == TCL_ONE_WORD_KEYS || \
 		    (tablePtr)->keyType == TCL_CUSTOM_PTR_KEYS) \
 		   ? (h)->key.oneWordValue \
 		   : (h)->key.string))
@@ -2506,10 +2506,10 @@
 
 #undef  Tcl_FindHashEntry
 #define Tcl_FindHashEntry(tablePtr, key) \
-	(*((tablePtr)->findProc))(tablePtr, key)
+	(*((tablePtr)->findProc))(tablePtr, (const char *)key)
 #undef  Tcl_CreateHashEntry
 #define Tcl_CreateHashEntry(tablePtr, key, newPtr) \
-	(*((tablePtr)->createProc))(tablePtr, key, newPtr)
+	(*((tablePtr)->createProc))(tablePtr, (const char *)key, newPtr)
 
 /*
  *----------------------------------------------------------------------------
Index: generic/tclExecute.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclExecute.c,v
retrieving revision 1.484
diff -u -r1.484 tclExecute.c
--- generic/tclExecute.c	31 May 2010 08:54:15 -0000	1.484
+++ generic/tclExecute.c	31 May 2010 09:18:35 -0000
@@ -233,7 +233,7 @@
     int *newPtr)
 {
     Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(&tablePtr->table,
-	    (char *) key, newPtr);
+	    key, newPtr);
 
     if (!hPtr) {
 	return NULL;
@@ -1655,7 +1655,7 @@
 
 	{
 	    Tcl_HashEntry *hePtr =
-		    Tcl_FindHashEntry(iPtr->lineBCPtr, (char *) codePtr);
+		    Tcl_FindHashEntry(iPtr->lineBCPtr, codePtr);
 
 	    if (hePtr) {
 		ExtCmdLoc *eclPtr = Tcl_GetHashValue(hePtr);
@@ -8256,14 +8256,14 @@
 	int srcOffset, i;
 	Interp *iPtr = (Interp *) *codePtr->interpHandle;
 	Tcl_HashEntry *hePtr =
-		Tcl_FindHashEntry(iPtr->lineBCPtr, (char *) codePtr);
+		Tcl_FindHashEntry(iPtr->lineBCPtr, codePtr);
 
 	if (!hePtr) {
 	    return;
 	}
 
 	srcOffset = cfPtr->cmd.str.cmd - codePtr->source;
-	eclPtr = (ExtCmdLoc *) Tcl_GetHashValue(hePtr);
+	eclPtr = Tcl_GetHashValue(hePtr);
 
 	for (i=0; i < eclPtr->nuloc; i++) {
 	    if (eclPtr->loc[i].srcOffset == srcOffset) {
Index: generic/tclTest.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTest.c,v
retrieving revision 1.151
diff -u -r1.151 tclTest.c
--- generic/tclTest.c	20 Apr 2010 14:24:34 -0000	1.151
+++ generic/tclTest.c	31 May 2010 09:18:54 -0000
@@ -6539,7 +6539,7 @@
     }
 
     for (i=0 ; i<limit ; i++) {
-	hPtr = Tcl_CreateHashEntry(&hash, (char *) INT2PTR(i), &isNew);
+	hPtr = Tcl_CreateHashEntry(&hash, INT2PTR(i), &isNew);
 	if (!isNew) {
 	    Tcl_SetObjResult(interp, Tcl_NewIntObj(i));
 	    Tcl_AppendToObj(Tcl_GetObjResult(interp)," creation problem",-1);
Index: generic/tclUtil.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclUtil.c,v
retrieving revision 1.115
diff -u -r1.115 tclUtil.c
--- generic/tclUtil.c	27 Apr 2010 12:36:22 -0000	1.115
+++ generic/tclUtil.c	31 May 2010 09:19:01 -0000
@@ -3009,7 +3009,7 @@
     cacheMap = GetThreadHash(&pgvPtr->key);
     ClearHash(cacheMap);
     hPtr = Tcl_CreateHashEntry(cacheMap,
-	    (char *) INT2PTR(pgvPtr->epoch), &dummy);
+	    INT2PTR(pgvPtr->epoch), &dummy);
     Tcl_SetHashValue(hPtr, newValue);
     Tcl_MutexUnlock(&pgvPtr->mutex);
 }
@@ -3104,7 +3104,7 @@
 
 	value = Tcl_NewStringObj(pgvPtr->value, pgvPtr->numBytes);
 	hPtr = Tcl_CreateHashEntry(cacheMap,
-		(char *) INT2PTR(pgvPtr->epoch), &dummy);
+		INT2PTR(pgvPtr->epoch), &dummy);
 	Tcl_MutexUnlock(&pgvPtr->mutex);
 	Tcl_SetHashValue(hPtr, value);
 	Tcl_IncrRefCount(value);
Index: generic/tclBasic.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBasic.c,v
retrieving revision 1.456
diff -u -r1.456 tclBasic.c
--- generic/tclBasic.c	3 May 2010 14:36:41 -0000	1.456
+++ generic/tclBasic.c	31 May 2010 09:18:11 -0000
@@ -649,7 +649,7 @@
     cancelInfo->length = 0;
 
     Tcl_MutexLock(&cancelLock);
-    hPtr = Tcl_CreateHashEntry(&cancelTable, (char *) iPtr, &isNew);
+    hPtr = Tcl_CreateHashEntry(&cancelTable, iPtr, &isNew);
     Tcl_SetHashValue(hPtr, cancelInfo);
     Tcl_MutexUnlock(&cancelLock);
 
@@ -5504,7 +5504,7 @@
 	if (cfPtr->line[i] < 0) {
 	    continue;
 	}
-	hPtr = Tcl_CreateHashEntry(iPtr->lineLAPtr, (char *) objv[i], &new);
+	hPtr = Tcl_CreateHashEntry(iPtr->lineLAPtr, objv[i], &new);
 	if (new) {
 	    /*
 	     * The word is not on the stack yet, remember the current location
@@ -5637,7 +5637,7 @@
 		int isnew;
 		Tcl_HashEntry *hPtr =
 			Tcl_CreateHashEntry(iPtr->lineLABCPtr,
-				(char *) objv[word], &isnew);
+				objv[word], &isnew);
 		CFWordBC *cfwPtr = (CFWordBC *) ckalloc(sizeof(CFWordBC));
 
 		cfwPtr->framePtr = cfPtr;
@@ -8903,7 +8903,7 @@
 	    int isNew;
 	    Tcl_HashEntry *newPtr =
 		    Tcl_CreateHashEntry(corPtr->base.lineLABCPtr,
-		    (char *) Tcl_GetHashKey(iPtr->lineLABCPtr, hePtr),
+		    Tcl_GetHashKey(iPtr->lineLABCPtr, hePtr),
 		    &isNew);
 
 	    Tcl_SetHashValue(newPtr, Tcl_GetHashValue(hePtr));
Index: generic/tclObj.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclObj.c,v
retrieving revision 1.173
diff -u -r1.173 tclObj.c
--- generic/tclObj.c	27 Apr 2010 12:36:21 -0000	1.173
+++ generic/tclObj.c	31 May 2010 09:18:44 -0000
@@ -575,7 +575,7 @@
     int newEntry;
     ThreadSpecificData *tsdPtr = TclGetContLineTable();
     Tcl_HashEntry *hPtr =
-	    Tcl_CreateHashEntry(tsdPtr->lineCLPtr, (char*) objPtr, &newEntry);
+	    Tcl_CreateHashEntry(tsdPtr->lineCLPtr, objPtr, &newEntry);
     ContLineLoc *clLocPtr = (ContLineLoc *)
             ckalloc(sizeof(ContLineLoc) + num*sizeof(int));
 
@@ -731,7 +731,7 @@
 {
     ThreadSpecificData *tsdPtr = TclGetContLineTable();
     Tcl_HashEntry *hPtr =
-            Tcl_FindHashEntry(tsdPtr->lineCLPtr, (char *) originObjPtr);
+            Tcl_FindHashEntry(tsdPtr->lineCLPtr, originObjPtr);
 
     if (hPtr) {
 	ContLineLoc *clLocPtr = Tcl_GetHashValue(hPtr);
@@ -765,7 +765,7 @@
 {
     ThreadSpecificData *tsdPtr = TclGetContLineTable();
     Tcl_HashEntry *hPtr =
-            Tcl_FindHashEntry(tsdPtr->lineCLPtr, (char *) objPtr);
+            Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
 
     if (!hPtr) {
         return NULL;
@@ -962,7 +962,7 @@
     Tcl_MutexLock(&tableMutex);
     hPtr = Tcl_FindHashEntry(&typeTable, typeName);
     if (hPtr != NULL) {
-	typePtr = (const Tcl_ObjType *) Tcl_GetHashValue(hPtr);
+	typePtr = Tcl_GetHashValue(hPtr);
     }
     Tcl_MutexUnlock(&tableMutex);
     return typePtr;
@@ -1111,7 +1111,7 @@
 	    Tcl_InitHashTable(tsdPtr->objThreadMap, TCL_ONE_WORD_KEYS);
 	}
 	tablePtr = tsdPtr->objThreadMap;
-	hPtr = Tcl_CreateHashEntry(tablePtr, (char *) objPtr, &isNew);
+	hPtr = Tcl_CreateHashEntry(tablePtr, objPtr, &isNew);
 	if (!isNew) {
 	    Tcl_Panic("expected to create new entry for object map");
 	}
@@ -1387,7 +1387,7 @@
         Tcl_HashEntry *hPtr;
 
 	if (tsdPtr->lineCLPtr) {
-            hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, (char *) objPtr);
+            hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
 	    if (hPtr) {
 		Tcl_EventuallyFree(Tcl_GetHashValue(hPtr), ContLineLocFree);
 		Tcl_DeleteHashEntry(hPtr);
@@ -1478,7 +1478,7 @@
         Tcl_HashEntry *hPtr;
 
 	if (tsdPtr->lineCLPtr) {
-            hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, (char *) objPtr);
+            hPtr = Tcl_FindHashEntry(tsdPtr->lineCLPtr, objPtr);
 	    if (hPtr) {
 		Tcl_EventuallyFree(Tcl_GetHashValue(hPtr), ContLineLocFree);
 		Tcl_DeleteHashEntry(hPtr);
@@ -3694,7 +3694,7 @@
 	if (!tablePtr) {
 	    Tcl_Panic("object table not initialized");
 	}
-	hPtr = Tcl_FindHashEntry(tablePtr, (char *) objPtr);
+	hPtr = Tcl_FindHashEntry(tablePtr, objPtr);
 	if (!hPtr) {
 	    Tcl_Panic("%s%s",
 		    "Trying to incr ref count of "
@@ -3759,7 +3759,7 @@
 	if (!tablePtr) {
 	    Tcl_Panic("object table not initialized");
 	}
-	hPtr = Tcl_FindHashEntry(tablePtr, (char *) objPtr);
+	hPtr = Tcl_FindHashEntry(tablePtr, objPtr);
 	if (!hPtr) {
 	    Tcl_Panic("%s%s",
 		    "Trying to decr ref count of "
@@ -3838,7 +3838,7 @@
 	if (!tablePtr) {
 	    Tcl_Panic("object table not initialized");
 	}
-	hPtr = Tcl_FindHashEntry(tablePtr, (char *) objPtr);
+	hPtr = Tcl_FindHashEntry(tablePtr, objPtr);
 	if (!hPtr) {
 	    Tcl_Panic("%s%s",
 		    "Trying to check shared status of"
Index: generic/tclVar.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclVar.c,v
retrieving revision 1.199
diff -u -r1.199 tclVar.c
--- generic/tclVar.c	31 May 2010 08:54:14 -0000	1.199
+++ generic/tclVar.c	31 May 2010 09:19:06 -0000
@@ -55,7 +55,7 @@
     int *newPtr)
 {
     Tcl_HashEntry *hPtr = Tcl_CreateHashEntry(&tablePtr->table,
-	    (char *) key, newPtr);
+	    key, newPtr);
 
     if (hPtr) {
 	return VarHashGetValue(hPtr);
@@ -2455,13 +2455,13 @@
 
 	    int isNew;
 
-	    tPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) varPtr);
+	    tPtr = Tcl_FindHashEntry(&iPtr->varTraces, varPtr);
 	    tracePtr = Tcl_GetHashValue(tPtr);
 	    varPtr->flags &= ~VAR_ALL_TRACES;
 	    Tcl_DeleteHashEntry(tPtr);
 	    if (dummyVar.flags & VAR_TRACED_UNSET) {
 		tPtr = Tcl_CreateHashEntry(&iPtr->varTraces,
-			(char *) &dummyVar, &isNew);
+			&dummyVar, &isNew);
 		Tcl_SetHashValue(tPtr, tracePtr);
 	    }
 	}
@@ -2481,8 +2481,7 @@
 
 	    tracePtr = NULL;
 	    if (TclIsVarTraced(&dummyVar)) {
-		tPtr = Tcl_FindHashEntry(&iPtr->varTraces,
-			(char *) &dummyVar);
+		tPtr = Tcl_FindHashEntry(&iPtr->varTraces, &dummyVar);
 		tracePtr = Tcl_GetHashValue(tPtr);
 		if (tPtr) {
 		    Tcl_DeleteHashEntry(tPtr);
@@ -3076,7 +3075,7 @@
      */
 
     searchPtr = (ArraySearch *) ckalloc(sizeof(ArraySearch));
-    hPtr = Tcl_CreateHashEntry(&iPtr->varSearches, (char *) varPtr, &isNew);
+    hPtr = Tcl_CreateHashEntry(&iPtr->varSearches, varPtr, &isNew);
     if (isNew) {
 	searchPtr->id = 1;
 	Tcl_AppendResult(interp, "s-1-", varName, NULL);
@@ -3401,7 +3400,7 @@
      * variable.
      */
 
-    hPtr = Tcl_FindHashEntry(&iPtr->varSearches, (char *) varPtr);
+    hPtr = Tcl_FindHashEntry(&iPtr->varSearches, varPtr);
     if (searchPtr == Tcl_GetHashValue(hPtr)) {
 	if (searchPtr->nextPtr) {
 	    Tcl_SetHashValue(hPtr, searchPtr->nextPtr);
@@ -5148,7 +5147,7 @@
 
     if (varPtr->flags & VAR_SEARCH_ACTIVE) {
 	Tcl_HashEntry *hPtr =
-		Tcl_FindHashEntry(&iPtr->varSearches, (char *) varPtr);
+		Tcl_FindHashEntry(&iPtr->varSearches, varPtr);
 
 	for (searchPtr = Tcl_GetHashValue(hPtr); searchPtr != NULL;
 		searchPtr = searchPtr->nextPtr) {
@@ -5190,7 +5189,7 @@
     Tcl_HashEntry *sPtr;
 
     if (arrayVarPtr->flags & VAR_SEARCH_ACTIVE) {
-	sPtr = Tcl_FindHashEntry(&iPtr->varSearches, (char *) arrayVarPtr);
+	sPtr = Tcl_FindHashEntry(&iPtr->varSearches, arrayVarPtr);
 	for (searchPtr = Tcl_GetHashValue(sPtr); searchPtr != NULL;
 		searchPtr = nextPtr) {
 	    nextPtr = searchPtr->nextPtr;
@@ -5258,8 +5257,7 @@
 	 */
 
 	if (TclIsVarTraced(varPtr)) {
-	    Tcl_HashEntry *tPtr = Tcl_FindHashEntry(&iPtr->varTraces,
-		    (char *) varPtr);
+	    Tcl_HashEntry *tPtr = Tcl_FindHashEntry(&iPtr->varTraces, varPtr);
 	    VarTrace *tracePtr = Tcl_GetHashValue(tPtr);
 	    ActiveVarTrace *activePtr;
 
@@ -5453,7 +5451,7 @@
 		TclObjCallVarTraces(iPtr, NULL, elPtr, arrayNamePtr,
 			elNamePtr, flags,/* leaveErrMsg */ 0, index);
 	    }
-	    tPtr = Tcl_FindHashEntry(&iPtr->varTraces, (char *) elPtr);
+	    tPtr = Tcl_FindHashEntry(&iPtr->varTraces, elPtr);
 	    tracePtr = Tcl_GetHashValue(tPtr);
 	    while (tracePtr) {
 		VarTrace *prevPtr = tracePtr;
Index: generic/tclCmdIL.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCmdIL.c,v
retrieving revision 1.182
diff -u -r1.182 tclCmdIL.c
--- generic/tclCmdIL.c	17 May 2010 09:46:09 -0000	1.182
+++ generic/tclCmdIL.c	31 May 2010 09:18:16 -0000
@@ -830,7 +830,7 @@
 		elemObjPtr = Tcl_NewStringObj(cmdName, -1);
 		Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
 		(void) Tcl_CreateHashEntry(&addedCommandsTable,
-			(char *)elemObjPtr, &isNew);
+			elemObjPtr, &isNew);
 	    }
 	    entryPtr = Tcl_NextHashEntry(&search);
 	}
@@ -855,7 +855,7 @@
 			|| Tcl_StringMatch(cmdName, simplePattern)) {
 		    elemObjPtr = Tcl_NewStringObj(cmdName, -1);
 		    (void) Tcl_CreateHashEntry(&addedCommandsTable,
-			    (char *) elemObjPtr, &isNew);
+			    elemObjPtr, &isNew);
 		    if (isNew) {
 			Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr);
 		    } else {
Index: generic/tclCompile.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclCompile.c,v
retrieving revision 1.186
diff -u -r1.186 tclCompile.c
--- generic/tclCompile.c	14 May 2010 08:22:02 -0000	1.186
+++ generic/tclCompile.c	31 May 2010 09:18:21 -0000
@@ -2486,7 +2486,7 @@
      * byte code object (internal rep), for use with the bc compiler.
      */
 
-    Tcl_SetHashValue(Tcl_CreateHashEntry(iPtr->lineBCPtr, (char *) codePtr,
+    Tcl_SetHashValue(Tcl_CreateHashEntry(iPtr->lineBCPtr, codePtr,
 	    &isNew), envPtr->extCmdMapPtr);
     envPtr->extCmdMapPtr = NULL;
 
Index: generic/tclIOCmd.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclIOCmd.c,v
retrieving revision 1.68
diff -u -r1.68 tclIOCmd.c
--- generic/tclIOCmd.c	20 Mar 2010 15:39:46 -0000	1.68
+++ generic/tclIOCmd.c	31 May 2010 09:18:37 -0000
@@ -1271,7 +1271,7 @@
 		TcpAcceptCallbacksDeleteProc, hTblPtr);
     }
 
-    hPtr = Tcl_CreateHashEntry(hTblPtr, (char *) acceptCallbackPtr, &isNew);
+    hPtr = Tcl_CreateHashEntry(hTblPtr, acceptCallbackPtr, &isNew);
     if (!isNew) {
 	Tcl_Panic("RegisterTcpServerCleanup: damaged accept record table");
     }
Index: generic/tclBinary.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclBinary.c,v
retrieving revision 1.64
diff -u -r1.64 tclBinary.c
--- generic/tclBinary.c	30 Apr 2010 20:52:51 -0000	1.64
+++ generic/tclBinary.c	31 May 2010 09:18:12 -0000
@@ -2114,7 +2114,7 @@
 	    register Tcl_HashEntry *hPtr;
 	    int isNew;
 
-	    hPtr = Tcl_CreateHashEntry(tablePtr, (char *)value, &isNew);
+	    hPtr = Tcl_CreateHashEntry(tablePtr, INT2PTR(value), &isNew);
 	    if (!isNew) {
 		return Tcl_GetHashValue(hPtr);
 	    }
Index: generic/tclDictObj.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclDictObj.c,v
retrieving revision 1.82
diff -u -r1.82 tclDictObj.c
--- generic/tclDictObj.c	5 Mar 2010 14:34:04 -0000	1.82
+++ generic/tclDictObj.c	31 May 2010 09:18:24 -0000
@@ -259,7 +259,7 @@
     int *newPtr)
 {
     ChainEntry *cPtr = (ChainEntry *)
-	    Tcl_CreateHashEntry(&dict->table, (char *) keyPtr, newPtr);
+	    Tcl_CreateHashEntry(&dict->table, keyPtr, newPtr);
 
     /*
      * If this is a new entry in the hash table, stitch it into the chain.
@@ -287,7 +287,7 @@
     Tcl_Obj *keyPtr)
 {
     ChainEntry *cPtr = (ChainEntry *)
-	    Tcl_FindHashEntry(&dict->table, (char *) keyPtr);
+	    Tcl_FindHashEntry(&dict->table, keyPtr);
 
     if (cPtr == NULL) {
 	return 0;
@@ -352,7 +352,7 @@
 
     InitChainTable(newDict);
     for (cPtr=oldDict->entryChainHead ; cPtr!=NULL ; cPtr=cPtr->nextPtr) {
-	void *key = Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
+	Tcl_Obj *key = Tcl_GetHashKey(&oldDict->table, &cPtr->entry);
 	Tcl_Obj *valuePtr = Tcl_GetHashValue(&cPtr->entry);
 	int n;
 	Tcl_HashEntry *hPtr = CreateChainEntry(newDict, key, &n);
@@ -500,7 +500,7 @@
 	 * elements already.
 	 */
 
-	keyPtr = (Tcl_Obj *) Tcl_GetHashKey(&dict->table, &cPtr->entry);
+	keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
 	elem = TclGetStringFromObj(keyPtr, &length);
 	dictPtr->length += Tcl_ScanCountedElement(elem, length,
 		&flagPtr[i]) + 1;
@@ -518,7 +518,7 @@
     dictPtr->bytes = ckalloc((unsigned) dictPtr->length);
     dst = dictPtr->bytes;
     for (i=0,cPtr=dict->entryChainHead; i<numElems; i+=2,cPtr=cPtr->nextPtr) {
-	keyPtr = (Tcl_Obj *) Tcl_GetHashKey(&dict->table, &cPtr->entry);
+	keyPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
 	elem = TclGetStringFromObj(keyPtr, &length);
 	dst += Tcl_ConvertCountedElement(elem, length, dst,
 		flagPtr[i] | (i==0 ? 0 : TCL_DONT_QUOTE_HASH));
@@ -814,7 +814,7 @@
     }
 
     for (i=0 ; i<keyc ; i++) {
-	Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&dict->table, (char *)keyv[i]);
+	Tcl_HashEntry *hPtr = Tcl_FindHashEntry(&dict->table, keyv[i]);
 	Tcl_Obj *tmpObj;
 
 	if (hPtr == NULL) {
@@ -1004,7 +1004,7 @@
     }
 
     dict = dictPtr->internalRep.otherValuePtr;
-    hPtr = Tcl_FindHashEntry(&dict->table, (char *) keyPtr);
+    hPtr = Tcl_FindHashEntry(&dict->table, keyPtr);
     if (hPtr == NULL) {
 	*valuePtrPtr = NULL;
     } else {
@@ -1161,8 +1161,7 @@
 	searchPtr->next = cPtr->nextPtr;
 	dict->refcount++;
 	if (keyPtrPtr != NULL) {
-	    *keyPtrPtr = (Tcl_Obj *) Tcl_GetHashKey(&dict->table,
-		    &cPtr->entry);
+	    *keyPtrPtr = Tcl_GetHashKey(&dict->table, &cPtr->entry);
 	}
 	if (valuePtrPtr != NULL) {
 	    *valuePtrPtr = Tcl_GetHashValue(&cPtr->entry);
@@ -1238,7 +1237,7 @@
     searchPtr->next = cPtr->nextPtr;
     *donePtr = 0;
     if (keyPtrPtr != NULL) {
-	*keyPtrPtr = (Tcl_Obj *) Tcl_GetHashKey(
+	*keyPtrPtr = Tcl_GetHashKey(
 		&((Dict *)searchPtr->dictionaryPtr)->table, &cPtr->entry);
     }
     if (valuePtrPtr != NULL) {
Index: generic/tclTrace.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclTrace.c,v
retrieving revision 1.58
diff -u -r1.58 tclTrace.c
--- generic/tclTrace.c	24 Feb 2010 10:45:04 -0000	1.58
+++ generic/tclTrace.c	31 May 2010 09:18:58 -0000
@@ -3198,7 +3198,7 @@
 #endif
     tracePtr->flags = tracePtr->flags & flagMask;
 
-    hPtr = Tcl_CreateHashEntry(&iPtr->varTraces, (char *) varPtr, &isNew);
+    hPtr = Tcl_CreateHashEntry(&iPtr->varTraces, varPtr, &isNew);
     if (isNew) {
 	tracePtr->nextPtr = NULL;
     } else {
Index: generic/tclProc.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclProc.c,v
retrieving revision 1.179
diff -u -r1.179 tclProc.c
--- generic/tclProc.c	5 Mar 2010 14:34:04 -0000	1.179
+++ generic/tclProc.c	31 May 2010 09:18:48 -0000
@@ -272,7 +272,7 @@
 		cfPtr->cmd.str.len = 0;
 
 		hePtr = Tcl_CreateHashEntry(iPtr->linePBodyPtr,
-			(char *) procPtr, &isNew);
+			procPtr, &isNew);
 		if (!isNew) {
 		    /*
 		     * Get the old command frame and release it. See also
@@ -2566,7 +2566,7 @@
 		cfPtr->cmd.str.len = 0;
 
 		Tcl_SetHashValue(Tcl_CreateHashEntry(iPtr->linePBodyPtr,
-			(char *) procPtr, &isNew), cfPtr);
+			procPtr, &isNew), cfPtr);
 	    }
 
 	    /*
Index: generic/tclInterp.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclInterp.c,v
retrieving revision 1.112
diff -u -r1.112 tclInterp.c
--- generic/tclInterp.c	5 Mar 2010 14:34:04 -0000	1.112
+++ generic/tclInterp.c	31 May 2010 09:18:40 -0000
@@ -4008,7 +4008,7 @@
 	return;
     }
 
-    hashPtr = Tcl_CreateHashEntry(&iPtr->limit.callbacks, (char *) &key,
+    hashPtr = Tcl_CreateHashEntry(&iPtr->limit.callbacks, &key,
 	    &isNew);
     if (!isNew) {
 	limitCBPtr = Tcl_GetHashValue(hashPtr);
Index: generic/tclEncoding.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclEncoding.c,v
retrieving revision 1.70
diff -u -r1.70 tclEncoding.c
--- generic/tclEncoding.c	24 Feb 2010 10:32:17 -0000	1.70
+++ generic/tclEncoding.c	31 May 2010 09:18:27 -0000
@@ -776,7 +776,7 @@
 
     hPtr = Tcl_FindHashEntry(&encodingTable, name);
     if (hPtr != NULL) {
-	encodingPtr = (Encoding *) Tcl_GetHashValue(hPtr);
+	encodingPtr = Tcl_GetHashValue(hPtr);
 	encodingPtr->refCount++;
 	Tcl_MutexUnlock(&encodingMutex);
 	return (Tcl_Encoding) encodingPtr;
@@ -925,7 +925,7 @@
 	Encoding *encodingPtr = Tcl_GetHashValue(hPtr);
 
 	Tcl_CreateHashEntry(&table,
-		(char *) Tcl_NewStringObj(encodingPtr->name, -1), &dummy);
+		Tcl_NewStringObj(encodingPtr->name, -1), &dummy);
     }
     Tcl_MutexUnlock(&encodingMutex);
 
@@ -938,7 +938,7 @@
 
     Tcl_DictObjFirst(NULL, map, &mapSearch, &name, NULL, &done);
     for (; !done; Tcl_DictObjNext(&mapSearch, &name, NULL, &done)) {
-	Tcl_CreateHashEntry(&table, (char *) name, &dummy);
+	Tcl_CreateHashEntry(&table, name, &dummy);
     }
 
     /*