summaryrefslogtreecommitdiffstats
path: root/generic/tclHash.c
diff options
context:
space:
mode:
authordas <das>2006-11-13 08:23:06 (GMT)
committerdas <das>2006-11-13 08:23:06 (GMT)
commit14658604dc06848987405fc50bd939df33cd8796 (patch)
tree99d99df3c8e5314426464d9cf33cc3f090935734 /generic/tclHash.c
parent28b521aa54b70b09061301be5da23d1b4bf33f8e (diff)
downloadtcl-14658604dc06848987405fc50bd939df33cd8796.zip
tcl-14658604dc06848987405fc50bd939df33cd8796.tar.gz
tcl-14658604dc06848987405fc50bd939df33cd8796.tar.bz2
* generic/tclCompExpr.c: fix gcc warnings about 'cast to/from
* generic/tclEncoding.c: pointer from/to integer of different * generic/tclEvent.c: size' on 64-bit platforms by casting to * generic/tclExecute.c: intermediate types intptr_t/uintptr_t * generic/tclHash.c: via new PTR2INT(), INT2PTR(), * generic/tclIO.c: PTR2UINT() and UINT2PTR() macros. * generic/tclInt.h: [Patch 1592791] * generic/tclProc.c: * generic/tclTest.c: * generic/tclThreadStorage.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/configure.in: * unix/tclUnixChan.c: * unix/tclUnixPipe.c: * unix/tclUnixPort.h: * unix/tclUnixTest.c: * unix/tclUnixThrd.c: * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r--generic/tclHash.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c
index cabf02a..61837d5 100644
--- a/generic/tclHash.c
+++ b/generic/tclHash.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclHash.c,v 1.26 2006/10/22 00:13:29 msofer Exp $
+ * RCS: @(#) $Id: tclHash.c,v 1.27 2006/11/13 08:23:08 das Exp $
*/
#include "tclInt.h"
@@ -329,7 +329,7 @@ Tcl_CreateHashEntry(
index = hash & tablePtr->mask;
}
} else {
- hash = (unsigned int) key;
+ hash = PTR2UINT(key);
index = RANDOM_INDEX (tablePtr, hash);
}
@@ -342,7 +342,7 @@ Tcl_CreateHashEntry(
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
#if TCL_HASH_KEY_STORE_HASH
- if (hash != (unsigned int) hPtr->hash) {
+ if (hash != PTR2UINT(hPtr->hash)) {
continue;
}
#endif
@@ -356,7 +356,7 @@ Tcl_CreateHashEntry(
for (hPtr = tablePtr->buckets[index]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
#if TCL_HASH_KEY_STORE_HASH
- if (hash != (unsigned int) hPtr->hash) {
+ if (hash != PTR2UINT(hPtr->hash)) {
continue;
}
#endif
@@ -387,7 +387,7 @@ Tcl_CreateHashEntry(
hPtr->tablePtr = tablePtr;
#if TCL_HASH_KEY_STORE_HASH
# if TCL_PRESERVE_BINARY_COMPATABILITY
- hPtr->hash = (VOID *) hash;
+ hPtr->hash = UINT2PTR(hash);
# else
hPtr->hash = hash;
# endif
@@ -464,7 +464,7 @@ Tcl_DeleteHashEntry(
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
index = RANDOM_INDEX (tablePtr, entryPtr->hash);
} else {
- index = ((unsigned int) entryPtr->hash) & tablePtr->mask;
+ index = PTR2UINT(entryPtr->hash) & tablePtr->mask;
}
bucketPtr = &(tablePtr->buckets[index]);
@@ -1127,7 +1127,7 @@ RebuildTable(
|| typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) {
index = RANDOM_INDEX (tablePtr, hPtr->hash);
} else {
- index = ((unsigned int) hPtr->hash) & tablePtr->mask;
+ index = PTR2UINT(hPtr->hash) & tablePtr->mask;
}
hPtr->nextPtr = tablePtr->buckets[index];
tablePtr->buckets[index] = hPtr;