summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclAssembly.c4
-rw-r--r--generic/tclCmdIL.c2
-rw-r--r--generic/tclCmdMZ.c11
-rw-r--r--generic/tclCompExpr.c2
-rw-r--r--generic/tclDate.c14
-rw-r--r--generic/tclDictObj.c3
-rw-r--r--generic/tclExecute.c6
-rw-r--r--generic/tclGetDate.y14
-rw-r--r--generic/tclIORChan.c8
-rw-r--r--generic/tclLink.c10
-rw-r--r--generic/tclScan.c8
-rw-r--r--generic/tclStringObj.c23
-rw-r--r--generic/tclZipfs.c6
-rw-r--r--macosx/tclMacOSXFCmd.c4
-rw-r--r--unix/tclLoadDyld.c3
-rw-r--r--unix/tclUnixFCmd.c8
-rw-r--r--unix/tclUnixInit.c2
-rw-r--r--unix/tclUnixPipe.c5
-rw-r--r--win/tclAppInit.c4
-rw-r--r--win/tclWinFCmd.c4
-rw-r--r--win/tclWinInit.c2
-rw-r--r--win/tclWinPipe.c2
22 files changed, 77 insertions, 68 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 55fde66..605758b 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -815,7 +815,7 @@ TclNRAssembleObjCmd(
Tcl_AddErrorInfo(interp, "\n (\"");
Tcl_AppendObjToErrorInfo(interp, objv[0]);
Tcl_AddErrorInfo(interp, "\" body, line ");
- backtrace = Tcl_NewWideIntObj(Tcl_GetErrorLine(interp));
+ TclNewIntObj(backtrace, Tcl_GetErrorLine(interp));
Tcl_AppendObjToErrorInfo(interp, backtrace);
Tcl_AddErrorInfo(interp, ")");
return TCL_ERROR;
@@ -4270,7 +4270,7 @@ AddBasicBlockRangeToErrorInfo(
Tcl_Obj* lineNo; /* Line number in the source */
Tcl_AddErrorInfo(interp, "\n in assembly code between lines ");
- lineNo = Tcl_NewWideIntObj(bbPtr->startLine);
+ TclNewIntObj(lineNo, bbPtr->startLine);
Tcl_IncrRefCount(lineNo);
Tcl_AppendObjToErrorInfo(interp, lineNo);
Tcl_AddErrorInfo(interp, " and ");
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index e8e69b2..6a81309 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -383,7 +383,7 @@ Tcl_IncrObjCmd(
if (objc == 3) {
incrPtr = objv[2];
} else {
- incrPtr = Tcl_NewWideIntObj(1);
+ TclNewIntObj(incrPtr, 1);
}
Tcl_IncrRefCount(incrPtr);
newValuePtr = TclIncrObjVar2(interp, objv[1], NULL,
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index ce8ba13..6eb2954 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -4550,7 +4550,8 @@ Tcl_TimeRateObjCmd(
#endif /* TCL_WIDE_CLICKS */
if (!count) { /* no iterations - avoid divide by zero */
- objs[0] = objs[2] = objs[4] = Tcl_NewWideIntObj(0);
+ TclNewIntObj(objs[4], 0);
+ objs[0] = objs[2] = objs[4];
goto retRes;
}
@@ -4591,7 +4592,7 @@ Tcl_TimeRateObjCmd(
val = usec / count; /* microsecs per iteration */
if (val >= 1000000) {
- objs[0] = Tcl_NewWideIntObj(val);
+ TclNewIntObj(objs[0], val);
} else {
if (val < 10) {
digits = 6;
@@ -4607,7 +4608,7 @@ Tcl_TimeRateObjCmd(
objs[0] = Tcl_ObjPrintf("%.*f", digits, ((double) usec)/count);
}
- objs[2] = Tcl_NewWideIntObj(count); /* iterations */
+ TclNewIntObj(objs[2], count); /* iterations */
/*
* Calculate speed as rate (count) per sec
@@ -4629,7 +4630,7 @@ Tcl_TimeRateObjCmd(
objs[4] = Tcl_ObjPrintf("%.*f",
digits, ((double) (count * 1000000)) / usec);
} else {
- objs[4] = Tcl_NewWideIntObj(val);
+ TclNewIntObj(objs[4], val);
}
} else {
objs[4] = Tcl_NewWideIntObj((count / usec) * 1000000);
@@ -4644,7 +4645,7 @@ Tcl_TimeRateObjCmd(
if (usec >= 1) {
objs[6] = Tcl_ObjPrintf("%.3f", (double)usec / 1000);
} else {
- objs[6] = Tcl_NewWideIntObj(0);
+ TclNewIntObj(objs[6], 0);
}
TclNewLiteralStringObj(objs[7], "net-ms");
}
diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c
index a630ad4..aabd764 100644
--- a/generic/tclCompExpr.c
+++ b/generic/tclCompExpr.c
@@ -1009,7 +1009,7 @@ ParseExpr(
* later.
*/
- literal = Tcl_NewObj();
+ TclNewObj(literal);
if (TclWordKnownAtCompileTime(tokenPtr, literal)) {
Tcl_ListObjAppendElement(NULL, litList, literal);
complete = lastParsed = OT_LITERAL;
diff --git a/generic/tclDate.c b/generic/tclDate.c
index f8552a3..7f659eb 100644
--- a/generic/tclDate.c
+++ b/generic/tclDate.c
@@ -2787,7 +2787,7 @@ TclClockOldscanObjCmd(
yyHaveRel = 0;
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
- dateInfo.messages = Tcl_NewObj();
+ TclNewObj(dateInfo.messages);
dateInfo.separatrix = "";
Tcl_IncrRefCount(dateInfo.messages);
@@ -2844,8 +2844,8 @@ TclClockOldscanObjCmd(
return TCL_ERROR;
}
- result = Tcl_NewObj();
- resultElement = Tcl_NewObj();
+ TclNewObj(result);
+ TclNewObj(resultElement);
if (yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyYear));
@@ -2863,7 +2863,7 @@ TclClockOldscanObjCmd(
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveZone) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) -yyTimezone));
@@ -2872,7 +2872,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveRel) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyRelMonth));
@@ -2883,7 +2883,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveDay && !yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyDayOrdinal));
@@ -2892,7 +2892,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveOrdinalMonth) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyMonthOrdinal));
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c
index 116dd6d..9c11df6 100644
--- a/generic/tclDictObj.c
+++ b/generic/tclDictObj.c
@@ -2226,8 +2226,9 @@ DictIncrCmd(
if (objc == 4) {
code = TclIncrObj(interp, valuePtr, objv[3]);
} else {
- Tcl_Obj *incrPtr = Tcl_NewWideIntObj(1);
+ Tcl_Obj *incrPtr;
+ TclNewIntObj(incrPtr, 1);
Tcl_IncrRefCount(incrPtr);
code = TclIncrObj(interp, valuePtr, incrPtr);
TclDecrRefCount(incrPtr);
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 867cdd7..54c147d 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -3736,7 +3736,7 @@ TEBCresume(
TRACE(("%u %ld => ", opnd, increment));
if (Tcl_IsShared(objPtr)) {
objPtr->refCount--; /* We know it's shared. */
- objResultPtr = Tcl_NewWideIntObj(w+increment);
+ TclNewIntObj(objResultPtr, w + increment);
Tcl_IncrRefCount(objResultPtr);
varPtr->value.objPtr = objResultPtr;
} else {
@@ -6156,7 +6156,7 @@ TEBCresume(
wideResultOfArithmetic:
TRACE(("%s %s => ", O2S(valuePtr), O2S(value2Ptr)));
if (Tcl_IsShared(valuePtr)) {
- objResultPtr = Tcl_NewWideIntObj(wResult);
+ TclNewIntObj(objResultPtr, wResult);
TRACE(("%s\n", O2S(objResultPtr)));
NEXT_INST_F(1, 2, 1);
}
@@ -7564,7 +7564,7 @@ TEBCresume(
default:
Tcl_Panic("clockRead instruction with unknown clock#");
}
- objResultPtr = Tcl_NewWideIntObj(wval);
+ TclNewIntObj(objResultPtr, wval);
TRACE_WITH_OBJ(("=> "), objResultPtr);
NEXT_INST_F(2, 0, 1);
}
diff --git a/generic/tclGetDate.y b/generic/tclGetDate.y
index 33b23ae..a84d3c2 100644
--- a/generic/tclGetDate.y
+++ b/generic/tclGetDate.y
@@ -1002,7 +1002,7 @@ TclClockOldscanObjCmd(
yyHaveRel = 0;
yyRelMonth = 0; yyRelDay = 0; yyRelSeconds = 0; yyRelPointer = NULL;
- dateInfo.messages = Tcl_NewObj();
+ TclNewObj(dateInfo.messages);
dateInfo.separatrix = "";
Tcl_IncrRefCount(dateInfo.messages);
@@ -1059,8 +1059,8 @@ TclClockOldscanObjCmd(
return TCL_ERROR;
}
- result = Tcl_NewObj();
- resultElement = Tcl_NewObj();
+ TclNewObj(result);
+ TclNewObj(resultElement);
if (yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyYear));
@@ -1078,7 +1078,7 @@ TclClockOldscanObjCmd(
Tcl_ListObjAppendElement(interp, result, Tcl_NewObj());
}
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveZone) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) -yyTimezone));
@@ -1087,7 +1087,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveRel) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyRelMonth));
@@ -1098,7 +1098,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- resultElement = Tcl_NewObj();
+ TcNewObj(resultElement);
if (yyHaveDay && !yyHaveDate) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyDayOrdinal));
@@ -1107,7 +1107,7 @@ TclClockOldscanObjCmd(
}
Tcl_ListObjAppendElement(interp, result, resultElement);
- resultElement = Tcl_NewObj();
+ TclNewObj(resultElement);
if (yyHaveOrdinalMonth) {
Tcl_ListObjAppendElement(interp, resultElement,
Tcl_NewIntObj((int) yyMonthOrdinal));
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index c622afa..7c4b038 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -1591,7 +1591,7 @@ ReflectSeekWide(
Tcl_Preserve(rcPtr);
- offObj = Tcl_NewWideIntObj(offset);
+ TclNewIntObj(offObj, offset);
baseObj = Tcl_NewStringObj(
(seekMode == SEEK_SET) ? "start" :
(seekMode == SEEK_CUR) ? "current" : "end", -1);
@@ -3052,7 +3052,7 @@ ForwardProc(
TclNewIntObj(toReadObj, paramPtr->input.toRead);
Tcl_IncrRefCount(toReadObj);
- Tcl_Preserve(rcPtr);
+ Tcl_Preserve(rcPtr);
if (InvokeTclMethod(rcPtr, METH_READ, toReadObj, NULL, &resObj)!=TCL_OK){
int code = ErrnoReturn(rcPtr, resObj);
@@ -3127,7 +3127,9 @@ ForwardProc(
}
case ForwardedSeek: {
- Tcl_Obj *offObj = Tcl_NewWideIntObj(paramPtr->seek.offset);
+ Tcl_Obj *offObj;
+
+ TclNewIntObj(offObj, paramPtr->seek.offset);
Tcl_Obj *baseObj = Tcl_NewStringObj(
(paramPtr->seek.seekMode==SEEK_SET) ? "start" :
(paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1);
diff --git a/generic/tclLink.c b/generic/tclLink.c
index 090192e..13bf6c4 100644
--- a/generic/tclLink.c
+++ b/generic/tclLink.c
@@ -1309,7 +1309,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
- objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.wPtr[i]);
+ TclNewIntObj(objv[i], linkPtr->lastValue.wPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1400,7 +1400,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
- objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.uiPtr[i]);
+ TclNewIntObj(objv[i], linkPtr->lastValue.uiPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1414,7 +1414,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
- objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.lPtr[i]);
+ TclNewIntObj(objv[i], linkPtr->lastValue.lPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1427,7 +1427,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
- objv[i] = Tcl_NewWideIntObj(linkPtr->lastValue.ulPtr[i]);
+ TclNewIntObj(objv[i], linkPtr->lastValue.ulPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
ckfree(objv);
@@ -1454,7 +1454,7 @@ ObjValue(
memcpy(linkPtr->lastValue.aryPtr, linkPtr->addr, linkPtr->bytes);
objv = (Tcl_Obj **)ckalloc(linkPtr->numElems * sizeof(Tcl_Obj *));
for (i=0; i < linkPtr->numElems; i++) {
- objv[i] = Tcl_NewWideIntObj((Tcl_WideInt)
+ TclNewIntObj(objv[i], (Tcl_WideInt)
linkPtr->lastValue.uwPtr[i]);
}
resultObj = Tcl_NewListObj(linkPtr->numElems, objv);
diff --git a/generic/tclScan.c b/generic/tclScan.c
index 1eefafe..ee04165 100644
--- a/generic/tclScan.c
+++ b/generic/tclScan.c
@@ -716,7 +716,7 @@ Tcl_ScanObjCmd(
switch (ch) {
case 'n':
if (!(flags & SCAN_SUPPRESS)) {
- objPtr = Tcl_NewWideIntObj(string - baseString);
+ TclNewIntObj(objPtr, string - baseString);
Tcl_IncrRefCount(objPtr);
CLANG_ASSERT(objs);
objs[objIndex++] = objPtr;
@@ -879,7 +879,7 @@ Tcl_ScanObjCmd(
offset = TclUtfToUCS4(string, &i);
string += offset;
if (!(flags & SCAN_SUPPRESS)) {
- objPtr = Tcl_NewWideIntObj(i);
+ TclNewIntObj(objPtr, i);
Tcl_IncrRefCount(objPtr);
CLANG_ASSERT(objs);
objs[objIndex++] = objPtr;
@@ -890,7 +890,7 @@ Tcl_ScanObjCmd(
/*
* Scan an unsigned or signed integer.
*/
- objPtr = Tcl_NewWideIntObj(0);
+ TclNewIntObj(objPtr, 0);
Tcl_IncrRefCount(objPtr);
if (width == 0) {
width = ~0;
@@ -1098,7 +1098,7 @@ Tcl_ScanObjCmd(
}
}
} else if (numVars) {
- objPtr = Tcl_NewWideIntObj(result);
+ TclNewIntObj(objPtr, result);
}
Tcl_SetObjResult(interp, objPtr);
}
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 66647f0..03aceaf 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2178,15 +2178,15 @@ Tcl_AppendFormatToObj(
const char *bytes;
if (useShort) {
- pure = Tcl_NewWideIntObj(s);
+ TclNewIntObj(pure, s);
#ifndef TCL_WIDE_INT_IS_LONG
} else if (useWide) {
- pure = Tcl_NewWideIntObj(w);
+ TclNewIntObj(pure, w);
#endif
} else if (useBig) {
pure = Tcl_NewBignumObj(&big);
} else {
- pure = Tcl_NewWideIntObj(l);
+ TclNewIntObj(pure, l);
}
Tcl_IncrRefCount(pure);
bytes = TclGetStringFromObj(pure, &length);
@@ -2543,8 +2543,9 @@ Tcl_Format(
Tcl_Obj *const objv[])
{
int result;
- Tcl_Obj *objPtr = Tcl_NewObj();
+ Tcl_Obj *objPtr;
+ TclNewObj(objPtr);
result = Tcl_AppendFormatToObj(interp, objPtr, format, objc, objv);
if (result != TCL_OK) {
Tcl_DecrRefCount(objPtr);
@@ -2572,9 +2573,10 @@ AppendPrintfToObjVA(
va_list argList)
{
int code, objc;
- Tcl_Obj **objv, *list = Tcl_NewObj();
+ Tcl_Obj **objv, *list;
const char *p;
+ TclNewObj(list);
p = format;
Tcl_IncrRefCount(list);
while (*p != '\0') {
@@ -2788,8 +2790,9 @@ Tcl_ObjPrintf(
...)
{
va_list argList;
- Tcl_Obj *objPtr = Tcl_NewObj();
+ Tcl_Obj *objPtr;
+ TclNewObj(objPtr);
va_start(argList, format);
AppendPrintfToObjVA(objPtr, format, argList);
va_end(argList);
@@ -3410,7 +3413,7 @@ TclStringCmp(
if (nocase) {
s1 = (char *) Tcl_GetUnicodeFromObj(value1Ptr, &s1len);
s2 = (char *) Tcl_GetUnicodeFromObj(value2Ptr, &s2len);
- memCmpFn = (memCmpFn_t)Tcl_UniCharNcasecmp;
+ memCmpFn = (memCmpFn_t)(void *)Tcl_UniCharNcasecmp;
} else {
s1len = Tcl_GetCharLength(value1Ptr);
s2len = Tcl_GetCharLength(value2Ptr);
@@ -3435,7 +3438,7 @@ TclStringCmp(
s1len *= sizeof(Tcl_UniChar);
s2len *= sizeof(Tcl_UniChar);
} else {
- memCmpFn = (memCmpFn_t) Tcl_UniCharNcmp;
+ memCmpFn = (memCmpFn_t)(void *)Tcl_UniCharNcmp;
}
}
}
@@ -3493,11 +3496,11 @@ TclStringCmp(
*/
if ((reqlength < 0) && !nocase) {
- memCmpFn = (memCmpFn_t) TclpUtfNcmp2;
+ memCmpFn = (memCmpFn_t)(void *)TclpUtfNcmp2;
} else {
s1len = Tcl_NumUtfChars(s1, s1len);
s2len = Tcl_NumUtfChars(s2, s2len);
- memCmpFn = (memCmpFn_t)
+ memCmpFn = (memCmpFn_t)(void *)
(nocase ? Tcl_UtfNcasecmp : Tcl_UtfNcmp);
}
}
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index 1b007cf..ceb0833 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -4485,13 +4485,13 @@ ZipFSFileAttrsGetProc(
}
switch (index) {
case 0:
- *objPtrRef = Tcl_NewWideIntObj(z->numBytes);
+ TclNewIntObj(*objPtrRef, z->numBytes);
break;
case 1:
- *objPtrRef = Tcl_NewWideIntObj(z->numCompressedBytes);
+ TclNewIntObj(*objPtrRef, z->numCompressedBytes);
break;
case 2:
- *objPtrRef = Tcl_NewWideIntObj(z->offset);
+ TclNewIntObj(*objPtrRef, z->offset);
break;
case 3:
*objPtrRef = Tcl_NewStringObj(z->zipFilePtr->mountPoint,
diff --git a/macosx/tclMacOSXFCmd.c b/macosx/tclMacOSXFCmd.c
index 06ad180..52c43e7 100644
--- a/macosx/tclMacOSXFCmd.c
+++ b/macosx/tclMacOSXFCmd.c
@@ -192,11 +192,11 @@ TclMacOSXGetFileAttribute(
OSSwapBigToHostInt32(finder->type));
break;
case MACOSX_HIDDEN_ATTRIBUTE:
- *attributePtrPtr = Tcl_NewWideIntObj(
+ TclNewIntObj(*attributePtrPtr,
(finder->fdFlags & kFinfoIsInvisible) != 0);
break;
case MACOSX_RSRCLENGTH_ATTRIBUTE:
- *attributePtrPtr = Tcl_NewWideIntObj(*rsrcForkSize);
+ TclNewIntObj(*attributePtrPtr, *rsrcForkSize);
break;
}
return TCL_OK;
diff --git a/unix/tclLoadDyld.c b/unix/tclLoadDyld.c
index e95d269..ee13350 100644
--- a/unix/tclLoadDyld.c
+++ b/unix/tclLoadDyld.c
@@ -292,8 +292,9 @@ TclpDlopen(
*loadHandle = newHandle;
result = TCL_OK;
} else {
- Tcl_Obj *errObj = Tcl_NewObj();
+ Tcl_Obj *errObj;
+ TclNewObj(errObj);
if (errMsg != NULL) {
Tcl_AppendToObj(errObj, errMsg, -1);
}
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index b188f21..eee47d7 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -1363,7 +1363,7 @@ GetGroupAttribute(
groupPtr = TclpGetGrGid(statBuf.st_gid);
if (groupPtr == NULL) {
- *attributePtrPtr = Tcl_NewWideIntObj(statBuf.st_gid);
+ TclNewIntObj(*attributePtrPtr, statBuf.st_gid);
} else {
Tcl_DString ds;
const char *utf;
@@ -1417,7 +1417,7 @@ GetOwnerAttribute(
pwPtr = TclpGetPwUid(statBuf.st_uid);
if (pwPtr == NULL) {
- *attributePtrPtr = Tcl_NewWideIntObj(statBuf.st_uid);
+ TclNewIntObj(*attributePtrPtr, statBuf.st_uid);
} else {
Tcl_DString ds;
@@ -2411,7 +2411,7 @@ GetUnixFileAttributes(
return TCL_ERROR;
}
- *attributePtrPtr = Tcl_NewWideIntObj(
+ TclNewIntObj(*attributePtrPtr,
(fileAttributes & attributeArray[objIndex]) != 0);
return TCL_OK;
}
@@ -2511,7 +2511,7 @@ GetUnixFileAttributes(
return TCL_ERROR;
}
- *attributePtrPtr = Tcl_NewWideIntObj((statBuf.st_flags & UF_IMMUTABLE) != 0);
+ TclNewIntObj(*attributePtrPtr, (statBuf.st_flags & UF_IMMUTABLE) != 0);
return TCL_OK;
}
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index b67d91d..12cbd2c 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -463,7 +463,7 @@ TclpInitLibraryPath(
const char *str;
Tcl_DString buffer;
- pathPtr = Tcl_NewObj();
+ TclNewObj(pathPtr);
/*
* Look for the library relative to the TCL_LIBRARY env variable. If the
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index 681ee64..5d02486 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -229,9 +229,10 @@ TclpCreateTempFile(
Tcl_Obj *
TclpTempFileName(void)
{
- Tcl_Obj *retVal, *nameObj = Tcl_NewObj();
+ Tcl_Obj *retVal, *nameObj;
int fd;
+ TclNewObj(nameObj);
Tcl_IncrRefCount(nameObj);
fd = TclUnixOpenTemporaryFile(NULL, NULL, NULL, nameObj);
if (fd == -1) {
@@ -1284,7 +1285,7 @@ Tcl_PidObjCmd(
*/
pipePtr = (PipeState *)Tcl_GetChannelInstanceData(chan);
- resultPtr = Tcl_NewObj();
+ TclNewObj(resultPtr);
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, resultPtr,
Tcl_NewWideIntObj(PTR2INT(TclpGetPid(pipePtr->pidPtr[i]))));
diff --git a/win/tclAppInit.c b/win/tclAppInit.c
index 59c21e5..de5f788 100644
--- a/win/tclAppInit.c
+++ b/win/tclAppInit.c
@@ -29,7 +29,7 @@ extern Tcl_PackageInitProc Tcltest_Init;
extern Tcl_PackageInitProc Tcltest_SafeInit;
#endif /* TCL_TEST */
-#if defined(STATIC_BUILD) && TCL_USE_STATIC_PACKAGES
+#if defined(STATIC_BUILD) && defined(TCL_USE_STATIC_PACKAGES) && TCL_USE_STATIC_PACKAGES
extern Tcl_PackageInitProc Registry_Init;
extern Tcl_PackageInitProc Dde_Init;
extern Tcl_PackageInitProc Dde_SafeInit;
@@ -164,7 +164,7 @@ Tcl_AppInit(
return TCL_ERROR;
}
-#if defined(STATIC_BUILD) && TCL_USE_STATIC_PACKAGES
+#if defined(STATIC_BUILD) && defined(TCL_USE_STATIC_PACKAGES) && TCL_USE_STATIC_PACKAGES
if (Registry_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index 6750d29..ad4bae1 100644
--- a/win/tclWinFCmd.c
+++ b/win/tclWinFCmd.c
@@ -1560,7 +1560,7 @@ GetWinFileAttributes(
}
}
- *attributePtrPtr = Tcl_NewWideIntObj(attr != 0);
+ TclNewIntObj(*attributePtrPtr, attr != 0);
return TCL_OK;
}
@@ -1926,7 +1926,7 @@ TclpObjListVolumes(void)
int i;
char *p;
- resultPtr = Tcl_NewObj();
+ TclNewObj(resultPtr);
/*
* On Win32s:
diff --git a/win/tclWinInit.c b/win/tclWinInit.c
index 9378641..868ebd9 100644
--- a/win/tclWinInit.c
+++ b/win/tclWinInit.c
@@ -189,7 +189,7 @@ TclpInitLibraryPath(
const char *bytes;
int length;
- pathPtr = Tcl_NewObj();
+ TclNewObj(pathPtr);
/*
* Initialize the substring used when locating the script library. The
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 14270f8..a93688d 100644
--- a/win/tclWinPipe.c
+++ b/win/tclWinPipe.c
@@ -2771,7 +2771,7 @@ Tcl_PidObjCmd(
}
pipePtr = (PipeInfo *) Tcl_GetChannelInstanceData(chan);
- resultPtr = Tcl_NewObj();
+ TclNewObj(resultPtr);
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(/*interp*/ NULL, resultPtr,
Tcl_NewWideIntObj((unsigned)