summaryrefslogtreecommitdiffstats
path: root/generic/tclIORChan.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-10-31 20:19:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-10-31 20:19:43 (GMT)
commitce16019300e66b466f8ad327c5b3a03fe6876f8e (patch)
tree75652e34b31819c0360f9598db333054faffde99 /generic/tclIORChan.c
parent20c1156972864f916da62a217137e346eb93ac79 (diff)
downloadtcl-ce16019300e66b466f8ad327c5b3a03fe6876f8e.zip
tcl-ce16019300e66b466f8ad327c5b3a03fe6876f8e.tar.gz
tcl-ce16019300e66b466f8ad327c5b3a03fe6876f8e.tar.bz2
* generic/tclBasic.c: Refactored and renamed the routines
* generic/tclCkalloc.c: TclObjPrintf, TclFormatObj, and * generic/tclCmdAH.c: TclFormatToErrorInfo to a new set of * generic/tclCmdIL.c: routines TclAppendPrintfToObj, * generic/tclCmdMZ.c: TclAppendFormatToObj, TclObjPrintf, and * generic/tclDictObj.c: TclObjFormat, with the intent of making * generic/tclExecute.c: the latter list, plus TclAppendLimitedToObj * generic/tclIORChan.c: and TclAppendObjToErrorInfo, public via * generic/tclIOUtil.c: a revised TIP 270. * generic/tclInt.h: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclParseExpr.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStringObj.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c:
Diffstat (limited to 'generic/tclIORChan.c')
-rw-r--r--generic/tclIORChan.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index a69ea2e..d944287 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -15,7 +15,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIORChan.c,v 1.15 2006/03/27 18:08:51 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclIORChan.c,v 1.16 2006/10/31 20:19:45 dgp Exp $
*/
#include <tclInt.h>
@@ -1651,13 +1651,11 @@ ReflectGetOption(
* Odd number of elements is wrong.
*/
- Tcl_Obj *objPtr = Tcl_NewObj();
-
Tcl_ResetResult(interp);
- TclObjPrintf(NULL, objPtr, "Expected list with even number of "
+ Tcl_SetObjResult(interp, TclObjPrintf(NULL,
+ "Expected list with even number of "
"elements, got %d element%s instead", listc,
- (listc == 1 ? "" : "s"));
- Tcl_SetObjResult(interp, objPtr);
+ (listc == 1 ? "" : "s")));
Tcl_DecrRefCount(resObj); /* Remove reference held from invoke */
return TCL_ERROR;
} else {
@@ -1910,9 +1908,8 @@ NextHandle(void)
static unsigned long rcCounter = 0;
Tcl_Obj *resObj;
- TclNewObj(resObj);
Tcl_MutexLock(&rcCounterMutex);
- TclObjPrintf(NULL, resObj, "rc%lu", rcCounter);
+ resObj = TclObjPrintf(NULL, "rc%lu", rcCounter);
rcCounter++;
Tcl_MutexUnlock(&rcCounterMutex);
@@ -2043,19 +2040,17 @@ InvokeTclMethod(
Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rcPtr->argv);
int cmdLen;
CONST char *cmdString = Tcl_GetStringFromObj(cmd, &cmdLen);
- Tcl_Obj *msg = Tcl_NewObj();
Tcl_IncrRefCount(cmd);
- TclObjPrintf(NULL, msg, "chan handler returned bad code: %d",
- result);
Tcl_ResetResult(rcPtr->interp);
- Tcl_SetObjResult(rcPtr->interp, msg);
+ Tcl_SetObjResult(rcPtr->interp, TclObjPrintf(NULL,
+ "chan handler returned bad code: %d", result));
Tcl_LogCommandInfo(rcPtr->interp, cmdString, cmdString, cmdLen);
Tcl_DecrRefCount(cmd);
result = TCL_ERROR;
}
- TclFormatToErrorInfo(rcPtr->interp,
- "\n (chan handler subcommand \"%s\")", method);
+ TclAppendObjToErrorInfo(rcPtr->interp, TclObjPrintf(NULL,
+ "\n (chan handler subcommand \"%s\")", method));
resObj = MarshallError(rcPtr->interp);
}
Tcl_IncrRefCount(resObj);