diff options
47 files changed, 290 insertions, 298 deletions
diff --git a/generic/tcl.decls b/generic/tcl.decls index 873e45c..06e2b89 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -186,7 +186,7 @@ declare 44 { Tcl_Obj *objPtr) } declare 45 { - int TclListObjGetElements_(Tcl_Interp *interp, Tcl_Obj *listPtr, + int TclListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr) } declare 46 { @@ -194,7 +194,7 @@ declare 46 { Tcl_Obj **objPtrPtr) } declare 47 { - int TclListObjLength_(Tcl_Interp *interp, Tcl_Obj *listPtr, + int TclListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr) } declare 48 { @@ -879,12 +879,12 @@ declare 241 { void Tcl_SourceRCFile(Tcl_Interp *interp) } declare 242 { - int TclSplitList_(Tcl_Interp *interp, const char *listStr, int *argcPtr, + int TclSplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr) } # Obsolete, use Tcl_FSSplitPath declare 243 { - void TclSplitPath_(const char *path, int *argcPtr, const char ***argvPtr) + void TclSplitPath(const char *path, int *argcPtr, const char ***argvPtr) } # Removed in 9.0 (stub entry only) #declare 244 { @@ -1700,7 +1700,7 @@ declare 460 { Tcl_Obj *Tcl_FSJoinPath(Tcl_Obj *listObj, size_t elements) } declare 461 { - Tcl_Obj *TclFSSplitPath_(Tcl_Obj *pathPtr, int *lenPtr) + Tcl_Obj *TclFSSplitPath(Tcl_Obj *pathPtr, int *lenPtr) } declare 462 { int Tcl_FSEqualPaths(Tcl_Obj *firstPtr, Tcl_Obj *secondPtr) @@ -1839,7 +1839,7 @@ declare 496 { Tcl_Obj *keyPtr) } declare 497 { - int TclDictObjSize_(Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr) + int TclDictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr) } declare 498 { int Tcl_DictObjFirst(Tcl_Interp *interp, Tcl_Obj *dictPtr, @@ -2267,7 +2267,7 @@ declare 603 { # TIP#265 (option parser) dkf for Sam Bromley declare 604 { - int TclParseArgsObjv_(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, + int TclParseArgsObjv(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv) } diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c index 4a76595..609958b 100644 --- a/generic/tclAssembly.c +++ b/generic/tclAssembly.c @@ -1983,7 +1983,7 @@ CreateMirrorJumpTable( * table. */ size_t i; - if (TclListObjGetElements(interp, jumps, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, jumps, &objc, &objv) != TCL_OK) { return TCL_ERROR; } if (objc % 2 != 0) { diff --git a/generic/tclBasic.c b/generic/tclBasic.c index a43bca0..2dc8e5f 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -4703,7 +4703,7 @@ TEOV_NotFound( * itself. */ - TclListObjGetElements(NULL, currNsPtr->unknownHandlerPtr, + TclListObjGetElementsM(NULL, currNsPtr->unknownHandlerPtr, &handlerObjc, &handlerObjv); newObjc = objc + handlerObjc; newObjv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * newObjc); @@ -5211,7 +5211,7 @@ TclEvalEx( if (tokenPtr->type == TCL_TOKEN_EXPAND_WORD) { size_t numElements; - code = TclListObjLength(interp, objv[objectsUsed], + code = TclListObjLengthM(interp, objv[objectsUsed], &numElements); if (code == TCL_ERROR) { /* @@ -5263,7 +5263,7 @@ TclEvalEx( size_t numElements; Tcl_Obj **elements, *temp = copy[wordIdx]; - TclListObjGetElements(NULL, temp, &numElements, + TclListObjGetElementsM(NULL, temp, &numElements, &elements); objectsUsed += numElements; while (numElements--) { @@ -6026,7 +6026,7 @@ TclNREvalObjEx( TclNRAddCallback(interp, TEOEx_ListCallback, listPtr, eoFramePtr, objPtr, NULL); - TclListObjGetElements(NULL, listPtr, &objc, &objv); + TclListObjGetElementsM(NULL, listPtr, &objc, &objv); return TclNREvalObjv(interp, objc, objv, flags, NULL); } @@ -8629,7 +8629,7 @@ TclNRTailcallEval( size_t objc; Tcl_Obj **objv; - TclListObjGetElements(interp, listPtr, &objc, &objv); + TclListObjGetElementsM(interp, listPtr, &objc, &objv); nsObjPtr = objv[0]; if (result == TCL_OK) { @@ -9057,7 +9057,7 @@ TclNREvalList( TclMarkTailcall(interp); TclNRAddCallback(interp, TclNRReleaseValues, listPtr, NULL, NULL,NULL); - TclListObjGetElements(NULL, listPtr, &objc, &objv); + TclListObjGetElementsM(NULL, listPtr, &objc, &objv); return TclNREvalObjv(interp, objc, objv, 0, NULL); } @@ -9343,7 +9343,7 @@ InjectHandler( TclMarkTailcall(interp); TclNRAddCallback(interp, InjectHandlerPostCall, corPtr, listPtr, INT2PTR(nargs), isProbe); - TclListObjGetElements(NULL, listPtr, &objc, &objv); + TclListObjGetElementsM(NULL, listPtr, &objc, &objv); return TclNREvalObjv(interp, objc, objv, 0, NULL); } diff --git a/generic/tclBinary.c b/generic/tclBinary.c index ebc0ffb..a45e4b2 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -1015,7 +1015,7 @@ BinaryFormatCmd( * The macro evals its args more than once: avoid arg++ */ - if (TclListObjGetElements(interp, objv[arg], &listc, + if (TclListObjGetElementsM(interp, objv[arg], &listc, &listv) != TCL_OK) { return TCL_ERROR; } @@ -1299,7 +1299,7 @@ BinaryFormatCmd( listc = 1; count = 1; } else { - TclListObjGetElements(interp, objv[arg], &listc, &listv); + TclListObjGetElementsM(interp, objv[arg], &listc, &listv); if (count == BINARY_ALL) { count = listc; } diff --git a/generic/tclClock.c b/generic/tclClock.c index c021a31..2175ed9 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -754,7 +754,7 @@ ConvertLocalToUTC( * Unpack the tz data. */ - if (TclListObjGetElements(interp, tzdata, &rowc, &rowv) != TCL_OK) { + if (TclListObjGetElementsM(interp, tzdata, &rowc, &rowv) != TCL_OK) { return TCL_ERROR; } @@ -819,7 +819,7 @@ ConvertLocalToUTCUsingTable( while (!found) { row = LookupLastTransition(interp, fields->seconds, rowc, rowv); if ((row == NULL) - || TclListObjGetElements(interp, row, &cellc, + || TclListObjGetElementsM(interp, row, &cellc, &cellv) != TCL_OK || TclGetIntFromObj(interp, cellv[1], &fields->tzOffset) != TCL_OK) { @@ -957,7 +957,7 @@ ConvertUTCToLocal( * Unpack the tz data. */ - if (TclListObjGetElements(interp, tzdata, &rowc, &rowv) != TCL_OK) { + if (TclListObjGetElementsM(interp, tzdata, &rowc, &rowv) != TCL_OK) { return TCL_ERROR; } @@ -1009,7 +1009,7 @@ ConvertUTCToLocalUsingTable( row = LookupLastTransition(interp, fields->seconds, rowc, rowv); if (row == NULL || - TclListObjGetElements(interp, row, &cellc, &cellv) != TCL_OK || + TclListObjGetElementsM(interp, row, &cellc, &cellv) != TCL_OK || TclGetIntFromObj(interp, cellv[1], &fields->tzOffset) != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 1243d21..54bce1c 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -2593,7 +2593,7 @@ EachloopCmd( result = TCL_ERROR; goto done; } - TclListObjGetElements(NULL, statePtr->vCopyList[i], + TclListObjGetElementsM(NULL, statePtr->vCopyList[i], &statePtr->varcList[i], &statePtr->varvList[i]); if (statePtr->varcList[i] < 1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -2611,7 +2611,7 @@ EachloopCmd( result = TCL_ERROR; goto done; } - TclListObjGetElements(NULL, statePtr->aCopyList[i], + TclListObjGetElementsM(NULL, statePtr->aCopyList[i], &statePtr->argcList[i], &statePtr->argvList[i]); j = statePtr->argcList[i] / statePtr->varcList[i]; diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c index 3cfabf0..40755cb 100644 --- a/generic/tclCmdIL.c +++ b/generic/tclCmdIL.c @@ -2193,7 +2193,7 @@ Tcl_JoinObjCmd( * pointer to its array of element pointers. */ - if (TclListObjGetElements(interp, objv[1], &listLen, + if (TclListObjGetElementsM(interp, objv[1], &listLen, &elemPtrs) != TCL_OK) { return TCL_ERROR; } @@ -2280,7 +2280,7 @@ Tcl_LassignObjCmd( return TCL_ERROR; } - TclListObjGetElements(NULL, listCopyPtr, &listObjc, &listObjv); + TclListObjGetElementsM(NULL, listCopyPtr, &listObjc, &listObjv); objc -= 2; objv += 2; @@ -2406,7 +2406,7 @@ Tcl_LinsertObjCmd( return TCL_ERROR; } - result = TclListObjLength(interp, objv[1], &len); + result = TclListObjLengthM(interp, objv[1], &len); if (result != TCL_OK) { return result; } @@ -2525,7 +2525,7 @@ Tcl_LlengthObjCmd( return TCL_ERROR; } - result = TclListObjLength(interp, objv[1], &listLen); + result = TclListObjLengthM(interp, objv[1], &listLen); if (result != TCL_OK) { return result; } @@ -2579,7 +2579,7 @@ Tcl_LpopObjCmd( return TCL_ERROR; } - result = TclListObjGetElements(interp, listPtr, &listLen, &elemPtrs); + result = TclListObjGetElementsM(interp, listPtr, &listLen, &elemPtrs); if (result != TCL_OK) { return result; } @@ -2674,7 +2674,7 @@ Tcl_LrangeObjCmd( return TCL_ERROR; } - result = TclListObjLength(interp, objv[1], &listLen); + result = TclListObjLengthM(interp, objv[1], &listLen); if (result != TCL_OK) { return result; } @@ -2748,7 +2748,7 @@ Tcl_LremoveObjCmd( } listObj = objv[1]; - if (TclListObjLength(interp, listObj, &listLen) != TCL_OK) { + if (TclListObjLengthM(interp, listObj, &listLen) != TCL_OK) { return TCL_ERROR; } @@ -2972,7 +2972,7 @@ Tcl_LreplaceObjCmd( return TCL_ERROR; } - result = TclListObjLength(interp, objv[1], &listLen); + result = TclListObjLengthM(interp, objv[1], &listLen); if (result != TCL_OK) { return result; } @@ -3070,7 +3070,7 @@ Tcl_LreverseObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "list"); return TCL_ERROR; } - if (TclListObjGetElements(interp, objv[1], &elemc, &elemv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objv[1], &elemc, &elemv) != TCL_OK) { return TCL_ERROR; } @@ -3343,7 +3343,7 @@ Tcl_LsearchObjCmd( */ i++; - if (TclListObjGetElements(interp, objv[i], + if (TclListObjGetElementsM(interp, objv[i], &sortInfo.indexc, &indices) != TCL_OK) { result = TCL_ERROR; goto done; @@ -3449,7 +3449,7 @@ Tcl_LsearchObjCmd( * pointer to its array of element pointers. */ - result = TclListObjGetElements(interp, objv[objc - 2], &listc, &listv); + result = TclListObjGetElementsM(interp, objv[objc - 2], &listc, &listv); if (result != TCL_OK) { goto done; } @@ -3554,7 +3554,7 @@ Tcl_LsearchObjCmd( * 1844789] */ - TclListObjGetElements(NULL, objv[objc - 2], &listc, &listv); + TclListObjGetElementsM(NULL, objv[objc - 2], &listc, &listv); break; case REAL: result = Tcl_GetDoubleFromObj(interp, patObj, &patDouble); @@ -3567,7 +3567,7 @@ Tcl_LsearchObjCmd( * 1844789] */ - TclListObjGetElements(NULL, objv[objc - 2], &listc, &listv); + TclListObjGetElementsM(NULL, objv[objc - 2], &listc, &listv); break; } } else { @@ -4082,7 +4082,7 @@ Tcl_LsortObjCmd( sortInfo.resultCode = TCL_ERROR; goto done; } - if (TclListObjGetElements(interp, objv[i+1], &sortindex, + if (TclListObjGetElementsM(interp, objv[i+1], &sortindex, &indexv) != TCL_OK) { sortInfo.resultCode = TCL_ERROR; goto done; @@ -4175,7 +4175,7 @@ Tcl_LsortObjCmd( if (indexPtr) { Tcl_Obj **indexv; - TclListObjGetElements(interp, indexPtr, &sortInfo.indexc, &indexv); + TclListObjGetElementsM(interp, indexPtr, &sortInfo.indexc, &indexv); switch (sortInfo.indexc) { case 0: sortInfo.indexv = NULL; @@ -4235,7 +4235,7 @@ Tcl_LsortObjCmd( sortInfo.compareCmdPtr = newCommandPtr; } - sortInfo.resultCode = TclListObjGetElements(interp, listObj, + sortInfo.resultCode = TclListObjGetElementsM(interp, listObj, &length, &listObjPtrs); if (sortInfo.resultCode != TCL_OK || length <= 0) { goto done; @@ -4652,10 +4652,10 @@ SortCompare( * Replace them and evaluate the result. */ - TclListObjLength(infoPtr->interp, infoPtr->compareCmdPtr, &objc); + TclListObjLengthM(infoPtr->interp, infoPtr->compareCmdPtr, &objc); Tcl_ListObjReplace(infoPtr->interp, infoPtr->compareCmdPtr, objc - 2, 2, 2, paramObjv); - TclListObjGetElements(infoPtr->interp, infoPtr->compareCmdPtr, + TclListObjGetElementsM(infoPtr->interp, infoPtr->compareCmdPtr, &objc, &objv); infoPtr->resultCode = Tcl_EvalObjv(infoPtr->interp, objc, objv, 0); @@ -4866,7 +4866,7 @@ SelectObjFromSublist( int index; Tcl_Obj *currentObj; - if (TclListObjLength(infoPtr->interp, objPtr, &listLen) != TCL_OK) { + if (TclListObjLengthM(infoPtr->interp, objPtr, &listLen) != TCL_OK) { infoPtr->resultCode = TCL_ERROR; return NULL; } diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 78d3936..a22231c 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -673,7 +673,7 @@ Tcl_RegsubObjCmd( * object. (If they aren't, that's cheap to do.) */ - if (TclListObjLength(interp, objv[2], &numParts) != TCL_OK) { + if (TclListObjLengthM(interp, objv[2], &numParts) != TCL_OK) { return TCL_ERROR; } if (numParts < 1) { @@ -775,7 +775,7 @@ Tcl_RegsubObjCmd( Tcl_Obj **args = NULL, **parts; size_t numArgs; - TclListObjGetElements(interp, subPtr, &numParts, &parts); + TclListObjGetElementsM(interp, subPtr, &numParts, &parts); numArgs = numParts + info.nsubs + 1; args = (Tcl_Obj **)Tcl_Alloc(sizeof(Tcl_Obj*) * numArgs); memcpy(args, parts, sizeof(Tcl_Obj*) * numParts); @@ -1809,7 +1809,7 @@ StringIsCmd( * well-formed lists. */ - if (TCL_OK == TclListObjLength(NULL, objPtr, &length3)) { + if (TCL_OK == TclListObjLengthM(NULL, objPtr, &length3)) { break; } @@ -2026,7 +2026,7 @@ StringMapCmd( Tcl_DictObjDone(&search); } else { size_t i; - if (TclListObjGetElements(interp, objv[objc-2], &i, + if (TclListObjGetElementsM(interp, objv[objc-2], &i, &mapElemv) != TCL_OK) { return TCL_ERROR; } @@ -3577,7 +3577,7 @@ TclNRSwitchObjCmd( size_t listc; blist = objv[0]; - if (TclListObjGetElements(interp, objv[0], &listc, &listv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objv[0], &listc, &listv) != TCL_OK) { return TCL_ERROR; } @@ -3963,7 +3963,7 @@ Tcl_ThrowObjCmd( * The type must be a list of at least length 1. */ - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { return TCL_ERROR; } else if (len < 1) { Tcl_SetObjResult(interp, Tcl_NewStringObj( @@ -4752,7 +4752,7 @@ TclNRTryObjCmd( return TCL_ERROR; } code = 1; - if (TclListObjLength(NULL, objv[i+1], &dummy) != TCL_OK) { + if (TclListObjLengthM(NULL, objv[i+1], &dummy) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad prefix '%s': must be a list", TclGetString(objv[i+1]))); @@ -4764,7 +4764,7 @@ TclNRTryObjCmd( info[2] = objv[i+1]; commonHandler: - if (TclListObjLength(interp, objv[i+2], &dummy) != TCL_OK) { + if (TclListObjLengthM(interp, objv[i+2], &dummy) != TCL_OK) { Tcl_DecrRefCount(handlersObj); return TCL_ERROR; } @@ -4914,12 +4914,12 @@ TryPostBody( int found = 0; Tcl_Obj **handlers, **info; - TclListObjGetElements(NULL, handlersObj, &numHandlers, &handlers); + TclListObjGetElementsM(NULL, handlersObj, &numHandlers, &handlers); for (i=0 ; i<numHandlers ; i++) { Tcl_Obj *handlerBodyObj; size_t numElems = 0; - TclListObjGetElements(NULL, handlers[i], &numElems, &info); + TclListObjGetElementsM(NULL, handlers[i], &numElems, &info); if (!found) { Tcl_GetIntFromObj(NULL, info[1], &code); if (code != result) { @@ -4940,8 +4940,8 @@ TryPostBody( TclNewLiteralStringObj(errorCodeName, "-errorcode"); Tcl_DictObjGet(NULL, options, errorCodeName, &errcode); Tcl_DecrRefCount(errorCodeName); - TclListObjGetElements(NULL, info[2], &len1, &bits1); - if (TclListObjGetElements(NULL, errcode, &len2, + TclListObjGetElementsM(NULL, info[2], &len1, &bits1); + if (TclListObjGetElementsM(NULL, errcode, &len2, &bits2) != TCL_OK) { continue; } @@ -4981,7 +4981,7 @@ TryPostBody( Tcl_ResetResult(interp); result = TCL_ERROR; - TclListObjLength(NULL, info[3], &numElems); + TclListObjLengthM(NULL, info[3], &numElems); if (numElems> 0) { Tcl_Obj *varName; diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 4cc6a81..9b21ae8 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -302,7 +302,7 @@ TclCompileArraySetCmd( TclNewObj(literalObj); isDataLiteral = TclWordKnownAtCompileTime(dataTokenPtr, literalObj); isDataValid = (isDataLiteral - && TclListObjLength(NULL, literalObj, &len) == TCL_OK); + && TclListObjLengthM(NULL, literalObj, &len) == TCL_OK); isDataEven = (isDataValid && (len & 1) == 0); /* @@ -893,7 +893,7 @@ TclCompileConcatCmd( const char *bytes; size_t len, slen; - TclListObjGetElements(NULL, listObj, &len, &objs); + TclListObjGetElementsM(NULL, listObj, &len, &objs); objPtr = Tcl_ConcatObj(len, objs); Tcl_DecrRefCount(listObj); bytes = Tcl_GetStringFromObj(objPtr, &slen); @@ -2755,7 +2755,7 @@ CompileEachloopCmd( */ if (!TclWordKnownAtCompileTime(tokenPtr, varListObj) || - TCL_OK != TclListObjLength(NULL, varListObj, &numVars) || + TCL_OK != TclListObjLengthM(NULL, varListObj, &numVars) || numVars == 0) { code = TCL_ERROR; goto done; diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c index 39c03d0..4be8a37 100644 --- a/generic/tclCompCmdsSZ.c +++ b/generic/tclCompCmdsSZ.c @@ -943,7 +943,7 @@ TclCompileStringMapCmd( if (!TclWordKnownAtCompileTime(mapTokenPtr, mapObj)) { Tcl_DecrRefCount(mapObj); return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr); - } else if (TclListObjGetElements(NULL, mapObj, &len, &objv) != TCL_OK) { + } else if (TclListObjGetElementsM(NULL, mapObj, &len, &objv) != TCL_OK) { Tcl_DecrRefCount(mapObj); return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr); } else if (len != 2) { @@ -2739,7 +2739,7 @@ TclCompileThrowCmd( CompileWord(envPtr, msgToken, interp, 2); codeIsList = codeKnown && (TCL_OK == - TclListObjLength(interp, objPtr, &len)); + TclListObjLengthM(interp, objPtr, &len)); codeIsValid = codeIsList && (len != 0); if (codeIsValid) { @@ -2872,7 +2872,7 @@ TclCompileTryCmd( TclNewObj(tmpObj); Tcl_IncrRefCount(tmpObj); if (!TclWordKnownAtCompileTime(tokenPtr, tmpObj) - || TclListObjLength(NULL, tmpObj, &objc) != TCL_OK + || TclListObjLengthM(NULL, tmpObj, &objc) != TCL_OK || (objc == 0)) { TclDecrRefCount(tmpObj); goto failedToCompile; @@ -2915,7 +2915,7 @@ TclCompileTryCmd( TclDecrRefCount(tmpObj); goto failedToCompile; } - if (TclListObjGetElements(NULL, tmpObj, &objc, &objv) != TCL_OK + if (TclListObjGetElementsM(NULL, tmpObj, &objc, &objv) != TCL_OK || (objc > 2)) { TclDecrRefCount(tmpObj); goto failedToCompile; @@ -3130,7 +3130,7 @@ IssueTryClausesInstructions( JUMP4( JUMP_FALSE, notCodeJumpSource); if (matchClauses[i]) { const char *p; - TclListObjLength(NULL, matchClauses[i], &len); + TclListObjLengthM(NULL, matchClauses[i], &len); /* * Match the errorcode according to try/trap rules. @@ -3342,7 +3342,7 @@ IssueTryClausesFinallyInstructions( OP( EQ); JUMP4( JUMP_FALSE, notCodeJumpSource); if (matchClauses[i]) { - TclListObjLength(NULL, matchClauses[i], &len); + TclListObjLengthM(NULL, matchClauses[i], &len); /* * Match the errorcode according to try/trap rules. diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 830d24e..fbd59d8 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -2226,8 +2226,8 @@ TclCompileExpr( TclAdvanceLines(&envPtr->line, script, script + TclParseAllWhiteSpace(script, numBytes)); - TclListObjGetElements(NULL, litList, &objc, (Tcl_Obj ***)&litObjv); - TclListObjGetElements(NULL, funcList, &objc, &funcObjv); + TclListObjGetElementsM(NULL, litList, &objc, (Tcl_Obj ***)&litObjv); + TclListObjGetElementsM(NULL, funcList, &objc, &funcObjv); CompileExprTree(interp, opTree, 0, &litObjv, funcObjv, parsePtr->tokenPtr, envPtr, optimize); } else { diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 4a3817e..fdee1be 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -165,7 +165,7 @@ EXTERN int Tcl_ListObjAppendList(Tcl_Interp *interp, EXTERN int Tcl_ListObjAppendElement(Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr); /* 45 */ -EXTERN int TclListObjGetElements_(Tcl_Interp *interp, +EXTERN int TclListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr); /* 46 */ @@ -173,7 +173,7 @@ EXTERN int Tcl_ListObjIndex(Tcl_Interp *interp, Tcl_Obj *listPtr, size_t index, Tcl_Obj **objPtrPtr); /* 47 */ -EXTERN int TclListObjLength_(Tcl_Interp *interp, +EXTERN int TclListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 48 */ EXTERN int Tcl_ListObjReplace(Tcl_Interp *interp, @@ -661,11 +661,10 @@ EXTERN const char * Tcl_SignalMsg(int sig); /* 241 */ EXTERN void Tcl_SourceRCFile(Tcl_Interp *interp); /* 242 */ -EXTERN int TclSplitList_(Tcl_Interp *interp, - const char *listStr, int *argcPtr, - const char ***argvPtr); +EXTERN int TclSplitList(Tcl_Interp *interp, const char *listStr, + int *argcPtr, const char ***argvPtr); /* 243 */ -EXTERN void TclSplitPath_(const char *path, int *argcPtr, +EXTERN void TclSplitPath(const char *path, int *argcPtr, const char ***argvPtr); /* Slot 244 is reserved */ /* Slot 245 is reserved */ @@ -1205,7 +1204,7 @@ EXTERN int Tcl_FSConvertToPathType(Tcl_Interp *interp, /* 460 */ EXTERN Tcl_Obj * Tcl_FSJoinPath(Tcl_Obj *listObj, size_t elements); /* 461 */ -EXTERN Tcl_Obj * TclFSSplitPath_(Tcl_Obj *pathPtr, int *lenPtr); +EXTERN Tcl_Obj * TclFSSplitPath(Tcl_Obj *pathPtr, int *lenPtr); /* 462 */ EXTERN int Tcl_FSEqualPaths(Tcl_Obj *firstPtr, Tcl_Obj *secondPtr); @@ -1300,7 +1299,7 @@ EXTERN int Tcl_DictObjGet(Tcl_Interp *interp, Tcl_Obj *dictPtr, EXTERN int Tcl_DictObjRemove(Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr); /* 497 */ -EXTERN int TclDictObjSize_(Tcl_Interp *interp, Tcl_Obj *dictPtr, +EXTERN int TclDictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr); /* 498 */ EXTERN int Tcl_DictObjFirst(Tcl_Interp *interp, @@ -1606,7 +1605,7 @@ EXTERN int Tcl_SetEnsembleParameterList(Tcl_Interp *interp, EXTERN int Tcl_GetEnsembleParameterList(Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **paramListPtr); /* 604 */ -EXTERN int TclParseArgsObjv_(Tcl_Interp *interp, +EXTERN int TclParseArgsObjv(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 605 */ @@ -1864,9 +1863,9 @@ typedef struct TclStubs { void (*tcl_InvalidateStringRep) (Tcl_Obj *objPtr); /* 42 */ int (*tcl_ListObjAppendList) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *elemListPtr); /* 43 */ int (*tcl_ListObjAppendElement) (Tcl_Interp *interp, Tcl_Obj *listPtr, Tcl_Obj *objPtr); /* 44 */ - int (*tclListObjGetElements_) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr); /* 45 */ + int (*tclListObjGetElements) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr); /* 45 */ int (*tcl_ListObjIndex) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t index, Tcl_Obj **objPtrPtr); /* 46 */ - int (*tclListObjLength_) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 47 */ + int (*tclListObjLength) (Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr); /* 47 */ int (*tcl_ListObjReplace) (Tcl_Interp *interp, Tcl_Obj *listPtr, size_t first, size_t count, size_t objc, Tcl_Obj *const objv[]); /* 48 */ void (*reserved49)(void); Tcl_Obj * (*tcl_NewByteArrayObj) (const unsigned char *bytes, size_t numBytes); /* 50 */ @@ -2061,8 +2060,8 @@ typedef struct TclStubs { const char * (*tcl_SignalId) (int sig); /* 239 */ const char * (*tcl_SignalMsg) (int sig); /* 240 */ void (*tcl_SourceRCFile) (Tcl_Interp *interp); /* 241 */ - int (*tclSplitList_) (Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr); /* 242 */ - void (*tclSplitPath_) (const char *path, int *argcPtr, const char ***argvPtr); /* 243 */ + int (*tclSplitList) (Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr); /* 242 */ + void (*tclSplitPath) (const char *path, int *argcPtr, const char ***argvPtr); /* 243 */ void (*reserved244)(void); void (*reserved245)(void); void (*reserved246)(void); @@ -2280,7 +2279,7 @@ typedef struct TclStubs { int (*tcl_FSChdir) (Tcl_Obj *pathPtr); /* 458 */ int (*tcl_FSConvertToPathType) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 459 */ Tcl_Obj * (*tcl_FSJoinPath) (Tcl_Obj *listObj, size_t elements); /* 460 */ - Tcl_Obj * (*tclFSSplitPath_) (Tcl_Obj *pathPtr, int *lenPtr); /* 461 */ + Tcl_Obj * (*tclFSSplitPath) (Tcl_Obj *pathPtr, int *lenPtr); /* 461 */ int (*tcl_FSEqualPaths) (Tcl_Obj *firstPtr, Tcl_Obj *secondPtr); /* 462 */ Tcl_Obj * (*tcl_FSGetNormalizedPath) (Tcl_Interp *interp, Tcl_Obj *pathPtr); /* 463 */ Tcl_Obj * (*tcl_FSJoinToPath) (Tcl_Obj *pathPtr, size_t objc, Tcl_Obj *const objv[]); /* 464 */ @@ -2316,7 +2315,7 @@ typedef struct TclStubs { int (*tcl_DictObjPut) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, Tcl_Obj *valuePtr); /* 494 */ int (*tcl_DictObjGet) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr, Tcl_Obj **valuePtrPtr); /* 495 */ int (*tcl_DictObjRemove) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_Obj *keyPtr); /* 496 */ - int (*tclDictObjSize_) (Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr); /* 497 */ + int (*tclDictObjSize) (Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr); /* 497 */ int (*tcl_DictObjFirst) (Tcl_Interp *interp, Tcl_Obj *dictPtr, Tcl_DictSearch *searchPtr, Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); /* 498 */ void (*tcl_DictObjNext) (Tcl_DictSearch *searchPtr, Tcl_Obj **keyPtrPtr, Tcl_Obj **valuePtrPtr, int *donePtr); /* 499 */ void (*tcl_DictObjDone) (Tcl_DictSearch *searchPtr); /* 500 */ @@ -2423,7 +2422,7 @@ typedef struct TclStubs { unsigned (*tcl_GetBlockSizeFromStat) (const Tcl_StatBuf *statPtr); /* 601 */ int (*tcl_SetEnsembleParameterList) (Tcl_Interp *interp, Tcl_Command token, Tcl_Obj *paramList); /* 602 */ int (*tcl_GetEnsembleParameterList) (Tcl_Interp *interp, Tcl_Command token, Tcl_Obj **paramListPtr); /* 603 */ - int (*tclParseArgsObjv_) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 604 */ + int (*tclParseArgsObjv) (Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv); /* 604 */ int (*tcl_GetErrorLine) (Tcl_Interp *interp); /* 605 */ void (*tcl_SetErrorLine) (Tcl_Interp *interp, int lineNum); /* 606 */ void (*tcl_TransferResult) (Tcl_Interp *sourceInterp, int code, Tcl_Interp *targetInterp); /* 607 */ @@ -2594,12 +2593,12 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_ListObjAppendList) /* 43 */ #define Tcl_ListObjAppendElement \ (tclStubsPtr->tcl_ListObjAppendElement) /* 44 */ -#define TclListObjGetElements_ \ - (tclStubsPtr->tclListObjGetElements_) /* 45 */ +#define TclListObjGetElements \ + (tclStubsPtr->tclListObjGetElements) /* 45 */ #define Tcl_ListObjIndex \ (tclStubsPtr->tcl_ListObjIndex) /* 46 */ -#define TclListObjLength_ \ - (tclStubsPtr->tclListObjLength_) /* 47 */ +#define TclListObjLength \ + (tclStubsPtr->tclListObjLength) /* 47 */ #define Tcl_ListObjReplace \ (tclStubsPtr->tcl_ListObjReplace) /* 48 */ /* Slot 49 is reserved */ @@ -2963,10 +2962,10 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_SignalMsg) /* 240 */ #define Tcl_SourceRCFile \ (tclStubsPtr->tcl_SourceRCFile) /* 241 */ -#define TclSplitList_ \ - (tclStubsPtr->tclSplitList_) /* 242 */ -#define TclSplitPath_ \ - (tclStubsPtr->tclSplitPath_) /* 243 */ +#define TclSplitList \ + (tclStubsPtr->tclSplitList) /* 242 */ +#define TclSplitPath \ + (tclStubsPtr->tclSplitPath) /* 243 */ /* Slot 244 is reserved */ /* Slot 245 is reserved */ /* Slot 246 is reserved */ @@ -3368,8 +3367,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_FSConvertToPathType) /* 459 */ #define Tcl_FSJoinPath \ (tclStubsPtr->tcl_FSJoinPath) /* 460 */ -#define TclFSSplitPath_ \ - (tclStubsPtr->tclFSSplitPath_) /* 461 */ +#define TclFSSplitPath \ + (tclStubsPtr->tclFSSplitPath) /* 461 */ #define Tcl_FSEqualPaths \ (tclStubsPtr->tcl_FSEqualPaths) /* 462 */ #define Tcl_FSGetNormalizedPath \ @@ -3440,8 +3439,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_DictObjGet) /* 495 */ #define Tcl_DictObjRemove \ (tclStubsPtr->tcl_DictObjRemove) /* 496 */ -#define TclDictObjSize_ \ - (tclStubsPtr->tclDictObjSize_) /* 497 */ +#define TclDictObjSize \ + (tclStubsPtr->tclDictObjSize) /* 497 */ #define Tcl_DictObjFirst \ (tclStubsPtr->tcl_DictObjFirst) /* 498 */ #define Tcl_DictObjNext \ @@ -3653,8 +3652,8 @@ extern const TclStubs *tclStubsPtr; (tclStubsPtr->tcl_SetEnsembleParameterList) /* 602 */ #define Tcl_GetEnsembleParameterList \ (tclStubsPtr->tcl_GetEnsembleParameterList) /* 603 */ -#define TclParseArgsObjv_ \ - (tclStubsPtr->tclParseArgsObjv_) /* 604 */ +#define TclParseArgsObjv \ + (tclStubsPtr->tclParseArgsObjv) /* 604 */ #define Tcl_GetErrorLine \ (tclStubsPtr->tcl_GetErrorLine) /* 605 */ #define Tcl_SetErrorLine \ @@ -4026,33 +4025,33 @@ extern const TclStubs *tclStubsPtr; ? (size_t (*)(wchar_t *))tclStubsPtr->tcl_UniCharLen \ : (size_t (*)(wchar_t *))Tcl_Char16Len) # undef Tcl_ListObjGetElements -# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) != sizeof(int) \ +# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_ListObjGetElements((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)) \ - : tclStubsPtr->tclListObjGetElements_((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr))) + : tclStubsPtr->tclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr))) # undef Tcl_ListObjLength -# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) != sizeof(int) \ +# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_ListObjLength((interp), (listPtr), (size_t *)(void *)(lengthPtr)) \ - : tclStubsPtr->tclListObjLength_((interp), (listPtr), (int *)(void *)(lengthPtr))) + : tclStubsPtr->tclListObjLength((interp), (listPtr), (int *)(void *)(lengthPtr))) # undef Tcl_DictObjSize -# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) != sizeof(int) \ +# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_DictObjSize((interp), (dictPtr), (size_t *)(void *)(sizePtr)) \ - : tclStubsPtr->tclDictObjSize_((interp), (dictPtr), (int *)(void *)(sizePtr))) + : tclStubsPtr->tclDictObjSize((interp), (dictPtr), (int *)(void *)(sizePtr))) # undef Tcl_SplitList -# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) != sizeof(int) \ +# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_SplitList((interp), (listStr), (size_t *)(void *)(argcPtr), (argvPtr)) \ - : tclStubsPtr->tclSplitList_((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr))) + : tclStubsPtr->tclSplitList((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr))) # undef Tcl_SplitPath -# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) != sizeof(int) \ +# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_SplitPath((path), (size_t *)(void *)(argcPtr), (argvPtr)) \ - : tclStubsPtr->tclSplitPath_((path), (int *)(void *)(argcPtr), (argvPtr))) + : tclStubsPtr->tclSplitPath((path), (int *)(void *)(argcPtr), (argvPtr))) # undef Tcl_FSSplitPath -# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) != sizeof(int) \ +# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_FSSplitPath((pathPtr), (size_t *)(void *)(lenPtr)) \ - : tclStubsPtr->tclFSSplitPath_((pathPtr), (int *)(void *)(lenPtr))) + : tclStubsPtr->tclFSSplitPath((pathPtr), (int *)(void *)(lenPtr))) # undef Tcl_ParseArgsObjv -# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) != sizeof(int) \ +# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(size_t) \ ? tclStubsPtr->tcl_ParseArgsObjv((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv)) \ - : tclStubsPtr->tclParseArgsObjv_((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv))) + : tclStubsPtr->tclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv))) #else # define Tcl_WCharToUtfDString (sizeof(wchar_t) != sizeof(short) \ ? (char *(*)(const wchar_t *, size_t, Tcl_DString *))Tcl_UniCharToUtfDString \ @@ -4066,27 +4065,27 @@ extern const TclStubs *tclStubsPtr; # define Tcl_WCharLen (sizeof(wchar_t) != sizeof(short) \ ? (size_t (*)(wchar_t *))Tcl_UniCharLen \ : (size_t (*)(wchar_t *))Tcl_Char16Len) -# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) != sizeof(int) \ +# define Tcl_ListObjGetElements(interp, listPtr, objcPtr, objvPtr) (sizeof(*(objcPtr)) == sizeof(size_t) \ ? (Tcl_ListObjGetElements)((interp), (listPtr), (size_t *)(void *)(objcPtr), (objvPtr)) \ - : TclListObjGetElements_((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr))) -# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) != sizeof(int) \ + : TclListObjGetElements((interp), (listPtr), (int *)(void *)(objcPtr), (objvPtr))) +# define Tcl_ListObjLength(interp, listPtr, lengthPtr) (sizeof(*(lengthPtr)) == sizeof(size_t) \ ? (Tcl_ListObjLength)((interp), (listPtr), (size_t *)(void *)(lengthPtr)) \ - : TclListObjLength_((interp), (listPtr), (int *)(void *)(lengthPtr))) -# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) != sizeof(int) \ + : TclListObjLength((interp), (listPtr), (int *)(void *)(lengthPtr))) +# define Tcl_DictObjSize(interp, dictPtr, sizePtr) (sizeof(*(sizePtr)) == sizeof(size_t) \ ? (Tcl_DictObjSize)((interp), (dictPtr), (size_t *)(void *)(sizePtr)) \ - : TclDictObjSize_((interp), (dictPtr), (int *)(void *)(sizePtr))) -# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) != sizeof(int) \ + : TclDictObjSize((interp), (dictPtr), (int *)(void *)(sizePtr))) +# define Tcl_SplitList(interp, listStr, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \ ? (Tcl_SplitList)((interp), (listStr), (size_t *)(void *)(argcPtr), (argvPtr)) \ - : TclSplitList_((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr))) -# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) != sizeof(int) \ + : TclSplitList((interp), (listStr), (int *)(void *)(argcPtr), (argvPtr))) +# define Tcl_SplitPath(path, argcPtr, argvPtr) (sizeof(*(argcPtr)) == sizeof(size_t) \ ? (Tcl_SplitPath)((path), (size_t *)(void *)(argcPtr), (argvPtr)) \ - : TclSplitPath_((path), (int *)(void *)(argcPtr), (argvPtr))) -# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) != sizeof(int) \ + : TclSplitPath((path), (int *)(void *)(argcPtr), (argvPtr))) +# define Tcl_FSSplitPath(pathPtr, lenPtr) (sizeof(*(lenPtr)) == sizeof(size_t) \ ? (Tcl_FSSplitPath)((pathPtr), (size_t *)(void *)(lenPtr)) \ - : TclFSSplitPath_((pathPtr), (int *)(void *)(lenPtr))) -# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) != sizeof(int) \ + : TclFSSplitPath((pathPtr), (int *)(void *)(lenPtr))) +# define Tcl_ParseArgsObjv(interp, argTable, objcPtr, objv, remObjv) (sizeof(*(objcPtr)) == sizeof(size_t) \ ? (Tcl_ParseArgsObjv)((interp), (argTable), (size_t *)(void *)(objcPtr), (objv), (remObjv)) \ - : TclParseArgsObjv_((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv))) + : TclParseArgsObjv((interp), (argTable), (int *)(void *)(objcPtr), (objv), (remObjv))) #endif /* diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index 1a076da..61299bd 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -606,7 +606,7 @@ SetDictFromAny( Tcl_Obj **objv; /* Cannot fail, we already know the Tcl_ObjType is "list". */ - TclListObjGetElements(NULL, objPtr, &objc, &objv); + TclListObjGetElementsM(NULL, objPtr, &objc, &objv); if (objc & 1) { goto missingValue; } @@ -2474,7 +2474,7 @@ DictForNRCmd( * Parse arguments. */ - if (TclListObjGetElements(interp, objv[1], &varc, &varv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objv[1], &varc, &varv) != TCL_OK) { return TCL_ERROR; } if (varc != 2) { @@ -2493,7 +2493,7 @@ DictForNRCmd( TclStackFree(interp, searchPtr); return TCL_OK; } - TclListObjGetElements(NULL, objv[1], &varc, &varv); + TclListObjGetElementsM(NULL, objv[1], &varc, &varv); keyVarObj = varv[0]; valueVarObj = varv[1]; scriptObj = objv[3]; @@ -2669,7 +2669,7 @@ DictMapNRCmd( * Parse arguments. */ - if (TclListObjGetElements(interp, objv[1], &varc, &varv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objv[1], &varc, &varv) != TCL_OK) { return TCL_ERROR; } if (varc != 2) { @@ -2695,7 +2695,7 @@ DictMapNRCmd( return TCL_OK; } TclNewObj(storagePtr->accumulatorObj); - TclListObjGetElements(NULL, objv[1], &varc, &varv); + TclListObjGetElementsM(NULL, objv[1], &varc, &varv); storagePtr->keyVarObj = varv[0]; storagePtr->valueVarObj = varv[1]; storagePtr->scriptObj = objv[3]; @@ -3109,7 +3109,7 @@ DictFilterCmd( * copying from the "dict for" implementation has occurred! */ - if (TclListObjGetElements(interp, objv[3], &varc, &varv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objv[3], &varc, &varv) != TCL_OK) { return TCL_ERROR; } if (varc != 2) { @@ -3371,7 +3371,7 @@ FinalizeDictUpdate( * an instruction to remove the key. */ - TclListObjGetElements(NULL, argsObj, &objc, &objv); + TclListObjGetElementsM(NULL, argsObj, &objc, &objv); for (i=0 ; i<objc ; i+=2) { objPtr = Tcl_ObjGetVar2(interp, objv[i+1], NULL, 0); if (objPtr == NULL) { @@ -3495,7 +3495,7 @@ FinalizeDictWith( state = Tcl_SaveInterpState(interp, result); if (pathPtr != NULL) { - TclListObjGetElements(NULL, pathPtr, &pathc, &pathv); + TclListObjGetElementsM(NULL, pathPtr, &pathc, &pathv); } else { pathc = 0; pathv = NULL; @@ -3701,7 +3701,7 @@ TclDictWithFinish( * Now process our updates on the leaf dictionary. */ - TclListObjGetElements(NULL, keysPtr, &keyc, &keyv); + TclListObjGetElementsM(NULL, keysPtr, &keyc, &keyv); for (i=0 ; i<keyc ; i++) { valPtr = Tcl_ObjGetVar2(interp, keyv[i], NULL, 0); if (valPtr == NULL) { diff --git a/generic/tclDisassemble.c b/generic/tclDisassemble.c index 205571f..6afd0e6 100644 --- a/generic/tclDisassemble.c +++ b/generic/tclDisassemble.c @@ -763,7 +763,7 @@ TclGetInnerContext( * Reset while keeping the list internalrep as much as possible. */ - TclListObjLength(interp, result, &len); + TclListObjLengthM(interp, result, &len); Tcl_ListObjReplace(interp, result, 0, len, 0, NULL); } Tcl_ListObjAppendElement(NULL, result, TclNewInstNameObj(*pc)); diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index c8c7215..4d7da25 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -370,7 +370,7 @@ Tcl_SetEncodingSearchPath( { size_t dummy; - if (TCL_ERROR == TclListObjLength(NULL, searchPath, &dummy)) { + if (TCL_ERROR == TclListObjLengthM(NULL, searchPath, &dummy)) { return TCL_ERROR; } TclSetProcessGlobalValue(&encodingSearchPath, searchPath, NULL); @@ -417,7 +417,7 @@ TclSetLibraryPath( { size_t dummy; - if (TCL_ERROR == TclListObjLength(NULL, path, &dummy)) { + if (TCL_ERROR == TclListObjLengthM(NULL, path, &dummy)) { return; } TclSetProcessGlobalValue(&libraryPath, path, NULL); @@ -456,7 +456,7 @@ FillEncodingFileMap(void) searchPath = Tcl_GetEncodingSearchPath(); Tcl_IncrRefCount(searchPath); - TclListObjLength(NULL, searchPath, &numDirs); + TclListObjLengthM(NULL, searchPath, &numDirs); map = Tcl_NewDictObj(); Tcl_IncrRefCount(map); @@ -480,7 +480,7 @@ FillEncodingFileMap(void) Tcl_FSMatchInDirectory(NULL, matchFileList, directory, "*.enc", &readableFiles); - TclListObjGetElements(NULL, matchFileList, &numFiles, &filev); + TclListObjGetElementsM(NULL, matchFileList, &numFiles, &filev); for (j=0; j<numFiles; j++) { Tcl_Obj *encodingName, *fileObj; @@ -1555,7 +1555,7 @@ OpenEncodingFileChannel( Tcl_Channel chan = NULL; size_t i, numDirs; - TclListObjGetElements(NULL, searchPath, &numDirs, &dir); + TclListObjGetElementsM(NULL, searchPath, &numDirs, &dir); Tcl_IncrRefCount(nameObj); Tcl_AppendToObj(fileNameObj, ".enc", -1); Tcl_IncrRefCount(fileNameObj); @@ -3940,7 +3940,7 @@ InitializeEncodingSearchPath( Tcl_IncrRefCount(searchPathObj); libPathObj = TclGetLibraryPath(); Tcl_IncrRefCount(libPathObj); - TclListObjLength(NULL, libPathObj, &numDirs); + TclListObjLengthM(NULL, libPathObj, &numDirs); for (i = 0; i < numDirs; i++) { Tcl_Obj *directoryObj, *pathObj; diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c index c8cffa2..15c2933 100644 --- a/generic/tclEnsemble.c +++ b/generic/tclEnsemble.c @@ -235,7 +235,7 @@ TclNamespaceEnsembleCmd( cxtPtr = nsPtr; continue; case CRT_SUBCMDS: - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { if (allocatedMapFlag) { Tcl_DecrRefCount(mapObj); } @@ -244,7 +244,7 @@ TclNamespaceEnsembleCmd( subcmdObj = (len > 0 ? objv[1] : NULL); continue; case CRT_PARAM: - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { if (allocatedMapFlag) { Tcl_DecrRefCount(mapObj); } @@ -274,7 +274,7 @@ TclNamespaceEnsembleCmd( Tcl_Obj **listv; const char *cmd; - if (TclListObjGetElements(interp, listObj, &len, + if (TclListObjGetElementsM(interp, listObj, &len, &listv) != TCL_OK) { Tcl_DictObjDone(&search); if (patchedDict) { @@ -339,7 +339,7 @@ TclNamespaceEnsembleCmd( } continue; case CRT_UNKNOWN: - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { if (allocatedMapFlag) { Tcl_DecrRefCount(mapObj); } @@ -537,13 +537,13 @@ TclNamespaceEnsembleCmd( } switch (idx) { case CONF_SUBCMDS: - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { goto freeMapAndError; } subcmdObj = (len > 0 ? objv[1] : NULL); continue; case CONF_PARAM: - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { goto freeMapAndError; } paramObj = (len > 0 ? objv[1] : NULL); @@ -565,7 +565,7 @@ TclNamespaceEnsembleCmd( continue; } do { - if (TclListObjGetElements(interp, listObj, &len, + if (TclListObjGetElementsM(interp, listObj, &len, &listv) != TCL_OK) { Tcl_DictObjDone(&search); if (patchedDict) { @@ -627,7 +627,7 @@ TclNamespaceEnsembleCmd( } continue; case CONF_UNKNOWN: - if (TclListObjLength(interp, objv[1], &len) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) { goto freeMapAndError; } unknownObj = (len > 0 ? objv[1] : NULL); @@ -796,7 +796,7 @@ Tcl_SetEnsembleSubcommandList( if (subcmdList != NULL) { size_t length; - if (TclListObjLength(interp, subcmdList, &length) != TCL_OK) { + if (TclListObjLengthM(interp, subcmdList, &length) != TCL_OK) { return TCL_ERROR; } if (length < 1) { @@ -872,7 +872,7 @@ Tcl_SetEnsembleParameterList( if (paramList == NULL) { length = 0; } else { - if (TclListObjLength(interp, paramList, &length) != TCL_OK) { + if (TclListObjLengthM(interp, paramList, &length) != TCL_OK) { return TCL_ERROR; } if (length < 1) { @@ -1048,7 +1048,7 @@ Tcl_SetEnsembleUnknownHandler( if (unknownList != NULL) { size_t length; - if (TclListObjLength(interp, unknownList, &length) != TCL_OK) { + if (TclListObjLengthM(interp, unknownList, &length) != TCL_OK) { return TCL_ERROR; } if (length < 1) { @@ -1892,7 +1892,7 @@ NsEnsembleImplementationCmdNR( Tcl_Obj **copyObjv; size_t copyObjc, prefixObjc; - TclListObjLength(NULL, prefixObj, &prefixObjc); + TclListObjLengthM(NULL, prefixObj, &prefixObjc); if (objc == 2) { copyPtr = TclListObjCopy(NULL, prefixObj); @@ -1926,7 +1926,7 @@ NsEnsembleImplementationCmdNR( */ TclSkipTailcall(interp); - TclListObjGetElements(NULL, copyPtr, ©Objc, ©Objv); + TclListObjGetElementsM(NULL, copyPtr, ©Objc, ©Objv); ((Interp *)interp)->lookupNsPtr = ensemblePtr->nsPtr; return TclNREvalObjv(interp, copyObjc, copyObjv, TCL_EVAL_INVOKE, NULL); } @@ -2302,7 +2302,7 @@ EnsembleUnknownCallback( for (i = 1 ; i < (size_t)objc ; i++) { Tcl_ListObjAppendElement(NULL, unknownCmd, objv[i]); } - TclListObjGetElements(NULL, unknownCmd, ¶mc, ¶mv); + TclListObjGetElementsM(NULL, unknownCmd, ¶mc, ¶mv); Tcl_IncrRefCount(unknownCmd); /* @@ -2339,7 +2339,7 @@ EnsembleUnknownCallback( /* A non-empty list is the replacement command. */ - if (TclListObjLength(interp, *prefixObjPtr, &prefixObjc) != TCL_OK) { + if (TclListObjLengthM(interp, *prefixObjPtr, &prefixObjc) != TCL_OK) { TclDecrRefCount(*prefixObjPtr); Tcl_AddErrorInfo(interp, "\n while parsing result of " "ensemble unknown subcommand handler"); @@ -2596,7 +2596,7 @@ BuildEnsembleConfig( * Determine the target for each. */ - TclListObjGetElements(NULL, subList, &subc, &subv); + TclListObjGetElementsM(NULL, subList, &subc, &subv); if (subList == mapDict) { /* * Unusual case where explicit list of subcommands is same value @@ -2993,7 +2993,7 @@ TclCompileEnsemble( const char *str; Tcl_Obj *matchObj = NULL; - if (TclListObjGetElements(NULL, listObj, &len, &elems) != TCL_OK) { + if (TclListObjGetElementsM(NULL, listObj, &len, &elems) != TCL_OK) { goto failed; } for (i=0 ; i<len ; i++) { @@ -3113,7 +3113,7 @@ TclCompileEnsemble( doneMapLookup: Tcl_ListObjAppendElement(NULL, replaced, replacement); - if (TclListObjGetElements(NULL, targetCmdObj, &len, &elems) != TCL_OK) { + if (TclListObjGetElementsM(NULL, targetCmdObj, &len, &elems) != TCL_OK) { goto failed; } else if (len != 1) { /* @@ -3397,7 +3397,7 @@ CompileToInvokedCommand( * difference. Hence the call to TclContinuationsEnterDerived... */ - TclListObjGetElements(NULL, replacements, &numWords, &words); + TclListObjGetElementsM(NULL, replacements, &numWords, &words); for (i = 0, tokPtr = parsePtr->tokenPtr; i < parsePtr->numWords; i++, tokPtr = TokenAfter(tokPtr)) { if (i > 0 && i <= numWords) { diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 02d4c8d..6445ca3 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -220,7 +220,7 @@ HandleBgErrors( errPtr = assocPtr->firstBgPtr; - TclListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv); + TclListObjGetElementsM(NULL, copyObj, &prefixObjc, &prefixObjv); tempObjv = (Tcl_Obj**)Tcl_Alloc((prefixObjc+2) * sizeof(Tcl_Obj *)); memcpy(tempObjv, prefixObjv, prefixObjc*sizeof(Tcl_Obj *)); tempObjv[prefixObjc] = errPtr->errorMsg; diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 98b7fb0..0a2297b 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2673,7 +2673,7 @@ TEBCresume( objPtr = OBJ_AT_TOS; TRACE(("\"%.30s\" => ", O2S(objPtr))); - if (TclListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objPtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -2883,7 +2883,7 @@ TEBCresume( TclMarkTailcall(interp); TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL); - TclListObjGetElements(NULL, objPtr, &objc, &objv); + TclListObjGetElementsM(NULL, objPtr, &objc, &objv); TclNRAddCallback(interp, TclNRReleaseValues, objPtr, NULL, NULL, NULL); return TclNREvalObjv(interp, objc, objv, TCL_EVAL_INVOKE, NULL); @@ -3295,7 +3295,7 @@ TEBCresume( varPtr = varPtr->value.linkPtr; } TRACE(("%u <- \"%.30s\" => ", opnd, O2S(valuePtr))); - if (TclListObjGetElements(interp, valuePtr, &objc, &objv) + if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; @@ -3321,7 +3321,7 @@ TEBCresume( } TRACE(("%u \"%.30s\" \"%.30s\" => ", opnd, O2S(part2Ptr), O2S(valuePtr))); - if (TclListObjGetElements(interp, valuePtr, &objc, &objv) + if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; @@ -3363,7 +3363,7 @@ TEBCresume( lappendListDirect: objResultPtr = varPtr->value.objPtr; - if (TclListObjLength(interp, objResultPtr, &len) != TCL_OK) { + if (TclListObjLengthM(interp, objResultPtr, &len) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -3384,7 +3384,7 @@ TEBCresume( lappendList: opnd = -1; - if (TclListObjGetElements(interp, valuePtr, &objc, &objv) + if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; @@ -3422,7 +3422,7 @@ TEBCresume( if (!objResultPtr) { valueToAssign = valuePtr; - } else if (TclListObjLength(interp, objResultPtr, &len)!=TCL_OK) { + } else if (TclListObjLengthM(interp, objResultPtr, &len)!=TCL_OK) { TRACE_ERROR(interp); goto gotError; } else { @@ -4638,7 +4638,7 @@ TEBCresume( case INST_LIST_LENGTH: TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS))); - if (TclListObjLength(interp, OBJ_AT_TOS, &length) != TCL_OK) { + if (TclListObjLengthM(interp, OBJ_AT_TOS, &length) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -4655,7 +4655,7 @@ TEBCresume( * Extract the desired list element. */ - if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK) + if ((TclListObjGetElementsM(interp, valuePtr, &objc, &objv) == TCL_OK) && !TclHasInternalRep(value2Ptr, &tclListType)) { int code; @@ -4700,7 +4700,7 @@ TEBCresume( * in the process. */ - if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -4839,7 +4839,7 @@ TEBCresume( * in the process. */ - if (TclListObjLength(interp, valuePtr, &objc) != TCL_OK) { + if (TclListObjLengthM(interp, valuePtr, &objc) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -4904,7 +4904,7 @@ TEBCresume( s1 = Tcl_GetStringFromObj(valuePtr, &s1len); TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr))); - if (TclListObjLength(interp, value2Ptr, &length) != TCL_OK) { + if (TclListObjLengthM(interp, value2Ptr, &length) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -6245,7 +6245,7 @@ TEBCresume( varListPtr = infoPtr->varLists[i]; numVars = varListPtr->numVars; listPtr = OBJ_AT_DEPTH(listTmpDepth); - if (TclListObjLength(interp, listPtr, &listLen) != TCL_OK) { + if (TclListObjLengthM(interp, listPtr, &listLen) != TCL_OK) { TRACE_APPEND(("ERROR converting list %" TCL_Z_MODIFIER "d, \"%s\": %s", i, O2S(listPtr), O2S(Tcl_GetObjResult(interp)))); goto gotError; @@ -6326,7 +6326,7 @@ TEBCresume( numVars = varListPtr->numVars; listPtr = OBJ_AT_DEPTH(listTmpDepth); - TclListObjGetElements(interp, listPtr, &listLen, &elements); + TclListObjGetElementsM(interp, listPtr, &listLen, &elements); valIndex = (iterNum * numVars); for (j = 0; j < numVars; j++) { @@ -6941,7 +6941,7 @@ TEBCresume( } } Tcl_IncrRefCount(dictPtr); - if (TclListObjGetElements(interp, OBJ_AT_TOS, &length, + if (TclListObjGetElementsM(interp, OBJ_AT_TOS, &length, &keyPtrPtr) != TCL_OK) { TRACE_ERROR(interp); goto gotError; @@ -7001,7 +7001,7 @@ TEBCresume( NEXT_INST_F(9, 1, 0); } if (Tcl_DictObjSize(interp, dictPtr, &length) != TCL_OK - || TclListObjGetElements(interp, OBJ_AT_TOS, &length, + || TclListObjGetElementsM(interp, OBJ_AT_TOS, &length, &keyPtrPtr) != TCL_OK) { TRACE_ERROR(interp); goto gotError; @@ -7060,7 +7060,7 @@ TEBCresume( dictPtr = OBJ_UNDER_TOS; listPtr = OBJ_AT_TOS; TRACE(("\"%.30s\" \"%.30s\" =>", O2S(dictPtr), O2S(listPtr))); - if (TclListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, listPtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } @@ -7078,7 +7078,7 @@ TEBCresume( listPtr = OBJ_AT_TOS; TRACE(("\"%.30s\" \"%.30s\" \"%.30s\" => ", O2S(varNamePtr), O2S(valuePtr), O2S(keysPtr))); - if (TclListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, listPtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); TclDecrRefCount(keysPtr); goto gotError; @@ -7109,7 +7109,7 @@ TEBCresume( varPtr = LOCAL(opnd); TRACE(("%u <- \"%.30s\" \"%.30s\" => ", opnd, O2S(valuePtr), O2S(keysPtr))); - if (TclListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, listPtr, &objc, &objv) != TCL_OK) { TRACE_ERROR(interp); goto gotError; } diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c index 183b88a..63ad5e0 100644 --- a/generic/tclFCmd.c +++ b/generic/tclFCmd.c @@ -1007,7 +1007,7 @@ TclFileAttrsCmd( * Use objStrings as a list object. */ - if (TclListObjLength(interp, objStrings, &numObjStrings) != TCL_OK) { + if (TclListObjLengthM(interp, objStrings, &numObjStrings) != TCL_OK) { goto end; } attributeStringsAllocated = (const char **) diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 9f5b4b2..dcaf9d1 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -516,7 +516,7 @@ TclpNativeSplitPath( */ if (lenPtr != NULL) { - TclListObjLength(NULL, resultPtr, lenPtr); + TclListObjLengthM(NULL, resultPtr, lenPtr); } return resultPtr; } @@ -1334,7 +1334,7 @@ Tcl_GlobObjCmd( return TCL_ERROR; } typePtr = objv[i+1]; - if (TclListObjLength(interp, typePtr, &length) != TCL_OK) { + if (TclListObjLengthM(interp, typePtr, &length) != TCL_OK) { return TCL_ERROR; } i++; @@ -1456,7 +1456,7 @@ Tcl_GlobObjCmd( * platform. */ - TclListObjLength(interp, typePtr, &length); + TclListObjLengthM(interp, typePtr, &length); if (length == 0) { goto skipTypes; } @@ -1527,7 +1527,7 @@ Tcl_GlobObjCmd( Tcl_Obj *item; size_t llen; - if ((TclListObjLength(NULL, look, &llen) == TCL_OK) + if ((TclListObjLengthM(NULL, look, &llen) == TCL_OK) && (llen == 3)) { Tcl_ListObjIndex(interp, look, 0, &item); if (!strcmp("macintosh", TclGetString(item))) { @@ -1634,7 +1634,7 @@ Tcl_GlobObjCmd( } if ((globFlags & TCL_GLOBMODE_NO_COMPLAIN) == 0) { - if (TclListObjLength(interp, Tcl_GetObjResult(interp), + if (TclListObjLengthM(interp, Tcl_GetObjResult(interp), &length) != TCL_OK) { /* * This should never happen. Maybe we should be more dramatic. @@ -2017,7 +2017,7 @@ TclGlob( } } - TclListObjGetElements(NULL, filenamesObj, &objc, &objv); + TclListObjGetElementsM(NULL, filenamesObj, &objc, &objv); for (i = 0; i< objc; i++) { size_t len; const char *oldStr = Tcl_GetStringFromObj(objv[i], &len); @@ -2346,13 +2346,13 @@ DoGlob( size_t i, subdirc, repair = TCL_INDEX_NONE; Tcl_Obj **subdirv; - result = TclListObjGetElements(interp, subdirsPtr, + result = TclListObjGetElementsM(interp, subdirsPtr, &subdirc, &subdirv); for (i=0; result==TCL_OK && i<subdirc; i++) { Tcl_Obj *copy = NULL; if (pathPtr == NULL && TclGetString(subdirv[i])[0] == '~') { - TclListObjLength(NULL, matchesObj, &repair); + TclListObjLengthM(NULL, matchesObj, &repair); copy = subdirv[i]; subdirv[i] = Tcl_NewStringObj("./", 2); Tcl_AppendObjToObj(subdirv[i], copy); @@ -2365,7 +2365,7 @@ DoGlob( Tcl_DecrRefCount(subdirv[i]); subdirv[i] = copy; - TclListObjLength(NULL, matchesObj, &end); + TclListObjLengthM(NULL, matchesObj, &end); while (repair + 1 <= end) { const char *bytes; size_t numBytes; diff --git a/generic/tclIO.c b/generic/tclIO.c index 650695c..83f3be3 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10949,7 +10949,7 @@ FixLevelCode( * information. Hence an error means that we've got serious breakage. */ - res = TclListObjGetElements(NULL, msg, &lc, &lv); + res = TclListObjGetElementsM(NULL, msg, &lc, &lv); if (res != TCL_OK) { Tcl_Panic("Tcl_SetChannelError: bad syntax of message"); } diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index 3091467..868791a 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -266,7 +266,7 @@ TclChannelTransform( return TCL_ERROR; } - if (TCL_OK != TclListObjLength(interp, cmdObjPtr, &objc)) { + if (TCL_OK != TclListObjLengthM(interp, cmdObjPtr, &objc)) { Tcl_SetObjResult(interp, Tcl_NewStringObj("-command value is not a list", -1)); return TCL_ERROR; diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index f8646ff..7dc7dd7 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -609,7 +609,7 @@ TclChanCreateObjCmd( * Compare open mode against optional r/w. */ - if (TclListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) { + if (TclListObjGetElementsM(NULL, resObj, &listc, &listv) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s initialize\" returned non-list: %s", TclGetString(cmdObj), TclGetString(resObj))); @@ -1062,7 +1062,7 @@ UnmarshallErrorResult( * information; if we panic here, something has gone badly wrong already. */ - if (TclListObjGetElements(interp, msgObj, &lc, &lv) != TCL_OK) { + if (TclListObjGetElementsM(interp, msgObj, &lc, &lv) != TCL_OK) { Tcl_Panic("TclChanCaughtErrorBypass: Bad syntax of caught result"); } if (interp == NULL) { @@ -1994,7 +1994,7 @@ ReflectGetOption( * result is a valid list. Nor that the list has an even number elements. */ - if (TclListObjGetElements(interp, resObj, &listc, &listv) != TCL_OK) { + if (TclListObjGetElementsM(interp, resObj, &listc, &listv) != TCL_OK) { goto error; } @@ -2140,7 +2140,7 @@ EncodeEventMask( int evIndex; /* Id of event for an element of the eventspec * list. */ - if (TclListObjGetElements(interp, obj, &listc, &listv) != TCL_OK) { + if (TclListObjGetElementsM(interp, obj, &listc, &listv) != TCL_OK) { return TCL_ERROR; } @@ -3308,7 +3308,7 @@ ForwardProc( size_t listc; Tcl_Obj **listv; - if (TclListObjGetElements(interp, resObj, &listc, + if (TclListObjGetElementsM(interp, resObj, &listc, &listv) != TCL_OK) { Tcl_DecrRefCount(resObj); resObj = MarshallError(interp); diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index bbfa46a..5c0f47e 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -599,7 +599,7 @@ TclChanPushObjCmd( * through the mask. Compare open mode against optional r/w. */ - if (TclListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) { + if (TclListObjGetElementsM(NULL, resObj, &listc, &listv) != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "chan handler \"%s initialize\" returned non-list: %s", TclGetString(cmdObj), TclGetString(resObj))); @@ -835,7 +835,7 @@ UnmarshallErrorResult( * information; if we panic here, something has gone badly wrong already. */ - if (TclListObjGetElements(interp, msgObj, &lc, &lv) != TCL_OK) { + if (TclListObjGetElementsM(interp, msgObj, &lc, &lv) != TCL_OK) { Tcl_Panic("TclChanCaughtErrorBypass: Bad syntax of caught result"); } if (interp == NULL) { @@ -1756,7 +1756,7 @@ NewReflectedTransform( /* ASSERT: cmdpfxObj is a Tcl List */ - TclListObjGetElements(interp, cmdpfxObj, &listc, &listv); + TclListObjGetElementsM(interp, cmdpfxObj, &listc, &listv); /* * See [==] as well. diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c index b206604..d51491f 100644 --- a/generic/tclIOUtil.c +++ b/generic/tclIOUtil.c @@ -1066,7 +1066,7 @@ Tcl_FSMatchInDirectory( * resultPtr and tmpResultPtr are guaranteed to be distinct. */ - ret = TclListObjGetElements(interp, tmpResultPtr, + ret = TclListObjGetElementsM(interp, tmpResultPtr, &resLength, &elemsPtr); for (i=0 ; ret==TCL_OK && i<resLength ; i++) { ret = Tcl_ListObjAppendElement(interp, resultPtr, @@ -1114,10 +1114,10 @@ FsAddMountsToGlobResult( return; } - if (TclListObjLength(NULL, mounts, &mLength) != TCL_OK || mLength == 0) { + if (TclListObjLengthM(NULL, mounts, &mLength) != TCL_OK || mLength == 0) { goto endOfMounts; } - if (TclListObjLength(NULL, resultPtr, &gLength) != TCL_OK) { + if (TclListObjLengthM(NULL, resultPtr, &gLength) != TCL_OK) { goto endOfMounts; } for (i=0 ; i<mLength ; i++) { @@ -2479,7 +2479,7 @@ TclFSFileAttrIndex( size_t i, objc; Tcl_Obj **objv; - if (TclListObjGetElements(NULL, listObj, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(NULL, listObj, &objc, &objv) != TCL_OK) { TclDecrRefCount(listObj); return TCL_ERROR; } @@ -3953,7 +3953,7 @@ Tcl_FSSplitPath( } if (lenPtr != NULL) { - TclListObjLength(NULL, result, lenPtr); + TclListObjLengthM(NULL, result, lenPtr); } return result; } @@ -4076,7 +4076,7 @@ TclFSNonnativePathType( Tcl_Obj *thisFsVolumes = fsRecPtr->fsPtr->listVolumesProc(); if (thisFsVolumes != NULL) { - if (TclListObjLength(NULL, thisFsVolumes, &numVolumes) + if (TclListObjLengthM(NULL, thisFsVolumes, &numVolumes) != TCL_OK) { /* * This is VERY bad; the listVolumesProc didn't return a diff --git a/generic/tclIndexObj.c b/generic/tclIndexObj.c index 682e908..40aabce 100644 --- a/generic/tclIndexObj.c +++ b/generic/tclIndexObj.c @@ -122,7 +122,7 @@ GetIndexFromObjList( * of the code there. This is a bit ineffiecient but simpler. */ - result = TclListObjGetElements(interp, tableObjPtr, &objc, &objv); + result = TclListObjGetElementsM(interp, tableObjPtr, &objc, &objv); if (result != TCL_OK) { return result; } @@ -553,7 +553,7 @@ PrefixMatchObjCmd( return TCL_ERROR; } i++; - result = TclListObjLength(interp, objv[i], &errorLength); + result = TclListObjLengthM(interp, objv[i], &errorLength); if (result != TCL_OK) { return TCL_ERROR; } @@ -577,7 +577,7 @@ PrefixMatchObjCmd( * error case regardless of level. */ - result = TclListObjLength(interp, tablePtr, &dummyLength); + result = TclListObjLengthM(interp, tablePtr, &dummyLength); if (result != TCL_OK) { return result; } @@ -643,7 +643,7 @@ PrefixAllObjCmd( return TCL_ERROR; } - result = TclListObjGetElements(interp, objv[1], &tableObjc, &tableObjv); + result = TclListObjGetElementsM(interp, objv[1], &tableObjc, &tableObjv); if (result != TCL_OK) { return result; } @@ -701,7 +701,7 @@ PrefixLongestObjCmd( return TCL_ERROR; } - result = TclListObjGetElements(interp, objv[1], &tableObjc, &tableObjv); + result = TclListObjGetElementsM(interp, objv[1], &tableObjc, &tableObjv); if (result != TCL_OK) { return result; } diff --git a/generic/tclInt.h b/generic/tclInt.h index ef253af..f212273 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2407,12 +2407,12 @@ typedef struct List { #define ListObjIsCanonical(listPtr) \ (((listPtr)->bytes == NULL) || ListRepPtr(listPtr)->canonicalFlag) -#define TclListObjGetElements(interp, listPtr, objcPtr, objvPtr) \ +#define TclListObjGetElementsM(interp, listPtr, objcPtr, objvPtr) \ (((listPtr)->typePtr == &tclListType) \ ? ((ListObjGetElements((listPtr), *(objcPtr), *(objvPtr))), TCL_OK)\ : Tcl_ListObjGetElements((interp), (listPtr), (objcPtr), (objvPtr))) -#define TclListObjLength(interp, listPtr, lenPtr) \ +#define TclListObjLengthM(interp, listPtr, lenPtr) \ (((listPtr)->typePtr == &tclListType) \ ? ((ListObjLength((listPtr), *(lenPtr))), TCL_OK)\ : Tcl_ListObjLength((interp), (listPtr), (lenPtr))) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index acb5e5b..fd3264f 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -2322,7 +2322,7 @@ GetInterp( Tcl_Interp *searchInterp; /* Interim storage for interp. to find. */ InterpInfo *parentInfoPtr; - if (TclListObjGetElements(interp, pathPtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, pathPtr, &objc, &objv) != TCL_OK) { return NULL; } @@ -2378,7 +2378,7 @@ ChildBgerror( if (objc) { size_t length; - if (TCL_ERROR == TclListObjLength(NULL, objv[0], &length) + if (TCL_ERROR == TclListObjLengthM(NULL, objv[0], &length) || (length < 1)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "cmdPrefix must be list of length >= 1", -1)); @@ -2426,7 +2426,7 @@ ChildCreate( size_t objc; Tcl_Obj **objv; - if (TclListObjGetElements(interp, pathPtr, &objc, &objv) != TCL_OK) { + if (TclListObjGetElementsM(interp, pathPtr, &objc, &objv) != TCL_OK) { return NULL; } if (objc < 2) { diff --git a/generic/tclLink.c b/generic/tclLink.c index fdd44f8..839cc0c 100644 --- a/generic/tclLink.c +++ b/generic/tclLink.c @@ -946,7 +946,7 @@ LinkTraceProc( */ if (linkPtr->flags & LINK_ALLOC_LAST) { - if (TclListObjGetElements(NULL, (valueObj), &objc, &objv) == TCL_ERROR + if (TclListObjGetElementsM(NULL, (valueObj), &objc, &objv) == TCL_ERROR || objc != linkPtr->numElems) { return (char *) "wrong dimension"; } diff --git a/generic/tclListObj.c b/generic/tclListObj.c index c0d1b88..aa07e58 100644 --- a/generic/tclListObj.c +++ b/generic/tclListObj.c @@ -416,7 +416,7 @@ TclListObjRange( size_t i, newLen; List *listRepPtr; - TclListObjGetElements(NULL, listPtr, &listLen, &elemPtrs); + TclListObjGetElementsM(NULL, listPtr, &listLen, &elemPtrs); if (fromIdx == TCL_INDEX_NONE) { fromIdx = 0; @@ -586,7 +586,7 @@ Tcl_ListObjAppendList( * Pull the elements to append from elemListPtr. */ - if (TCL_OK != TclListObjGetElements(interp, elemListPtr, &objc, &objv)) { + if (TCL_OK != TclListObjGetElementsM(interp, elemListPtr, &objc, &objv)) { return TCL_ERROR; } @@ -1318,7 +1318,7 @@ TclLindexFlat( break; } - TclListObjGetElements(NULL, sublistCopy, &listLen, &elemPtrs); + TclListObjGetElementsM(NULL, sublistCopy, &listLen, &elemPtrs); if (TclGetIntForIndexM(interp, indexArray[i], /*endValue*/ listLen-1, &index) == TCL_OK) { @@ -1411,7 +1411,7 @@ TclLsetList( return TclLsetFlat(interp, listPtr, 1, &indexArgPtr, valuePtr); } - TclListObjGetElements(NULL, indexArgPtr, &indexCount, &indices); + TclListObjGetElementsM(NULL, indexArgPtr, &indexCount, &indices); /* * Let TclLsetFlat handle the actual lset'ting. @@ -1532,7 +1532,7 @@ TclLsetFlat( * Check for the possible error conditions... */ - if (TclListObjGetElements(interp, subListPtr, &elemCount, &elemPtrs) + if (TclListObjGetElementsM(interp, subListPtr, &elemCount, &elemPtrs) != TCL_OK) { /* ...the sublist we're indexing into isn't a list at all. */ result = TCL_ERROR; @@ -1679,7 +1679,7 @@ TclLsetFlat( */ len = TCL_INDEX_NONE; - TclListObjLength(NULL, subListPtr, &len); + TclListObjLengthM(NULL, subListPtr, &len); if (valuePtr == NULL) { Tcl_ListObjReplace(NULL, subListPtr, index, 1, 0, NULL); } else if (index == (size_t)len) { diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index 7bd5907..979426c 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -4068,7 +4068,7 @@ NamespacePathCmd( * There is a path given, so parse it into an array of namespace pointers. */ - if (TclListObjGetElements(interp, objv[1], &nsObjc, &nsObjv) != TCL_OK) { + if (TclListObjGetElementsM(interp, objv[1], &nsObjc, &nsObjv) != TCL_OK) { goto badNamespace; } if (nsObjc != 0) { @@ -4436,7 +4436,7 @@ Tcl_SetNamespaceUnknownHandler( */ if (handlerPtr != NULL) { - if (TclListObjLength(interp, handlerPtr, &lstlen) != TCL_OK) { + if (TclListObjLengthM(interp, handlerPtr, &lstlen) != TCL_OK) { /* * Not a list. */ @@ -5013,7 +5013,7 @@ TclLogCommandInfo( size_t len; iPtr->resetErrorStack = 0; - TclListObjLength(interp, iPtr->errorStack, &len); + TclListObjLengthM(interp, iPtr->errorStack, &len); /* * Reset while keeping the list internalrep as much as possible. @@ -5098,7 +5098,7 @@ TclErrorStackResetIf( size_t len; iPtr->resetErrorStack = 0; - TclListObjLength(interp, iPtr->errorStack, &len); + TclListObjLengthM(interp, iPtr->errorStack, &len); /* * Reset while keeping the list internalrep as much as possible. diff --git a/generic/tclOODefineCmds.c b/generic/tclOODefineCmds.c index e1e639b..d7f66da 100644 --- a/generic/tclOODefineCmds.c +++ b/generic/tclOODefineCmds.c @@ -1067,7 +1067,7 @@ MagicDefinitionInvoke( Tcl_ListObjAppendElement(NULL, objPtr, obj2Ptr); /* TODO: overflow? */ Tcl_ListObjReplace(NULL, objPtr, 1, 0, objc - offset, objv + offset); - TclListObjGetElements(NULL, objPtr, &dummy, &objs); + TclListObjGetElementsM(NULL, objPtr, &dummy, &objs); result = Tcl_EvalObjv(interp, objc - cmdIndex, objs, TCL_EVAL_INVOKE); if (isRoot) { @@ -2374,7 +2374,7 @@ ClassFilterSet( "attempt to misuse API", -1)); Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); return TCL_ERROR; - } else if (TclListObjGetElements(interp, objv[0], &filterc, + } else if (TclListObjGetElementsM(interp, objv[0], &filterc, &filterv) != TCL_OK) { return TCL_ERROR; } @@ -2458,7 +2458,7 @@ ClassMixinSet( "attempt to misuse API", -1)); Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); return TCL_ERROR; - } else if (TclListObjGetElements(interp, objv[0], &mixinc, + } else if (TclListObjGetElementsM(interp, objv[0], &mixinc, &mixinv) != TCL_OK) { return TCL_ERROR; } @@ -2569,7 +2569,7 @@ ClassSuperSet( "may not modify the superclass of the root object", -1)); Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); return TCL_ERROR; - } else if (TclListObjGetElements(interp, objv[0], &superc, + } else if (TclListObjGetElementsM(interp, objv[0], &superc, &superv) != TCL_OK) { return TCL_ERROR; } @@ -2739,7 +2739,7 @@ ClassVarsSet( "attempt to misuse API", -1)); Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", NULL); return TCL_ERROR; - } else if (TclListObjGetElements(interp, objv[0], &varc, + } else if (TclListObjGetElementsM(interp, objv[0], &varc, &varv) != TCL_OK) { return TCL_ERROR; } @@ -2831,7 +2831,7 @@ ObjFilterSet( return TCL_ERROR; } objv += Tcl_ObjectContextSkippedArgs(context); - if (TclListObjGetElements(interp, objv[0], &filterc, + if (TclListObjGetElementsM(interp, objv[0], &filterc, &filterv) != TCL_OK) { return TCL_ERROR; } @@ -2905,7 +2905,7 @@ ObjMixinSet( return TCL_ERROR; } objv += Tcl_ObjectContextSkippedArgs(context); - if (TclListObjGetElements(interp, objv[0], &mixinc, + if (TclListObjGetElementsM(interp, objv[0], &mixinc, &mixinv) != TCL_OK) { return TCL_ERROR; } @@ -2995,7 +2995,7 @@ ObjVarsSet( return TCL_ERROR; } objv += Tcl_ObjectContextSkippedArgs(context); - if (TclListObjGetElements(interp, objv[0], &varc, + if (TclListObjGetElementsM(interp, objv[0], &varc, &varv) != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index 0801897..4a64fe5 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -339,7 +339,7 @@ TclOONewProcInstanceMethod( ProcedureMethod *pmPtr; Tcl_Method method; - if (TclListObjLength(interp, argsObj, &argsLen) != TCL_OK) { + if (TclListObjLengthM(interp, argsObj, &argsLen) != TCL_OK) { return NULL; } pmPtr = (ProcedureMethod *)Tcl_Alloc(sizeof(ProcedureMethod)); @@ -397,7 +397,7 @@ TclOONewProcMethod( TclNewObj(argsObj); Tcl_IncrRefCount(argsObj); procName = "<destructor>"; - } else if (TclListObjLength(interp, argsObj, &argsLen) != TCL_OK) { + } else if (TclListObjLengthM(interp, argsObj, &argsLen) != TCL_OK) { return NULL; } else { procName = (nameObj==NULL ? "<constructor>" : TclGetString(nameObj)); @@ -1390,7 +1390,7 @@ TclOONewForwardInstanceMethod( size_t prefixLen; ForwardMethod *fmPtr; - if (TclListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) { + if (TclListObjLengthM(interp, prefixObj, &prefixLen) != TCL_OK) { return NULL; } if (prefixLen < 1) { @@ -1429,7 +1429,7 @@ TclOONewForwardMethod( size_t prefixLen; ForwardMethod *fmPtr; - if (TclListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) { + if (TclListObjLengthM(interp, prefixObj, &prefixLen) != TCL_OK) { return NULL; } if (prefixLen < 1) { @@ -1478,7 +1478,7 @@ InvokeForwardMethod( * can ignore here. */ - TclListObjGetElements(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs); + TclListObjGetElementsM(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs); argObjs = InitEnsembleRewrite(interp, objc, objv, skip, numPrefixes, prefixObjs, &len); Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL); diff --git a/generic/tclObj.c b/generic/tclObj.c index b8a973d..03dec9e 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -841,7 +841,7 @@ Tcl_AppendAllObjTypes( * Get the test for a valid list out of the way first. */ - if (TclListObjLength(interp, objPtr, &numElems) != TCL_OK) { + if (TclListObjLengthM(interp, objPtr, &numElems) != TCL_OK) { return TCL_ERROR; } diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c index a698d6f..f7da276 100644 --- a/generic/tclPathObj.c +++ b/generic/tclPathObj.c @@ -810,12 +810,12 @@ Tcl_FSJoinPath( size_t objc; Tcl_Obj **objv; - if (TclListObjLength(NULL, listObj, &objc) != TCL_OK) { + if (TclListObjLengthM(NULL, listObj, &objc) != TCL_OK) { return NULL; } elements = ((elements != TCL_INDEX_NONE) && (elements <= objc)) ? elements : objc; - TclListObjGetElements(NULL, listObj, &objc, &objv); + TclListObjGetElementsM(NULL, listObj, &objc, &objv); res = TclJoinPath(elements, objv, 0); return res; } @@ -2312,7 +2312,7 @@ SetFsPathFromAny( Tcl_Obj **objv; Tcl_Obj *parts = TclpNativeSplitPath(pathPtr, NULL); - TclListObjGetElements(NULL, parts, &objc, &objv); + TclListObjGetElementsM(NULL, parts, &objc, &objv); /* * Skip '~'. It's replaced by its expansion. diff --git a/generic/tclPkg.c b/generic/tclPkg.c index 865f318..c02cded 100644 --- a/generic/tclPkg.c +++ b/generic/tclPkg.c @@ -1362,7 +1362,7 @@ TclNRPackageObjCmd( objvListPtr = Tcl_NewListObj(0, NULL); Tcl_IncrRefCount(objvListPtr); Tcl_ListObjAppendElement(interp, objvListPtr, ov); - TclListObjGetElements(interp, objvListPtr, &newobjc, &newObjvPtr); + TclListObjGetElementsM(interp, objvListPtr, &newobjc, &newObjvPtr); Tcl_NRAddCallback(interp, TclNRPackageObjCmdCleanup, objv[3], objvListPtr, NULL,NULL); @@ -1389,7 +1389,7 @@ TclNRPackageObjCmd( Tcl_ListObjAppendElement(interp, objvListPtr, Tcl_DuplicateObj(newobjv[i])); } - TclListObjGetElements(interp, objvListPtr, &newobjc, &newObjvPtr); + TclListObjGetElementsM(interp, objvListPtr, &newobjc, &newObjvPtr); Tcl_NRAddCallback(interp, TclNRPackageObjCmdCleanup, objv[2], objvListPtr, NULL,NULL); Tcl_NRAddCallback(interp, diff --git a/generic/tclProc.c b/generic/tclProc.c index 13f16e8..dedbc98 100644 --- a/generic/tclProc.c +++ b/generic/tclProc.c @@ -484,7 +484,7 @@ TclCreateProc( * in the Proc. */ - result = TclListObjGetElements(interp , argsPtr ,&numArgs ,&argArray); + result = TclListObjGetElementsM(interp , argsPtr ,&numArgs ,&argArray); if (result != TCL_OK) { goto procError; } @@ -514,7 +514,7 @@ TclCreateProc( * Now divide the specifier up into name and default. */ - result = TclListObjGetElements(interp, argArray[i], &fieldCount, + result = TclListObjGetElementsM(interp, argArray[i], &fieldCount, &fieldValues); if (result != TCL_OK) { goto procError; @@ -920,7 +920,7 @@ TclNRUplevelObjCmd( } else if (!TclHasStringRep(objv[1]) && objc == 2) { int status; size_t llength; - status = TclListObjLength(interp, objv[1], &llength); + status = TclListObjLengthM(interp, objv[1], &llength); if (status == TCL_OK && llength > 1) { /* the first argument can't interpreted as a level. Avoid * generating a string representation of the script. */ @@ -2398,7 +2398,7 @@ SetLambdaFromAny( * length is not 2, then it cannot be converted to lambdaType. */ - result = TclListObjGetElements(NULL, objPtr, &objc, &objv); + result = TclListObjGetElementsM(NULL, objPtr, &objc, &objv); if ((result != TCL_OK) || ((objc != 2) && (objc != 3))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't interpret \"%s\" as a lambda expression", diff --git a/generic/tclProcess.c b/generic/tclProcess.c index 38e585f..db060e9 100644 --- a/generic/tclProcess.c +++ b/generic/tclProcess.c @@ -532,7 +532,7 @@ ProcessStatusObjCmd( * Only return statuses of provided processes. */ - result = TclListObjGetElements(interp, objv[1], &numPids, &pidObjs); + result = TclListObjGetElementsM(interp, objv[1], &numPids, &pidObjs); if (result != TCL_OK) { return result; } @@ -645,7 +645,7 @@ ProcessPurgeObjCmd( * Purge only provided processes. */ - result = TclListObjGetElements(interp, objv[1], &numPids, &pidObjs); + result = TclListObjGetElementsM(interp, objv[1], &numPids, &pidObjs); if (result != TCL_OK) { return result; } diff --git a/generic/tclResult.c b/generic/tclResult.c index b5573ae..da6365e 100644 --- a/generic/tclResult.c +++ b/generic/tclResult.c @@ -750,12 +750,12 @@ TclProcessReturn( * if someone does [return -errorstack [info errorstack]] */ - if (TclListObjGetElements(interp, valuePtr, &valueObjc, + if (TclListObjGetElementsM(interp, valuePtr, &valueObjc, &valueObjv) == TCL_ERROR) { return TCL_ERROR; } iPtr->resetErrorStack = 0; - TclListObjLength(interp, iPtr->errorStack, &len); + TclListObjLengthM(interp, iPtr->errorStack, &len); /* * Reset while keeping the list internalrep as much as possible. @@ -912,7 +912,7 @@ TclMergeReturnOptions( if (valuePtr != NULL) { size_t length; - if (TCL_ERROR == TclListObjLength(NULL, valuePtr, &length )) { + if (TCL_ERROR == TclListObjLengthM(NULL, valuePtr, &length )) { /* * Value is not a list, which is illegal for -errorcode. */ @@ -934,7 +934,7 @@ TclMergeReturnOptions( if (valuePtr != NULL) { size_t length; - if (TCL_ERROR == TclListObjLength(NULL, valuePtr, &length)) { + if (TCL_ERROR == TclListObjLengthM(NULL, valuePtr, &length)) { /* * Value is not a list, which is illegal for -errorstack. */ @@ -1105,7 +1105,7 @@ Tcl_SetReturnOptions( Tcl_Obj **objv, *mergedOpts; Tcl_IncrRefCount(options); - if (TCL_ERROR == TclListObjGetElements(interp, options, &objc, &objv) + if (TCL_ERROR == TclListObjGetElementsM(interp, options, &objc, &objv) || (objc % 2)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "expected dict but got \"%s\"", TclGetString(options))); diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index d6e6d0f..2cf3ea7 100644 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -558,7 +558,7 @@ TclParseNumber( if (TclHasInternalRep(objPtr, &tclListType)) { size_t length; /* A list can only be a (single) number if its length == 1 */ - TclListObjLength(NULL, objPtr, &length); + TclListObjLengthM(NULL, objPtr, &length); if (length != 1) { return TCL_ERROR; } diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index fab8e57..b3ad31b 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -511,7 +511,7 @@ TclCheckEmptyString( } if (TclListObjIsCanonical(objPtr)) { - TclListObjLength(NULL, objPtr, &length); + TclListObjLengthM(NULL, objPtr, &length); return length == 0; } @@ -2793,7 +2793,7 @@ AppendPrintfToObjVA( } } while (seekingConversion); } - TclListObjGetElements(NULL, list, &objc, &objv); + TclListObjGetElementsM(NULL, list, &objc, &objv); code = Tcl_AppendFormatToObj(NULL, objPtr, format, objc, objv); if (code != TCL_OK) { Tcl_AppendPrintfToObj(objPtr, diff --git a/generic/tclStubInit.c b/generic/tclStubInit.c index fff3c42..76bc871 100644 --- a/generic/tclStubInit.c +++ b/generic/tclStubInit.c @@ -88,14 +88,7 @@ static void uniCodePanic() { #define TclUtfNext Tcl_UtfNext #define TclUtfPrev Tcl_UtfPrev -#define TclListObjGetElements_ LOGetElements -#define TclListObjLength_ LOLength -#define TclDictObjSize_ DOSize -#define TclSplitList_ SplitList -#define TclSplitPath_ SplitPath -#define TclFSSplitPath_ FSSplitPath -#define TclParseArgsObjv_ ParseArgsObjv -int LOGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, +int TclListObjGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, int *objcPtr, Tcl_Obj ***objvPtr) { size_t n = TCL_INDEX_NONE; int result = Tcl_ListObjGetElements(interp, listPtr, &n, objvPtr); @@ -110,10 +103,10 @@ int LOGetElements(Tcl_Interp *interp, Tcl_Obj *listPtr, } return result; } -int LOLength(Tcl_Interp *interp, Tcl_Obj *listPtr, +int TclListObjLength(Tcl_Interp *interp, Tcl_Obj *listPtr, int *lengthPtr) { size_t n = TCL_INDEX_NONE; - int result = TclListObjLength(interp, listPtr, &n); + int result = Tcl_ListObjLength(interp, listPtr, &n); if (lengthPtr) { if ((result == TCL_OK) && (n > INT_MAX)) { if (interp) { @@ -125,7 +118,7 @@ int LOLength(Tcl_Interp *interp, Tcl_Obj *listPtr, } return result; } -static int DOSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, +int TclDictObjSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, int *sizePtr) { size_t n = TCL_INDEX_NONE; int result = Tcl_DictObjSize(interp, dictPtr, &n); @@ -140,7 +133,7 @@ static int DOSize(Tcl_Interp *interp, Tcl_Obj *dictPtr, } return result; } -static int SplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr, +int TclSplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr, const char ***argvPtr) { size_t n = TCL_INDEX_NONE; int result = Tcl_SplitList(interp, listStr, &n, argvPtr); @@ -156,7 +149,7 @@ static int SplitList(Tcl_Interp *interp, const char *listStr, int *argcPtr, } return result; } -static void SplitPath(const char *path, int *argcPtr, const char ***argvPtr) { +void TclSplitPath(const char *path, int *argcPtr, const char ***argvPtr) { size_t n = TCL_INDEX_NONE; Tcl_SplitPath(path, &n, argvPtr); if (argcPtr) { @@ -168,7 +161,7 @@ static void SplitPath(const char *path, int *argcPtr, const char ***argvPtr) { *argcPtr = n; } } -static Tcl_Obj *FSSplitPath(Tcl_Obj *pathPtr, int *lenPtr) { +Tcl_Obj *TclFSSplitPath(Tcl_Obj *pathPtr, int *lenPtr) { size_t n = TCL_INDEX_NONE; Tcl_Obj *result = Tcl_FSSplitPath(pathPtr, &n); if (lenPtr) { @@ -180,7 +173,7 @@ static Tcl_Obj *FSSplitPath(Tcl_Obj *pathPtr, int *lenPtr) { } return result; } -static int ParseArgsObjv(Tcl_Interp *interp, +int TclParseArgsObjv(Tcl_Interp *interp, const Tcl_ArgvInfo *argTable, int *objcPtr, Tcl_Obj *const *objv, Tcl_Obj ***remObjv) { size_t n = (*objcPtr < 0) ? TCL_INDEX_NONE: (size_t)*objcPtr ; @@ -838,9 +831,9 @@ const TclStubs tclStubs = { Tcl_InvalidateStringRep, /* 42 */ Tcl_ListObjAppendList, /* 43 */ Tcl_ListObjAppendElement, /* 44 */ - TclListObjGetElements_, /* 45 */ + TclListObjGetElements, /* 45 */ Tcl_ListObjIndex, /* 46 */ - TclListObjLength_, /* 47 */ + TclListObjLength, /* 47 */ Tcl_ListObjReplace, /* 48 */ 0, /* 49 */ Tcl_NewByteArrayObj, /* 50 */ @@ -1035,8 +1028,8 @@ const TclStubs tclStubs = { Tcl_SignalId, /* 239 */ Tcl_SignalMsg, /* 240 */ Tcl_SourceRCFile, /* 241 */ - TclSplitList_, /* 242 */ - TclSplitPath_, /* 243 */ + TclSplitList, /* 242 */ + TclSplitPath, /* 243 */ 0, /* 244 */ 0, /* 245 */ 0, /* 246 */ @@ -1254,7 +1247,7 @@ const TclStubs tclStubs = { Tcl_FSChdir, /* 458 */ Tcl_FSConvertToPathType, /* 459 */ Tcl_FSJoinPath, /* 460 */ - TclFSSplitPath_, /* 461 */ + TclFSSplitPath, /* 461 */ Tcl_FSEqualPaths, /* 462 */ Tcl_FSGetNormalizedPath, /* 463 */ Tcl_FSJoinToPath, /* 464 */ @@ -1290,7 +1283,7 @@ const TclStubs tclStubs = { Tcl_DictObjPut, /* 494 */ Tcl_DictObjGet, /* 495 */ Tcl_DictObjRemove, /* 496 */ - TclDictObjSize_, /* 497 */ + TclDictObjSize, /* 497 */ Tcl_DictObjFirst, /* 498 */ Tcl_DictObjNext, /* 499 */ Tcl_DictObjDone, /* 500 */ @@ -1397,7 +1390,7 @@ const TclStubs tclStubs = { Tcl_GetBlockSizeFromStat, /* 601 */ Tcl_SetEnsembleParameterList, /* 602 */ Tcl_GetEnsembleParameterList, /* 603 */ - TclParseArgsObjv_, /* 604 */ + TclParseArgsObjv, /* 604 */ Tcl_GetErrorLine, /* 605 */ Tcl_SetErrorLine, /* 606 */ Tcl_TransferResult, /* 607 */ diff --git a/generic/tclTrace.c b/generic/tclTrace.c index f080b04..2558fdc 100644 --- a/generic/tclTrace.c +++ b/generic/tclTrace.c @@ -429,7 +429,7 @@ TraceExecutionObjCmd( * pointer to its array of element pointers. */ - result = TclListObjGetElements(interp, objv[4], &listLen, &elemPtrs); + result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs); if (result != TCL_OK) { return result; } @@ -599,7 +599,7 @@ TraceExecutionObjCmd( TclNewLiteralStringObj(opObj, "leavestep"); Tcl_ListObjAppendElement(NULL, elemObjPtr, opObj); } - TclListObjLength(NULL, elemObjPtr, &numOps); + TclListObjLengthM(NULL, elemObjPtr, &numOps); if (0 == numOps) { Tcl_DecrRefCount(elemObjPtr); continue; @@ -672,7 +672,7 @@ TraceCommandObjCmd( * pointer to its array of element pointers. */ - result = TclListObjGetElements(interp, objv[4], &listLen, &elemPtrs); + result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs); if (result != TCL_OK) { return result; } @@ -796,7 +796,7 @@ TraceCommandObjCmd( TclNewLiteralStringObj(opObj, "delete"); Tcl_ListObjAppendElement(NULL, elemObjPtr, opObj); } - TclListObjLength(NULL, elemObjPtr, &numOps); + TclListObjLengthM(NULL, elemObjPtr, &numOps); if (0 == numOps) { Tcl_DecrRefCount(elemObjPtr); continue; @@ -873,7 +873,7 @@ TraceVariableObjCmd( * pointer to its array of element pointers. */ - result = TclListObjGetElements(interp, objv[4], &listLen, &elemPtrs); + result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs); if (result != TCL_OK) { return result; } diff --git a/generic/tclUtil.c b/generic/tclUtil.c index 30be4ef..dee06eb 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -3487,7 +3487,7 @@ GetEndOffsetFromObj( if ((TclMaxListLength(bytes, -1, NULL) > 1) /* If it's possible, do the full list parse. */ - && (TCL_OK == TclListObjLength(NULL, objPtr, &len)) + && (TCL_OK == TclListObjLengthM(NULL, objPtr, &len)) && (len > 1)) { goto parseError; } diff --git a/generic/tclVar.c b/generic/tclVar.c index dc85eea..e0f46e7 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -2835,7 +2835,7 @@ Tcl_LappendObjCmd( return TCL_ERROR; } } else { - result = TclListObjLength(interp, newValuePtr, &numElems); + result = TclListObjLengthM(interp, newValuePtr, &numElems); if (result != TCL_OK) { return result; } @@ -2893,7 +2893,7 @@ Tcl_LappendObjCmd( createdNewObj = 1; } - result = TclListObjLength(interp, varValuePtr, &numElems); + result = TclListObjLengthM(interp, varValuePtr, &numElems); if (result == TCL_OK) { result = Tcl_ListObjReplace(interp, varValuePtr, numElems, 0, (objc-2), (objv+2)); @@ -3046,7 +3046,7 @@ ArrayForNRCmd( * Parse arguments. */ - if (TclListObjLength(interp, objv[1], &numVars) != TCL_OK) { + if (TclListObjLengthM(interp, objv[1], &numVars) != TCL_OK) { return TCL_ERROR; } @@ -3158,7 +3158,7 @@ ArrayForLoopCallback( goto arrayfordone; } - TclListObjGetElements(NULL, varListObj, &varc, &varv); + TclListObjGetElementsM(NULL, varListObj, &varc, &varv); if (Tcl_ObjSetVar2(interp, varv[0], NULL, keyObj, TCL_LEAVE_ERR_MSG) == NULL) { result = TCL_ERROR; @@ -3699,7 +3699,7 @@ ArrayGetCmd( */ TclNewObj(tmpResObj); - result = TclListObjGetElements(interp, nameLstObj, &count, &nameObjPtr); + result = TclListObjGetElementsM(interp, nameLstObj, &count, &nameObjPtr); if (result != TCL_OK) { goto errorInArrayGet; } @@ -4024,7 +4024,7 @@ ArraySetCmd( size_t elemLen; Tcl_Obj **elemPtrs, *copyListObj; - result = TclListObjGetElements(interp, arrayElemObj, + result = TclListObjGetElementsM(interp, arrayElemObj, &elemLen, &elemPtrs); if (result != TCL_OK) { return result; diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 56541b5..2a7ecae 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -3029,7 +3029,7 @@ ZipFSMkZipOrImg( } } Tcl_IncrRefCount(list); - if (TclListObjGetElements(interp, list, &lobjc, &lobjv) != TCL_OK) { + if (TclListObjGetElementsM(interp, list, &lobjc, &lobjv) != TCL_OK) { Tcl_DecrRefCount(list); return TCL_ERROR; } diff --git a/generic/tclZlib.c b/generic/tclZlib.c index fc50bb6..5effcb5 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -1373,7 +1373,7 @@ Tcl_ZlibStreamGet( Tcl_DecrRefCount(zshPtr->currentInput); zshPtr->currentInput = NULL; } - TclListObjLength(NULL, zshPtr->inData, &listLen); + TclListObjLengthM(NULL, zshPtr->inData, &listLen); if (listLen > 0) { /* * There is more input available, get it from the list and @@ -1422,7 +1422,7 @@ Tcl_ZlibStreamGet( e = inflate(&zshPtr->stream, zshPtr->flush); } }; - TclListObjLength(NULL, zshPtr->inData, &listLen); + TclListObjLengthM(NULL, zshPtr->inData, &listLen); while ((zshPtr->stream.avail_out > 0) && (e == Z_OK || e == Z_BUF_ERROR) && (listLen > 0)) { @@ -1502,7 +1502,7 @@ Tcl_ZlibStreamGet( inflateEnd(&zshPtr->stream); } } else { - TclListObjLength(NULL, zshPtr->outData, &listLen); + TclListObjLengthM(NULL, zshPtr->outData, &listLen); if (count == TCL_INDEX_NONE) { count = 0; for (i=0; i<listLen; i++) { @@ -1524,7 +1524,7 @@ Tcl_ZlibStreamGet( dataPtr += existing; while ((count > dataPos) && - (TclListObjLength(NULL, zshPtr->outData, &listLen) == TCL_OK) + (TclListObjLengthM(NULL, zshPtr->outData, &listLen) == TCL_OK) && (listLen > 0)) { /* * Get the next chunk off our list of chunks and grab the data out |