diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2007-04-17 14:49:53 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2007-04-17 14:49:53 (GMT) |
commit | 7ab521d768effeec66e8d06abf0067ce0652a57f (patch) | |
tree | d38a0997ec4141e501a5f19512dfe1445d8c4404 /generic/tclHash.c | |
parent | 3943396d1d7a64194d6babf11bbf7db8ab76be16 (diff) | |
download | tcl-7ab521d768effeec66e8d06abf0067ce0652a57f.zip tcl-7ab521d768effeec66e8d06abf0067ce0652a57f.tar.gz tcl-7ab521d768effeec66e8d06abf0067ce0652a57f.tar.bz2 |
Eliminate use of (VOID*) casts when calling memset or memcpy.
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 { |