From afc237737b8031e888a9338f9040e0f523333db7 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 21 Nov 2012 00:42:23 +0000 Subject: converting to use TCL_STRLEN --- generic/tclAssembly.c | 36 ++++++++++------- generic/tclBasic.c | 66 ++++++++++++++++--------------- generic/tclBinary.c | 9 +++-- generic/tclClock.c | 15 +++---- generic/tclCmdAH.c | 12 +++--- generic/tclCmdIL.c | 78 ++++++++++++++++++++---------------- generic/tclCmdMZ.c | 20 +++++----- generic/tclCompCmds.c | 5 ++- generic/tclCompCmdsSZ.c | 3 +- generic/tclCompile.c | 9 +++-- generic/tclConfig.c | 15 ++++--- generic/tclDate.c | 30 +++++++------- generic/tclDictObj.c | 10 ++--- generic/tclEncoding.c | 8 ++-- generic/tclEnsemble.c | 78 +++++++++++++++++++----------------- generic/tclEvent.c | 10 +++-- generic/tclExecute.c | 36 +++++++++-------- generic/tclFCmd.c | 7 ++-- generic/tclFileName.c | 33 +++++++++------- generic/tclIO.c | 4 +- generic/tclIOCmd.c | 31 +++++++++------ generic/tclIORTrans.c | 8 ++-- generic/tclIndexObj.c | 12 +++--- generic/tclInterp.c | 103 ++++++++++++++++++++++++++---------------------- generic/tclLink.c | 4 +- generic/tclLoad.c | 12 +++--- generic/tclLoadNone.c | 2 +- generic/tclOO.c | 10 ++--- generic/tclOOCall.c | 9 +++-- 29 files changed, 367 insertions(+), 308 deletions(-) diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 07af149..6cb1bb3 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -1631,7 +1631,7 @@ AssembleOneLine( if (opnd < 2) { if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, - Tcl_NewStringObj("operand must be >=2", -1)); + Tcl_NewStringObj("operand must be >=2", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "OPERAND>=2", NULL); } goto cleanup; @@ -2002,7 +2002,7 @@ CreateMirrorJumpTable( if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "jump table must have an even number of list elements", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADJUMPTABLE", NULL); } return TCL_ERROR; @@ -2114,7 +2114,8 @@ GetNextOperand( Tcl_DecrRefCount(operandObj); if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "assembly code may not contain substitutions", -1)); + "assembly code may not contain substitutions", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "NOSUBST", NULL); } return TCL_ERROR; @@ -2336,7 +2337,7 @@ FindLocalVar( if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot use this instruction to create a variable" - " in a non-proc context", -1)); + " in a non-proc context", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "LVT", NULL); } return -1; @@ -2406,7 +2407,8 @@ CheckOneByte( Tcl_Obj* result; /* Error message */ if (value < 0 || value > 0xff) { - result = Tcl_NewStringObj("operand does not fit in one byte", -1); + result = Tcl_NewStringObj("operand does not fit in one byte", + TCL_STRLEN); Tcl_SetObjResult(interp, result); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "1BYTE", NULL); return TCL_ERROR; @@ -2441,7 +2443,8 @@ CheckSignedOneByte( Tcl_Obj* result; /* Error message */ if (value > 0x7f || value < -0x80) { - result = Tcl_NewStringObj("operand does not fit in one byte", -1); + result = Tcl_NewStringObj("operand does not fit in one byte", + TCL_STRLEN); Tcl_SetObjResult(interp, result); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "1BYTE", NULL); return TCL_ERROR; @@ -2474,7 +2477,7 @@ CheckNonNegative( Tcl_Obj* result; /* Error message */ if (value < 0) { - result = Tcl_NewStringObj("operand must be nonnegative", -1); + result = Tcl_NewStringObj("operand must be nonnegative", TCL_STRLEN); Tcl_SetObjResult(interp, result); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "NONNEGATIVE", NULL); return TCL_ERROR; @@ -2507,7 +2510,7 @@ CheckStrictlyPositive( Tcl_Obj* result; /* Error message */ if (value <= 0) { - result = Tcl_NewStringObj("operand must be positive", -1); + result = Tcl_NewStringObj("operand must be positive", TCL_STRLEN); Tcl_SetObjResult(interp, result); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "POSITIVE", NULL); return TCL_ERROR; @@ -3419,7 +3422,8 @@ StackCheckBasicBlock( } if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "inconsistent stack depths on two execution paths", -1)); + "inconsistent stack depths on two execution paths", + TCL_STRLEN)); /* * TODO - add execution trace of both paths @@ -3448,7 +3452,8 @@ StackCheckBasicBlock( if (initialStackDepth + blockPtr->minStackDepth < 0) { if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("stack underflow", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("stack underflow", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADSTACK", NULL); AddBasicBlockRangeToErrorInfo(assemEnvPtr, blockPtr); Tcl_SetErrorLine(interp, blockPtr->startLine); @@ -3467,7 +3472,8 @@ StackCheckBasicBlock( + blockPtr->enclosingCatch->finalStackDepth)) { if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "code pops stack below level of enclosing catch", -1)); + "code pops stack below level of enclosing catch", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADSTACKINCATCH", -1); AddBasicBlockRangeToErrorInfo(assemEnvPtr, blockPtr); Tcl_SetErrorLine(interp, blockPtr->startLine); @@ -3739,7 +3745,7 @@ ProcessCatchesInBasicBlock( if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "execution reaches an instruction in inconsistent " - "exception contexts", -1)); + "exception contexts", TCL_STRLEN)); Tcl_SetErrorLine(interp, bbPtr->startLine); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADCATCH", NULL); } @@ -3798,7 +3804,8 @@ ProcessCatchesInBasicBlock( if (enclosing == NULL) { if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "endCatch without a corresponding beginCatch", -1)); + "endCatch without a corresponding beginCatch", + TCL_STRLEN)); Tcl_SetErrorLine(interp, bbPtr->startLine); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "BADENDCATCH", NULL); } @@ -3873,7 +3880,8 @@ CheckForUnclosedCatches( if (assemEnvPtr->curr_bb->catchState >= BBCS_INCATCH) { if (assemEnvPtr->flags & TCL_EVAL_DIRECT) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "catch still active on exit from assembly code", -1)); + "catch still active on exit from assembly code", + TCL_STRLEN)); Tcl_SetErrorLine(interp, assemEnvPtr->curr_bb->enclosingCatch->startLine); Tcl_SetErrorCode(interp, "TCL", "ASSEM", "UNCLOSEDCATCH", NULL); diff --git a/generic/tclBasic.c b/generic/tclBasic.c index f1ffee6..5ad2d9c 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -1706,7 +1706,7 @@ Tcl_HideCommand( if (strstr(hiddenCmdToken, "::") != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "cannot use namespace qualifiers in hidden command" - " token (rename)", -1)); + " token (rename)", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "HIDDENTOKEN", NULL); return TCL_ERROR; } @@ -1730,8 +1730,8 @@ Tcl_HideCommand( if (cmdPtr->nsPtr != iPtr->globalNsPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only hide global namespace commands (use rename then hide)", - -1)); + "can only hide global namespace commands " + "(use rename then hide)", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "HIDE", "NON_GLOBAL", NULL); return TCL_ERROR; } @@ -1860,8 +1860,8 @@ Tcl_ExposeCommand( if (strstr(cmdName, "::") != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot expose to a namespace (use expose to toplevel, then rename)", - -1)); + "cannot expose to a namespace " + "(use expose to toplevel, then rename)", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "EXPOSE", "NON_GLOBAL", NULL); return TCL_ERROR; } @@ -1898,7 +1898,7 @@ Tcl_ExposeCommand( Tcl_SetObjResult(interp, Tcl_NewStringObj( "trying to expose a non-global command namespace command", - -1)); + TCL_STRLEN)); return TCL_ERROR; } @@ -3540,7 +3540,7 @@ OldMathFuncProc( Tcl_SetObjResult(interp, Tcl_NewStringObj( "argument to math function didn't have numeric value", - -1)); + TCL_STRLEN)); TclCheckBadOctal(interp, Tcl_GetString(valuePtr)); ckfree(args); return TCL_ERROR; @@ -3770,7 +3770,7 @@ Tcl_ListMathFuncs( if ((pattern != NULL) && TclMatchIsTrivial(pattern)) { if (Tcl_FindHashEntry(&nsPtr->cmdTable, pattern) != NULL) { Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(pattern, -1)); + Tcl_NewStringObj(pattern, TCL_STRLEN)); } } else { Tcl_HashSearch cmdHashSearch; @@ -3784,7 +3784,7 @@ Tcl_ListMathFuncs( if (pattern == NULL || Tcl_StringMatch(cmdNamePtr, pattern)) { Tcl_ListObjAppendElement(NULL, result, - Tcl_NewStringObj(cmdNamePtr, -1)); + Tcl_NewStringObj(cmdNamePtr, TCL_STRLEN)); } } } @@ -3828,7 +3828,7 @@ TclInterpReady( if (iPtr->flags & DELETED) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "attempt to call eval in deleted interpreter", -1)); + "attempt to call eval in deleted interpreter", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "IDELETE", "attempt to call eval in deleted interpreter", NULL); return TCL_ERROR; @@ -3857,7 +3857,7 @@ TclInterpReady( } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "too many nested evaluations (infinite loop?)", -1)); + "too many nested evaluations (infinite loop?)", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LIMIT", "STACK", NULL); return TCL_ERROR; } @@ -3991,7 +3991,7 @@ Tcl_Canceled( } } - Tcl_SetObjResult(interp, Tcl_NewStringObj(message, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(message, TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "CANCEL", id, message, NULL); } @@ -6284,10 +6284,10 @@ ProcessUnexpectedResult( Tcl_ResetResult(interp); if (returnCode == TCL_BREAK) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "invoked \"break\" outside of a loop", -1)); + "invoked \"break\" outside of a loop", TCL_STRLEN)); } else if (returnCode == TCL_CONTINUE) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "invoked \"continue\" outside of a loop", -1)); + "invoked \"continue\" outside of a loop", TCL_STRLEN)); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "command returned bad code: %d", returnCode)); @@ -6333,7 +6333,7 @@ Tcl_ExprLong( *ptr = 0; } else { - exprPtr = Tcl_NewStringObj(exprstring, -1); + exprPtr = Tcl_NewStringObj(exprstring, TCL_STRLEN); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprLongObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); @@ -6361,7 +6361,7 @@ Tcl_ExprDouble( *ptr = 0.0; } else { - exprPtr = Tcl_NewStringObj(exprstring, -1); + exprPtr = Tcl_NewStringObj(exprstring, TCL_STRLEN); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprDoubleObj(interp, exprPtr, ptr); Tcl_DecrRefCount(exprPtr); @@ -6389,7 +6389,7 @@ Tcl_ExprBoolean( return TCL_OK; } else { int result; - Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, -1); + Tcl_Obj *exprPtr = Tcl_NewStringObj(exprstring, TCL_STRLEN); Tcl_IncrRefCount(exprPtr); result = Tcl_ExprBooleanObj(interp, exprPtr, ptr); @@ -6623,7 +6623,7 @@ TclObjInvoke( if ((objc < 1) || (objv == NULL)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "illegal argument vector", -1)); + "illegal argument vector", TCL_STRLEN)); return TCL_ERROR; } @@ -6717,7 +6717,7 @@ Tcl_ExprString( Tcl_SetObjResult(interp, Tcl_NewIntObj(0)); } else { - Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, -1); + Tcl_Obj *resultPtr, *exprObj = Tcl_NewStringObj(expr, TCL_STRLEN); Tcl_IncrRefCount(exprObj); code = Tcl_ExprObj(interp, exprObj, &resultPtr); @@ -6845,7 +6845,7 @@ Tcl_AddObjErrorInfo( * interp->result completely. */ - iPtr->errorInfo = Tcl_NewStringObj(iPtr->result, -1); + iPtr->errorInfo = Tcl_NewStringObj(iPtr->result, TCL_STRLEN); } else { iPtr->errorInfo = iPtr->objResultPtr; } @@ -7269,7 +7269,7 @@ ExprIsqrtFunc( negarg: Tcl_SetObjResult(interp, Tcl_NewStringObj( - "square root of negative argument", -1)); + "square root of negative argument", TCL_STRLEN)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", "domain error: argument not in valid range", NULL); return TCL_ERROR; @@ -8320,7 +8320,8 @@ TclNRTailcallObjCmd( if (!(iPtr->varFramePtr->isProcCallFrame & 1)) { /* or is upleveled */ Tcl_SetObjResult(interp, Tcl_NewStringObj( - "tailcall can only be called from a proc or lambda", -1)); + "tailcall can only be called from a proc or lambda", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL); return TCL_ERROR; } @@ -8351,7 +8352,7 @@ TclNRTailcallObjCmd( listPtr = Tcl_NewListObj(objc-1, objv+1); Tcl_IncrRefCount(listPtr); - nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, TCL_STRLEN); if ((TCL_OK != TclGetNamespaceFromObj(interp, nsObjPtr, &ns1Ptr)) || (nsPtr != ns1Ptr)) { Tcl_Panic("Tailcall failed to find the proper namespace"); @@ -8480,7 +8481,7 @@ TclNRYieldObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yield can only be called in a coroutine", -1)); + "yield can only be called in a coroutine", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); return TCL_ERROR; } @@ -8514,7 +8515,7 @@ TclNRYieldToObjCmd( if (!corPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yieldto can only be called in a coroutine", -1)); + "yieldto can only be called in a coroutine", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); return TCL_ERROR; } @@ -8528,7 +8529,7 @@ TclNRYieldToObjCmd( listPtr = Tcl_NewListObj(objc-1, objv+1); Tcl_IncrRefCount(listPtr); - nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(nsPtr->fullName, TCL_STRLEN); if ((TCL_OK != TclGetNamespaceFromObj(interp, nsObjPtr, &ns1Ptr)) || (nsPtr != ns1Ptr)) { Tcl_Panic("yieldto failed to find the proper namespace"); @@ -8763,7 +8764,7 @@ TclNRCoroutineActivateCallback( if (corPtr->stackLevel != stackLevel) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot yield: C stack busy", -1)); + "cannot yield: C stack busy", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "CANT_YIELD", NULL); return TCL_ERROR; @@ -8823,7 +8824,7 @@ NRCoroInjectObjCmd( cmdPtr = (Command *) Tcl_GetCommandFromObj(interp, objv[1]); if ((!cmdPtr) || (cmdPtr->nreProc != TclNRInterpCoroutine)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only inject a command into a coroutine", -1)); + "can only inject a command into a coroutine", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "COROUTINE", TclGetString(objv[1]), NULL); return TCL_ERROR; @@ -8832,7 +8833,8 @@ NRCoroInjectObjCmd( corPtr = cmdPtr->objClientData; if (!COR_IS_SUSPENDED(corPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "can only inject a command into a suspended coroutine", -1)); + "can only inject a command into a suspended coroutine", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ACTIVE", NULL); return TCL_ERROR; } @@ -8883,9 +8885,9 @@ TclNRInterpCoroutine( break; default: if (corPtr->nargs != objc-1) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("wrong coro nargs; how did we get here? " - "not implemented!", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "wrong coro nargs; how did we get here? " + "not implemented!", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); return TCL_ERROR; } diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 639dea9..7da5442 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -860,7 +860,7 @@ BinaryFormatCmd( } else if (count > listc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "number of elements in list does not match count", - -1)); + TCL_STRLEN)); return TCL_ERROR; } } @@ -870,7 +870,8 @@ BinaryFormatCmd( case 'x': if (count == BINARY_ALL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot use \"*\" in format string with \"x\"", -1)); + "cannot use \"*\" in format string with \"x\"", + TCL_STRLEN)); return TCL_ERROR; } else if (count == BINARY_NOCOUNT) { count = 1; @@ -1208,7 +1209,7 @@ BinaryFormatCmd( } error: - Tcl_SetObjResult(interp, Tcl_NewStringObj(errorString, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(errorString, TCL_STRLEN)); return TCL_ERROR; } @@ -1579,7 +1580,7 @@ BinaryScanCmd( } error: - Tcl_SetObjResult(interp, Tcl_NewStringObj(errorString, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(errorString, TCL_STRLEN)); return TCL_ERROR; } diff --git a/generic/tclClock.c b/generic/tclClock.c index 013c920..9b62fd2 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -250,7 +250,7 @@ TclClockInit( data->refCount = 0; data->literals = ckalloc(LIT__END * sizeof(Tcl_Obj*)); for (i = 0; i < LIT__END; ++i) { - data->literals[i] = Tcl_NewStringObj(literals[i], -1); + data->literals[i] = Tcl_NewStringObj(literals[i], TCL_STRLEN); Tcl_IncrRefCount(data->literals[i]); } @@ -326,7 +326,7 @@ ClockConvertlocaltoutcObjCmd( } if (secondsObj == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj("key \"localseconds\" not " - "found in dictionary", -1)); + "found in dictionary", TCL_STRLEN)); return TCL_ERROR; } if ((Tcl_GetWideIntFromObj(interp, secondsObj, @@ -859,7 +859,7 @@ ConvertLocalToUTCUsingC( if (localErrno != 0 || (fields->seconds == -1 && timeVal.tm_yday == -1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "time value too large/small to represent", -1)); + "time value too large/small to represent", TCL_STRLEN)); return TCL_ERROR; } return TCL_OK; @@ -999,7 +999,8 @@ ConvertUTCToLocalUsingC( tock = (time_t) fields->seconds; if ((Tcl_WideInt) tock != fields->seconds) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "number too large to represent as a Posix time", -1)); + "number too large to represent as a Posix time", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "CLOCK", "argTooLarge", NULL); return TCL_ERROR; } @@ -1008,7 +1009,7 @@ ConvertUTCToLocalUsingC( if (timeVal == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "localtime failed (clock value may be too " - "large/small to represent)", -1)); + "large/small to represent)", TCL_STRLEN)); Tcl_SetErrorCode(interp, "CLOCK", "localtimeFailed", NULL); return TCL_ERROR; } @@ -1050,7 +1051,7 @@ ConvertUTCToLocalUsingC( if (diff > 0) { sprintf(buffer+5, "%02d", diff); } - fields->tzName = Tcl_NewStringObj(buffer, -1); + fields->tzName = Tcl_NewStringObj(buffer, TCL_STRLEN); Tcl_IncrRefCount(fields->tzName); return TCL_OK; } @@ -1590,7 +1591,7 @@ ClockGetenvObjCmd( if (varValue == NULL) { varValue = ""; } - Tcl_SetObjResult(interp, Tcl_NewStringObj(varValue, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(varValue, TCL_STRLEN)); return TCL_OK; } diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index edc9c0e..bbe7914 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -465,7 +465,7 @@ Tcl_EncodingObjCmd( } if (objc == 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - Tcl_GetEncodingName(NULL), -1)); + Tcl_GetEncodingName(NULL), TCL_STRLEN)); } else { return Tcl_SetSystemEncoding(interp, TclGetString(objv[2])); } @@ -1232,7 +1232,7 @@ FileAttrTypeCmd( return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewStringObj( - GetTypeFromMode((unsigned short) buf.st_mode), -1)); + GetTypeFromMode((unsigned short) buf.st_mode), TCL_STRLEN)); return TCL_OK; } @@ -1711,7 +1711,8 @@ PathFilesystemCmd( } fsInfo = Tcl_FSFileSystemInfo(objv[1]); if (fsInfo == NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("unrecognised path", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("unrecognised path", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM", Tcl_GetString(objv[1]), NULL); return TCL_ERROR; @@ -1963,7 +1964,7 @@ FilesystemSeparatorCmd( if (separatorObj == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unrecognised path", -1)); + "unrecognised path", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "FILESYSTEM", Tcl_GetString(objv[1]), NULL); return TCL_ERROR; @@ -2161,7 +2162,8 @@ StoreStatData( STORE_ARY("ctime", Tcl_NewLongObj((long)statPtr->st_ctime)); mode = (unsigned short) statPtr->st_mode; STORE_ARY("mode", Tcl_NewIntObj(mode)); - STORE_ARY("type", Tcl_NewStringObj(GetTypeFromMode(mode), -1)); + STORE_ARY("type", Tcl_NewStringObj(GetTypeFromMode(mode), + TCL_STRLEN)); #undef STORE_ARY return TCL_OK; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index bb8e6eb..49dd1b7 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -327,7 +327,7 @@ IfConditionCallback( if (i < objc - 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args: extra words after \"else\" clause in \"if\" command", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); return TCL_ERROR; } @@ -487,7 +487,7 @@ InfoArgsCmd( localPtr = localPtr->nextPtr) { if (TclIsVarArgument(localPtr)) { Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewStringObj(localPtr->name, -1)); + Tcl_NewStringObj(localPtr->name, TCL_STRLEN)); } } Tcl_SetObjResult(interp, listObjPtr); @@ -709,7 +709,7 @@ InfoCommandsCmd( Tcl_GetCommandFullName(interp, cmd, elemObjPtr); } else { cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr); - elemObjPtr = Tcl_NewStringObj(cmdName, -1); + elemObjPtr = Tcl_NewStringObj(cmdName, TCL_STRLEN); } Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); Tcl_SetObjResult(interp, listPtr); @@ -737,7 +737,7 @@ InfoCommandsCmd( if (entryPtr != NULL) { cmdName = Tcl_GetHashKey(tablePtr, entryPtr); Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(cmdName, -1)); + Tcl_NewStringObj(cmdName, TCL_STRLEN)); Tcl_SetObjResult(interp, listPtr); return TCL_OK; } @@ -759,7 +759,7 @@ InfoCommandsCmd( elemObjPtr = Tcl_NewObj(); Tcl_GetCommandFullName(interp, cmd, elemObjPtr); } else { - elemObjPtr = Tcl_NewStringObj(cmdName, -1); + elemObjPtr = Tcl_NewStringObj(cmdName, TCL_STRLEN); } Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); } @@ -782,7 +782,7 @@ InfoCommandsCmd( || Tcl_StringMatch(cmdName, simplePattern)) { if (Tcl_FindHashEntry(&nsPtr->cmdTable,cmdName) == NULL) { Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(cmdName, -1)); + Tcl_NewStringObj(cmdName, TCL_STRLEN)); } } entryPtr = Tcl_NextHashEntry(&search); @@ -811,7 +811,7 @@ InfoCommandsCmd( cmdName = Tcl_GetHashKey(&nsPtr->cmdTable, entryPtr); if ((simplePattern == NULL) || Tcl_StringMatch(cmdName, simplePattern)) { - elemObjPtr = Tcl_NewStringObj(cmdName, -1); + elemObjPtr = Tcl_NewStringObj(cmdName, TCL_STRLEN); Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); (void) Tcl_CreateHashEntry(&addedCommandsTable, elemObjPtr, &isNew); @@ -837,7 +837,7 @@ InfoCommandsCmd( cmdName = Tcl_GetHashKey(&pathNsPtr->cmdTable, entryPtr); if ((simplePattern == NULL) || Tcl_StringMatch(cmdName, simplePattern)) { - elemObjPtr = Tcl_NewStringObj(cmdName, -1); + elemObjPtr = Tcl_NewStringObj(cmdName, TCL_STRLEN); (void) Tcl_CreateHashEntry(&addedCommandsTable, elemObjPtr, &isNew); if (isNew) { @@ -864,7 +864,7 @@ InfoCommandsCmd( cmdName = Tcl_GetHashKey(&globalNsPtr->cmdTable, entryPtr); if ((simplePattern == NULL) || Tcl_StringMatch(cmdName, simplePattern)) { - elemObjPtr = Tcl_NewStringObj(cmdName, -1); + elemObjPtr = Tcl_NewStringObj(cmdName, TCL_STRLEN); if (Tcl_FindHashEntry(&addedCommandsTable, (char *) elemObjPtr) == NULL) { Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); @@ -1279,7 +1279,8 @@ TclInfoFrame( * str. */ - ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1)); + ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], + TCL_STRLEN)); ADD_PAIR("line", Tcl_NewIntObj(framePtr->line[0])); ADD_PAIR("cmd", Tcl_NewStringObj(framePtr->cmd.str.cmd, framePtr->cmd.str.len)); @@ -1291,7 +1292,8 @@ TclInfoFrame( * listPtr, possibly a frame. */ - ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1)); + ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], + TCL_STRLEN)); ADD_PAIR("line", Tcl_NewIntObj(1)); /* @@ -1309,7 +1311,8 @@ TclInfoFrame( * Precompiled. Result contains the type as signal, nothing else. */ - ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1)); + ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], + TCL_STRLEN)); break; case TCL_LOCATION_BC: { @@ -1334,7 +1337,8 @@ TclInfoFrame( * Possibly modified: type, path! */ - ADD_PAIR("type", Tcl_NewStringObj(typeString[fPtr->type], -1)); + ADD_PAIR("type", Tcl_NewStringObj(typeString[fPtr->type], + TCL_STRLEN)); if (fPtr->line) { ADD_PAIR("line", Tcl_NewIntObj(fPtr->line[0])); } @@ -1360,7 +1364,8 @@ TclInfoFrame( * Evaluation of a script file. */ - ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], -1)); + ADD_PAIR("type", Tcl_NewStringObj(typeString[framePtr->type], + TCL_STRLEN)); ADD_PAIR("line", Tcl_NewIntObj(framePtr->line[0])); ADD_PAIR("file", framePtr->data.eval.path); @@ -1407,7 +1412,8 @@ TclInfoFrame( */ for (i=0 ; ilength ; i++) { - lv[lc++] = Tcl_NewStringObj(efiPtr->fields[i].name, -1); + lv[lc++] = Tcl_NewStringObj(efiPtr->fields[i].name, + TCL_STRLEN); if (efiPtr->fields[i].proc) { lv[lc++] = efiPtr->fields[i].proc(efiPtr->fields[i].clientData); @@ -1521,12 +1527,12 @@ InfoHostnameCmd( name = Tcl_GetHostName(); if (name) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(name, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(name, TCL_STRLEN)); return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unable to determine name of host", -1)); + "unable to determine name of host", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "HOSTNAME", "UNKNOWN", NULL); return TCL_ERROR; } @@ -1641,12 +1647,12 @@ InfoLibraryCmd( libDirName = Tcl_GetVar(interp, "tcl_library", TCL_GLOBAL_ONLY); if (libDirName != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(libDirName, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(libDirName, TCL_STRLEN)); return TCL_OK; } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "no library has been specified for Tcl", -1)); + "no library has been specified for Tcl", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "VARIABLE", "tcl_library",NULL); return TCL_ERROR; } @@ -1768,7 +1774,7 @@ InfoPatchLevelCmd( patchlevel = Tcl_GetVar(interp, "tcl_patchLevel", (TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG)); if (patchlevel != NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj(patchlevel, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(patchlevel, TCL_STRLEN)); return TCL_OK; } return TCL_ERROR; @@ -1881,7 +1887,7 @@ InfoProcsCmd( Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, elemObjPtr); } else { - elemObjPtr = Tcl_NewStringObj(simplePattern, -1); + elemObjPtr = Tcl_NewStringObj(simplePattern, TCL_STRLEN); } Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); } @@ -1909,7 +1915,7 @@ InfoProcsCmd( Tcl_GetCommandFullName(interp, (Tcl_Command) cmdPtr, elemObjPtr); } else { - elemObjPtr = Tcl_NewStringObj(cmdName, -1); + elemObjPtr = Tcl_NewStringObj(cmdName, TCL_STRLEN); } Tcl_ListObjAppendElement(interp, listPtr, elemObjPtr); } @@ -1948,7 +1954,7 @@ InfoProcsCmd( if (TclIsProc(cmdPtr) || ((realCmdPtr != NULL) && TclIsProc(realCmdPtr))) { Tcl_ListObjAppendElement(interp, listPtr, - Tcl_NewStringObj(cmdName, -1)); + Tcl_NewStringObj(cmdName, TCL_STRLEN)); } } } @@ -2045,7 +2051,7 @@ InfoSharedlibCmd( } #ifdef TCL_SHLIB_EXT - Tcl_SetObjResult(interp, Tcl_NewStringObj(TCL_SHLIB_EXT, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(TCL_SHLIB_EXT, TCL_STRLEN)); #endif return TCL_OK; } @@ -2993,7 +2999,7 @@ Tcl_LsearchObjCmd( } if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing starting index", -1)); + "missing starting index", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); result = TCL_ERROR; goto done; @@ -3026,7 +3032,7 @@ Tcl_LsearchObjCmd( } Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-index\" option must be followed by list index", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); return TCL_ERROR; } @@ -3086,7 +3092,8 @@ Tcl_LsearchObjCmd( Tcl_DecrRefCount(startPtr); } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "-subindices cannot be used without -index option", -1)); + "-subindices cannot be used without -index option", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", "BAD_OPTION_MIX", NULL); return TCL_ERROR; @@ -3094,7 +3101,7 @@ Tcl_LsearchObjCmd( if (bisect && (allMatches || negatedMatch)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "-bisect is not compatible with -all or -not", -1)); + "-bisect is not compatible with -all or -not", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSEARCH", "BAD_OPTION_MIX", NULL); return TCL_ERROR; @@ -3664,7 +3671,7 @@ Tcl_LsortObjCmd( if (i == objc-2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-command\" option must be followed " - "by comparison command", -1)); + "by comparison command", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); sortInfo.resultCode = TCL_ERROR; goto done2; @@ -3689,7 +3696,7 @@ Tcl_LsortObjCmd( if (i == objc-2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-index\" option must be followed by list index", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); sortInfo.resultCode = TCL_ERROR; goto done2; @@ -3740,7 +3747,7 @@ Tcl_LsortObjCmd( if (i == objc-2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-stride\" option must be " - "followed by stride length", -1)); + "followed by stride length", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); sortInfo.resultCode = TCL_ERROR; goto done2; @@ -3751,7 +3758,7 @@ Tcl_LsortObjCmd( } if (groupSize < 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "stride length must be at least 2", -1)); + "stride length must be at least 2", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", "BADSTRIDE", NULL); sortInfo.resultCode = TCL_ERROR; @@ -3849,7 +3856,7 @@ Tcl_LsortObjCmd( if (length % groupSize) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "list size must be a multiple of the stride length", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", "BADSTRIDE", NULL); sortInfo.resultCode = TCL_ERROR; @@ -3869,7 +3876,7 @@ Tcl_LsortObjCmd( if (groupOffset < 0 || groupOffset >= groupSize) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "when used with \"-stride\", the leading \"-index\"" - " value must be within the group", -1)); + " value must be within the group", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LSORT", "BADINDEX", NULL); sortInfo.resultCode = TCL_ERROR; @@ -4256,7 +4263,8 @@ SortCompare( if (TclGetIntFromObj(infoPtr->interp, Tcl_GetObjResult(infoPtr->interp), &order) != TCL_OK) { Tcl_SetObjResult(infoPtr->interp, Tcl_NewStringObj( - "-compare command returned non-integer result", -1)); + "-compare command returned non-integer result", + TCL_STRLEN)); Tcl_SetErrorCode(infoPtr->interp, "TCL", "OPERATION", "LSORT", "COMPARISONFAILED", NULL); infoPtr->resultCode = TCL_ERROR; diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index f8a64c8..760b8be 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -231,7 +231,8 @@ Tcl_RegexpObjCmd( if (doinline && ((objc - 2) != 0)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "regexp match variables not allowed when using -inline", -1)); + "regexp match variables not allowed when using -inline", + TCL_STRLEN)); goto optionError; } @@ -1936,7 +1937,7 @@ StringMapCmd( */ Tcl_SetObjResult(interp, - Tcl_NewStringObj("char map list unbalanced", -1)); + Tcl_NewStringObj("char map list unbalanced", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "MAP", "UNBALANCED", NULL); return TCL_ERROR; @@ -3667,7 +3668,7 @@ TclNRSwitchObjCmd( if (objc % 2) { Tcl_ResetResult(interp); Tcl_SetObjResult(interp, Tcl_NewStringObj( - "extra switch pattern with no body", -1)); + "extra switch pattern with no body", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "SWITCH", "BADARM", NULL); @@ -4031,7 +4032,7 @@ Tcl_ThrowObjCmd( return TCL_ERROR; } else if (len < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "type must be non-empty list", -1)); + "type must be non-empty list", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "THROW", "BADEXCEPTION", NULL); return TCL_ERROR; @@ -4217,7 +4218,7 @@ TclNRTryObjCmd( case TryFinally: /* finally script */ if (i < objc-2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "finally clause must be last", -1)); + "finally clause must be last", TCL_STRLEN)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "FINALLY", "NONTERMINAL", NULL); @@ -4225,7 +4226,7 @@ TclNRTryObjCmd( } else if (i == objc-1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args to finally clause: must be" - " \"... finally script\"", -1)); + " \"... finally script\"", TCL_STRLEN)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "FINALLY", "ARGUMENT", NULL); @@ -4238,7 +4239,7 @@ TclNRTryObjCmd( if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args to on clause: must be \"... on code" - " variableList script\"", -1)); + " variableList script\"", TCL_STRLEN)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "ON", "ARGUMENT", NULL); @@ -4257,7 +4258,7 @@ TclNRTryObjCmd( Tcl_SetObjResult(interp, Tcl_NewStringObj( "wrong # args to trap clause: " "must be \"... trap pattern variableList script\"", - -1)); + TCL_STRLEN)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "TRAP", "ARGUMENT", NULL); @@ -4299,7 +4300,8 @@ TclNRTryObjCmd( } if (bodyShared) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "last non-finally clause must not have a body of \"-\"", -1)); + "last non-finally clause must not have a body of \"-\"", + TCL_STRLEN)); Tcl_DecrRefCount(handlersObj); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "TRY", "BADFALLTHROUGH", NULL); diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 6c818bd..90347b2 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -924,7 +924,8 @@ TclCompileDictIncrCmd( if (parsePtr->numWords == 4) { const char *word; - int numBytes, code; + size_t numBytes; + int code; Tcl_Token *incrTokenPtr; Tcl_Obj *intObj; @@ -3649,7 +3650,7 @@ TclCompileIncrCmd( incrTokenPtr = TokenAfter(varTokenPtr); if (incrTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) { const char *word = incrTokenPtr[1].start; - int numBytes = incrTokenPtr[1].size; + size_t numBytes = incrTokenPtr[1].size; int code; Tcl_Obj *intObj = Tcl_NewStringObj(word, numBytes); diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 5d21117..3747c0c 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -434,8 +434,9 @@ TclCompileStringMatchCmd( { DefineLineInformation; /* TIP #280 */ Tcl_Token *tokenPtr; - int i, length, exactMatch = 0, nocase = 0; + int i, exactMatch = 0, nocase = 0; const char *str; + size_t length; if (parsePtr->numWords < 3 || parsePtr->numWords > 4) { return TCL_ERROR; diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 6474b8f..a8304d0 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -2569,16 +2569,17 @@ TclInitByteCodeObj( for (i = 0; i < numLitObjects; i++) { if (objPtr == envPtr->literalArrayPtr[i].objPtr) { /* - * Prevent circular reference where the bytecode intrep of - * a value contains a literal which is that same value. - * If this is allowed to happen, refcount decrements may not - * reach zero, and memory may leak. Bugs 467523, 3357771 + * Prevent circular reference where the bytecode intrep of a value + * contains a literal which is that same value. If this is allowed + * to happen, refcount decrements may not reach zero, and memory + * may leak. Bugs 467523, 3357771 * * NOTE: [Bugs 3392070, 3389764] We make a copy based completely * on the string value, and do not call Tcl_DuplicateObj() so we * can be sure we do not have any lingering cycles hiding in * the intrep. */ + size_t numBytes; const char *bytes = Tcl_GetStringFromObj(objPtr, &numBytes); diff --git a/generic/tclConfig.c b/generic/tclConfig.c index ea67852..da0601c 100644 --- a/generic/tclConfig.c +++ b/generic/tclConfig.c @@ -79,7 +79,7 @@ Tcl_RegisterConfig( QCCD *cdPtr = ckalloc(sizeof(QCCD)); cdPtr->interp = interp; - cdPtr->pkg = Tcl_NewStringObj(pkgName, -1); + cdPtr->pkg = Tcl_NewStringObj(pkgName, TCL_STRLEN); /* * Phase I: Adding the provided information to the internal database of @@ -129,8 +129,9 @@ Tcl_RegisterConfig( * conversion required. */ - Tcl_DictObjPut(interp, pkgDict, Tcl_NewStringObj(cfg->key, -1), - Tcl_NewStringObj(convValue, -1)); + Tcl_DictObjPut(interp, pkgDict, + Tcl_NewStringObj(cfg->key, TCL_STRLEN), + Tcl_NewStringObj(convValue, TCL_STRLEN)); Tcl_DStringFree(&conv); } @@ -235,7 +236,8 @@ QueryConfigObjCmd( * present. */ - Tcl_SetObjResult(interp, Tcl_NewStringObj("package not known", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("package not known", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "FATAL", "PKGCFG_BASE", Tcl_GetString(pkgName), NULL); return TCL_ERROR; @@ -250,7 +252,8 @@ QueryConfigObjCmd( if (Tcl_DictObjGet(interp, pkgDict, objv[2], &val) != TCL_OK || val == NULL) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("key not known", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("key not known", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "CONFIG", Tcl_GetString(objv[2]), NULL); return TCL_ERROR; @@ -270,7 +273,7 @@ QueryConfigObjCmd( if (!listPtr) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "insufficient memory to create list", -1)); + "insufficient memory to create list", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); return TCL_ERROR; } diff --git a/generic/tclDate.c b/generic/tclDate.c index 77d5efb..b3a3e0a 100644 --- a/generic/tclDate.c +++ b/generic/tclDate.c @@ -2803,15 +2803,15 @@ TclClockOldscanObjCmd( Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "PARSE", NULL); return TCL_ERROR; } else if (status == 2) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("memory exhausted", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("memory exhausted", + TCL_STRLEN)); Tcl_DecrRefCount(dateInfo.messages); Tcl_SetErrorCode(interp, "TCL", "MEMORY", NULL); return TCL_ERROR; } else if (status != 0) { - Tcl_SetObjResult(interp, Tcl_NewStringObj("Unknown status returned " - "from date parser. Please " - "report this error as a " - "bug in Tcl.", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "unknown status returned from date parser. Please " + "report this error as a bug in Tcl.", TCL_STRLEN)); Tcl_DecrRefCount(dateInfo.messages); Tcl_SetErrorCode(interp, "TCL", "BUG", NULL); return TCL_ERROR; @@ -2819,32 +2819,32 @@ TclClockOldscanObjCmd( Tcl_DecrRefCount(dateInfo.messages); if (yyHaveDate > 1) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("more than one date in string", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "more than one date in string", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); return TCL_ERROR; } if (yyHaveTime > 1) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("more than one time of day in string", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "more than one time of day in string", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); return TCL_ERROR; } if (yyHaveZone > 1) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("more than one time zone in string", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "more than one time zone in string", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); return TCL_ERROR; } if (yyHaveDay > 1) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("more than one weekday in string", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "more than one weekday in string", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); return TCL_ERROR; } if (yyHaveOrdinalMonth > 1) { - Tcl_SetObjResult(interp, - Tcl_NewStringObj("more than one ordinal month in string", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "more than one ordinal month in string", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DATE", "MULTIPLE", NULL); return TCL_ERROR; } diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index c80a8d2..327c159 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -704,7 +704,7 @@ SetDictFromAny( missingValue: if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing value to go with key", -1)); + "missing value to go with key", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", NULL); } result = TCL_ERROR; @@ -2050,7 +2050,7 @@ DictInfoCmd( dict = dictPtr->internalRep.otherValuePtr; statsStr = Tcl_HashStats(&dict->table); - Tcl_SetObjResult(interp, Tcl_NewStringObj(statsStr, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(statsStr, TCL_STRLEN)); ckfree(statsStr); return TCL_OK; } @@ -2382,7 +2382,7 @@ DictForNRCmd( } if (varc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "must have exactly two variable names", -1)); + "must have exactly two variable names", TCL_STRLEN)); return TCL_ERROR; } searchPtr = TclStackAlloc(interp, sizeof(Tcl_DictSearch)); @@ -2574,7 +2574,7 @@ DictMapNRCmd( } if (varc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "must have exactly two variable names", -1)); + "must have exactly two variable names", TCL_STRLEN)); return TCL_ERROR; } storagePtr = TclStackAlloc(interp, sizeof(DictMapStorage)); @@ -3013,7 +3013,7 @@ DictFilterCmd( } if (varc != 2) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "must have exactly two variable names", -1)); + "must have exactly two variable names", TCL_STRLEN)); return TCL_ERROR; } keyVarObj = varv[0]; diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 9fb52d1..633d589 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -682,7 +682,7 @@ Tcl_SetDefaultEncodingDir( const char *path) { Tcl_Obj *searchPath = Tcl_GetEncodingSearchPath(); - Tcl_Obj *directory = Tcl_NewStringObj(path, -1); + Tcl_Obj *directory = Tcl_NewStringObj(path, TCL_STRLEN); searchPath = Tcl_DuplicateObj(searchPath); Tcl_ListObjReplace(NULL, searchPath, 0, 0, 1, &directory); @@ -881,7 +881,7 @@ Tcl_GetEncodingNames( Encoding *encodingPtr = Tcl_GetHashValue(hPtr); Tcl_CreateHashEntry(&table, - Tcl_NewStringObj(encodingPtr->name, -1), &dummy); + Tcl_NewStringObj(encodingPtr->name, TCL_STRLEN), &dummy); } Tcl_MutexUnlock(&encodingMutex); @@ -1425,7 +1425,7 @@ OpenEncodingFileChannel( const char *name) /* The name of the encoding file on disk and * also the name for new encoding. */ { - Tcl_Obj *nameObj = Tcl_NewStringObj(name, -1); + Tcl_Obj *nameObj = Tcl_NewStringObj(name, TCL_STRLEN); Tcl_Obj *fileNameObj = Tcl_DuplicateObj(nameObj); Tcl_Obj *searchPath = Tcl_DuplicateObj(Tcl_GetEncodingSearchPath()); Tcl_Obj *map = TclGetProcessGlobalValue(&encodingFileMap); @@ -1435,7 +1435,7 @@ OpenEncodingFileChannel( Tcl_ListObjGetElements(NULL, searchPath, &numDirs, &dir); Tcl_IncrRefCount(nameObj); - Tcl_AppendToObj(fileNameObj, ".enc", -1); + Tcl_AppendToObj(fileNameObj, ".enc", TCL_STRLEN); Tcl_IncrRefCount(fileNameObj); Tcl_DictObjGet(NULL, map, nameObj, &directory); diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index 058f2b3..775d563 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -86,7 +86,7 @@ NewNsObj( if (namespacePtr == TclGetGlobalNamespace(nsPtr->interp)) { return Tcl_NewStringObj("::", 2); } else { - return Tcl_NewStringObj(nsPtr->fullName, -1); + return Tcl_NewStringObj(nsPtr->fullName, TCL_STRLEN); } } @@ -130,7 +130,7 @@ TclNamespaceEnsembleCmd( if (!Tcl_InterpDeleted(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "tried to manipulate ensemble of deleted namespace", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "DEAD", NULL); } return TCL_ERROR; @@ -251,7 +251,7 @@ TclNamespaceEnsembleCmd( if (len < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "ensemble subcommand implementations " - "must be non-empty lists", -1)); + "must be non-empty lists", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "EMPTY_TARGET", NULL); Tcl_DictObjDone(&search); @@ -414,44 +414,43 @@ TclNamespaceEnsembleCmd( TclNewObj(resultObj); /* -map option */ - Tcl_ListObjAppendElement(NULL, resultObj, - Tcl_NewStringObj(ensembleConfigOptions[CONF_MAP], -1)); + Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( + ensembleConfigOptions[CONF_MAP], TCL_STRLEN)); Tcl_GetEnsembleMappingDict(NULL, token, &tmpObj); Tcl_ListObjAppendElement(NULL, resultObj, (tmpObj != NULL) ? tmpObj : Tcl_NewObj()); /* -namespace option */ - Tcl_ListObjAppendElement(NULL, resultObj, - Tcl_NewStringObj(ensembleConfigOptions[CONF_NAMESPACE], - -1)); + Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( + ensembleConfigOptions[CONF_NAMESPACE], TCL_STRLEN)); namespacePtr = NULL; /* silence gcc 4 warning */ Tcl_GetEnsembleNamespace(NULL, token, &namespacePtr); Tcl_ListObjAppendElement(NULL, resultObj, NewNsObj(namespacePtr)); /* -parameters option */ - Tcl_ListObjAppendElement(NULL, resultObj, - Tcl_NewStringObj(ensembleConfigOptions[CONF_PARAM], -1)); + Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( + ensembleConfigOptions[CONF_PARAM], TCL_STRLEN)); Tcl_GetEnsembleParameterList(NULL, token, &tmpObj); Tcl_ListObjAppendElement(NULL, resultObj, (tmpObj != NULL) ? tmpObj : Tcl_NewObj()); /* -prefix option */ - Tcl_ListObjAppendElement(NULL, resultObj, - Tcl_NewStringObj(ensembleConfigOptions[CONF_PREFIX], -1)); + Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( + ensembleConfigOptions[CONF_PREFIX], TCL_STRLEN)); Tcl_GetEnsembleFlags(NULL, token, &flags); Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewBooleanObj(flags & TCL_ENSEMBLE_PREFIX)); /* -subcommands option */ - Tcl_ListObjAppendElement(NULL, resultObj, - Tcl_NewStringObj(ensembleConfigOptions[CONF_SUBCMDS],-1)); + Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( + ensembleConfigOptions[CONF_SUBCMDS], TCL_STRLEN)); Tcl_GetEnsembleSubcommandList(NULL, token, &tmpObj); Tcl_ListObjAppendElement(NULL, resultObj, (tmpObj != NULL) ? tmpObj : Tcl_NewObj()); /* -unknown option */ - Tcl_ListObjAppendElement(NULL, resultObj, - Tcl_NewStringObj(ensembleConfigOptions[CONF_UNKNOWN],-1)); + Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewStringObj( + ensembleConfigOptions[CONF_UNKNOWN], TCL_STRLEN)); Tcl_GetEnsembleUnknownHandler(NULL, token, &tmpObj); Tcl_ListObjAppendElement(NULL, resultObj, (tmpObj != NULL) ? tmpObj : Tcl_NewObj()); @@ -531,7 +530,7 @@ TclNamespaceEnsembleCmd( if (len < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "ensemble subcommand implementations " - "must be non-empty lists", -1)); + "must be non-empty lists", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "EMPTY_TARGET", NULL); Tcl_DictObjDone(&search); @@ -570,7 +569,7 @@ TclNamespaceEnsembleCmd( } case CONF_NAMESPACE: Tcl_SetObjResult(interp, Tcl_NewStringObj( - "option -namespace is read-only", -1)); + "option -namespace is read-only", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "READ_ONLY", NULL); goto freeMapAndError; @@ -720,7 +719,7 @@ Tcl_SetEnsembleSubcommandList( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); return TCL_ERROR; } @@ -796,7 +795,7 @@ Tcl_SetEnsembleParameterList( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); return TCL_ERROR; } @@ -872,7 +871,7 @@ Tcl_SetEnsembleMappingDict( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); return TCL_ERROR; } @@ -899,7 +898,7 @@ Tcl_SetEnsembleMappingDict( if (bytes[0] != ':' || bytes[1] != ':') { Tcl_SetObjResult(interp, Tcl_NewStringObj( "ensemble target is not a fully-qualified command", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "UNQUALIFIED_TARGET", NULL); Tcl_DictObjDone(&search); @@ -972,7 +971,7 @@ Tcl_SetEnsembleUnknownHandler( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); return TCL_ERROR; } @@ -1038,7 +1037,7 @@ Tcl_SetEnsembleFlags( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); return TCL_ERROR; } @@ -1115,7 +1114,7 @@ Tcl_GetEnsembleSubcommandList( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); } return TCL_ERROR; @@ -1157,7 +1156,7 @@ Tcl_GetEnsembleParameterList( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); } return TCL_ERROR; @@ -1199,7 +1198,7 @@ Tcl_GetEnsembleMappingDict( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); } return TCL_ERROR; @@ -1240,7 +1239,7 @@ Tcl_GetEnsembleUnknownHandler( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); } return TCL_ERROR; @@ -1281,7 +1280,7 @@ Tcl_GetEnsembleFlags( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); } return TCL_ERROR; @@ -1322,7 +1321,7 @@ Tcl_GetEnsembleNamespace( if (cmdPtr->objProc != NsEnsembleImplementationCmd) { if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command is not an ensemble", -1)); + "command is not an ensemble", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "NOT_ENSEMBLE", NULL); } return TCL_ERROR; @@ -1532,7 +1531,7 @@ TclMakeEnsemble( TclDStringAppendLiteral(&buf, "::"); TclNewObj(mapDict); for (i=0 ; map[i].name != NULL ; i++) { - fromObj = Tcl_NewStringObj(map[i].name, -1); + fromObj = Tcl_NewStringObj(map[i].name, TCL_STRLEN); TclNewStringObj(toObj, Tcl_DStringValue(&buf), Tcl_DStringLength(&buf)); Tcl_AppendToObj(toObj, map[i].name, -1); @@ -1677,7 +1676,7 @@ NsEnsembleImplementationCmdNR( if (!Tcl_InterpDeleted(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "ensemble activated for deleted namespace", -1)); + "ensemble activated for deleted namespace", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "DEAD", NULL); } return TCL_ERROR; @@ -2108,7 +2107,8 @@ EnsembleUnknownCallback( if ((result == TCL_OK) && (ensemblePtr->flags & ENSEMBLE_DEAD)) { if (!Tcl_InterpDeleted(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unknown subcommand handler deleted its ensemble", -1)); + "unknown subcommand handler deleted its ensemble", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ENSEMBLE", "UNKNOWN_DELETED", NULL); } @@ -2161,16 +2161,20 @@ EnsembleUnknownCallback( if (result != TCL_ERROR) { Tcl_ResetResult(interp); Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unknown subcommand handler returned bad code: ", -1)); + "unknown subcommand handler returned bad code: ", + TCL_STRLEN)); switch (result) { case TCL_RETURN: - Tcl_AppendToObj(Tcl_GetObjResult(interp), "return", -1); + Tcl_AppendToObj(Tcl_GetObjResult(interp), "return", + TCL_STRLEN); break; case TCL_BREAK: - Tcl_AppendToObj(Tcl_GetObjResult(interp), "break", -1); + Tcl_AppendToObj(Tcl_GetObjResult(interp), "break", + TCL_STRLEN); break; case TCL_CONTINUE: - Tcl_AppendToObj(Tcl_GetObjResult(interp), "continue", -1); + Tcl_AppendToObj(Tcl_GetObjResult(interp), "continue", + TCL_STRLEN); break; default: Tcl_AppendPrintfToObj(Tcl_GetObjResult(interp), "%d", result); diff --git a/generic/tclEvent.c b/generic/tclEvent.c index d50725b..7568a33 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -333,7 +333,7 @@ TclDefaultBgErrorHandlerObjCmd( Tcl_DecrRefCount(keyPtr); if (valuePtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing return option \"-level\"", -1)); + "missing return option \"-level\"", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); return TCL_ERROR; } @@ -346,7 +346,7 @@ TclDefaultBgErrorHandlerObjCmd( Tcl_DecrRefCount(keyPtr); if (valuePtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing return option \"-code\"", -1)); + "missing return option \"-code\"", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); return TCL_ERROR; } @@ -1417,7 +1417,8 @@ Tcl_VwaitObjCmd( } if (Tcl_LimitExceeded(interp)) { Tcl_ResetResult(interp); - Tcl_SetObjResult(interp, Tcl_NewStringObj("limit exceeded", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "limit exceeded", TCL_STRLEN)); break; } } @@ -1521,7 +1522,8 @@ Tcl_UpdateObjCmd( } if (Tcl_LimitExceeded(interp)) { Tcl_ResetResult(interp); - Tcl_SetObjResult(interp, Tcl_NewStringObj("limit exceeded", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "limit exceeded", TCL_STRLEN)); return TCL_ERROR; } } diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 1a04cfc..300c97d 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2340,7 +2340,7 @@ TEBCresume( if (!corPtr) { TRACE_APPEND(("ERROR: yield outside coroutine\n")); Tcl_SetObjResult(interp, Tcl_NewStringObj( - "yield can only be called in a coroutine", -1)); + "yield can only be called in a coroutine", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "COROUTINE", "ILLEGAL_YIELD", NULL); goto gotError; @@ -2384,7 +2384,8 @@ TEBCresume( if (!(iPtr->varFramePtr->isProcCallFrame & 1)) { TRACE(("%d => ERROR: tailcall in non-proc context\n", opnd)); Tcl_SetObjResult(interp, Tcl_NewStringObj( - "tailcall can only be called from a proc or lambda", -1)); + "tailcall can only be called from a proc or lambda", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "TAILCALL", "ILLEGAL", NULL); goto gotError; } @@ -2410,7 +2411,8 @@ TEBCresume( */ listPtr = Tcl_NewListObj(opnd, &OBJ_AT_DEPTH(opnd-1)); - nsObjPtr = Tcl_NewStringObj(iPtr->varFramePtr->nsPtr->fullName, -1); + nsObjPtr = Tcl_NewStringObj(iPtr->varFramePtr->nsPtr->fullName, + TCL_STRLEN); Tcl_IncrRefCount(listPtr); Tcl_IncrRefCount(nsObjPtr); TclNRAddCallback(interp, TclNRTailcallEval, listPtr, nsObjPtr, @@ -4320,7 +4322,7 @@ TEBCresume( TRACE(("=> ERROR: no TclOO call context\n")); Tcl_SetObjResult(interp, Tcl_NewStringObj( "self may only be called from inside a method", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OO", "CONTEXT_REQUIRED", NULL); goto gotError; } @@ -5396,7 +5398,7 @@ TEBCresume( case INST_RSHIFT: if (l2 < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "negative shift argument", -1)); + "negative shift argument", TCL_STRLEN)); #if 0 DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", @@ -5444,7 +5446,7 @@ TEBCresume( case INST_LSHIFT: if (l2 < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "negative shift argument", -1)); + "negative shift argument", TCL_STRLEN)); #if 0 DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", @@ -5467,7 +5469,8 @@ TEBCresume( */ Tcl_SetObjResult(interp, Tcl_NewStringObj( - "integer value too large to represent", -1)); + "integer value too large to represent", + TCL_STRLEN)); #if 0 DECACHE_STACK_INFO(); Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", @@ -6836,7 +6839,8 @@ TEBCresume( divideByZero: DECACHE_STACK_INFO(); - Tcl_SetObjResult(interp, Tcl_NewStringObj("divide by zero", -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj("divide by zero", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", NULL); CACHE_STACK_INFO(); goto gotError; @@ -6849,7 +6853,7 @@ TEBCresume( exponOfZero: DECACHE_STACK_INFO(); Tcl_SetObjResult(interp, Tcl_NewStringObj( - "exponentiation of zero by negative power", -1)); + "exponentiation of zero by negative power", TCL_STRLEN)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", "exponentiation of zero by negative power", NULL); CACHE_STACK_INFO(); @@ -7226,7 +7230,7 @@ ExecuteExtendedBinaryMathOp( } if (invalid) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "negative shift argument", -1)); + "negative shift argument", TCL_STRLEN)); return GENERAL_ARITHMETIC_ERROR; } @@ -7257,7 +7261,7 @@ ExecuteExtendedBinaryMathOp( */ Tcl_SetObjResult(interp, Tcl_NewStringObj( - "integer value too large to represent", -1)); + "integer value too large to represent", TCL_STRLEN)); return GENERAL_ARITHMETIC_ERROR; } shift = (int)(*((const long *)ptr2)); @@ -7659,7 +7663,7 @@ ExecuteExtendedBinaryMathOp( if (type2 != TCL_NUMBER_LONG) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "exponent too large", -1)); + "exponent too large", TCL_STRLEN)); return GENERAL_ARITHMETIC_ERROR; } @@ -7898,7 +7902,7 @@ ExecuteExtendedBinaryMathOp( if (big2.used > 1) { mp_clear(&big2); Tcl_SetObjResult(interp, Tcl_NewStringObj( - "exponent too large", -1)); + "exponent too large", TCL_STRLEN)); return GENERAL_ARITHMETIC_ERROR; } Tcl_TakeBignumFromObj(NULL, valuePtr, &big1); @@ -8939,16 +8943,16 @@ TclExprFloatError( if ((errno == EDOM) || TclIsNaN(value)) { s = "domain error: argument not in valid range"; - Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(s, TCL_STRLEN)); Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", s, NULL); } else if ((errno == ERANGE) || TclIsInfinite(value)) { if (value == 0.0) { s = "floating-point value too small to represent"; - Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(s, TCL_STRLEN)); Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", s, NULL); } else { s = "floating-point value too large to represent"; - Tcl_SetObjResult(interp, Tcl_NewStringObj(s, -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(s, TCL_STRLEN)); Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", s, NULL); } } else { diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 57fc80f..6098211 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1047,8 +1047,8 @@ TclFileAttrsCmd( res = Tcl_FSFileAttrsGet(interp, index, filePtr, &objPtrAttr); if (res == TCL_OK) { - Tcl_Obj *objPtr = - Tcl_NewStringObj(attributeStrings[index], -1); + Tcl_Obj *objPtr = Tcl_NewStringObj( + attributeStrings[index], TCL_STRLEN); Tcl_ListObjAppendElement(interp, listPtr, objPtr); Tcl_ListObjAppendElement(interp, listPtr, objPtrAttr); @@ -1504,7 +1504,8 @@ TclFileTemporaryCmd( return TCL_ERROR; } } - Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetChannelName(chan), -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + Tcl_GetChannelName(chan), TCL_STRLEN)); return TCL_OK; } diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 3f8a332..543c95e 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -342,7 +342,7 @@ Tcl_GetPathType( const char *path) { Tcl_PathType type; - Tcl_Obj *tempObj = Tcl_NewStringObj(path,-1); + Tcl_Obj *tempObj = Tcl_NewStringObj(path, TCL_STRLEN); Tcl_IncrRefCount(tempObj); type = Tcl_FSGetPathType(tempObj); @@ -565,7 +565,7 @@ Tcl_SplitPath( * Perform the splitting, using objectified, vfs-aware code. */ - tmpPtr = Tcl_NewStringObj(path, -1); + tmpPtr = Tcl_NewStringObj(path, TCL_STRLEN); Tcl_IncrRefCount(tmpPtr); resultPtr = Tcl_FSSplitPath(tmpPtr, argcPtr); Tcl_IncrRefCount(resultPtr); @@ -763,6 +763,7 @@ SplitWinPath( length = p - elementStart; if (length > 0) { Tcl_Obj *nextElt; + if ((elementStart != path) && ((elementStart[0] == '~') || (isalpha(UCHAR(elementStart[0])) && elementStart[1] == ':'))) { @@ -988,7 +989,7 @@ Tcl_JoinPath( for (i = 0; i < argc; i++) { Tcl_ListObjAppendElement(NULL, listObj, - Tcl_NewStringObj(argv[i], -1)); + Tcl_NewStringObj(argv[i], TCL_STRLEN)); } /* @@ -1052,7 +1053,7 @@ Tcl_TranslateFileName( Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with * name after tilde substitution. */ { - Tcl_Obj *path = Tcl_NewStringObj(name, -1); + Tcl_Obj *path = Tcl_NewStringObj(name, TCL_STRLEN); Tcl_Obj *transPtr; Tcl_IncrRefCount(path); @@ -1182,7 +1183,7 @@ DoTildeSubst( if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "couldn't find HOME environment " - "variable to expand path", -1)); + "variable to expand path", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "FILENAME", "NO_HOME", NULL); } return NULL; @@ -1277,13 +1278,14 @@ Tcl_GlobObjCmd( case GLOB_DIR: /* -dir */ if (i == (objc-1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing argument to \"-directory\"", -1)); + "missing argument to \"-directory\"", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); return TCL_ERROR; } if (dir != PATH_NONE) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "\"-directory\" cannot be used with \"-path\"", -1)); + "\"-directory\" cannot be used with \"-path\"", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BADOPTIONCOMBINATION", NULL); return TCL_ERROR; @@ -1302,13 +1304,14 @@ Tcl_GlobObjCmd( case GLOB_PATH: /* -path */ if (i == (objc-1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing argument to \"-path\"", -1)); + "missing argument to \"-path\"", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); return TCL_ERROR; } if (dir != PATH_NONE) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "\"-path\" cannot be used with \"-directory\"", -1)); + "\"-path\" cannot be used with \"-directory\"", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BADOPTIONCOMBINATION", NULL); return TCL_ERROR; @@ -1320,7 +1323,7 @@ Tcl_GlobObjCmd( case GLOB_TYPE: /* -types */ if (i == (objc-1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing argument to \"-types\"", -1)); + "missing argument to \"-types\"", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "MISSING", NULL); return TCL_ERROR; } @@ -1340,7 +1343,7 @@ Tcl_GlobObjCmd( if ((globFlags & TCL_GLOBMODE_TAILS) && (pathOrDir == NULL)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "\"-tails\" must be used with either " - "\"-directory\" or \"-path\"", -1)); + "\"-directory\" or \"-path\"", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BADOPTIONCOMBINATION", NULL); return TCL_ERROR; @@ -1559,7 +1562,7 @@ Tcl_GlobObjCmd( badMacTypesArg: Tcl_SetObjResult(interp, Tcl_NewStringObj( "only one MacOS type or creator argument" - " to \"-types\" allowed", -1)); + " to \"-types\" allowed", TCL_STRLEN)); result = TCL_ERROR; Tcl_SetErrorCode(interp, "TCL", "ARGUMENT", "BAD", NULL); join = 0; @@ -1829,7 +1832,7 @@ TclGlob( || (tail[0] == '\\' && tail[1] == '\\'))) { size_t driveNameLen; Tcl_Obj *driveName; - Tcl_Obj *temp = Tcl_NewStringObj(tail, -1); + Tcl_Obj *temp = Tcl_NewStringObj(tail, TCL_STRLEN); Tcl_IncrRefCount(temp); switch (TclGetPathType(temp, NULL, &driveNameLen, &driveName)) { @@ -2220,14 +2223,14 @@ DoGlob( break; } Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unmatched open-brace in file name", -1)); + "unmatched open-brace in file name", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BALANCE", NULL); return TCL_ERROR; } else if (*p == '}') { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "unmatched close-brace in file name", -1)); + "unmatched close-brace in file name", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "GLOB", "BALANCE", NULL); return TCL_ERROR; diff --git a/generic/tclIO.c b/generic/tclIO.c index d96b8e2..47d7c34 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10284,7 +10284,7 @@ Tcl_GetChannelNamesEx( && (pattern[2] == 'd'))) { if ((Tcl_FindHashEntry(hTblPtr, pattern) != NULL) && (Tcl_ListObjAppendElement(interp, resultPtr, - Tcl_NewStringObj(pattern, -1)) != TCL_OK)) { + Tcl_NewStringObj(pattern, TCL_STRLEN)) != TCL_OK)) { goto error; } goto done; @@ -10311,7 +10311,7 @@ Tcl_GetChannelNamesEx( if (((pattern == NULL) || Tcl_StringMatch(name, pattern)) && (Tcl_ListObjAppendElement(interp, resultPtr, - Tcl_NewStringObj(name, -1)) != TCL_OK)) { + Tcl_NewStringObj(name, TCL_STRLEN)) != TCL_OK)) { error: TclDecrRefCount(resultPtr); return TCL_ERROR; diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c index 2da461a..98909c6 100644 --- a/generic/tclIOCmd.c +++ b/generic/tclIOCmd.c @@ -1158,7 +1158,8 @@ Tcl_OpenObjCmd( return TCL_ERROR; } Tcl_RegisterChannel(interp, chan); - Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetChannelName(chan), -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetChannelName(chan), + TCL_STRLEN)); return TCL_OK; } @@ -1464,7 +1465,8 @@ Tcl_SocketObjCmd( case SKT_ASYNC: if (server == 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot set -async option for server sockets", -1)); + "cannot set -async option for server sockets", + TCL_STRLEN)); return TCL_ERROR; } async = 1; @@ -1473,7 +1475,7 @@ Tcl_SocketObjCmd( a++; if (a >= objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "no argument given for -myaddr option", -1)); + "no argument given for -myaddr option", TCL_STRLEN)); return TCL_ERROR; } myaddr = TclGetString(objv[a]); @@ -1484,7 +1486,7 @@ Tcl_SocketObjCmd( a++; if (a >= objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "no argument given for -myport option", -1)); + "no argument given for -myport option", TCL_STRLEN)); return TCL_ERROR; } myPortName = TclGetString(objv[a]); @@ -1496,14 +1498,15 @@ Tcl_SocketObjCmd( case SKT_SERVER: if (async == 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot set -async option for server sockets", -1)); + "cannot set -async option for server sockets", + TCL_STRLEN)); return TCL_ERROR; } server = 1; a++; if (a >= objc) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "no argument given for -server option", -1)); + "no argument given for -server option", TCL_STRLEN)); return TCL_ERROR; } script = TclGetString(objv[a]); @@ -1516,7 +1519,7 @@ Tcl_SocketObjCmd( host = myaddr; /* NULL implies INADDR_ANY */ if (myport != 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "option -myport is not valid for servers", -1)); + "option -myport is not valid for servers", TCL_STRLEN)); return TCL_ERROR; } } else if (a < objc) { @@ -1584,7 +1587,8 @@ Tcl_SocketObjCmd( } Tcl_RegisterChannel(interp, chan); - Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetChannelName(chan), -1)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(Tcl_GetChannelName(chan), + TCL_STRLEN)); return TCL_OK; } @@ -1792,7 +1796,8 @@ ChanTruncateObjCmd( } if (length < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot truncate to negative length of file", -1)); + "cannot truncate to negative length of file", + TCL_STRLEN)); return TCL_ERROR; } } else { @@ -1862,9 +1867,9 @@ ChanPipeObjCmd( resultPtr = Tcl_NewObj(); Tcl_ListObjAppendElement(NULL, resultPtr, - Tcl_NewStringObj(channelNames[0], -1)); + Tcl_NewStringObj(channelNames[0], TCL_STRLEN)); Tcl_ListObjAppendElement(NULL, resultPtr, - Tcl_NewStringObj(channelNames[1], -1)); + Tcl_NewStringObj(channelNames[1], TCL_STRLEN)); Tcl_SetObjResult(interp, resultPtr); return TCL_OK; @@ -1968,8 +1973,8 @@ TclInitChanCmd( * Can assume that reference counts are all incremented. */ - Tcl_DictObjPut(NULL, mapObj, Tcl_NewStringObj(extras[i], -1), - Tcl_NewStringObj(extras[i+1], -1)); + Tcl_DictObjPut(NULL, mapObj, Tcl_NewStringObj(extras[i], TCL_STRLEN), + Tcl_NewStringObj(extras[i+1], TCL_STRLEN)); } Tcl_SetEnsembleMappingDict(interp, ensemble, mapObj); return ensemble; diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index fbd8776..8f19db5 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -699,7 +699,7 @@ TclChanPushObjCmd( */ Tcl_SetObjResult(interp, Tcl_NewStringObj( - Tcl_GetChannelName(rtPtr->chan), -1)); + Tcl_GetChannelName(rtPtr->chan), TCL_STRLEN)); return TCL_OK; error: @@ -1710,7 +1710,7 @@ DecodeEventMask( break; } - evObj = Tcl_NewStringObj(eventStr, -1); + evObj = Tcl_NewStringObj(eventStr, TCL_STRLEN); Tcl_IncrRefCount(evObj); return evObj; } @@ -1951,7 +1951,7 @@ InvokeTclMethod( */ if (resultObjPtr != NULL) { - resObj = Tcl_NewStringObj(msg_dstlost,-1); + resObj = Tcl_NewStringObj(msg_dstlost, TCL_STRLEN); *resultObjPtr = resObj; Tcl_IncrRefCount(resObj); } @@ -1970,7 +1970,7 @@ InvokeTclMethod( * before the channel id. */ - methObj = Tcl_NewStringObj(method, -1); + methObj = Tcl_NewStringObj(method, TCL_STRLEN); Tcl_IncrRefCount(methObj); rtPtr->argv[rtPtr->argc - 2] = methObj; diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 0bd7213..f5552f0 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -415,7 +415,7 @@ SetIndexFromAny( if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't convert value to index except via Tcl_GetIndexFromObj API", - -1)); + TCL_STRLEN)); } return TCL_ERROR; } @@ -596,7 +596,7 @@ PrefixMatchObjCmd( case PRFMATCH_MESSAGE: if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing value for -message", -1)); + "missing value for -message", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL); return TCL_ERROR; } @@ -606,7 +606,7 @@ PrefixMatchObjCmd( case PRFMATCH_ERROR: if (i > objc-4) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "missing value for -error", -1)); + "missing value for -error", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "NOARG", NULL); return TCL_ERROR; } @@ -618,7 +618,7 @@ PrefixMatchObjCmd( if ((errorLength % 2) != 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "error options must have an even number of elements", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "VALUE", "DICTIONARY", NULL); return TCL_ERROR; } @@ -1384,7 +1384,7 @@ PrintUsage( * Now add the option information, with pretty-printing. */ - msg = Tcl_NewStringObj("Command-specific options:", -1); + msg = Tcl_NewStringObj("Command-specific options:", TCL_STRLEN); for (infoPtr = argTable; infoPtr->type != TCL_ARGV_END; infoPtr++) { if ((infoPtr->type == TCL_ARGV_HELP) && (infoPtr->keyStr == NULL)) { Tcl_AppendPrintfToObj(msg, "\n%s", infoPtr->helpStr); @@ -1400,7 +1400,7 @@ PrintUsage( } numSpaces -= NUM_SPACES; } - Tcl_AppendToObj(msg, infoPtr->helpStr, -1); + Tcl_AppendToObj(msg, infoPtr->helpStr, TCL_STRLEN); switch (infoPtr->type) { case TCL_ARGV_INT: Tcl_AppendPrintfToObj(msg, "\n\t\tDefault value: %d", diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 62da3ac..424aafe 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -763,7 +763,7 @@ Tcl_InterpObjCmd( break; } } - slavePtr = Tcl_NewStringObj(buf, -1); + slavePtr = Tcl_NewStringObj(buf, TCL_STRLEN); } if (SlaveCreate(interp, slavePtr, safe) == NULL) { if (buf[0] != '\0') { @@ -798,7 +798,7 @@ Tcl_InterpObjCmd( return TCL_ERROR; } else if (slaveInterp == interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cannot delete the current interpreter", -1)); + "cannot delete the current interpreter", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "DELETESELF", NULL); return TCL_ERROR; @@ -976,7 +976,7 @@ Tcl_InterpObjCmd( for ( ; hPtr != NULL; hPtr = Tcl_NextHashEntry(&hashSearch)) { string = Tcl_GetHashKey(&iiPtr->master.slaveTable, hPtr); Tcl_ListObjAppendElement(NULL, resultPtr, - Tcl_NewStringObj(string, -1)); + Tcl_NewStringObj(string, TCL_STRLEN)); } Tcl_SetObjResult(interp, resultPtr); return TCL_OK; @@ -1130,14 +1130,14 @@ Tcl_CreateAlias( objv = TclStackAlloc(slaveInterp, (unsigned) sizeof(Tcl_Obj *) * argc); for (i = 0; i < argc; i++) { - objv[i] = Tcl_NewStringObj(argv[i], -1); + objv[i] = Tcl_NewStringObj(argv[i], TCL_STRLEN); Tcl_IncrRefCount(objv[i]); } - slaveObjPtr = Tcl_NewStringObj(slaveCmd, -1); + slaveObjPtr = Tcl_NewStringObj(slaveCmd, TCL_STRLEN); Tcl_IncrRefCount(slaveObjPtr); - targetObjPtr = Tcl_NewStringObj(targetCmd, -1); + targetObjPtr = Tcl_NewStringObj(targetCmd, TCL_STRLEN); Tcl_IncrRefCount(targetObjPtr); result = AliasCreate(slaveInterp, slaveInterp, targetInterp, slaveObjPtr, @@ -1181,10 +1181,10 @@ Tcl_CreateAliasObj( Tcl_Obj *slaveObjPtr, *targetObjPtr; int result; - slaveObjPtr = Tcl_NewStringObj(slaveCmd, -1); + slaveObjPtr = Tcl_NewStringObj(slaveCmd, TCL_STRLEN); Tcl_IncrRefCount(slaveObjPtr); - targetObjPtr = Tcl_NewStringObj(targetCmd, -1); + targetObjPtr = Tcl_NewStringObj(targetCmd, TCL_STRLEN); Tcl_IncrRefCount(targetObjPtr); result = AliasCreate(slaveInterp, slaveInterp, targetInterp, slaveObjPtr, @@ -1986,7 +1986,7 @@ Tcl_CreateSlave( Tcl_Obj *pathPtr; Tcl_Interp *slaveInterp; - pathPtr = Tcl_NewStringObj(slavePath, -1); + pathPtr = Tcl_NewStringObj(slavePath, TCL_STRLEN); slaveInterp = SlaveCreate(interp, pathPtr, isSafe); Tcl_DecrRefCount(pathPtr); @@ -2017,7 +2017,7 @@ Tcl_GetSlave( Tcl_Obj *pathPtr; Tcl_Interp *slaveInterp; - pathPtr = Tcl_NewStringObj(slavePath, -1); + pathPtr = Tcl_NewStringObj(slavePath, TCL_STRLEN); slaveInterp = GetInterp(interp, pathPtr); Tcl_DecrRefCount(pathPtr); @@ -2163,7 +2163,7 @@ Tcl_GetInterpPath( } Tcl_ListObjAppendElement(NULL, Tcl_GetObjResult(askingInterp), Tcl_NewStringObj(Tcl_GetHashKey(&iiPtr->master.slaveTable, - iiPtr->slave.slaveEntryPtr), -1)); + iiPtr->slave.slaveEntryPtr), TCL_STRLEN)); return TCL_OK; } @@ -2256,7 +2256,7 @@ SlaveBgerror( if (TCL_ERROR == TclListObjLength(NULL, objv[0], &length) || (length < 1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "cmdPrefix must be list of length >= 1", -1)); + "cmdPrefix must be list of length >= 1", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BGERRORFORMAT", NULL); return TCL_ERROR; @@ -2692,7 +2692,7 @@ SlaveDebugCmd( if (objc == 0) { resultPtr = Tcl_NewObj(); Tcl_ListObjAppendElement(NULL, resultPtr, - Tcl_NewStringObj("-frame", -1)); + Tcl_NewStringObj("-frame", TCL_STRLEN)); Tcl_ListObjAppendElement(NULL, resultPtr, Tcl_NewBooleanObj(iPtr->flags & INTERP_DEBUG_FRAME)); Tcl_SetObjResult(interp, resultPtr); @@ -2817,7 +2817,7 @@ SlaveExpose( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "permission denied: safe interpreter cannot expose commands", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); return TCL_ERROR; @@ -2862,7 +2862,8 @@ SlaveRecursionLimit( if (objc) { if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj("permission denied: " - "safe interpreters cannot change recursion limit", -1)); + "safe interpreters cannot change recursion limit", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); return TCL_ERROR; @@ -2872,7 +2873,7 @@ SlaveRecursionLimit( } if (limit <= 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "recursion limit must be > 0", -1)); + "recursion limit must be > 0", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADLIMIT", NULL); return TCL_ERROR; @@ -2881,7 +2882,7 @@ SlaveRecursionLimit( iPtr = (Interp *) slaveInterp; if (interp == slaveInterp && iPtr->numLevels > limit) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "falling back due to new recursion limit", -1)); + "falling back due to new recursion limit", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "RECURSION", NULL); return TCL_ERROR; } @@ -2923,7 +2924,7 @@ SlaveHide( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "permission denied: safe interpreter cannot hide commands", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); return TCL_ERROR; @@ -2969,8 +2970,8 @@ SlaveHidden( for (hPtr = Tcl_FirstHashEntry(hTblPtr, &hSearch); hPtr != NULL; hPtr = Tcl_NextHashEntry(&hSearch)) { - Tcl_ListObjAppendElement(NULL, listObjPtr, - Tcl_NewStringObj(Tcl_GetHashKey(hTblPtr, hPtr), -1)); + Tcl_ListObjAppendElement(NULL, listObjPtr, Tcl_NewStringObj( + Tcl_GetHashKey(hTblPtr, hPtr), TCL_STRLEN)); } } Tcl_SetObjResult(interp, listObjPtr); @@ -3007,7 +3008,7 @@ SlaveInvokeHidden( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not allowed to invoke hidden commands from safe interpreter", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); return TCL_ERROR; @@ -3063,7 +3064,7 @@ SlaveMarkTrusted( if (Tcl_IsSafe(interp)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "permission denied: safe interpreter cannot mark trusted", - -1)); + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "UNSAFE", NULL); return TCL_ERROR; @@ -3322,7 +3323,7 @@ Tcl_LimitCheck( iPtr->limit.exceeded &= ~TCL_LIMIT_COMMANDS; } else if (iPtr->limit.exceeded & TCL_LIMIT_COMMANDS) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command count limit exceeded", -1)); + "command count limit exceeded", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LIMIT", "COMMANDS", NULL); Tcl_Release(interp); return TCL_ERROR; @@ -3348,7 +3349,7 @@ Tcl_LimitCheck( iPtr->limit.exceeded &= ~TCL_LIMIT_TIME; } else if (iPtr->limit.exceeded & TCL_LIMIT_TIME) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "time limit exceeded", -1)); + "time limit exceeded", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LIMIT", "TIME", NULL); Tcl_Release(interp); return TCL_ERROR; @@ -4355,7 +4356,7 @@ SlaveCommandLimitCmd( if (interp == slaveInterp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "limits on current interpreter inaccessible", -1)); + "limits on current interpreter inaccessible", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "SELF", NULL); return TCL_ERROR; } @@ -4370,7 +4371,8 @@ SlaveCommandLimitCmd( if (hPtr != NULL) { limitCBPtr = Tcl_GetHashValue(hPtr); if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) { - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[0], TCL_STRLEN), limitCBPtr->scriptObj); } else { goto putEmptyCommandInDict; @@ -4381,21 +4383,23 @@ SlaveCommandLimitCmd( putEmptyCommandInDict: TclNewObj(empty); Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[0], -1), empty); + Tcl_NewStringObj(options[0], TCL_STRLEN), empty); } - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[1], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[1], TCL_STRLEN), Tcl_NewIntObj(Tcl_LimitGetGranularity(slaveInterp, - TCL_LIMIT_COMMANDS))); + TCL_LIMIT_COMMANDS))); if (Tcl_LimitTypeEnabled(slaveInterp, TCL_LIMIT_COMMANDS)) { - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[2], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[2], TCL_STRLEN), Tcl_NewIntObj(Tcl_LimitGetCommands(slaveInterp))); } else { Tcl_Obj *empty; TclNewObj(empty); Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[2], -1), empty); + Tcl_NewStringObj(options[2], TCL_STRLEN), empty); } Tcl_SetObjResult(interp, dictPtr); return TCL_OK; @@ -4453,7 +4457,7 @@ SlaveCommandLimitCmd( } if (gran < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "granularity must be at least 1", -1)); + "granularity must be at least 1", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADVALUE", NULL); return TCL_ERROR; @@ -4470,7 +4474,8 @@ SlaveCommandLimitCmd( } if (limit < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "command limit value must be at least 0", -1)); + "command limit value must be at least 0", + TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADVALUE", NULL); return TCL_ERROR; @@ -4543,7 +4548,7 @@ SlaveTimeLimitCmd( if (interp == slaveInterp) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "limits on current interpreter inaccessible", -1)); + "limits on current interpreter inaccessible", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "SELF", NULL); return TCL_ERROR; } @@ -4558,7 +4563,8 @@ SlaveTimeLimitCmd( if (hPtr != NULL) { limitCBPtr = Tcl_GetHashValue(hPtr); if (limitCBPtr != NULL && limitCBPtr->scriptObj != NULL) { - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[0], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[0], TCL_STRLEN), limitCBPtr->scriptObj); } else { goto putEmptyCommandInDict; @@ -4568,28 +4574,31 @@ SlaveTimeLimitCmd( putEmptyCommandInDict: TclNewObj(empty); Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[0], -1), empty); + Tcl_NewStringObj(options[0], TCL_STRLEN), empty); } - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[1], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[1], TCL_STRLEN), Tcl_NewIntObj(Tcl_LimitGetGranularity(slaveInterp, - TCL_LIMIT_TIME))); + TCL_LIMIT_TIME))); if (Tcl_LimitTypeEnabled(slaveInterp, TCL_LIMIT_TIME)) { Tcl_Time limitMoment; Tcl_LimitGetTime(slaveInterp, &limitMoment); - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[2], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[2], TCL_STRLEN), Tcl_NewLongObj(limitMoment.usec/1000)); - Tcl_DictObjPut(NULL, dictPtr, Tcl_NewStringObj(options[3], -1), + Tcl_DictObjPut(NULL, dictPtr, + Tcl_NewStringObj(options[3], TCL_STRLEN), Tcl_NewLongObj(limitMoment.sec)); } else { Tcl_Obj *empty; TclNewObj(empty); Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[2], -1), empty); + Tcl_NewStringObj(options[2], TCL_STRLEN), empty); Tcl_DictObjPut(NULL, dictPtr, - Tcl_NewStringObj(options[3], -1), empty); + Tcl_NewStringObj(options[3], TCL_STRLEN), empty); } Tcl_SetObjResult(interp, dictPtr); return TCL_OK; @@ -4662,7 +4671,7 @@ SlaveTimeLimitCmd( } if (gran < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "granularity must be at least 1", -1)); + "granularity must be at least 1", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADVALUE", NULL); return TCL_ERROR; @@ -4679,7 +4688,7 @@ SlaveTimeLimitCmd( } if (tmp < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "milliseconds must be at least 0", -1)); + "milliseconds must be at least 0", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADVALUE", NULL); return TCL_ERROR; @@ -4697,7 +4706,7 @@ SlaveTimeLimitCmd( } if (tmp < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "seconds must be at least 0", -1)); + "seconds must be at least 0", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADVALUE", NULL); return TCL_ERROR; @@ -4716,7 +4725,7 @@ SlaveTimeLimitCmd( if (secObj != NULL && secLen == 0 && milliLen > 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may only set -milliseconds if -seconds is not " - "also being reset", -1)); + "also being reset", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADUSAGE", NULL); return TCL_ERROR; @@ -4724,7 +4733,7 @@ SlaveTimeLimitCmd( if (milliLen == 0 && (secObj == NULL || secLen > 0)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "may only reset -milliseconds if -seconds is " - "also being reset", -1)); + "also being reset", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "INTERP", "BADUSAGE", NULL); return TCL_ERROR; diff --git a/generic/tclLink.c b/generic/tclLink.c index cb16571..082f6bb 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -122,7 +122,7 @@ Tcl_LinkVar( linkPtr = ckalloc(sizeof(Link)); linkPtr->interp = interp; - linkPtr->varName = Tcl_NewStringObj(varName, -1); + linkPtr->varName = Tcl_NewStringObj(varName, TCL_STRLEN); Tcl_IncrRefCount(linkPtr->varName); linkPtr->addr = addr; linkPtr->type = type & ~TCL_LINK_READ_ONLY; @@ -614,7 +614,7 @@ ObjValue( TclNewLiteralStringObj(resultObj, "NULL"); return resultObj; } - return Tcl_NewStringObj(p, -1); + return Tcl_NewStringObj(p, TCL_STRLEN); /* * This code only gets executed if the link type is unknown (shouldn't diff --git a/generic/tclLoad.c b/generic/tclLoad.c index 5666c81..f4fd32e 100644 --- a/generic/tclLoad.c +++ b/generic/tclLoad.c @@ -183,7 +183,7 @@ Tcl_LoadObjCmd( } if ((fullFileName[0] == 0) && (packageName == NULL)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "must specify either file name or package name", -1)); + "must specify either file name or package name", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "LOAD", "NOLIBRARY", NULL); code = TCL_ERROR; @@ -606,7 +606,7 @@ Tcl_UnloadObjCmd( } if ((fullFileName[0] == 0) && (packageName == NULL)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "must specify either file name or package name", -1)); + "must specify either file name or package name", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OPERATION", "UNLOAD", "NOLIBRARY", NULL); code = TCL_ERROR; @@ -1053,8 +1053,8 @@ TclGetLoadedPackages( Tcl_MutexLock(&packageMutex); for (pkgPtr = firstPackagePtr; pkgPtr != NULL; pkgPtr = pkgPtr->nextPtr) { - pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, -1); - pkgDesc[1] = Tcl_NewStringObj(pkgPtr->packageName, -1); + pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, TCL_STRLEN); + pkgDesc[1] = Tcl_NewStringObj(pkgPtr->packageName, TCL_STRLEN); Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewListObj(2, pkgDesc)); } @@ -1076,8 +1076,8 @@ TclGetLoadedPackages( resultObj = Tcl_NewObj(); for (; ipPtr != NULL; ipPtr = ipPtr->nextPtr) { pkgPtr = ipPtr->pkgPtr; - pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, -1); - pkgDesc[1] = Tcl_NewStringObj(pkgPtr->packageName, -1); + pkgDesc[0] = Tcl_NewStringObj(pkgPtr->fileName, TCL_STRLEN); + pkgDesc[1] = Tcl_NewStringObj(pkgPtr->packageName, TCL_STRLEN); Tcl_ListObjAppendElement(NULL, resultObj, Tcl_NewListObj(2, pkgDesc)); } Tcl_SetObjResult(interp, resultObj); diff --git a/generic/tclLoadNone.c b/generic/tclLoadNone.c index f030d89..05d5f04 100644 --- a/generic/tclLoadNone.c +++ b/generic/tclLoadNone.c @@ -47,7 +47,7 @@ TclpDlopen( { Tcl_SetObjResult(interp, Tcl_NewStringObj( "dynamic loading is not currently available on this system", - -1)); + TCL_STRLEN)); return TCL_ERROR; } diff --git a/generic/tclOO.c b/generic/tclOO.c index 2bec1d6..d6b8706 100644 --- a/generic/tclOO.c +++ b/generic/tclOO.c @@ -415,7 +415,7 @@ InitFoundation( TclNewLiteralStringObj(argsPtr, "originObject"); Tcl_IncrRefCount(argsPtr); - bodyPtr = Tcl_NewStringObj(clonedBody, -1); + bodyPtr = Tcl_NewStringObj(clonedBody, TCL_STRLEN); TclOONewProcMethod(interp, fPtr->objectCls, 0, fPtr->clonedName, argsPtr, bodyPtr, NULL); TclDecrRefCount(argsPtr); @@ -1653,7 +1653,7 @@ Tcl_NewObjectInstance( if (result != TCL_ERROR && Deleted(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "object deleted in constructor", -1)); + "object deleted in constructor", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OO", "STILLBORN", NULL); result = TCL_ERROR; } @@ -1800,7 +1800,7 @@ FinalizeAlloc( if (result != TCL_ERROR && Deleted(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "object deleted in constructor", -1)); + "object deleted in constructor", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OO", "STILLBORN", NULL); result = TCL_ERROR; } @@ -1858,7 +1858,7 @@ Tcl_CopyObjectInstance( if (IsRootClass(oPtr)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "may not clone the class of classes", -1)); + "may not clone the class of classes", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "OO", "CLONING_CLASS", NULL); return NULL; } @@ -2566,7 +2566,7 @@ TclOOObjectCmdCore( } if (contextPtr->index >= contextPtr->callPtr->numChain) { Tcl_SetObjResult(interp, Tcl_NewStringObj( - "no valid method implementation", -1)); + "no valid method implementation", TCL_STRLEN)); Tcl_SetErrorCode(interp, "TCL", "LOOKUP", "METHOD", TclGetString(methodNamePtr), NULL); TclOODeleteContext(contextPtr); diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index 1bb2dc0..126657b 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -1427,11 +1427,11 @@ TclOORenderCallChain( * Allocate the literals (potentially) used in our description. */ - filterLiteral = Tcl_NewStringObj("filter", -1); + filterLiteral = Tcl_NewStringObj("filter", TCL_STRLEN); Tcl_IncrRefCount(filterLiteral); - methodLiteral = Tcl_NewStringObj("method", -1); + methodLiteral = Tcl_NewStringObj("method", TCL_STRLEN); Tcl_IncrRefCount(methodLiteral); - objectLiteral = Tcl_NewStringObj("object", -1); + objectLiteral = Tcl_NewStringObj("object", TCL_STRLEN); Tcl_IncrRefCount(objectLiteral); /* @@ -1464,7 +1464,8 @@ TclOORenderCallChain( ? Tcl_GetObjectName(interp, (Tcl_Object) miPtr->mPtr->declaringClassPtr->thisPtr) : objectLiteral; - descObjs[3] = Tcl_NewStringObj(miPtr->mPtr->typePtr->name, -1); + descObjs[3] = Tcl_NewStringObj(miPtr->mPtr->typePtr->name, + TCL_STRLEN); objv[i] = Tcl_NewListObj(4, descObjs); } -- cgit v0.12