diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-07-06 09:23:09 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-07-06 09:23:09 (GMT) |
| commit | b294401d2f8ccdb83c4f030d41ecab1e4eac11d4 (patch) | |
| tree | b1ac03bf9f3d05e5b9cc99794ede4e2521ef08e6 /generic/tclLiteral.c | |
| parent | d1f3e49057fa7688586babd4b53652f22e479ff6 (diff) | |
| parent | 841ec05ecc0bb62728af6c92deba9d2a5721d5c6 (diff) | |
| download | tcl-b294401d2f8ccdb83c4f030d41ecab1e4eac11d4.zip tcl-b294401d2f8ccdb83c4f030d41ecab1e4eac11d4.tar.gz tcl-b294401d2f8ccdb83c4f030d41ecab1e4eac11d4.tar.bz2 | |
merge novem
Diffstat (limited to 'generic/tclLiteral.c')
| -rw-r--r-- | generic/tclLiteral.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tclLiteral.c b/generic/tclLiteral.c index 03200ca..a258ffc 100644 --- a/generic/tclLiteral.c +++ b/generic/tclLiteral.c @@ -176,7 +176,7 @@ 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. */ + size_t length, /* Number of bytes in the string. */ unsigned hash, /* The string's hash. If -1, it will be * computed here. */ int *newPtr, @@ -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 @@ -363,7 +363,7 @@ TclRegisterLiteral( register char *bytes, /* Points to string for which to find or * create an object in CompileEnv's object * array. */ - int length, /* Number of bytes in the string. If < 0, the + size_t length, /* Number of bytes in the string. If -1, the * string consists of all bytes up to the * first null character. */ int flags) /* If LITERAL_ON_HEAP then the caller already @@ -381,7 +381,7 @@ TclRegisterLiteral( int localHash, objIndex, new; Namespace *nsPtr; - if (length < 0) { + if (length == (size_t)-1) { length = (bytes ? strlen(bytes) : 0); } hash = HashString(bytes, length); @@ -397,7 +397,7 @@ TclRegisterLiteral( objPtr = localPtr->objPtr; if ((objPtr->length == length) && ((length == 0) || ((objPtr->bytes[0] == bytes[0]) - && (memcmp(objPtr->bytes, bytes, (unsigned) length) == 0)))) { + && (memcmp(objPtr->bytes, bytes, length) == 0)))) { if (flags & LITERAL_ON_HEAP) { ckfree(bytes); } |
