summaryrefslogtreecommitdiffstats
path: root/generic/tclHash.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-05-27 13:18:51 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-05-27 13:18:51 (GMT)
commitd63bdddac575b06d8dbaff5caf199f191258281a (patch)
tree81621affdfd50f3451faa2c5568732111932e247 /generic/tclHash.c
parent4761295d5dc11e76a759fc26de4b30d09bccd1a5 (diff)
downloadtcl-d63bdddac575b06d8dbaff5caf199f191258281a.zip
tcl-d63bdddac575b06d8dbaff5caf199f191258281a.tar.gz
tcl-d63bdddac575b06d8dbaff5caf199f191258281a.tar.bz2
Made compiling with -Wstrict-prototypes -Wmissing-prototypes much cleaner.
Also added support for [FRQ 951168] but left that switched off by default.
Diffstat (limited to 'generic/tclHash.c')
-rw-r--r--generic/tclHash.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclHash.c b/generic/tclHash.c
index 54a6efa..360acfe 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.18 2004/04/06 22:25:51 dgp Exp $
+ * RCS: @(#) $Id: tclHash.c,v 1.19 2004/05/27 13:18:53 dkf Exp $
*/
#include "tclInt.h"
@@ -986,11 +986,14 @@ AllocStringEntry(tablePtr, keyPtr)
static int
CompareStringKeys(keyPtr, hPtr)
VOID *keyPtr; /* New key to compare. */
- Tcl_HashEntry *hPtr; /* Existing key to compare. */
+ Tcl_HashEntry *hPtr; /* Existing key to compare. */
{
register CONST char *p1 = (CONST char *) keyPtr;
register CONST char *p2 = (CONST char *) hPtr->key.string;
+#ifdef TCL_COMPARE_HASHES_WITH_STRCMP
+ return !strcmp(p1, p2);
+#else
for (;; p1++, p2++) {
if (*p1 != *p2) {
break;
@@ -1000,6 +1003,7 @@ CompareStringKeys(keyPtr, hPtr)
}
}
return 0;
+#endif /* TCL_COMPARE_HASHES_WITH_STRCMP */
}
/*