summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-13 09:45:57 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-03-13 09:45:57 (GMT)
commit9cc68bccbf2916d0295cdfcb5db818c22c0da154 (patch)
treef139c8175f4a5b8428a0ae29570be55f28d47480 /generic
parent26619872a685f373c6fa06066eb03c5da5951bfa (diff)
downloadtcl-9cc68bccbf2916d0295cdfcb5db818c22c0da154.zip
tcl-9cc68bccbf2916d0295cdfcb5db818c22c0da154.tar.gz
tcl-9cc68bccbf2916d0295cdfcb5db818c22c0da154.tar.bz2
Restore TclListObjLength()/TclListObjGetElements() macro's, as they were in 8.6
Diffstat (limited to 'generic')
-rw-r--r--generic/tclAssembly.c4
-rw-r--r--generic/tclBasic.c14
-rw-r--r--generic/tclBinary.c6
-rw-r--r--generic/tclClock.c8
-rw-r--r--generic/tclCmdAH.c8
-rw-r--r--generic/tclCmdIL.c42
-rw-r--r--generic/tclCmdMZ.c28
-rw-r--r--generic/tclCompCmds.c6
-rw-r--r--generic/tclCompCmdsSZ.c12
-rw-r--r--generic/tclCompExpr.c4
-rw-r--r--generic/tclDictObj.c18
-rw-r--r--generic/tclDisassemble.c2
-rw-r--r--generic/tclEncoding.c14
-rw-r--r--generic/tclEnsemble.c40
-rw-r--r--generic/tclEvent.c2
-rw-r--r--generic/tclExecute.c42
-rw-r--r--generic/tclFCmd.c2
-rw-r--r--generic/tclFileName.c18
-rw-r--r--generic/tclIO.c2
-rw-r--r--generic/tclIOGT.c2
-rw-r--r--generic/tclIORChan.c10
-rw-r--r--generic/tclIORTrans.c6
-rw-r--r--generic/tclIOUtil.c12
-rw-r--r--generic/tclIndexObj.c10
-rw-r--r--generic/tclInt.h8
-rw-r--r--generic/tclInterp.c6
-rw-r--r--generic/tclLink.c2
-rw-r--r--generic/tclListObj.c12
-rw-r--r--generic/tclNamesp.c8
-rw-r--r--generic/tclOODefineCmds.c16
-rw-r--r--generic/tclOOMethod.c10
-rw-r--r--generic/tclObj.c2
-rw-r--r--generic/tclPathObj.c6
-rw-r--r--generic/tclPkg.c4
-rw-r--r--generic/tclProc.c10
-rw-r--r--generic/tclProcess.c4
-rw-r--r--generic/tclResult.c10
-rw-r--r--generic/tclStrToD.c2
-rw-r--r--generic/tclStringObj.c4
-rw-r--r--generic/tclTrace.c16
-rw-r--r--generic/tclUtil.c2
-rw-r--r--generic/tclVar.c14
-rw-r--r--generic/tclZipfs.c89
-rw-r--r--generic/tclZlib.c67
44 files changed, 307 insertions, 297 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index e7ce6e6..61eb319 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -1985,7 +1985,7 @@ CreateMirrorJumpTable(
* table. */
int i;
- if (TclListObjLengthM(interp, jumps, &objc) != TCL_OK) {
+ if (TclListObjLength(interp, jumps, &objc) != TCL_OK) {
return TCL_ERROR;
}
if (objc % 2 != 0) {
@@ -1997,7 +1997,7 @@ CreateMirrorJumpTable(
}
return TCL_ERROR;
}
- if (TclListObjGetElementsM(interp, jumps, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, jumps, &objc, &objv) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 509e63c..09839d7 100644
--- a/generic/tclBasic.c
+++ b/generic/tclBasic.c
@@ -5250,7 +5250,7 @@ TEOV_NotFound(
* itself.
*/
- TclListObjGetElementsM(NULL, currNsPtr->unknownHandlerPtr,
+ TclListObjGetElements(NULL, currNsPtr->unknownHandlerPtr,
&handlerObjc, &handlerObjv);
newObjc = objc + handlerObjc;
newObjv = (Tcl_Obj **)TclStackAlloc(interp, sizeof(Tcl_Obj *) * newObjc);
@@ -5809,7 +5809,7 @@ TclEvalEx(
if (tokenPtr->type == TCL_TOKEN_EXPAND_WORD) {
Tcl_Size numElements;
- code = TclListObjLengthM(interp, objv[objectsUsed],
+ code = TclListObjLength(interp, objv[objectsUsed],
&numElements);
if (code == TCL_ERROR) {
/*
@@ -5861,7 +5861,7 @@ TclEvalEx(
Tcl_Size numElements;
Tcl_Obj **elements, *temp = copy[wordIdx];
- TclListObjGetElementsM(NULL, temp, &numElements,
+ TclListObjGetElements(NULL, temp, &numElements,
&elements);
objectsUsed += numElements;
while (numElements--) {
@@ -6702,7 +6702,7 @@ TclNREvalObjEx(
TclNRAddCallback(interp, TEOEx_ListCallback, listPtr, eoFramePtr,
objPtr, NULL);
- TclListObjGetElementsM(NULL, listPtr, &objc, &objv);
+ TclListObjGetElements(NULL, listPtr, &objc, &objv);
return TclNREvalObjv(interp, objc, objv, flags, NULL);
}
@@ -9473,7 +9473,7 @@ TclNRTailcallEval(
Tcl_Size objc;
Tcl_Obj **objv;
- TclListObjGetElementsM(interp, listPtr, &objc, &objv);
+ TclListObjGetElements(interp, listPtr, &objc, &objv);
nsObjPtr = objv[0];
if (result == TCL_OK) {
@@ -9903,7 +9903,7 @@ TclNREvalList(
TclMarkTailcall(interp);
TclNRAddCallback(interp, TclNRReleaseValues, listPtr, NULL, NULL,NULL);
- TclListObjGetElementsM(NULL, listPtr, &objc, &objv);
+ TclListObjGetElements(NULL, listPtr, &objc, &objv);
return TclNREvalObjv(interp, objc, objv, 0, NULL);
}
@@ -10190,7 +10190,7 @@ InjectHandler(
TclMarkTailcall(interp);
TclNRAddCallback(interp, InjectHandlerPostCall, corPtr, listPtr,
INT2PTR(nargs), isProbe);
- TclListObjGetElementsM(NULL, listPtr, &objc, &objv);
+ TclListObjGetElements(NULL, listPtr, &objc, &objv);
return TclNREvalObjv(interp, objc, objv, 0, NULL);
}
diff --git a/generic/tclBinary.c b/generic/tclBinary.c
index 8b282f3..8be4b75 100644
--- a/generic/tclBinary.c
+++ b/generic/tclBinary.c
@@ -1060,7 +1060,7 @@ BinaryFormatCmd(
* The macro evals its args more than once: avoid arg++
*/
- if (TclListObjLengthM(interp, objv[arg], &listc
+ if (TclListObjLength(interp, objv[arg], &listc
) != TCL_OK) {
return TCL_ERROR;
}
@@ -1073,7 +1073,7 @@ BinaryFormatCmd(
-1));
return TCL_ERROR;
}
- if (TclListObjGetElementsM(interp, objv[arg], &listc,
+ if (TclListObjGetElements(interp, objv[arg], &listc,
&listv) != TCL_OK) {
return TCL_ERROR;
}
@@ -1346,7 +1346,7 @@ BinaryFormatCmd(
listc = 1;
count = 1;
} else {
- TclListObjGetElementsM(interp, objv[arg], &listc, &listv);
+ TclListObjGetElements(interp, objv[arg], &listc, &listv);
if (count == BINARY_ALL) {
count = listc;
}
diff --git a/generic/tclClock.c b/generic/tclClock.c
index 0b17c55..dee6253 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -732,7 +732,7 @@ ConvertLocalToUTC(
* Unpack the tz data.
*/
- if (TclListObjGetElementsM(interp, tzdata, &rowc, &rowv) != TCL_OK) {
+ if (TclListObjGetElements(interp, tzdata, &rowc, &rowv) != TCL_OK) {
return TCL_ERROR;
}
@@ -797,7 +797,7 @@ ConvertLocalToUTCUsingTable(
while (!found) {
row = LookupLastTransition(interp, fields->seconds, rowc, rowv);
if ((row == NULL)
- || TclListObjGetElementsM(interp, row, &cellc,
+ || TclListObjGetElements(interp, row, &cellc,
&cellv) != TCL_OK
|| TclGetIntFromObj(interp, cellv[1],
&fields->tzOffset) != TCL_OK) {
@@ -935,7 +935,7 @@ ConvertUTCToLocal(
* Unpack the tz data.
*/
- if (TclListObjGetElementsM(interp, tzdata, &rowc, &rowv) != TCL_OK) {
+ if (TclListObjGetElements(interp, tzdata, &rowc, &rowv) != TCL_OK) {
return TCL_ERROR;
}
@@ -987,7 +987,7 @@ ConvertUTCToLocalUsingTable(
row = LookupLastTransition(interp, fields->seconds, rowc, rowv);
if (row == NULL ||
- TclListObjGetElementsM(interp, row, &cellc, &cellv) != TCL_OK ||
+ TclListObjGetElements(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 e7e929f..e29fed7 100644
--- a/generic/tclCmdAH.c
+++ b/generic/tclCmdAH.c
@@ -190,7 +190,7 @@ Tcl_CaseObjCmd(
if (caseObjc == 1) {
Tcl_Obj **newObjv;
- TclListObjGetElementsM(interp, caseObjv[0], &caseObjc, &newObjv);
+ TclListObjGetElements(interp, caseObjv[0], &caseObjc, &newObjv);
caseObjv = newObjv;
}
@@ -2949,7 +2949,7 @@ EachloopCmd(
result = TCL_ERROR;
goto done;
}
- result = TclListObjLengthM(interp, statePtr->vCopyList[i],
+ result = TclListObjLength(interp, statePtr->vCopyList[i],
&statePtr->varcList[i]);
if (result != TCL_OK) {
result = TCL_ERROR;
@@ -2965,7 +2965,7 @@ EachloopCmd(
result = TCL_ERROR;
goto done;
}
- TclListObjGetElementsM(NULL, statePtr->vCopyList[i],
+ TclListObjGetElements(NULL, statePtr->vCopyList[i],
&statePtr->varcList[i], &statePtr->varvList[i]);
/* Values */
@@ -2985,7 +2985,7 @@ EachloopCmd(
result = TCL_ERROR;
goto done;
}
- result = TclListObjGetElementsM(interp, statePtr->aCopyList[i],
+ result = TclListObjGetElements(interp, statePtr->aCopyList[i],
&statePtr->argcList[i], &statePtr->argvList[i]);
if (result != TCL_OK) {
goto done;
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index 8f7cbe6..116dbbf 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -2218,7 +2218,7 @@ Tcl_JoinObjCmd(
isArithSeries = 1;
listLen = TclArithSeriesObjLength(objv[1]);
} else {
- if (TclListObjGetElementsM(interp, objv[1], &listLen,
+ if (TclListObjGetElements(interp, objv[1], &listLen,
&elemPtrs) != TCL_OK) {
return TCL_ERROR;
}
@@ -2339,7 +2339,7 @@ Tcl_LassignObjCmd(
}
Tcl_IncrRefCount(listCopyPtr); /* Important! fs */
- TclListObjGetElementsM(NULL, listCopyPtr, &listObjc, &listObjv);
+ TclListObjGetElements(NULL, listCopyPtr, &listObjc, &listObjv);
origListObjc = listObjc;
objc -= 2;
@@ -2472,7 +2472,7 @@ Tcl_LinsertObjCmd(
return TCL_ERROR;
}
- result = TclListObjLengthM(interp, objv[1], &len);
+ result = TclListObjLength(interp, objv[1], &len);
if (result != TCL_OK) {
return result;
}
@@ -2592,7 +2592,7 @@ Tcl_LlengthObjCmd(
return TCL_ERROR;
}
- result = TclListObjLengthM(interp, objv[1], &listLen);
+ result = TclListObjLength(interp, objv[1], &listLen);
if (result != TCL_OK) {
return result;
}
@@ -2647,7 +2647,7 @@ Tcl_LpopObjCmd(
return TCL_ERROR;
}
- result = TclListObjGetElementsM(interp, listPtr, &listLen, &elemPtrs);
+ result = TclListObjGetElements(interp, listPtr, &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
@@ -2741,7 +2741,7 @@ Tcl_LrangeObjCmd(
return TCL_ERROR;
}
- result = TclListObjLengthM(interp, objv[1], &listLen);
+ result = TclListObjLength(interp, objv[1], &listLen);
if (result != TCL_OK) {
return result;
}
@@ -2830,7 +2830,7 @@ Tcl_LremoveObjCmd(
}
listObj = objv[1];
- if (TclListObjLengthM(interp, listObj, &listLen) != TCL_OK) {
+ if (TclListObjLength(interp, listObj, &listLen) != TCL_OK) {
return TCL_ERROR;
}
@@ -3071,7 +3071,7 @@ Tcl_LreplaceObjCmd(
return TCL_ERROR;
}
- result = TclListObjLengthM(interp, objv[1], &listLen);
+ result = TclListObjLength(interp, objv[1], &listLen);
if (result != TCL_OK) {
return result;
}
@@ -3185,7 +3185,7 @@ Tcl_LreverseObjCmd(
} /* end ArithSeries */
/* True List */
- if (TclListObjLengthM(interp, objv[1], &elemc) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &elemc) != TCL_OK) {
return TCL_ERROR;
}
@@ -3197,7 +3197,7 @@ Tcl_LreverseObjCmd(
Tcl_SetObjResult(interp, objv[1]);
return TCL_OK;
}
- if (TclListObjGetElementsM(interp, objv[1], &elemc, &elemv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objv[1], &elemc, &elemv) != TCL_OK) {
return TCL_ERROR;
}
@@ -3468,7 +3468,7 @@ Tcl_LsearchObjCmd(
*/
i++;
- if (TclListObjGetElementsM(interp, objv[i],
+ if (TclListObjGetElements(interp, objv[i],
&sortInfo.indexc, &indices) != TCL_OK) {
result = TCL_ERROR;
goto done;
@@ -3574,7 +3574,7 @@ Tcl_LsearchObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjGetElementsM(interp, objv[objc - 2], &listc, &listv);
+ result = TclListObjGetElements(interp, objv[objc - 2], &listc, &listv);
if (result != TCL_OK) {
goto done;
}
@@ -3679,7 +3679,7 @@ Tcl_LsearchObjCmd(
* 1844789]
*/
- TclListObjGetElementsM(NULL, objv[objc - 2], &listc, &listv);
+ TclListObjGetElements(NULL, objv[objc - 2], &listc, &listv);
break;
case REAL:
result = Tcl_GetDoubleFromObj(interp, patObj, &patDouble);
@@ -3692,7 +3692,7 @@ Tcl_LsearchObjCmd(
* 1844789]
*/
- TclListObjGetElementsM(NULL, objv[objc - 2], &listc, &listv);
+ TclListObjGetElements(NULL, objv[objc - 2], &listc, &listv);
break;
}
} else {
@@ -4604,7 +4604,7 @@ Tcl_LsortObjCmd(
sortInfo.resultCode = TCL_ERROR;
goto done;
}
- if (TclListObjGetElementsM(interp, objv[i+1], &sortindex,
+ if (TclListObjGetElements(interp, objv[i+1], &sortindex,
&indexv) != TCL_OK) {
sortInfo.resultCode = TCL_ERROR;
goto done;
@@ -4697,7 +4697,7 @@ Tcl_LsortObjCmd(
if (indexPtr) {
Tcl_Obj **indexv;
- TclListObjGetElementsM(interp, indexPtr, &sortInfo.indexc, &indexv);
+ TclListObjGetElements(interp, indexPtr, &sortInfo.indexc, &indexv);
switch (sortInfo.indexc) {
case 0:
sortInfo.indexv = NULL;
@@ -4762,7 +4762,7 @@ Tcl_LsortObjCmd(
sortInfo.resultCode = TclArithSeriesGetElements(interp,
listObj, &length, &listObjPtrs);
} else {
- sortInfo.resultCode = TclListObjGetElementsM(interp, listObj,
+ sortInfo.resultCode = TclListObjGetElements(interp, listObj,
&length, &listObjPtrs);
}
if (sortInfo.resultCode != TCL_OK || length <= 0) {
@@ -5057,7 +5057,7 @@ Tcl_LeditObjCmd(
* by Tcl_{Lrange,Lreplace,Ledit}ObjCmd
*/
- result = TclListObjLengthM(interp, listPtr, &listLen);
+ result = TclListObjLength(interp, listPtr, &listLen);
if (result != TCL_OK) {
return result;
}
@@ -5301,10 +5301,10 @@ SortCompare(
* Replace them and evaluate the result.
*/
- TclListObjLengthM(infoPtr->interp, infoPtr->compareCmdPtr, &objc);
+ TclListObjLength(infoPtr->interp, infoPtr->compareCmdPtr, &objc);
Tcl_ListObjReplace(infoPtr->interp, infoPtr->compareCmdPtr, objc - 2,
2, 2, paramObjv);
- TclListObjGetElementsM(infoPtr->interp, infoPtr->compareCmdPtr,
+ TclListObjGetElements(infoPtr->interp, infoPtr->compareCmdPtr,
&objc, &objv);
infoPtr->resultCode = Tcl_EvalObjv(infoPtr->interp, objc, objv, 0);
@@ -5515,7 +5515,7 @@ SelectObjFromSublist(
int index;
Tcl_Obj *currentObj;
- if (TclListObjLengthM(infoPtr->interp, objPtr, &listLen) != TCL_OK) {
+ if (TclListObjLength(infoPtr->interp, objPtr, &listLen) != TCL_OK) {
infoPtr->resultCode = TCL_ERROR;
return NULL;
}
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index bf25b32..c6176a6 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -679,7 +679,7 @@ Tcl_RegsubObjCmd(
* object. (If they aren't, that's cheap to do.)
*/
- if (TclListObjLengthM(interp, objv[2], &numParts) != TCL_OK) {
+ if (TclListObjLength(interp, objv[2], &numParts) != TCL_OK) {
return TCL_ERROR;
}
if (numParts < 1) {
@@ -781,7 +781,7 @@ Tcl_RegsubObjCmd(
Tcl_Obj **args = NULL, **parts;
Tcl_Size numArgs;
- TclListObjGetElementsM(interp, subPtr, &numParts, &parts);
+ TclListObjGetElements(interp, subPtr, &numParts, &parts);
numArgs = numParts + info.nsubs + 1;
args = (Tcl_Obj **)ckalloc(sizeof(Tcl_Obj*) * numArgs);
memcpy(args, parts, sizeof(Tcl_Obj*) * numParts);
@@ -1817,7 +1817,7 @@ StringIsCmd(
* well-formed lists.
*/
- if (TCL_OK == TclListObjLengthM(NULL, objPtr, &length2)) {
+ if (TCL_OK == TclListObjLength(NULL, objPtr, &length2)) {
break;
}
@@ -2028,7 +2028,7 @@ StringMapCmd(
}
Tcl_DictObjDone(&search);
} else {
- if (TclListObjGetElementsM(interp, objv[objc-2], &mapElemc,
+ if (TclListObjGetElements(interp, objv[objc-2], &mapElemc,
&mapElemv) != TCL_OK) {
return TCL_ERROR;
}
@@ -3632,7 +3632,7 @@ TclNRSwitchObjCmd(
Tcl_Obj **listv;
blist = objv[0];
- if (TclListObjLengthM(interp, objv[0], &objc) != TCL_OK) {
+ if (TclListObjLength(interp, objv[0], &objc) != TCL_OK) {
return TCL_ERROR;
}
@@ -3645,7 +3645,7 @@ TclNRSwitchObjCmd(
"?-option ...? string {?pattern body ...? ?default body?}");
return TCL_ERROR;
}
- if (TclListObjGetElementsM(interp, objv[0], &objc, &listv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objv[0], &objc, &listv) != TCL_OK) {
return TCL_ERROR;
}
objv = listv;
@@ -4024,7 +4024,7 @@ Tcl_ThrowObjCmd(
* The type must be a list of at least length 1.
*/
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
return TCL_ERROR;
} else if (len < 1) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
@@ -4813,7 +4813,7 @@ TclNRTryObjCmd(
return TCL_ERROR;
}
code = 1;
- if (TclListObjLengthM(NULL, objv[i+1], &dummy) != TCL_OK) {
+ if (TclListObjLength(NULL, objv[i+1], &dummy) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"bad prefix '%s': must be a list",
TclGetString(objv[i+1])));
@@ -4825,7 +4825,7 @@ TclNRTryObjCmd(
info[2] = objv[i+1];
commonHandler:
- if (TclListObjLengthM(interp, objv[i+2], &dummy) != TCL_OK) {
+ if (TclListObjLength(interp, objv[i+2], &dummy) != TCL_OK) {
Tcl_DecrRefCount(handlersObj);
return TCL_ERROR;
}
@@ -4975,12 +4975,12 @@ TryPostBody(
int found = 0;
Tcl_Obj **handlers, **info;
- TclListObjGetElementsM(NULL, handlersObj, &numHandlers, &handlers);
+ TclListObjGetElements(NULL, handlersObj, &numHandlers, &handlers);
for (i=0 ; i<numHandlers ; i++) {
Tcl_Obj *handlerBodyObj;
Tcl_Size numElems = 0;
- TclListObjGetElementsM(NULL, handlers[i], &numElems, &info);
+ TclListObjGetElements(NULL, handlers[i], &numElems, &info);
if (!found) {
Tcl_GetIntFromObj(NULL, info[1], &code);
if (code != result) {
@@ -5001,8 +5001,8 @@ TryPostBody(
TclNewLiteralStringObj(errorCodeName, "-errorcode");
Tcl_DictObjGet(NULL, options, errorCodeName, &errcode);
Tcl_DecrRefCount(errorCodeName);
- TclListObjGetElementsM(NULL, info[2], &len1, &bits1);
- if (TclListObjGetElementsM(NULL, errcode, &len2,
+ TclListObjGetElements(NULL, info[2], &len1, &bits1);
+ if (TclListObjGetElements(NULL, errcode, &len2,
&bits2) != TCL_OK) {
continue;
}
@@ -5042,7 +5042,7 @@ TryPostBody(
Tcl_ResetResult(interp);
result = TCL_ERROR;
- TclListObjLengthM(NULL, info[3], &numElems);
+ TclListObjLength(NULL, info[3], &numElems);
if (numElems> 0) {
Tcl_Obj *varName;
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 0104285..2fdc22d 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -301,7 +301,7 @@ TclCompileArraySetCmd(
TclNewObj(literalObj);
isDataLiteral = TclWordKnownAtCompileTime(dataTokenPtr, literalObj);
isDataValid = (isDataLiteral
- && TclListObjLengthM(NULL, literalObj, &len) == TCL_OK);
+ && TclListObjLength(NULL, literalObj, &len) == TCL_OK);
isDataEven = (isDataValid && (len & 1) == 0);
/*
@@ -892,7 +892,7 @@ TclCompileConcatCmd(
const char *bytes;
int len;
- TclListObjGetElementsM(NULL, listObj, &len, &objs);
+ TclListObjGetElements(NULL, listObj, &len, &objs);
objPtr = Tcl_ConcatObj(len, objs);
Tcl_DecrRefCount(listObj);
bytes = TclGetStringFromObj(objPtr, &len);
@@ -2750,7 +2750,7 @@ CompileEachloopCmd(
*/
if (!TclWordKnownAtCompileTime(tokenPtr, varListObj) ||
- TCL_OK != TclListObjLengthM(NULL, varListObj, &numVars) ||
+ TCL_OK != TclListObjLength(NULL, varListObj, &numVars) ||
numVars == 0) {
code = TCL_ERROR;
goto done;
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index f738303..c3aba1e 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -935,7 +935,7 @@ TclCompileStringMapCmd(
if (!TclWordKnownAtCompileTime(mapTokenPtr, mapObj)) {
Tcl_DecrRefCount(mapObj);
return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
- } else if (TclListObjGetElementsM(NULL, mapObj, &len, &objv) != TCL_OK) {
+ } else if (TclListObjGetElements(NULL, mapObj, &len, &objv) != TCL_OK) {
Tcl_DecrRefCount(mapObj);
return TclCompileBasic2ArgCmd(interp, parsePtr, cmdPtr, envPtr);
} else if (len != 2) {
@@ -2727,7 +2727,7 @@ TclCompileThrowCmd(
CompileWord(envPtr, msgToken, interp, 2);
codeIsList = codeKnown && (TCL_OK ==
- TclListObjLengthM(interp, objPtr, &len));
+ TclListObjLength(interp, objPtr, &len));
codeIsValid = codeIsList && (len != 0);
if (codeIsValid) {
@@ -2860,7 +2860,7 @@ TclCompileTryCmd(
TclNewObj(tmpObj);
Tcl_IncrRefCount(tmpObj);
if (!TclWordKnownAtCompileTime(tokenPtr, tmpObj)
- || TclListObjLengthM(NULL, tmpObj, &objc) != TCL_OK
+ || TclListObjLength(NULL, tmpObj, &objc) != TCL_OK
|| (objc == 0)) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
@@ -2903,7 +2903,7 @@ TclCompileTryCmd(
TclDecrRefCount(tmpObj);
goto failedToCompile;
}
- if (TclListObjGetElementsM(NULL, tmpObj, &objc, &objv) != TCL_OK
+ if (TclListObjGetElements(NULL, tmpObj, &objc, &objv) != TCL_OK
|| (objc > 2)) {
TclDecrRefCount(tmpObj);
goto failedToCompile;
@@ -3117,7 +3117,7 @@ IssueTryClausesInstructions(
JUMP4( JUMP_FALSE, notCodeJumpSource);
if (matchClauses[i]) {
const char *p;
- TclListObjLengthM(NULL, matchClauses[i], &len);
+ TclListObjLength(NULL, matchClauses[i], &len);
/*
* Match the errorcode according to try/trap rules.
@@ -3328,7 +3328,7 @@ IssueTryClausesFinallyInstructions(
OP( EQ);
JUMP4( JUMP_FALSE, notCodeJumpSource);
if (matchClauses[i]) {
- TclListObjLengthM(NULL, matchClauses[i], &len);
+ TclListObjLength(NULL, matchClauses[i], &len);
/*
* Match the errorcode according to try/trap rules.
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index e97c552..187c25c 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -2223,8 +2223,8 @@ TclCompileExpr(
TclAdvanceLines(&envPtr->line, script,
script + TclParseAllWhiteSpace(script, numBytes));
- TclListObjGetElementsM(NULL, litList, &objc, (Tcl_Obj ***)&litObjv);
- TclListObjGetElementsM(NULL, funcList, &objc, &funcObjv);
+ TclListObjGetElements(NULL, litList, &objc, (Tcl_Obj ***)&litObjv);
+ TclListObjGetElements(NULL, funcList, &objc, &funcObjv);
CompileExprTree(interp, opTree, 0, &litObjv, funcObjv,
parsePtr->tokenPtr, envPtr, optimize);
} else {
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 9e0baea..c7e2c86 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -617,7 +617,7 @@ SetDictFromAny(
Tcl_Obj **objv;
/* Cannot fail, we already know the Tcl_ObjType is "list". */
- TclListObjGetElementsM(NULL, objPtr, &objc, &objv);
+ TclListObjGetElements(NULL, objPtr, &objc, &objv);
if (objc & 1) {
goto missingValue;
}
@@ -2485,7 +2485,7 @@ DictForNRCmd(
* Parse arguments.
*/
- if (TclListObjGetElementsM(interp, objv[1], &varc, &varv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objv[1], &varc, &varv) != TCL_OK) {
return TCL_ERROR;
}
if (varc != 2) {
@@ -2504,7 +2504,7 @@ DictForNRCmd(
TclStackFree(interp, searchPtr);
return TCL_OK;
}
- TclListObjGetElementsM(NULL, objv[1], &varc, &varv);
+ TclListObjGetElements(NULL, objv[1], &varc, &varv);
keyVarObj = varv[0];
valueVarObj = varv[1];
scriptObj = objv[3];
@@ -2680,7 +2680,7 @@ DictMapNRCmd(
* Parse arguments.
*/
- if (TclListObjGetElementsM(interp, objv[1], &varc, &varv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objv[1], &varc, &varv) != TCL_OK) {
return TCL_ERROR;
}
if (varc != 2) {
@@ -2706,7 +2706,7 @@ DictMapNRCmd(
return TCL_OK;
}
TclNewObj(storagePtr->accumulatorObj);
- TclListObjGetElementsM(NULL, objv[1], &varc, &varv);
+ TclListObjGetElements(NULL, objv[1], &varc, &varv);
storagePtr->keyVarObj = varv[0];
storagePtr->valueVarObj = varv[1];
storagePtr->scriptObj = objv[3];
@@ -3120,7 +3120,7 @@ DictFilterCmd(
* copying from the "dict for" implementation has occurred!
*/
- if (TclListObjGetElementsM(interp, objv[3], &varc, &varv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objv[3], &varc, &varv) != TCL_OK) {
return TCL_ERROR;
}
if (varc != 2) {
@@ -3382,7 +3382,7 @@ FinalizeDictUpdate(
* an instruction to remove the key.
*/
- TclListObjGetElementsM(NULL, argsObj, &objc, &objv);
+ TclListObjGetElements(NULL, argsObj, &objc, &objv);
for (i=0 ; i<objc ; i+=2) {
objPtr = Tcl_ObjGetVar2(interp, objv[i+1], NULL, 0);
if (objPtr == NULL) {
@@ -3506,7 +3506,7 @@ FinalizeDictWith(
state = Tcl_SaveInterpState(interp, result);
if (pathPtr != NULL) {
- TclListObjGetElementsM(NULL, pathPtr, &pathc, &pathv);
+ TclListObjGetElements(NULL, pathPtr, &pathc, &pathv);
} else {
pathc = 0;
pathv = NULL;
@@ -3712,7 +3712,7 @@ TclDictWithFinish(
* Now process our updates on the leaf dictionary.
*/
- TclListObjGetElementsM(NULL, keysPtr, &keyc, &keyv);
+ TclListObjGetElements(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 adbae1d..81bfa08 100644
--- a/generic/tclDisassemble.c
+++ b/generic/tclDisassemble.c
@@ -765,7 +765,7 @@ TclGetInnerContext(
* Reset while keeping the list internalrep as much as possible.
*/
- TclListObjLengthM(interp, result, &len);
+ TclListObjLength(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 0658d21..34d51e1 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -405,7 +405,7 @@ Tcl_SetEncodingSearchPath(
{
Tcl_Size dummy;
- if (TCL_ERROR == TclListObjLengthM(NULL, searchPath, &dummy)) {
+ if (TCL_ERROR == TclListObjLength(NULL, searchPath, &dummy)) {
return TCL_ERROR;
}
TclSetProcessGlobalValue(&encodingSearchPath, searchPath, NULL);
@@ -452,7 +452,7 @@ TclSetLibraryPath(
{
Tcl_Size dummy;
- if (TCL_ERROR == TclListObjLengthM(NULL, path, &dummy)) {
+ if (TCL_ERROR == TclListObjLength(NULL, path, &dummy)) {
return;
}
TclSetProcessGlobalValue(&libraryPath, path, NULL);
@@ -491,7 +491,7 @@ FillEncodingFileMap(void)
searchPath = Tcl_GetEncodingSearchPath();
Tcl_IncrRefCount(searchPath);
- TclListObjLengthM(NULL, searchPath, &numDirs);
+ TclListObjLength(NULL, searchPath, &numDirs);
map = Tcl_NewDictObj();
Tcl_IncrRefCount(map);
@@ -515,7 +515,7 @@ FillEncodingFileMap(void)
Tcl_FSMatchInDirectory(NULL, matchFileList, directory, "*.enc",
&readableFiles);
- TclListObjGetElementsM(NULL, matchFileList, &numFiles, &filev);
+ TclListObjGetElements(NULL, matchFileList, &numFiles, &filev);
for (j=0; j<numFiles; j++) {
Tcl_Obj *encodingName, *fileObj;
@@ -773,7 +773,7 @@ Tcl_GetDefaultEncodingDir(void)
int numDirs;
Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath();
- TclListObjLengthM(NULL, searchPath, &numDirs);
+ TclListObjLength(NULL, searchPath, &numDirs);
if (numDirs == 0) {
return NULL;
}
@@ -1823,7 +1823,7 @@ OpenEncodingFileChannel(
Tcl_Channel chan = NULL;
Tcl_Size i, numDirs;
- TclListObjGetElementsM(NULL, searchPath, &numDirs, &dir);
+ TclListObjGetElements(NULL, searchPath, &numDirs, &dir);
Tcl_IncrRefCount(nameObj);
Tcl_AppendToObj(fileNameObj, ".enc", TCL_INDEX_NONE);
Tcl_IncrRefCount(fileNameObj);
@@ -4381,7 +4381,7 @@ InitializeEncodingSearchPath(
Tcl_IncrRefCount(searchPathObj);
libPathObj = TclGetLibraryPath();
Tcl_IncrRefCount(libPathObj);
- TclListObjLengthM(NULL, libPathObj, &numDirs);
+ TclListObjLength(NULL, libPathObj, &numDirs);
for (i = 0; i < numDirs; i++) {
Tcl_Obj *directoryObj, *pathObj;
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index a7418aa..fff41d0 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -234,7 +234,7 @@ TclNamespaceEnsembleCmd(
cxtPtr = nsPtr;
continue;
case CRT_SUBCMDS:
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
}
@@ -243,7 +243,7 @@ TclNamespaceEnsembleCmd(
subcmdObj = (len > 0 ? objv[1] : NULL);
continue;
case CRT_PARAM:
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
}
@@ -273,7 +273,7 @@ TclNamespaceEnsembleCmd(
Tcl_Obj **listv;
const char *cmd;
- if (TclListObjGetElementsM(interp, listObj, &len,
+ if (TclListObjGetElements(interp, listObj, &len,
&listv) != TCL_OK) {
Tcl_DictObjDone(&search);
if (patchedDict) {
@@ -339,7 +339,7 @@ TclNamespaceEnsembleCmd(
continue;
}
case CRT_UNKNOWN:
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
if (allocatedMapFlag) {
Tcl_DecrRefCount(mapObj);
}
@@ -535,13 +535,13 @@ TclNamespaceEnsembleCmd(
}
switch ((enum EnsConfigOpts) index) {
case CONF_SUBCMDS:
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
goto freeMapAndError;
}
subcmdObj = (len > 0 ? objv[1] : NULL);
continue;
case CONF_PARAM:
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
goto freeMapAndError;
}
paramObj = (len > 0 ? objv[1] : NULL);
@@ -563,7 +563,7 @@ TclNamespaceEnsembleCmd(
continue;
}
do {
- if (TclListObjLengthM(interp, listObj, &len
+ if (TclListObjLength(interp, listObj, &len
) != TCL_OK) {
Tcl_DictObjDone(&search);
if (patchedDict) {
@@ -583,7 +583,7 @@ TclNamespaceEnsembleCmd(
}
goto freeMapAndError;
}
- if (TclListObjGetElementsM(interp, listObj, &len,
+ if (TclListObjGetElements(interp, listObj, &len,
&listv) != TCL_OK) {
Tcl_DictObjDone(&search);
if (patchedDict) {
@@ -633,7 +633,7 @@ TclNamespaceEnsembleCmd(
}
continue;
case CONF_UNKNOWN:
- if (TclListObjLengthM(interp, objv[1], &len) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &len) != TCL_OK) {
goto freeMapAndError;
}
unknownObj = (len > 0 ? objv[1] : NULL);
@@ -802,7 +802,7 @@ Tcl_SetEnsembleSubcommandList(
if (subcmdList != NULL) {
Tcl_Size length;
- if (TclListObjLengthM(interp, subcmdList, &length) != TCL_OK) {
+ if (TclListObjLength(interp, subcmdList, &length) != TCL_OK) {
return TCL_ERROR;
}
if (length < 1) {
@@ -878,7 +878,7 @@ Tcl_SetEnsembleParameterList(
if (paramList == NULL) {
length = 0;
} else {
- if (TclListObjLengthM(interp, paramList, &length) != TCL_OK) {
+ if (TclListObjLength(interp, paramList, &length) != TCL_OK) {
return TCL_ERROR;
}
if (length < 1) {
@@ -1054,7 +1054,7 @@ Tcl_SetEnsembleUnknownHandler(
if (unknownList != NULL) {
Tcl_Size length;
- if (TclListObjLengthM(interp, unknownList, &length) != TCL_OK) {
+ if (TclListObjLength(interp, unknownList, &length) != TCL_OK) {
return TCL_ERROR;
}
if (length < 1) {
@@ -1898,7 +1898,7 @@ NsEnsembleImplementationCmdNR(
Tcl_Obj **copyObjv;
Tcl_Size copyObjc, prefixObjc;
- TclListObjLengthM(NULL, prefixObj, &prefixObjc);
+ TclListObjLength(NULL, prefixObj, &prefixObjc);
if (objc == 2) {
copyPtr = TclListObjCopy(NULL, prefixObj);
@@ -1932,7 +1932,7 @@ NsEnsembleImplementationCmdNR(
*/
TclSkipTailcall(interp);
- TclListObjGetElementsM(NULL, copyPtr, &copyObjc, &copyObjv);
+ TclListObjGetElements(NULL, copyPtr, &copyObjc, &copyObjv);
((Interp *)interp)->lookupNsPtr = ensemblePtr->nsPtr;
return TclNREvalObjv(interp, copyObjc, copyObjv, TCL_EVAL_INVOKE, NULL);
}
@@ -2308,7 +2308,7 @@ EnsembleUnknownCallback(
for (i = 1 ; i < objc ; i++) {
Tcl_ListObjAppendElement(NULL, unknownCmd, objv[i]);
}
- TclListObjGetElementsM(NULL, unknownCmd, &paramc, &paramv);
+ TclListObjGetElements(NULL, unknownCmd, &paramc, &paramv);
Tcl_IncrRefCount(unknownCmd);
/*
@@ -2345,7 +2345,7 @@ EnsembleUnknownCallback(
/* A non-empty list is the replacement command. */
- if (TclListObjLengthM(interp, *prefixObjPtr, &prefixObjc) != TCL_OK) {
+ if (TclListObjLength(interp, *prefixObjPtr, &prefixObjc) != TCL_OK) {
TclDecrRefCount(*prefixObjPtr);
Tcl_AddErrorInfo(interp, "\n while parsing result of "
"ensemble unknown subcommand handler");
@@ -2602,7 +2602,7 @@ BuildEnsembleConfig(
* Determine the target for each.
*/
- TclListObjGetElementsM(NULL, subList, &subc, &subv);
+ TclListObjGetElements(NULL, subList, &subc, &subv);
if (subList == mapDict) {
/*
* Unusual case where explicit list of subcommands is same value
@@ -3000,7 +3000,7 @@ TclCompileEnsemble(
const char *str;
Tcl_Obj *matchObj = NULL;
- if (TclListObjGetElementsM(NULL, listObj, &len, &elems) != TCL_OK) {
+ if (TclListObjGetElements(NULL, listObj, &len, &elems) != TCL_OK) {
goto tryCompileToInv;
}
for (i=0 ; i<len ; i++) {
@@ -3120,7 +3120,7 @@ TclCompileEnsemble(
doneMapLookup:
Tcl_ListObjAppendElement(NULL, replaced, replacement);
- if (TclListObjGetElementsM(NULL, targetCmdObj, &len, &elems) != TCL_OK) {
+ if (TclListObjGetElements(NULL, targetCmdObj, &len, &elems) != TCL_OK) {
goto tryCompileToInv;
} else if (len != 1) {
/*
@@ -3404,7 +3404,7 @@ CompileToInvokedCommand(
* difference. Hence the call to TclContinuationsEnterDerived...
*/
- TclListObjGetElementsM(NULL, replacements, &numWords, &words);
+ TclListObjGetElements(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 ef87c47..1a2f8ca 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -249,7 +249,7 @@ HandleBgErrors(
errPtr = assocPtr->firstBgPtr;
- TclListObjGetElementsM(NULL, copyObj, &prefixObjc, &prefixObjv);
+ TclListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
tempObjv = (Tcl_Obj**)ckalloc((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 fd955f5..de57fc5 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2728,7 +2728,7 @@ TEBCresume(
objPtr = OBJ_AT_TOS;
TRACE(("\"%.30s\" => ", O2S(objPtr)));
- if (TclListObjGetElementsM(interp, objPtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objPtr, &objc, &objv) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -3025,7 +3025,7 @@ TEBCresume(
TclMarkTailcall(interp);
TclNRAddCallback(interp, TclClearRootEnsemble, NULL, NULL, NULL, NULL);
- TclListObjGetElementsM(NULL, objPtr, &objc, &objv);
+ TclListObjGetElements(NULL, objPtr, &objc, &objv);
TclNRAddCallback(interp, TclNRReleaseValues, objPtr, NULL, NULL, NULL);
return TclNREvalObjv(interp, objc, objv, TCL_EVAL_INVOKE, NULL);
@@ -3437,7 +3437,7 @@ TEBCresume(
varPtr = varPtr->value.linkPtr;
}
TRACE(("%u <- \"%.30s\" => ", opnd, O2S(valuePtr)));
- if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv)
+ if (TclListObjGetElements(interp, valuePtr, &objc, &objv)
!= TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
@@ -3463,7 +3463,7 @@ TEBCresume(
}
TRACE(("%u \"%.30s\" \"%.30s\" => ",
opnd, O2S(part2Ptr), O2S(valuePtr)));
- if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv)
+ if (TclListObjGetElements(interp, valuePtr, &objc, &objv)
!= TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
@@ -3505,7 +3505,7 @@ TEBCresume(
lappendListDirect:
objResultPtr = varPtr->value.objPtr;
- if (TclListObjLengthM(interp, objResultPtr, &len) != TCL_OK) {
+ if (TclListObjLength(interp, objResultPtr, &len) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -3526,7 +3526,7 @@ TEBCresume(
lappendList:
opnd = -1;
- if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv)
+ if (TclListObjGetElements(interp, valuePtr, &objc, &objv)
!= TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
@@ -3564,7 +3564,7 @@ TEBCresume(
if (!objResultPtr) {
valueToAssign = valuePtr;
- } else if (TclListObjLengthM(interp, objResultPtr, &len)!=TCL_OK) {
+ } else if (TclListObjLength(interp, objResultPtr, &len)!=TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
} else {
@@ -4846,7 +4846,7 @@ TEBCresume(
case INST_LIST_LENGTH:
TRACE(("\"%.30s\" => ", O2S(OBJ_AT_TOS)));
- if (TclListObjLengthM(interp, OBJ_AT_TOS, &length) != TCL_OK) {
+ if (TclListObjLength(interp, OBJ_AT_TOS, &length) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -4882,7 +4882,7 @@ TEBCresume(
* Extract the desired list element.
*/
- if ((TclListObjGetElementsM(interp, valuePtr, &objc, &objv) == TCL_OK)
+ if ((TclListObjGetElements(interp, valuePtr, &objc, &objv) == TCL_OK)
&& !TclHasInternalRep(value2Ptr, &tclListType)) {
int code;
@@ -4954,7 +4954,7 @@ TEBCresume(
* in the process.
*/
- if (TclListObjGetElementsM(interp, valuePtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, valuePtr, &objc, &objv) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -5095,7 +5095,7 @@ TEBCresume(
* in the process.
*/
- if (TclListObjLengthM(interp, valuePtr, &objc) != TCL_OK) {
+ if (TclListObjLength(interp, valuePtr, &objc) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -5168,7 +5168,7 @@ TEBCresume(
s1 = TclGetStringFromObj(valuePtr, &s1len);
TRACE(("\"%.30s\" \"%.30s\" => ", O2S(valuePtr), O2S(value2Ptr)));
- if (TclListObjLengthM(interp, value2Ptr, &length) != TCL_OK) {
+ if (TclListObjLength(interp, value2Ptr, &length) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -6660,7 +6660,7 @@ TEBCresume(
listVarPtr = LOCAL(listTmpIndex);
listPtr = listVarPtr->value.objPtr;
- if (TclListObjLengthM(interp, listPtr, &listLen) != TCL_OK) {
+ if (TclListObjLength(interp, listPtr, &listLen) != TCL_OK) {
TRACE_APPEND(("ERROR converting list %ld, \"%.30s\": %s\n",
i, O2S(listPtr), O2S(Tcl_GetObjResult(interp))));
goto gotError;
@@ -6689,7 +6689,7 @@ TEBCresume(
listVarPtr = LOCAL(listTmpIndex);
/* Do not use TclListObjCopy here - shimmers arithseries to list */
listPtr = Tcl_DuplicateObj(listVarPtr->value.objPtr);
- TclListObjGetElementsM(interp, listPtr, &listLen, &elements);
+ TclListObjGetElements(interp, listPtr, &listLen, &elements);
valIndex = (iterNum * numVars);
for (j = 0; j < numVars; j++) {
@@ -6779,7 +6779,7 @@ TEBCresume(
varListPtr = infoPtr->varLists[i];
numVars = varListPtr->numVars;
listPtr = OBJ_AT_DEPTH(listTmpDepth);
- if (TclListObjLengthM(interp, listPtr, &listLen) != TCL_OK) {
+ if (TclListObjLength(interp, listPtr, &listLen) != TCL_OK) {
TRACE_APPEND(("ERROR converting list %ld, \"%s\": %s",
i, O2S(listPtr), O2S(Tcl_GetObjResult(interp))));
goto gotError;
@@ -6873,7 +6873,7 @@ TEBCresume(
status = Tcl_ListObjLength(interp, listPtr, &listLen);
elements = NULL;
} else {
- status = TclListObjGetElementsM(
+ status = TclListObjGetElements(
interp, listPtr, &listLen, &elements);
}
if (status != TCL_OK) {
@@ -7503,7 +7503,7 @@ TEBCresume(
}
}
Tcl_IncrRefCount(dictPtr);
- if (TclListObjGetElementsM(interp, OBJ_AT_TOS, &length,
+ if (TclListObjGetElements(interp, OBJ_AT_TOS, &length,
&keyPtrPtr) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
@@ -7563,7 +7563,7 @@ TEBCresume(
NEXT_INST_F(9, 1, 0);
}
if (Tcl_DictObjSize(interp, dictPtr, &length) != TCL_OK
- || TclListObjGetElementsM(interp, OBJ_AT_TOS, &length,
+ || TclListObjGetElements(interp, OBJ_AT_TOS, &length,
&keyPtrPtr) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
@@ -7622,7 +7622,7 @@ TEBCresume(
dictPtr = OBJ_UNDER_TOS;
listPtr = OBJ_AT_TOS;
TRACE(("\"%.30s\" \"%.30s\" =>", O2S(dictPtr), O2S(listPtr)));
- if (TclListObjGetElementsM(interp, listPtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
@@ -7640,7 +7640,7 @@ TEBCresume(
listPtr = OBJ_AT_TOS;
TRACE(("\"%.30s\" \"%.30s\" \"%.30s\" => ",
O2S(varNamePtr), O2S(valuePtr), O2S(keysPtr)));
- if (TclListObjGetElementsM(interp, listPtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) {
TRACE_ERROR(interp);
TclDecrRefCount(keysPtr);
goto gotError;
@@ -7671,7 +7671,7 @@ TEBCresume(
varPtr = LOCAL(opnd);
TRACE(("%u <- \"%.30s\" \"%.30s\" => ", opnd, O2S(valuePtr),
O2S(keysPtr)));
- if (TclListObjGetElementsM(interp, listPtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, listPtr, &objc, &objv) != TCL_OK) {
TRACE_ERROR(interp);
goto gotError;
}
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 8ca0c88..42f4c5a 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -1006,7 +1006,7 @@ TclFileAttrsCmd(
* Use objStrings as a list object.
*/
- if (TclListObjLengthM(interp, objStrings, &numObjStrings) != TCL_OK) {
+ if (TclListObjLength(interp, objStrings, &numObjStrings) != TCL_OK) {
goto end;
}
attributeStringsAllocated = (const char **)
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 7f4f1cc..9b9d283 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -515,7 +515,7 @@ TclpNativeSplitPath(
*/
if (lenPtr != NULL) {
- TclListObjLengthM(NULL, resultPtr, lenPtr);
+ TclListObjLength(NULL, resultPtr, lenPtr);
}
return resultPtr;
}
@@ -1318,7 +1318,7 @@ Tcl_GlobObjCmd(
return TCL_ERROR;
}
typePtr = objv[i+1];
- if (TclListObjLengthM(interp, typePtr, &length) != TCL_OK) {
+ if (TclListObjLength(interp, typePtr, &length) != TCL_OK) {
return TCL_ERROR;
}
i++;
@@ -1444,7 +1444,7 @@ Tcl_GlobObjCmd(
* platform.
*/
- TclListObjLengthM(interp, typePtr, &length);
+ TclListObjLength(interp, typePtr, &length);
if (length <= 0) {
goto skipTypes;
}
@@ -1514,7 +1514,7 @@ Tcl_GlobObjCmd(
} else {
Tcl_Obj *item;
- if ((TclListObjLengthM(NULL, look, &len) == TCL_OK)
+ if ((TclListObjLength(NULL, look, &len) == TCL_OK)
&& (len == 3)) {
Tcl_ListObjIndex(interp, look, 0, &item);
if (!strcmp("macintosh", Tcl_GetString(item))) {
@@ -1621,7 +1621,7 @@ Tcl_GlobObjCmd(
}
if ((globFlags & TCL_GLOBMODE_NO_COMPLAIN) == 0) {
- if (TclListObjLengthM(interp, Tcl_GetObjResult(interp),
+ if (TclListObjLength(interp, Tcl_GetObjResult(interp),
&length) != TCL_OK) {
/*
* This should never happen. Maybe we should be more dramatic.
@@ -2004,7 +2004,7 @@ TclGlob(
}
}
- TclListObjGetElementsM(NULL, filenamesObj, &objc, &objv);
+ TclListObjGetElements(NULL, filenamesObj, &objc, &objv);
for (i = 0; i< objc; i++) {
int len;
const char *oldStr = TclGetStringFromObj(objv[i], &len);
@@ -2331,13 +2331,13 @@ DoGlob(
int subdirc, i, repair = -1;
Tcl_Obj **subdirv;
- result = TclListObjGetElementsM(interp, subdirsPtr,
+ result = TclListObjGetElements(interp, subdirsPtr,
&subdirc, &subdirv);
for (i=0; result==TCL_OK && i<subdirc; i++) {
Tcl_Obj *copy = NULL;
if (pathPtr == NULL && Tcl_GetString(subdirv[i])[0] == '~') {
- TclListObjLengthM(NULL, matchesObj, &repair);
+ TclListObjLength(NULL, matchesObj, &repair);
copy = subdirv[i];
subdirv[i] = Tcl_NewStringObj("./", 2);
Tcl_AppendObjToObj(subdirv[i], copy);
@@ -2350,7 +2350,7 @@ DoGlob(
Tcl_DecrRefCount(subdirv[i]);
subdirv[i] = copy;
- TclListObjLengthM(NULL, matchesObj, &end);
+ TclListObjLength(NULL, matchesObj, &end);
while (repair < end) {
const char *bytes;
int numBytes;
diff --git a/generic/tclIO.c b/generic/tclIO.c
index 7e7d88c..15e0785 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -11394,7 +11394,7 @@ FixLevelCode(
* information. Hence an error means that we've got serious breakage.
*/
- res = TclListObjGetElementsM(NULL, msg, &lc, &lv);
+ res = TclListObjGetElements(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 93442a1..4d5c0b3 100644
--- a/generic/tclIOGT.c
+++ b/generic/tclIOGT.c
@@ -274,7 +274,7 @@ TclChannelTransform(
return TCL_ERROR;
}
- if (TCL_OK != TclListObjLengthM(interp, cmdObjPtr, &objc)) {
+ if (TCL_OK != TclListObjLength(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 41e9e88..31ead91 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -619,7 +619,7 @@ TclChanCreateObjCmd(
* Compare open mode against optional r/w.
*/
- if (TclListObjGetElementsM(NULL, resObj, &listc, &listv) != TCL_OK) {
+ if (TclListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned non-list: %s",
TclGetString(cmdObj), TclGetString(resObj)));
@@ -1080,7 +1080,7 @@ UnmarshallErrorResult(
* information; if we panic here, something has gone badly wrong already.
*/
- if (TclListObjGetElementsM(interp, msgObj, &lc, &lv) != TCL_OK) {
+ if (TclListObjGetElements(interp, msgObj, &lc, &lv) != TCL_OK) {
Tcl_Panic("TclChanCaughtErrorBypass: Bad syntax of caught result");
}
if (interp == NULL) {
@@ -2029,7 +2029,7 @@ ReflectGetOption(
* result is a valid list. Nor that the list has an even number elements.
*/
- if (TclListObjGetElementsM(interp, resObj, &listc, &listv) != TCL_OK) {
+ if (TclListObjGetElements(interp, resObj, &listc, &listv) != TCL_OK) {
goto error;
}
@@ -2175,7 +2175,7 @@ EncodeEventMask(
int evIndex; /* Id of event for an element of the eventspec
* list. */
- if (TclListObjGetElementsM(interp, obj, &listc, &listv) != TCL_OK) {
+ if (TclListObjGetElements(interp, obj, &listc, &listv) != TCL_OK) {
return TCL_ERROR;
}
@@ -3335,7 +3335,7 @@ ForwardProc(
Tcl_Size listc;
Tcl_Obj **listv;
- if (TclListObjGetElementsM(interp, resObj, &listc,
+ if (TclListObjGetElements(interp, resObj, &listc,
&listv) != TCL_OK) {
Tcl_DecrRefCount(resObj);
resObj = MarshallError(interp);
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 75e2f96..42c62a4 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -607,7 +607,7 @@ TclChanPushObjCmd(
* through the mask. Compare open mode against optional r/w.
*/
- if (TclListObjGetElementsM(NULL, resObj, &listc, &listv) != TCL_OK) {
+ if (TclListObjGetElements(NULL, resObj, &listc, &listv) != TCL_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned non-list: %s",
TclGetString(cmdObj), TclGetString(resObj)));
@@ -843,7 +843,7 @@ UnmarshallErrorResult(
* information; if we panic here, something has gone badly wrong already.
*/
- if (TclListObjGetElementsM(interp, msgObj, &lc, &lv) != TCL_OK) {
+ if (TclListObjGetElements(interp, msgObj, &lc, &lv) != TCL_OK) {
Tcl_Panic("TclChanCaughtErrorBypass: Bad syntax of caught result");
}
if (interp == NULL) {
@@ -1796,7 +1796,7 @@ NewReflectedTransform(
/* ASSERT: cmdpfxObj is a Tcl List */
- TclListObjGetElementsM(interp, cmdpfxObj, &listc, &listv);
+ TclListObjGetElements(interp, cmdpfxObj, &listc, &listv);
/*
* See [==] as well.
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 28fed76..b3643fe 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -1067,7 +1067,7 @@ Tcl_FSMatchInDirectory(
* resultPtr and tmpResultPtr are guaranteed to be distinct.
*/
- ret = TclListObjGetElementsM(interp, tmpResultPtr,
+ ret = TclListObjGetElements(interp, tmpResultPtr,
&resLength, &elemsPtr);
for (i=0 ; ret==TCL_OK && i<resLength ; i++) {
ret = Tcl_ListObjAppendElement(interp, resultPtr,
@@ -1115,10 +1115,10 @@ FsAddMountsToGlobResult(
return;
}
- if (TclListObjLengthM(NULL, mounts, &mLength) != TCL_OK || mLength == 0) {
+ if (TclListObjLength(NULL, mounts, &mLength) != TCL_OK || mLength == 0) {
goto endOfMounts;
}
- if (TclListObjLengthM(NULL, resultPtr, &gLength) != TCL_OK) {
+ if (TclListObjLength(NULL, resultPtr, &gLength) != TCL_OK) {
goto endOfMounts;
}
for (i=0 ; i<mLength ; i++) {
@@ -2485,7 +2485,7 @@ TclFSFileAttrIndex(
Tcl_Size i, objc;
Tcl_Obj **objv;
- if (TclListObjGetElementsM(NULL, listObj, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(NULL, listObj, &objc, &objv) != TCL_OK) {
TclDecrRefCount(listObj);
return TCL_ERROR;
}
@@ -3878,7 +3878,7 @@ Tcl_FSSplitPath(
}
if (lenPtr != NULL) {
- TclListObjLengthM(NULL, result, lenPtr);
+ TclListObjLength(NULL, result, lenPtr);
}
return result;
}
@@ -4001,7 +4001,7 @@ TclFSNonnativePathType(
Tcl_Obj *thisFsVolumes = fsRecPtr->fsPtr->listVolumesProc();
if (thisFsVolumes != NULL) {
- if (TclListObjLengthM(NULL, thisFsVolumes, &numVolumes)
+ if (TclListObjLength(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 01d3c94..d999cc9 100644
--- a/generic/tclIndexObj.c
+++ b/generic/tclIndexObj.c
@@ -185,7 +185,7 @@ GetIndexFromObjList(
* of the code there. This is a bit inefficient but simpler.
*/
- result = TclListObjGetElementsM(interp, tableObjPtr, &objc, &objv);
+ result = TclListObjGetElements(interp, tableObjPtr, &objc, &objv);
if (result != TCL_OK) {
return result;
}
@@ -616,7 +616,7 @@ PrefixMatchObjCmd(
return TCL_ERROR;
}
i++;
- result = TclListObjLengthM(interp, objv[i], &errorLength);
+ result = TclListObjLength(interp, objv[i], &errorLength);
if (result != TCL_OK) {
return TCL_ERROR;
}
@@ -640,7 +640,7 @@ PrefixMatchObjCmd(
* error case regardless of level.
*/
- result = TclListObjLengthM(interp, tablePtr, &i);
+ result = TclListObjLength(interp, tablePtr, &i);
if (result != TCL_OK) {
return result;
}
@@ -706,7 +706,7 @@ PrefixAllObjCmd(
return TCL_ERROR;
}
- result = TclListObjGetElementsM(interp, objv[1], &tableObjc, &tableObjv);
+ result = TclListObjGetElements(interp, objv[1], &tableObjc, &tableObjv);
if (result != TCL_OK) {
return result;
}
@@ -764,7 +764,7 @@ PrefixLongestObjCmd(
return TCL_ERROR;
}
- result = TclListObjGetElementsM(interp, objv[1], &tableObjc, &tableObjv);
+ result = TclListObjGetElements(interp, objv[1], &tableObjc, &tableObjv);
if (result != TCL_OK) {
return result;
}
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 008980a..13e1c57 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -2627,7 +2627,7 @@ typedef struct ListRep {
* Return TCL_OK on success or TCL_ERROR if the Tcl_Obj cannot be
* converted to a list.
*/
-#define TclListObjGetElementsM(interp_, listObj_, objcPtr_, objvPtr_) \
+#define TclListObjGetElements(interp_, listObj_, objcPtr_, objvPtr_) \
(((listObj_)->typePtr == &tclListType) \
? ((ListObjGetElements((listObj_), *(objcPtr_), *(objvPtr_))), \
TCL_OK) \
@@ -2639,7 +2639,7 @@ typedef struct ListRep {
* count in lenPtr_. Returns TCL_OK on success or TCL_ERROR if the
* Tcl_Obj cannot be converted to a list.
*/
-#define TclListObjLengthM(interp_, listObj_, lenPtr_) \
+#define TclListObjLength(interp_, listObj_, lenPtr_) \
(((listObj_)->typePtr == &tclListType) \
? ((ListObjLength((listObj_), *(lenPtr_))), TCL_OK) \
: Tcl_ListObjLength((interp_), (listObj_), (lenPtr_)))
@@ -4374,13 +4374,13 @@ MODULE_SCOPE const TclFileAttrProcs tclpFileAttrProcs[];
#define TCL_MAX_TOKENS (int)(UINT_MAX / sizeof(Tcl_Token))
#define TclGrowTokenArray(tokenPtr, used, available, append, staticPtr) \
do { \
- int _needed = (used) + (append); \
+ Tcl_Size _needed = (used) + (append); \
if (_needed > TCL_MAX_TOKENS) { \
Tcl_Panic("max # of tokens for a Tcl parse (%d) exceeded", \
TCL_MAX_TOKENS); \
} \
if (_needed > (available)) { \
- int allocated = 2 * _needed; \
+ Tcl_Size allocated = 2 * _needed; \
Tcl_Token *oldPtr = (tokenPtr); \
Tcl_Token *newPtr; \
if (oldPtr == (staticPtr)) { \
diff --git a/generic/tclInterp.c b/generic/tclInterp.c
index 3d2c009..5abda57 100644
--- a/generic/tclInterp.c
+++ b/generic/tclInterp.c
@@ -2321,7 +2321,7 @@ GetInterp(
Tcl_Interp *searchInterp; /* Interim storage for interp. to find. */
InterpInfo *parentInfoPtr;
- if (TclListObjGetElementsM(interp, pathPtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, pathPtr, &objc, &objv) != TCL_OK) {
return NULL;
}
@@ -2377,7 +2377,7 @@ ChildBgerror(
if (objc) {
Tcl_Size length;
- if (TCL_ERROR == TclListObjLengthM(NULL, objv[0], &length)
+ if (TCL_ERROR == TclListObjLength(NULL, objv[0], &length)
|| (length < 1)) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"cmdPrefix must be list of length >= 1", -1));
@@ -2425,7 +2425,7 @@ ChildCreate(
Tcl_Size objc;
Tcl_Obj **objv;
- if (TclListObjGetElementsM(interp, pathPtr, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, pathPtr, &objc, &objv) != TCL_OK) {
return NULL;
}
if (objc < 2) {
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 9443db4..6a5e73a 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -907,7 +907,7 @@ LinkTraceProc(
*/
if (linkPtr->flags & LINK_ALLOC_LAST) {
- if (TclListObjGetElementsM(NULL, (valueObj), &objc, &objv) == TCL_ERROR
+ if (TclListObjGetElements(NULL, (valueObj), &objc, &objv) == TCL_ERROR
|| objc != linkPtr->numElems) {
return (char *) "wrong dimension";
}
diff --git a/generic/tclListObj.c b/generic/tclListObj.c
index 6c7f128..181ae6b 100644
--- a/generic/tclListObj.c
+++ b/generic/tclListObj.c
@@ -1712,7 +1712,7 @@ Tcl_ListObjAppendList(
Tcl_Panic("%s called with shared object", "Tcl_ListObjAppendList");
}
- if (TclListObjGetElementsM(interp, fromObj, &objc, &objv) != TCL_OK) {
+ if (TclListObjGetElements(interp, fromObj, &objc, &objv) != TCL_OK) {
return TCL_ERROR;
}
@@ -1959,7 +1959,7 @@ Tcl_ListObjIndex(
return TCL_OK;
}
- if (TclListObjGetElementsM(interp, listObj, &numElems, &elemObjs)
+ if (TclListObjGetElements(interp, listObj, &numElems, &elemObjs)
!= TCL_OK) {
return TCL_ERROR;
}
@@ -2591,7 +2591,7 @@ TclLindexList(
*/
return TclLindexFlat(interp, listObj, 1, &argObj);
}
- TclListObjGetElementsM(interp, indexListCopy, &numIndexObjs, &indexObjs);
+ TclListObjGetElements(interp, indexListCopy, &numIndexObjs, &indexObjs);
listObj = TclLindexFlat(interp, listObj, numIndexObjs, indexObjs);
Tcl_DecrRefCount(indexListCopy);
return listObj;
@@ -2782,7 +2782,7 @@ TclLsetList(
*/
retValueObj = TclLsetFlat(interp, listObj, 1, &indexArgObj, valueObj);
} else {
- if (TCL_OK != TclListObjGetElementsM(
+ if (TCL_OK != TclListObjGetElements(
interp, indexListCopy, &indexCount, &indices)) {
Tcl_DecrRefCount(indexListCopy);
/*
@@ -2912,7 +2912,7 @@ TclLsetFlat(
* Check for the possible error conditions...
*/
- if (TclListObjGetElementsM(interp, subListObj, &elemCount, &elemPtrs)
+ if (TclListObjGetElements(interp, subListObj, &elemCount, &elemPtrs)
!= TCL_OK) {
/* ...the sublist we're indexing into isn't a list at all. */
result = TCL_ERROR;
@@ -3070,7 +3070,7 @@ TclLsetFlat(
*/
len = -1;
- TclListObjLengthM(NULL, subListObj, &len);
+ TclListObjLength(NULL, subListObj, &len);
if (valueObj == NULL) {
/* T:listrep-1.{4.2,5.4,6.1,7.1,8.3},2.{4,5}.4 */
Tcl_ListObjReplace(NULL, subListObj, index, 1, 0, NULL);
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 9aea2b6..781e125 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -4086,7 +4086,7 @@ NamespacePathCmd(
* There is a path given, so parse it into an array of namespace pointers.
*/
- if (TclListObjGetElementsM(interp, objv[1], &nsObjc, &nsObjv) != TCL_OK) {
+ if (TclListObjGetElements(interp, objv[1], &nsObjc, &nsObjv) != TCL_OK) {
goto badNamespace;
}
if (nsObjc != 0) {
@@ -4454,7 +4454,7 @@ Tcl_SetNamespaceUnknownHandler(
*/
if (handlerPtr != NULL) {
- if (TclListObjLengthM(interp, handlerPtr, &lstlen) != TCL_OK) {
+ if (TclListObjLength(interp, handlerPtr, &lstlen) != TCL_OK) {
/*
* Not a list.
*/
@@ -5030,7 +5030,7 @@ TclLogCommandInfo(
Tcl_Size len;
iPtr->resetErrorStack = 0;
- TclListObjLengthM(interp, iPtr->errorStack, &len);
+ TclListObjLength(interp, iPtr->errorStack, &len);
/*
* Reset while keeping the list internalrep as much as possible.
@@ -5115,7 +5115,7 @@ TclErrorStackResetIf(
Tcl_Size len;
iPtr->resetErrorStack = 0;
- TclListObjLengthM(interp, iPtr->errorStack, &len);
+ TclListObjLength(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 5f10475..32bd940 100644
--- a/generic/tclOODefineCmds.c
+++ b/generic/tclOODefineCmds.c
@@ -1082,7 +1082,7 @@ MagicDefinitionInvoke(
Tcl_ListObjAppendElement(NULL, objPtr, obj2Ptr);
/* TODO: overflow? */
Tcl_ListObjReplace(NULL, objPtr, 1, 0, objc - offset, objv + offset);
- TclListObjGetElementsM(NULL, objPtr, &dummy, &objs);
+ TclListObjGetElements(NULL, objPtr, &dummy, &objs);
result = Tcl_EvalObjv(interp, objc - cmdIndex, objs, TCL_EVAL_INVOKE);
if (isRoot) {
@@ -2389,7 +2389,7 @@ ClassFilterSet(
"attempt to misuse API", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL);
return TCL_ERROR;
- } else if (TclListObjGetElementsM(interp, objv[0], &filterc,
+ } else if (TclListObjGetElements(interp, objv[0], &filterc,
&filterv) != TCL_OK) {
return TCL_ERROR;
}
@@ -2477,7 +2477,7 @@ ClassMixinSet(
"attempt to misuse API", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL);
return TCL_ERROR;
- } else if (TclListObjGetElementsM(interp, objv[0], &mixinc,
+ } else if (TclListObjGetElements(interp, objv[0], &mixinc,
&mixinv) != TCL_OK) {
return TCL_ERROR;
}
@@ -2597,7 +2597,7 @@ ClassSuperSet(
"may not modify the superclass of the root object", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL);
return TCL_ERROR;
- } else if (TclListObjGetElementsM(interp, objv[0], &superc,
+ } else if (TclListObjGetElements(interp, objv[0], &superc,
&superv) != TCL_OK) {
return TCL_ERROR;
}
@@ -2767,7 +2767,7 @@ ClassVarsSet(
"attempt to misuse API", -1));
Tcl_SetErrorCode(interp, "TCL", "OO", "MONKEY_BUSINESS", (void *)NULL);
return TCL_ERROR;
- } else if (TclListObjGetElementsM(interp, objv[0], &varc,
+ } else if (TclListObjGetElements(interp, objv[0], &varc,
&varv) != TCL_OK) {
return TCL_ERROR;
}
@@ -2859,7 +2859,7 @@ ObjFilterSet(
return TCL_ERROR;
}
objv += Tcl_ObjectContextSkippedArgs(context);
- if (TclListObjGetElementsM(interp, objv[0], &filterc,
+ if (TclListObjGetElements(interp, objv[0], &filterc,
&filterv) != TCL_OK) {
return TCL_ERROR;
}
@@ -2936,7 +2936,7 @@ ObjMixinSet(
return TCL_ERROR;
}
objv += Tcl_ObjectContextSkippedArgs(context);
- if (TclListObjGetElementsM(interp, objv[0], &mixinc,
+ if (TclListObjGetElements(interp, objv[0], &mixinc,
&mixinv) != TCL_OK) {
return TCL_ERROR;
}
@@ -3039,7 +3039,7 @@ ObjVarsSet(
return TCL_ERROR;
}
objv += Tcl_ObjectContextSkippedArgs(context);
- if (TclListObjGetElementsM(interp, objv[0], &varc,
+ if (TclListObjGetElements(interp, objv[0], &varc,
&varv) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 893c05e..264cbe8 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -339,7 +339,7 @@ TclOONewProcInstanceMethod(
ProcedureMethod *pmPtr;
Tcl_Method method;
- if (TclListObjLengthM(interp, argsObj, &argsLen) != TCL_OK) {
+ if (TclListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
return NULL;
}
pmPtr = (ProcedureMethod *)ckalloc(sizeof(ProcedureMethod));
@@ -397,7 +397,7 @@ TclOONewProcMethod(
TclNewObj(argsObj);
Tcl_IncrRefCount(argsObj);
procName = "<destructor>";
- } else if (TclListObjLengthM(interp, argsObj, &argsLen) != TCL_OK) {
+ } else if (TclListObjLength(interp, argsObj, &argsLen) != TCL_OK) {
return NULL;
} else {
procName = (nameObj==NULL ? "<constructor>" : TclGetString(nameObj));
@@ -1389,7 +1389,7 @@ TclOONewForwardInstanceMethod(
int prefixLen;
ForwardMethod *fmPtr;
- if (TclListObjLengthM(interp, prefixObj, &prefixLen) != TCL_OK) {
+ if (TclListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) {
return NULL;
}
if (prefixLen < 1) {
@@ -1428,7 +1428,7 @@ TclOONewForwardMethod(
int prefixLen;
ForwardMethod *fmPtr;
- if (TclListObjLengthM(interp, prefixObj, &prefixLen) != TCL_OK) {
+ if (TclListObjLength(interp, prefixObj, &prefixLen) != TCL_OK) {
return NULL;
}
if (prefixLen < 1) {
@@ -1476,7 +1476,7 @@ InvokeForwardMethod(
* can ignore here.
*/
- TclListObjGetElementsM(NULL, fmPtr->prefixObj, &numPrefixes, &prefixObjs);
+ TclListObjGetElements(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 a7080d1..f321399 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.c
@@ -881,7 +881,7 @@ Tcl_AppendAllObjTypes(
* Get the test for a valid list out of the way first.
*/
- if (TclListObjLengthM(interp, objPtr, &numElems) != TCL_OK) {
+ if (TclListObjLength(interp, objPtr, &numElems) != TCL_OK) {
return TCL_ERROR;
}
diff --git a/generic/tclPathObj.c b/generic/tclPathObj.c
index 7282709..d448fbc 100644
--- a/generic/tclPathObj.c
+++ b/generic/tclPathObj.c
@@ -837,12 +837,12 @@ Tcl_FSJoinPath(
int objc;
Tcl_Obj **objv;
- if (TclListObjLengthM(NULL, listObj, &objc) != TCL_OK) {
+ if (TclListObjLength(NULL, listObj, &objc) != TCL_OK) {
return NULL;
}
elements = ((elements >= 0) && (elements <= objc)) ? elements : objc;
- TclListObjGetElementsM(NULL, listObj, &objc, &objv);
+ TclListObjGetElements(NULL, listObj, &objc, &objv);
res = TclJoinPath(elements, objv, 0);
return res;
}
@@ -2338,7 +2338,7 @@ SetFsPathFromAny(
Tcl_Obj **objv;
Tcl_Obj *parts = TclpNativeSplitPath(pathPtr, NULL);
- TclListObjGetElementsM(NULL, parts, &objc, &objv);
+ TclListObjGetElements(NULL, parts, &objc, &objv);
/*
* Skip '~'. It's replaced by its expansion.
diff --git a/generic/tclPkg.c b/generic/tclPkg.c
index 55e09a2..82860a6 100644
--- a/generic/tclPkg.c
+++ b/generic/tclPkg.c
@@ -1359,7 +1359,7 @@ TclNRPackageObjCmd(
objvListPtr = Tcl_NewListObj(0, NULL);
Tcl_IncrRefCount(objvListPtr);
Tcl_ListObjAppendElement(interp, objvListPtr, ov);
- TclListObjGetElementsM(interp, objvListPtr, &newobjc, &newObjvPtr);
+ TclListObjGetElements(interp, objvListPtr, &newobjc, &newObjvPtr);
Tcl_NRAddCallback(interp,
TclNRPackageObjCmdCleanup, objv[3], objvListPtr, NULL,NULL);
@@ -1386,7 +1386,7 @@ TclNRPackageObjCmd(
Tcl_ListObjAppendElement(interp, objvListPtr,
Tcl_DuplicateObj(newobjv[i]));
}
- TclListObjGetElementsM(interp, objvListPtr, &newobjc, &newObjvPtr);
+ TclListObjGetElements(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 4ea10ad..25a32ba 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -485,7 +485,7 @@ TclCreateProc(
* in the Proc.
*/
- result = TclListObjGetElementsM(interp, argsPtr, &numArgs, &argArray);
+ result = TclListObjGetElements(interp, argsPtr, &numArgs, &argArray);
if (result != TCL_OK) {
goto procError;
}
@@ -515,7 +515,7 @@ TclCreateProc(
* Now divide the specifier up into name and default.
*/
- result = TclListObjGetElementsM(interp, argArray[i], &fieldCount,
+ result = TclListObjGetElements(interp, argArray[i], &fieldCount,
&fieldValues);
if (result != TCL_OK) {
goto procError;
@@ -921,7 +921,7 @@ TclNRUplevelObjCmd(
} else if (!TclHasStringRep(objv[1]) && objc == 2) {
int status;
Tcl_Size llength;
- status = TclListObjLengthM(interp, objv[1], &llength);
+ status = TclListObjLength(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. */
@@ -2465,7 +2465,7 @@ SetLambdaFromAny(
* length is not 2, then it cannot be converted to lambdaType.
*/
- result = TclListObjLengthM(NULL, objPtr, &objc);
+ result = TclListObjLength(NULL, objPtr, &objc);
if ((result != TCL_OK) || ((objc != 2) && (objc != 3))) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"can't interpret \"%s\" as a lambda expression",
@@ -2473,7 +2473,7 @@ SetLambdaFromAny(
Tcl_SetErrorCode(interp, "TCL", "VALUE", "LAMBDA", (void *)NULL);
return TCL_ERROR;
}
- result = TclListObjGetElementsM(NULL, objPtr, &objc, &objv);
+ result = TclListObjGetElements(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 d55a1fd..1a4bf8c 100644
--- a/generic/tclProcess.c
+++ b/generic/tclProcess.c
@@ -526,7 +526,7 @@ ProcessStatusObjCmd(
* Only return statuses of provided processes.
*/
- result = TclListObjGetElementsM(interp, objv[1], &numPids, &pidObjs);
+ result = TclListObjGetElements(interp, objv[1], &numPids, &pidObjs);
if (result != TCL_OK) {
return result;
}
@@ -641,7 +641,7 @@ ProcessPurgeObjCmd(
* Purge only provided processes.
*/
- result = TclListObjGetElementsM(interp, objv[1], &numPids, &pidObjs);
+ result = TclListObjGetElements(interp, objv[1], &numPids, &pidObjs);
if (result != TCL_OK) {
return result;
}
diff --git a/generic/tclResult.c b/generic/tclResult.c
index 91ddc6e..b35aee0 100644
--- a/generic/tclResult.c
+++ b/generic/tclResult.c
@@ -1328,12 +1328,12 @@ TclProcessReturn(
* if someone does [return -errorstack [info errorstack]]
*/
- if (TclListObjGetElementsM(interp, valuePtr, &valueObjc,
+ if (TclListObjGetElements(interp, valuePtr, &valueObjc,
&valueObjv) == TCL_ERROR) {
return TCL_ERROR;
}
iPtr->resetErrorStack = 0;
- TclListObjLengthM(interp, iPtr->errorStack, &len);
+ TclListObjLength(interp, iPtr->errorStack, &len);
/*
* Reset while keeping the list internalrep as much as possible.
@@ -1490,7 +1490,7 @@ TclMergeReturnOptions(
if (valuePtr != NULL) {
int length;
- if (TCL_ERROR == TclListObjLengthM(NULL, valuePtr, &length )) {
+ if (TCL_ERROR == TclListObjLength(NULL, valuePtr, &length )) {
/*
* Value is not a list, which is illegal for -errorcode.
*/
@@ -1512,7 +1512,7 @@ TclMergeReturnOptions(
if (valuePtr != NULL) {
int length;
- if (TCL_ERROR == TclListObjLengthM(NULL, valuePtr, &length )) {
+ if (TCL_ERROR == TclListObjLength(NULL, valuePtr, &length )) {
/*
* Value is not a list, which is illegal for -errorstack.
*/
@@ -1682,7 +1682,7 @@ Tcl_SetReturnOptions(
Tcl_Obj **objv, *mergedOpts;
Tcl_IncrRefCount(options);
- if (TCL_ERROR == TclListObjGetElementsM(interp, options, &objc, &objv)
+ if (TCL_ERROR == TclListObjGetElements(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 f23b23b..09fd1f3 100644
--- a/generic/tclStrToD.c
+++ b/generic/tclStrToD.c
@@ -557,7 +557,7 @@ TclParseNumber(
if (TclHasInternalRep(objPtr, &tclListType)) {
int length;
/* A list can only be a (single) number if its length == 1 */
- TclListObjLengthM(NULL, objPtr, &length);
+ TclListObjLength(NULL, objPtr, &length);
if (length != 1) {
return TCL_ERROR;
}
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 54060c0..bcab176 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -700,7 +700,7 @@ TclCheckEmptyString(
}
if (TclListObjIsCanonical(objPtr)) {
- TclListObjLengthM(NULL, objPtr, &length);
+ TclListObjLength(NULL, objPtr, &length);
return length == 0;
}
@@ -3215,7 +3215,7 @@ AppendPrintfToObjVA(
}
} while (seekingConversion);
}
- TclListObjGetElementsM(NULL, list, &objc, &objv);
+ TclListObjGetElements(NULL, list, &objc, &objv);
code = Tcl_AppendFormatToObj(NULL, objPtr, format, objc, objv);
if (code != TCL_OK) {
Tcl_AppendPrintfToObj(objPtr,
diff --git a/generic/tclTrace.c b/generic/tclTrace.c
index 6adc724..2ef358c 100644
--- a/generic/tclTrace.c
+++ b/generic/tclTrace.c
@@ -443,7 +443,7 @@ TraceExecutionObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjLengthM(interp, objv[4], &listLen);
+ result = TclListObjLength(interp, objv[4], &listLen);
if (result != TCL_OK) {
return result;
}
@@ -455,7 +455,7 @@ TraceExecutionObjCmd(
(void *)NULL);
return TCL_ERROR;
}
- result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs);
+ result = TclListObjGetElements(interp, objv[4], &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
@@ -616,7 +616,7 @@ TraceExecutionObjCmd(
TclNewLiteralStringObj(opObj, "leavestep");
Tcl_ListObjAppendElement(NULL, elemObjPtr, opObj);
}
- TclListObjLengthM(NULL, elemObjPtr, &numOps);
+ TclListObjLength(NULL, elemObjPtr, &numOps);
if (0 == numOps) {
Tcl_DecrRefCount(elemObjPtr);
continue;
@@ -690,7 +690,7 @@ TraceCommandObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjLengthM(interp, objv[4], &listLen);
+ result = TclListObjLength(interp, objv[4], &listLen);
if (result != TCL_OK) {
return result;
}
@@ -702,7 +702,7 @@ TraceCommandObjCmd(
(void *)NULL);
return TCL_ERROR;
}
- result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs);
+ result = TclListObjGetElements(interp, objv[4], &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
@@ -816,7 +816,7 @@ TraceCommandObjCmd(
TclNewLiteralStringObj(opObj, "delete");
Tcl_ListObjAppendElement(NULL, elemObjPtr, opObj);
}
- TclListObjLengthM(NULL, elemObjPtr, &numOps);
+ TclListObjLength(NULL, elemObjPtr, &numOps);
if (0 == numOps) {
Tcl_DecrRefCount(elemObjPtr);
continue;
@@ -894,7 +894,7 @@ TraceVariableObjCmd(
* pointer to its array of element pointers.
*/
- result = TclListObjLengthM(interp, objv[4], &listLen);
+ result = TclListObjLength(interp, objv[4], &listLen);
if (result != TCL_OK) {
return result;
}
@@ -906,7 +906,7 @@ TraceVariableObjCmd(
(void *)NULL);
return TCL_ERROR;
}
- result = TclListObjGetElementsM(interp, objv[4], &listLen, &elemPtrs);
+ result = TclListObjGetElements(interp, objv[4], &listLen, &elemPtrs);
if (result != TCL_OK) {
return result;
}
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 30fb89d..25f84e4 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3807,7 +3807,7 @@ GetEndOffsetFromObj(
if ((TclMaxListLength(bytes, TCL_INDEX_NONE, NULL) > 1)
/* If it's possible, do the full list parse. */
- && (TCL_OK == TclListObjLengthM(NULL, objPtr, &length))
+ && (TCL_OK == TclListObjLength(NULL, objPtr, &length))
&& (length > 1)) {
goto parseError;
}
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 3007296..48e8cc3 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -2977,7 +2977,7 @@ Tcl_LappendObjCmd(
return TCL_ERROR;
}
} else {
- result = TclListObjLengthM(interp, newValuePtr, &numElems);
+ result = TclListObjLength(interp, newValuePtr, &numElems);
if (result != TCL_OK) {
return result;
}
@@ -3035,7 +3035,7 @@ Tcl_LappendObjCmd(
createdNewObj = 1;
}
- result = TclListObjLengthM(interp, varValuePtr, &numElems);
+ result = TclListObjLength(interp, varValuePtr, &numElems);
if (result == TCL_OK) {
result = Tcl_ListObjReplace(interp, varValuePtr, numElems, 0,
(objc-2), (objv+2));
@@ -3188,7 +3188,7 @@ ArrayForNRCmd(
* Parse arguments.
*/
- if (TclListObjLengthM(interp, objv[1], &numVars) != TCL_OK) {
+ if (TclListObjLength(interp, objv[1], &numVars) != TCL_OK) {
return TCL_ERROR;
}
@@ -3304,7 +3304,7 @@ ArrayForLoopCallback(
goto arrayfordone;
}
- result = TclListObjGetElementsM(NULL, varListObj, &varc, &varv);
+ result = TclListObjGetElements(NULL, varListObj, &varc, &varv);
if (result != TCL_OK) {
goto arrayfordone;
}
@@ -3848,7 +3848,7 @@ ArrayGetCmd(
*/
TclNewObj(tmpResObj);
- result = TclListObjGetElementsM(interp, nameLstObj, &count, &nameObjPtr);
+ result = TclListObjGetElements(interp, nameLstObj, &count, &nameObjPtr);
if (result != TCL_OK) {
goto errorInArrayGet;
}
@@ -4172,7 +4172,7 @@ ArraySetCmd(
Tcl_Obj **elemPtrs, *copyListObj;
Tcl_Size i;
- result = TclListObjLengthM(interp, arrayElemObj, &elemLen);
+ result = TclListObjLength(interp, arrayElemObj, &elemLen);
if (result != TCL_OK) {
return result;
}
@@ -4185,7 +4185,7 @@ ArraySetCmd(
if (elemLen == 0) {
goto ensureArray;
}
- result = TclListObjGetElementsM(interp, arrayElemObj,
+ result = TclListObjGetElements(interp, arrayElemObj,
&elemLen, &elemPtrs);
if (result != TCL_OK) {
return result;
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 6f014eb..d902ad8 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -738,11 +738,11 @@ ToDosDate(
*-------------------------------------------------------------------------
*/
-static inline int
+static inline size_t
CountSlashes(
const char *string)
{
- int count = 0;
+ size_t count = 0;
const char *p = string;
while (*p != '\0') {
@@ -1036,7 +1036,7 @@ NormalizeMountPoint(Tcl_Interp *interp,
Tcl_DecrRefCount(unnormalizedObj);
/* normalizedObj owned by Tcl!! Do NOT DecrRef without an IncrRef */
- normalizedPath = Tcl_GetStringFromObj(normalizedObj, &normalizedLen);
+ normalizedPath = TclGetStringFromObj(normalizedObj, &normalizedLen);
Tcl_DStringFree(&dsJoin);
Tcl_DStringAppend(dsPtr, normalizedPath, normalizedLen);
Tcl_DecrRefCount(normalizedObj);
@@ -1122,7 +1122,7 @@ MapPathToZipfs(Tcl_Interp *interp,
Tcl_DecrRefCount(unnormalizedObj);
/* normalizedObj owned by Tcl!! Do NOT DecrRef without an IncrRef */
- normalizedPath = Tcl_GetStringFromObj(normalizedObj, &normalizedLen);
+ normalizedPath = TclGetStringFromObj(normalizedObj, &normalizedLen);
Tcl_DStringAppend(dsPtr, normalizedPath, normalizedLen);
Tcl_DecrRefCount(normalizedObj);
return Tcl_DStringValue(dsPtr);
@@ -1813,7 +1813,7 @@ static inline int
IsPasswordValid(
Tcl_Interp *interp,
const char *passwd,
- int pwlen)
+ size_t pwlen)
{
if ((pwlen > 255) || strchr(passwd, 0xff)) {
ZIPFS_ERROR(interp, "illegal password");
@@ -1850,8 +1850,8 @@ ZipFSCatalogFilesystem(
* the ZIP is unprotected. */
const char *zipname) /* Path to ZIP file to build a catalog of. */
{
- int pwlen, isNew;
- size_t i;
+ int isNew;
+ size_t i, pwlen;
ZipFile *zf0;
ZipEntry *z;
Tcl_HashEntry *hPtr;
@@ -2366,7 +2366,7 @@ TclZipfs_Mount(
ret = TCL_ERROR;
} else {
Tcl_IncrRefCount(normZipPathObj);
- const char *normPath = Tcl_GetString(normZipPathObj);
+ const char *normPath = TclGetString(normZipPathObj);
if (passwd == NULL ||
(ret = IsPasswordValid(interp, passwd, strlen(passwd))) ==
TCL_OK) {
@@ -2616,13 +2616,13 @@ ZipFSMountObjCmd(
*/
if (objc > 1) {
if (objc == 2) {
- mountPoint = Tcl_GetString(objv[1]);
+ mountPoint = TclGetString(objv[1]);
} else {
/* 2 < objc < 4 */
- zipFile = Tcl_GetString(objv[1]);
- mountPoint = Tcl_GetString(objv[2]);
+ zipFile = TclGetString(objv[1]);
+ mountPoint = TclGetString(objv[2]);
if (objc > 3) {
- password = Tcl_GetString(objv[3]);
+ password = TclGetString(objv[3]);
}
}
}
@@ -2663,7 +2663,7 @@ ZipFSMountBufferObjCmd(
return TCL_ERROR;
}
data = Tcl_GetBytesFromObj(interp, objv[1], &length);
- mountPoint = Tcl_GetString(objv[2]);
+ mountPoint = TclGetString(objv[2]);
if (data == NULL) {
return TCL_ERROR;
}
@@ -2728,7 +2728,7 @@ ZipFSUnmountObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "mountpoint");
return TCL_ERROR;
}
- return TclZipfs_Unmount(interp, Tcl_GetString(objv[1]));
+ return TclZipfs_Unmount(interp, TclGetString(objv[1]));
}
/*
@@ -2908,7 +2908,7 @@ ZipAddFile(
zpathlen = strlen(zpathExt);
if (zpathlen + ZIP_CENTRAL_HEADER_LEN > bufsize) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "path too long for \"%s\"", Tcl_GetString(pathObj)));
+ "path too long for \"%s\"", TclGetString(pathObj)));
ZIPFS_ERROR_CODE(interp, "PATH_LEN");
Tcl_DStringFree(&zpathDs);
return TCL_ERROR;
@@ -2950,7 +2950,7 @@ ZipAddFile(
}
readErrorWithChannelOpen:
Tcl_SetObjResult(interp, Tcl_ObjPrintf("read error on \"%s\": %s",
- Tcl_GetString(pathObj), Tcl_PosixError(interp)));
+ TclGetString(pathObj), Tcl_PosixError(interp)));
Tcl_Close(interp, in);
return TCL_ERROR;
}
@@ -2962,7 +2962,7 @@ ZipAddFile(
}
if (Tcl_Seek(in, 0, SEEK_SET) == -1) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf("seek error on \"%s\": %s",
- Tcl_GetString(pathObj), Tcl_PosixError(interp)));
+ TclGetString(pathObj), Tcl_PosixError(interp)));
Tcl_Close(interp, in);
Tcl_DStringFree(&zpathDs);
return TCL_ERROR;
@@ -2987,7 +2987,7 @@ ZipAddFile(
writeErrorWithChannelOpen:
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"write error on \"%s\": %s",
- Tcl_GetString(pathObj), Tcl_PosixError(interp)));
+ TclGetString(pathObj), Tcl_PosixError(interp)));
Tcl_Close(interp, in);
Tcl_DStringFree(&zpathDs);
return TCL_ERROR;
@@ -3063,7 +3063,7 @@ ZipAddFile(
if (deflateInit2(&stream, 9, Z_DEFLATED, -15, 8,
Z_DEFAULT_STRATEGY) != Z_OK) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "compression init error on \"%s\"", Tcl_GetString(pathObj)));
+ "compression init error on \"%s\"", TclGetString(pathObj)));
ZIPFS_ERROR_CODE(interp, "DEFLATE_INIT");
Tcl_Close(interp, in);
Tcl_DStringFree(&zpathDs);
@@ -3085,7 +3085,7 @@ ZipAddFile(
len = deflate(&stream, flush);
if (len == (size_t) Z_STREAM_ERROR) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "deflate error on \"%s\"", Tcl_GetString(pathObj)));
+ "deflate error on \"%s\"", TclGetString(pathObj)));
ZIPFS_ERROR_CODE(interp, "DEFLATE");
deflateEnd(&stream);
Tcl_Close(interp, in);
@@ -3172,7 +3172,7 @@ ZipAddFile(
hPtr = Tcl_CreateHashEntry(fileHash, zpathTcl, &isNew);
if (!isNew) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
- "non-unique path name \"%s\"", Tcl_GetString(pathObj)));
+ "non-unique path name \"%s\"", TclGetString(pathObj)));
ZIPFS_ERROR_CODE(interp, "DUPLICATE_PATH");
return TCL_ERROR;
}
@@ -3289,7 +3289,7 @@ ComputeNameInArchive(
Tcl_Size len;
if (directNameObj) {
- name = Tcl_GetString(directNameObj);
+ name = TclGetString(directNameObj);
} else {
name = TclGetStringFromObj(pathObj, &len);
if (slen > 0) {
@@ -3354,11 +3354,12 @@ ZipFSMkZipOrImg(
* there's no password protection. */
{
Tcl_Channel out;
- int pwlen = 0, slen = 0, count, ret = TCL_ERROR, lobjc;
+ int count, ret = TCL_ERROR;
+ int pwlen = 0, slen = 0, lobjc;
size_t len, i = 0;
long long directoryStartOffset;
- /* The overall file offset of the start of the
- * central directory. */
+ /* The overall file offset of the start of the
+ * central directory. */
long long suffixStartOffset;/* The overall file offset of the start of the
* suffix of the central directory (i.e.,
* where this data will be written). */
@@ -3393,7 +3394,7 @@ ZipFSMkZipOrImg(
}
}
Tcl_IncrRefCount(list);
- if (TclListObjLengthM(interp, list, &lobjc) != TCL_OK) {
+ if (TclListObjLength(interp, list, &lobjc) != TCL_OK) {
Tcl_DecrRefCount(list);
return TCL_ERROR;
}
@@ -3409,7 +3410,7 @@ ZipFSMkZipOrImg(
ZIPFS_ERROR_CODE(interp, "EMPTY");
return TCL_ERROR;
}
- if (TclListObjGetElementsM(interp, list, &lobjc, &lobjv) != TCL_OK) {
+ if (TclListObjGetElements(interp, list, &lobjc, &lobjv) != TCL_OK) {
Tcl_DecrRefCount(list);
return TCL_ERROR;
}
@@ -3431,7 +3432,7 @@ ZipFSMkZipOrImg(
const char *imgName;
// TODO: normalize the origin file name
- imgName = (originFile != NULL) ? Tcl_GetString(originFile) :
+ imgName = (originFile != NULL) ? TclGetString(originFile) :
Tcl_GetNameOfExecutable();
if (pwlen) {
i = 0;
@@ -3676,8 +3677,8 @@ CopyImageFile(
for (k = 0; k < i; k += m) {
m = i - k;
- if (m > (int) sizeof(buf)) {
- m = (int) sizeof(buf);
+ if (m > (Tcl_Size) sizeof(buf)) {
+ m = sizeof(buf);
}
n = Tcl_Read(in, buf, m);
if (n == -1) {
@@ -3980,14 +3981,14 @@ ZipFSCanonicalObjCmd(
if (objc == 2) {
mntPoint = ZIPFS_VOLUME;
} else {
- if (NormalizeMountPoint(interp, Tcl_GetString(objv[1]), &dsMount) != TCL_OK) {
+ if (NormalizeMountPoint(interp, TclGetString(objv[1]), &dsMount) != TCL_OK) {
return TCL_ERROR;
}
mntPoint = Tcl_DStringValue(&dsMount);
}
(void)MapPathToZipfs(interp,
mntPoint,
- Tcl_GetString(objv[objc - 1]),
+ TclGetString(objv[objc - 1]),
&dsPath);
Tcl_SetObjResult(interp, Tcl_DStringToObj(&dsPath));
return TCL_OK;
@@ -4026,7 +4027,7 @@ ZipFSExistsObjCmd(
return TCL_ERROR;
}
- filename = Tcl_GetString(objv[1]);
+ filename = TclGetString(objv[1]);
ReadLock();
exists = ZipFSLookup(filename) != NULL;
@@ -4075,7 +4076,7 @@ ZipFSInfoObjCmd(
Tcl_WrongNumArgs(interp, 1, objv, "filename");
return TCL_ERROR;
}
- filename = Tcl_GetString(objv[1]);
+ filename = TclGetString(objv[1]);
ReadLock();
z = ZipFSLookup(filename);
if (z) {
@@ -4153,17 +4154,17 @@ ZipFSListObjCmd(
}
switch (idx) {
case OPT_GLOB:
- pattern = Tcl_GetString(objv[2]);
+ pattern = TclGetString(objv[2]);
break;
case OPT_REGEXP:
- regexp = Tcl_RegExpCompile(interp, Tcl_GetString(objv[2]));
+ regexp = Tcl_RegExpCompile(interp, TclGetString(objv[2]));
if (!regexp) {
return TCL_ERROR;
}
break;
}
} else if (objc == 2) {
- pattern = Tcl_GetString(objv[1]);
+ pattern = TclGetString(objv[1]);
}
/*
@@ -5394,7 +5395,7 @@ ZipFSOpenFileChannelProc(
return NULL;
}
- return ZipChannelOpen(interp, Tcl_GetString(pathPtr), mode);
+ return ZipChannelOpen(interp, TclGetString(pathPtr), mode);
}
/*
@@ -5423,7 +5424,7 @@ ZipFSStatProc(
if (!pathPtr) {
return -1;
}
- return ZipEntryStat(Tcl_GetString(pathPtr), buf);
+ return ZipEntryStat(TclGetString(pathPtr), buf);
}
/*
@@ -5452,7 +5453,7 @@ ZipFSAccessProc(
if (!pathPtr) {
return -1;
}
- return ZipEntryAccess(Tcl_GetString(pathPtr), mode);
+ return ZipEntryAccess(TclGetString(pathPtr), mode);
}
/*
@@ -5498,11 +5499,11 @@ AppendWithPrefix(
Tcl_DString *prefix, /* The prefix to add to the element, or NULL
* for don't do that. */
const char *name, /* The name to append. */
- int nameLen) /* The length of the name. May be -1 for
+ Tcl_Size nameLen) /* The length of the name. May be < 0 for
* append-up-to-NUL-byte. */
{
if (prefix) {
- int prefixLength = Tcl_DStringLength(prefix);
+ Tcl_Size prefixLength = Tcl_DStringLength(prefix);
Tcl_DStringAppend(prefix, name, nameLen);
Tcl_ListObjAppendElement(NULL, result, Tcl_NewStringObj(
@@ -5761,10 +5762,10 @@ ZipFSMatchMountPoints(
{
Tcl_HashEntry *hPtr;
Tcl_HashSearch search;
- int l;
+ size_t l;
Tcl_Size normLength;
const char *path = TclGetStringFromObj(normPathPtr, &normLength);
- Tcl_Size len = (size_t) normLength;
+ Tcl_Size len = normLength;
if (len < 1) {
/*
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index e951060..29d5c81 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -517,7 +517,7 @@ GenerateHeader(
if (GetValue(interp, dictObj, "time", &value) != TCL_OK) {
goto error;
- } else if (value != NULL && Tcl_GetWideIntFromObj(interp, value,
+ } else if (value != NULL && TclGetWideIntFromObj(interp, value,
&wideValue) != TCL_OK) {
goto error;
}
@@ -623,7 +623,7 @@ SetInflateDictionary(
Tcl_Obj *compDictObj)
{
if (compDictObj != NULL) {
- int length;
+ Tcl_Size length;
unsigned char *bytes = Tcl_GetByteArrayFromObj(compDictObj, &length);
return inflateSetDictionary(strm, bytes, length);
@@ -637,7 +637,7 @@ SetDeflateDictionary(
Tcl_Obj *compDictObj)
{
if (compDictObj != NULL) {
- int length;
+ Tcl_Size length;
unsigned char *bytes = Tcl_GetByteArrayFromObj(compDictObj, &length);
return deflateSetDictionary(strm, bytes, length);
@@ -1227,7 +1227,8 @@ Tcl_ZlibStreamPut(
ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle;
char *dataTmp = NULL;
int e;
- int size, outSize, toStore;
+ Tcl_Size size;
+ int outSize, toStore;
unsigned char *bytes;
if (zshPtr->streamEnd) {
@@ -1352,7 +1353,7 @@ int
Tcl_ZlibStreamGet(
Tcl_ZlibStream zshandle, /* As obtained from Tcl_ZlibStreamInit */
Tcl_Obj *data, /* A place to append the data. */
- int count) /* Number of bytes to grab as a maximum, you
+ Tcl_Size count) /* Number of bytes to grab as a maximum, you
* may get less! */
{
ZlibStreamHandle *zshPtr = (ZlibStreamHandle *) zshandle;
@@ -1402,7 +1403,7 @@ Tcl_ZlibStreamGet(
Tcl_DecrRefCount(zshPtr->currentInput);
zshPtr->currentInput = NULL;
}
- TclListObjLengthM(NULL, zshPtr->inData, &listLen);
+ TclListObjLength(NULL, zshPtr->inData, &listLen);
if (listLen > 0) {
/*
* There is more input available, get it from the list and
@@ -1451,7 +1452,7 @@ Tcl_ZlibStreamGet(
e = inflate(&zshPtr->stream, zshPtr->flush);
}
};
- TclListObjLengthM(NULL, zshPtr->inData, &listLen);
+ TclListObjLength(NULL, zshPtr->inData, &listLen);
while ((zshPtr->stream.avail_out > 0)
&& (e == Z_OK || e == Z_BUF_ERROR) && (listLen > 0)) {
@@ -1531,7 +1532,7 @@ Tcl_ZlibStreamGet(
inflateEnd(&zshPtr->stream);
}
} else {
- TclListObjLengthM(NULL, zshPtr->outData, &listLen);
+ TclListObjLength(NULL, zshPtr->outData, &listLen);
if (count == -1) {
count = 0;
for (i=0; i<listLen; i++) {
@@ -1553,7 +1554,7 @@ Tcl_ZlibStreamGet(
dataPtr += existing;
while ((count > dataPos) &&
- (TclListObjLengthM(NULL, zshPtr->outData, &listLen) == TCL_OK)
+ (TclListObjLength(NULL, zshPtr->outData, &listLen) == TCL_OK)
&& (listLen > 0)) {
/*
* Get the next chunk off our list of chunks and grab the data out
@@ -1675,7 +1676,7 @@ Tcl_ZlibDeflate(
TclNewObj(obj);
memset(&stream, 0, sizeof(z_stream));
- stream.avail_in = (uInt) inLen;
+ stream.avail_in = inLen;
stream.next_in = inData;
/*
@@ -1834,7 +1835,7 @@ Tcl_ZlibInflate(
TclNewObj(obj);
outData = Tcl_SetByteArrayLength(obj, bufferSize);
memset(&stream, 0, sizeof(z_stream));
- stream.avail_in = (uInt) inLen+1; /* +1 because zlib can "over-request"
+ stream.avail_in = inLen+1; /* +1 because zlib can "over-request"
* input (but ignore it!) */
stream.next_in = inData;
stream.avail_out = bufferSize;
@@ -1981,8 +1982,11 @@ ZlibCmd(
int objc,
Tcl_Obj *const objv[])
{
- int command, dlen, i, option, level = -1;
- unsigned start, buffersize = 0;
+ int command, i, option, level = -1;
+ unsigned buffersize = 0;
+ Tcl_Size dlen;
+ unsigned start;
+ Tcl_WideInt wideLen;
Byte *data;
Tcl_Obj *headerDictObj;
const char *extraInfoStr = NULL;
@@ -2135,14 +2139,15 @@ ZlibCmd(
return TCL_ERROR;
}
if (objc > 3) {
- if (Tcl_GetIntFromObj(interp, objv[3],
- (int *) &buffersize) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[3],
+ &wideLen) != TCL_OK) {
return TCL_ERROR;
}
- if (buffersize < MIN_NONSTREAM_BUFFER_SIZE
- || buffersize > MAX_BUFFER_SIZE) {
+ if (wideLen < MIN_NONSTREAM_BUFFER_SIZE
+ || wideLen > MAX_BUFFER_SIZE) {
goto badBuffer;
}
+ buffersize = wideLen;
}
return Tcl_ZlibInflate(interp, TCL_ZLIB_FORMAT_RAW, objv[2],
buffersize, NULL);
@@ -2154,14 +2159,15 @@ ZlibCmd(
return TCL_ERROR;
}
if (objc > 3) {
- if (Tcl_GetIntFromObj(interp, objv[3],
- (int *) &buffersize) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[3],
+ &wideLen) != TCL_OK) {
return TCL_ERROR;
}
- if (buffersize < MIN_NONSTREAM_BUFFER_SIZE
- || buffersize > MAX_BUFFER_SIZE) {
+ if (wideLen < MIN_NONSTREAM_BUFFER_SIZE
+ || wideLen > MAX_BUFFER_SIZE) {
goto badBuffer;
}
+ buffersize = wideLen;
}
return Tcl_ZlibInflate(interp, TCL_ZLIB_FORMAT_ZLIB, objv[2],
buffersize, NULL);
@@ -2185,14 +2191,15 @@ ZlibCmd(
}
switch (option) {
case 0:
- if (Tcl_GetIntFromObj(interp, objv[i+1],
- (int *) &buffersize) != TCL_OK) {
+ if (TclGetWideIntFromObj(interp, objv[i+1],
+ &wideLen) != TCL_OK) {
return TCL_ERROR;
}
- if (buffersize < MIN_NONSTREAM_BUFFER_SIZE
- || buffersize > MAX_BUFFER_SIZE) {
+ if (wideLen < MIN_NONSTREAM_BUFFER_SIZE
+ || wideLen > MAX_BUFFER_SIZE) {
goto badBuffer;
}
+ buffersize = wideLen;
break;
case 1:
headerVarObj = objv[i+1];
@@ -3220,7 +3227,8 @@ ZlibTransformOutput(
ZlibChannelData *cd = (ZlibChannelData *)instanceData;
Tcl_DriverOutputProc *outProc =
Tcl_ChannelOutputProc(Tcl_GetChannelType(cd->parent));
- int e, produced;
+ int e;
+ int produced;
Tcl_Obj *errObj;
if (cd->mode == TCL_ZLIB_STREAM_INFLATE) {
@@ -3282,7 +3290,8 @@ ZlibTransformFlush(
ZlibChannelData *cd,
int flushType)
{
- int e, len;
+ int e;
+ int len;
cd->outStream.avail_in = 0;
do {
@@ -3498,7 +3507,7 @@ ZlibTransformGetOption(
Tcl_DStringAppendElement(dsPtr, "-dictionary");
if (cd->compDictObj) {
Tcl_DStringAppendElement(dsPtr,
- Tcl_GetString(cd->compDictObj));
+ TclGetString(cd->compDictObj));
} else {
Tcl_DStringAppendElement(dsPtr, "");
}
@@ -3526,7 +3535,7 @@ ZlibTransformGetOption(
ExtractHeader(&cd->inHeader.header, tmpObj);
if (optionName == NULL) {
Tcl_DStringAppendElement(dsPtr, "-header");
- Tcl_DStringAppendElement(dsPtr, Tcl_GetString(tmpObj));
+ Tcl_DStringAppendElement(dsPtr, TclGetString(tmpObj));
Tcl_DecrRefCount(tmpObj);
} else {
TclDStringAppendObj(dsPtr, tmpObj);