diff options
author | dgp <dgp@users.sourceforge.net> | 2006-11-02 15:58:03 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-11-02 15:58:03 (GMT) |
commit | c35468e1cedfb102415aff618d0be65dd4c1d819 (patch) | |
tree | a0d484e9ff364f3de46b9d807276106b6236242c /generic/tclStringObj.c | |
parent | 8b2128ad1251acebbb373eaaa545f36d5a546c0a (diff) | |
download | tcl-c35468e1cedfb102415aff618d0be65dd4c1d819.zip tcl-c35468e1cedfb102415aff618d0be65dd4c1d819.tar.gz tcl-c35468e1cedfb102415aff618d0be65dd4c1d819.tar.bz2 |
* generic/tclBasic.c: Further revised TclAppendPrintToObj() and
* generic/tclCkalloc.c: TclObjPrintf() routines to panic when unable
* generic/tclCmdAH.c: to complete their formatting operations, rather
* generic/tclCmdIL.c: than report an error message. This means an
* generic/tclCmdMZ.c: interp argument for error message recording is
* generic/tclDictObj.c: no longer needed, further simplifying the
* generic/tclExecute.c: interface for callers.
* generic/tclIORChan.c:
* generic/tclIOUtil.c:
* 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/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index c3ba0f0..9b06eb2 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -33,7 +33,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStringObj.c,v 1.59 2006/10/31 20:19:45 dgp Exp $ */ + * RCS: @(#) $Id: tclStringObj.c,v 1.60 2006/11/02 15:58:09 dgp Exp $ */ #include "tclInt.h" #include "tommath.h" @@ -53,7 +53,7 @@ static void AppendUtfToUtfRep(Tcl_Obj *objPtr, static void FillUnicodeRep(Tcl_Obj *objPtr); static int AppendFormatToObjVA(Tcl_Interp *interp, Tcl_Obj *objPtr, CONST char *format, va_list argList); -static int AppendPrintfToObjVA(Tcl_Interp *interp, Tcl_Obj *objPtr, +static void AppendPrintfToObjVA(Tcl_Obj *objPtr, CONST char *format, va_list argList); static void FreeStringInternalRep(Tcl_Obj *objPtr); static void DupStringInternalRep(Tcl_Obj *objPtr, @@ -2412,9 +2412,8 @@ TclObjFormat( *--------------------------------------------------------------------------- */ -static int +static void AppendPrintfToObjVA( - Tcl_Interp *interp, Tcl_Obj *objPtr, CONST char *format, va_list argList) @@ -2536,9 +2535,12 @@ AppendPrintfToObjVA( } while (seekingConversion); } Tcl_ListObjGetElements(NULL, list, &objc, &objv); - code = TclAppendFormattedObjs(interp, objPtr, format, objc, objv); + code = TclAppendFormattedObjs(NULL, objPtr, format, objc, objv); + if (code != TCL_OK) { + Tcl_Panic("Unable to format \"%s\" with supplied arguments: %s", + format, Tcl_GetString(list)); + } Tcl_DecrRefCount(list); - return code; } /* @@ -2555,20 +2557,17 @@ AppendPrintfToObjVA( *--------------------------------------------------------------------------- */ -int +void TclAppendPrintfToObj( - Tcl_Interp *interp, Tcl_Obj *objPtr, CONST char *format, ...) { va_list argList; - int result; va_start(argList, format); - result = AppendPrintfToObjVA(interp, objPtr, format, argList); + AppendPrintfToObjVA(objPtr, format, argList); va_end(argList); - return result; } /* @@ -2587,21 +2586,15 @@ TclAppendPrintfToObj( Tcl_Obj * TclObjPrintf( - Tcl_Interp *interp, CONST char *format, ...) { va_list argList; - int result; Tcl_Obj *objPtr = Tcl_NewObj(); va_start(argList, format); - result = AppendPrintfToObjVA(interp, objPtr, format, argList); + AppendPrintfToObjVA(objPtr, format, argList); va_end(argList); - if (result != TCL_OK) { - Tcl_DecrRefCount(objPtr); - return NULL; - } return objPtr; } |