summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmdsGR.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-17 13:48:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-09-17 13:48:12 (GMT)
commit733b7a43a45ee6be75ccd99172f66b35b69841c5 (patch)
tree2c38bde59af6c90ad19dbda96878de709d5859d0 /generic/tclCompCmdsGR.c
parentbc10bf6d03a6c8685c64e36a6095e289e2b1ef33 (diff)
downloadtcl-733b7a43a45ee6be75ccd99172f66b35b69841c5.zip
tcl-733b7a43a45ee6be75ccd99172f66b35b69841c5.tar.gz
tcl-733b7a43a45ee6be75ccd99172f66b35b69841c5.tar.bz2
Eliminate many usages of Tcl_NewObj (-> TclNewObj) and Tcl_NewIntObj (-> TclNewIntObj or Tcl_NewWideIntObj)
Diffstat (limited to 'generic/tclCompCmdsGR.c')
-rw-r--r--generic/tclCompCmdsGR.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 3361d7f..221ac3a 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -53,9 +53,10 @@ TclGetIndexFromToken(
int after,
int *indexPtr)
{
- Tcl_Obj *tmpObj = Tcl_NewObj();
+ Tcl_Obj *tmpObj;
int result = TCL_ERROR;
+ TclNewObj(tmpObj);
if (TclWordKnownAtCompileTime(tokenPtr, tmpObj)) {
result = TclIndexEncode(NULL, tmpObj, before, after, indexPtr);
}
@@ -598,7 +599,7 @@ TclCompileInfoCommandsCmd(
return TCL_ERROR;
}
tokenPtr = TokenAfter(parsePtr->tokenPtr);
- objPtr = Tcl_NewObj();
+ TclNewObj(objPtr);
Tcl_IncrRefCount(objPtr);
if (!TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
goto notCompilable;
@@ -1169,9 +1170,9 @@ TclCompileListCmd(
numWords = parsePtr->numWords;
valueTokenPtr = TokenAfter(parsePtr->tokenPtr);
- listObj = Tcl_NewObj();
+ TclNewObj(listObj);
for (i = 1; i < numWords && listObj != NULL; i++) {
- objPtr = Tcl_NewObj();
+ TclNewObj(objPtr);
if (TclWordKnownAtCompileTime(valueTokenPtr, objPtr)) {
(void) Tcl_ListObjAppendElement(NULL, listObj, objPtr);
} else {
@@ -2264,7 +2265,7 @@ TclCompileRegsubCmd(
Tcl_DStringInit(&pattern);
tokenPtr = TokenAfter(tokenPtr);
- patternObj = Tcl_NewObj();
+ TclNewObj(patternObj);
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
goto done;
}
@@ -2275,7 +2276,7 @@ TclCompileRegsubCmd(
}
tokenPtr = TokenAfter(tokenPtr);
Tcl_DecrRefCount(patternObj);
- patternObj = Tcl_NewObj();
+ TclNewObj(patternObj);
if (!TclWordKnownAtCompileTime(tokenPtr, patternObj)) {
goto done;
}
@@ -2290,7 +2291,7 @@ TclCompileRegsubCmd(
stringTokenPtr = TokenAfter(tokenPtr);
tokenPtr = TokenAfter(stringTokenPtr);
- replacementObj = Tcl_NewObj();
+ TclNewObj(replacementObj);
if (!TclWordKnownAtCompileTime(tokenPtr, replacementObj)) {
goto done;
}
@@ -2440,7 +2441,7 @@ TclCompileReturnCmd(
*/
for (objc = 0; objc < numOptionWords; objc++) {
- objv[objc] = Tcl_NewObj();
+ TclNewObj(objv[objc]);
Tcl_IncrRefCount(objv[objc]);
if (!TclWordKnownAtCompileTime(wordTokenPtr, objv[objc])) {
/*
@@ -2659,7 +2660,7 @@ TclCompileUpvarCmd(
* Push the frame index if it is known at compile time
*/
- objPtr = Tcl_NewObj();
+ TclNewObj(objPtr);
tokenPtr = TokenAfter(parsePtr->tokenPtr);
if (TclWordKnownAtCompileTime(tokenPtr, objPtr)) {
CallFrame *framePtr;