summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2014-12-18 20:34:12 (GMT)
committerdgp <dgp@users.sourceforge.net>2014-12-18 20:34:12 (GMT)
commit0495b7f2194bbfb5a1d05b091df455407e717021 (patch)
treeb97966071e345d3cff8b86174610360e23524fe2
parentf06d852f72d64565eab335c0aaab3fdc60927171 (diff)
downloadtcl-0495b7f2194bbfb5a1d05b091df455407e717021.zip
tcl-0495b7f2194bbfb5a1d05b091df455407e717021.tar.gz
tcl-0495b7f2194bbfb5a1d05b091df455407e717021.tar.bz2
With that shift, varcList is no longer needed.
-rw-r--r--generic/tclCompCmds.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index f07b19f..739bf21 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -1553,11 +1553,9 @@ TclCompileForeachCmd(
/*
* We parse the variable list argument words and create two arrays:
- * varcList[i] is number of variables in i-th var list.
* varvList[i] points to array of var names in i-th var list.
*/
- int *varcList;
const char ***varvList;
/*
@@ -1592,8 +1590,6 @@ TclCompileForeachCmd(
*/
numLists = (numWords - 2)/2;
- varcList = (int *) TclStackAlloc(interp, numLists * sizeof(int));
- memset(varcList, 0, numLists * sizeof(int));
varvList = (const char ***) TclStackAlloc(interp,
numLists * sizeof(const char **));
memset((char*) varvList, 0, numLists * sizeof(const char **));
@@ -1637,13 +1633,12 @@ TclCompileForeachCmd(
Tcl_DStringInit(&varList);
Tcl_DStringAppend(&varList, tokenPtr[1].start, tokenPtr[1].size);
code = Tcl_SplitList(interp, Tcl_DStringValue(&varList),
- &varcList[loopIndex], &varvList[loopIndex]);
+ &numVars, &varvList[loopIndex]);
Tcl_DStringFree(&varList);
if (code != TCL_OK) {
code = TCL_ERROR;
goto done;
}
- numVars = varcList[loopIndex];
varListPtr = (ForeachVarList *) ckalloc((unsigned)
sizeof(ForeachVarList) + numVars*sizeof(int));
@@ -1831,7 +1826,6 @@ TclCompileForeachCmd(
}
}
TclStackFree(interp, (void *)varvList);
- TclStackFree(interp, varcList);
return code;
}