diff options
author | dgp <dgp@users.sourceforge.net> | 2006-10-31 20:19:43 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-10-31 20:19:43 (GMT) |
commit | ce16019300e66b466f8ad327c5b3a03fe6876f8e (patch) | |
tree | 75652e34b31819c0360f9598db333054faffde99 /generic/tclBasic.c | |
parent | 20c1156972864f916da62a217137e346eb93ac79 (diff) | |
download | tcl-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/tclBasic.c')
-rw-r--r-- | generic/tclBasic.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 2be44d3..2ef6a8d 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.208 2006/10/31 15:23:41 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.209 2006/10/31 20:19:44 dgp Exp $ */ #include "tclInt.h" @@ -3765,8 +3765,8 @@ Tcl_EvalEx( * Attempt to expand a non-list. */ - TclFormatToErrorInfo(interp, - "\n (expanding word %d)", objectsUsed); + TclAppendObjToErrorInfo(interp, TclObjPrintf(NULL, + "\n (expanding word %d)", objectsUsed)); Tcl_DecrRefCount(objv[objectsUsed]); goto error; } @@ -4156,10 +4156,8 @@ ProcessUnexpectedResult( Tcl_AppendResult(interp, "invoked \"continue\" outside of a loop", NULL); } else { - Tcl_Obj *objPtr = Tcl_NewObj(); - TclObjPrintf(NULL, objPtr, "command returned bad code: %d", - returnCode); - Tcl_SetObjResult(interp, objPtr); + Tcl_SetObjResult(interp, TclObjPrintf(NULL, + "command returned bad code: %d", returnCode)); } } @@ -5777,7 +5775,6 @@ MathFuncWrongNumArgs( int found, /* Actual parameter count */ Tcl_Obj *CONST *objv) /* Actual parameter vector */ { - Tcl_Obj *errorMessage; CONST char *name = Tcl_GetString(objv[0]); CONST char *tail = name + strlen(name); @@ -5788,11 +5785,9 @@ MathFuncWrongNumArgs( break; } } - TclNewObj(errorMessage); - TclObjPrintf(NULL, errorMessage, + Tcl_SetObjResult(interp, TclObjPrintf(NULL, "too %s arguments for math function \"%s\"", - (found < expected ? "few" : "many"), name); - Tcl_SetObjResult(interp, errorMessage); + (found < expected ? "few" : "many"), name)); } /* |