summaryrefslogtreecommitdiffstats
path: root/generic/tclLiteral.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-12 14:40:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-07-12 14:40:12 (GMT)
commita5748bcfeaed4a02c8b11829a0ea0a13dceb8ff9 (patch)
tree8160d7f7f3f65ca19b5b22fd16ce872dcc7d0da2 /generic/tclLiteral.c
parentf01fb783f1afd8768dbd42908789383213d06682 (diff)
parent1f93e78598609897fe4b42ebbeea728336dc17aa (diff)
downloadtcl-a5748bcfeaed4a02c8b11829a0ea0a13dceb8ff9.zip
tcl-a5748bcfeaed4a02c8b11829a0ea0a13dceb8ff9.tar.gz
tcl-a5748bcfeaed4a02c8b11829a0ea0a13dceb8ff9.tar.bz2
Merge trunk
Diffstat (limited to 'generic/tclLiteral.c')
-rw-r--r--generic/tclLiteral.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c
index e0425cf..3864ad5 100644
--- a/generic/tclLiteral.c
+++ b/generic/tclLiteral.c
@@ -176,8 +176,8 @@ TclCreateLiteral(
Interp *iPtr,
char *bytes, /* The start of the string. Note that this is
* not a NUL-terminated string. */
- int length, /* Number of bytes in the string. */
- unsigned hash, /* The string's hash. If -1, it will be
+ size_t length, /* Number of bytes in the string. */
+ TCL_HASH_TYPE hash, /* The string's hash. If -1, it will be
* computed here. */
int *newPtr,
Namespace *nsPtr,
@@ -186,14 +186,14 @@ TclCreateLiteral(
{
LiteralTable *globalTablePtr = &iPtr->literalTable;
LiteralEntry *globalPtr;
- int globalHash;
+ TCL_HASH_TYPE globalHash;
Tcl_Obj *objPtr;
/*
* Is it in the interpreter's global literal table?
*/
- if (hash == (unsigned) -1) {
+ if (hash == (TCL_HASH_TYPE) -1) {
hash = HashString(bytes, length);
}
globalHash = (hash & globalTablePtr->mask);
@@ -201,9 +201,9 @@ TclCreateLiteral(
globalPtr = globalPtr->nextPtr) {
objPtr = globalPtr->objPtr;
if ((globalPtr->nsPtr == nsPtr)
- && (objPtr->length == length) && ((length == 0)
+ && ((size_t)objPtr->length == length) && ((length == 0)
|| ((objPtr->bytes[0] == bytes[0])
- && (memcmp(objPtr->bytes, bytes, (unsigned) length) == 0)))) {
+ && (memcmp(objPtr->bytes, bytes, length) == 0)))) {
/*
* A literal was found: return it
*/
@@ -245,7 +245,7 @@ TclCreateLiteral(
#ifdef TCL_COMPILE_DEBUG
if (LookupLiteralEntry((Tcl_Interp *) iPtr, objPtr) != NULL) {
Tcl_Panic("%s: literal \"%.*s\" found globally but shouldn't be",
- "TclRegisterLiteral", (length>60? 60 : length), bytes);
+ "TclRegisterLiteral", (length>60? 60 : (int)length), bytes);
}
#endif