diff options
author | dkf <dkf@noemail.net> | 2007-04-17 14:49:52 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2007-04-17 14:49:52 (GMT) |
commit | c4b6ad1ceb3dd7475f09d4af2f35f31c2ac0d65b (patch) | |
tree | d38a0997ec4141e501a5f19512dfe1445d8c4404 /generic/tclHash.c | |
parent | 6b4e4cde646d4f2d4569427d3363a5212b7882c9 (diff) | |
download | tcl-c4b6ad1ceb3dd7475f09d4af2f35f31c2ac0d65b.zip tcl-c4b6ad1ceb3dd7475f09d4af2f35f31c2ac0d65b.tar.gz tcl-c4b6ad1ceb3dd7475f09d4af2f35f31c2ac0d65b.tar.bz2 |
Eliminate use of (VOID*) casts when calling memset or memcpy.
FossilOrigin-Name: 45b49489451e09193f60023f5244b0d73a26880e
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r-- | generic/tclHash.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c index 542e89c..8be7d1f 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.28 2007/02/20 23:24:04 nijtmans Exp $ + * RCS: @(#) $Id: tclHash.c,v 1.29 2007/04/17 14:49:53 dkf Exp $ */ #include "tclInt.h" @@ -322,7 +322,7 @@ Tcl_CreateHashEntry( #endif if (typePtr->hashKeyProc) { - hash = typePtr->hashKeyProc (tablePtr, (VOID *) key); + hash = typePtr->hashKeyProc(tablePtr, (VOID *) key); if (typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { index = RANDOM_INDEX (tablePtr, hash); } else { @@ -346,9 +346,10 @@ Tcl_CreateHashEntry( continue; } #endif - if (compareKeysProc ((VOID *) key, hPtr)) { - if (newPtr) + if (compareKeysProc((VOID *) key, hPtr)) { + if (newPtr) { *newPtr = 0; + } return hPtr; } } @@ -361,16 +362,17 @@ Tcl_CreateHashEntry( } #endif if (key == hPtr->key.oneWordValue) { - if (newPtr) + if (newPtr) { *newPtr = 0; + } return hPtr; } } } - if (!newPtr) + if (!newPtr) { return NULL; - + } /* * Entry not found. Add a new one to the bucket. @@ -378,7 +380,7 @@ Tcl_CreateHashEntry( *newPtr = 1; if (typePtr->allocEntryProc) { - hPtr = typePtr->allocEntryProc (tablePtr, (VOID *) key); + hPtr = typePtr->allocEntryProc(tablePtr, (VOID *) key); } else { hPtr = (Tcl_HashEntry *) ckalloc((unsigned) sizeof(Tcl_HashEntry)); hPtr->key.oneWordValue = (char *) key; @@ -1132,11 +1134,12 @@ RebuildTable( hPtr->nextPtr = tablePtr->buckets[index]; tablePtr->buckets[index] = hPtr; #else - VOID *key = (VOID *) Tcl_GetHashKey (tablePtr, hPtr); + VOID *key = (VOID *) Tcl_GetHashKey(tablePtr, hPtr); if (typePtr->hashKeyProc) { unsigned int hash; - hash = typePtr->hashKeyProc (tablePtr, (VOID *) key); + + hash = typePtr->hashKeyProc(tablePtr, (VOID *) key); if (typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { index = RANDOM_INDEX (tablePtr, hash); } else { |