summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclStringObj.c (Tcl_AppendFormatToObj):dgp2008-04-071-3/+3
| | | | | | Fix [format {% d}] so that it behaves the same way as in 8.4 and as C's printf(). * tests/format.test: Add a test for '% d' and '%+d'.
* * generic/tclStringObj.c (Tcl_AppendFormatToObj): [format %llx $big]dgp2008-02-281-1/+4
| | | | leaked an mp_int.
* * generic/tclStringObj.c (Tcl_AppendFormatToObj): Correct failure todgp2008-01-101-4/+4
| | | | | * tests/format.test: account for big.used == 0 corner case in the %ll(idox) format directives. [Bug 1867855].
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* More minor cleanupdkf2007-11-181-74/+69
|
* [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-17/+17
| | | | objTypes.
* * generic/tclCmdMZ.c (STR_REVERSE): Implement the actualdgp2007-03-281-1/+83
| | | | | | | | | | | [string reverse] command in terms of the new TclStringObjReverse() routine. * generic/tclInt.h (TclStringObjReverse): New internal routine * generic/tclStringObj.c (TclStringObjReverse): that implements the [string reverse] operation, making use of knowledge/surgery of the String intrep to minimize the number of allocs and copies needed to do the job.
* * generic/tclExecute.c: More ckalloc -> ckrealloc conversions.dgp2007-03-211-10/+8
| | | | | | | | | * generic/tclLiteral.c: * generic/tclNamesp.c: * generic/tclParse.c: * generic/tclPreserve.c: * generic/tclStringObj.c: * generic/tclUtil.c:
* TIP#270 IMPLEMENTATIONdgp2006-11-151-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tcl.decls: New public routines Tcl_ObjPrintf, * generic/tclStringObj.c: Tcl_AppendObjToErrorInfo, Tcl_Format, * generic/tclInt.h: Tcl_AppendLimitedToObj, Tcl_AppendFormatToObj and Tcl_AppendPrintfToObj. Former internal versions removed. * generic/tclDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclBasic.c: Updated callers. * generic/tclCkalloc.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclMain.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclPkg.c: * generic/tclProc.c: * generic/tclStrToD.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/tclUnixFCmd.c:
* * generic/tclStringObj.c: Changed Tcl_ObjPrintf() response todgp2006-11-051-2/+3
| | | | | an invalid format specifier string. No longer panics; now produces an error message as output.
* * generic/tclCmdAH.c: Further revisions to produce the routinesdgp2006-11-021-91/+10
| | | | | | * generic/tclInt.h: TclFormat() and TclAppendFormatToObj() that * generic/tclNamesp.c: accept (objc, objv) arguments rather than * generic/tclStringObj.c: any varargs stuff.
* * generic/tclBasic.c: Further revised TclAppendPrintToObj() anddgp2006-11-021-18/+11
| | | | | | | | | | | | | | | | | | | | | * 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:
* * generic/tclBasic.c: Refactored and renamed the routinesdgp2006-10-311-25/+60
| | | | | | | | | | | | | | | | | | | | | * 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:
* * generic/tclStringObj.c (STRING_SIZE): fix allocation forMiguel Sofer2006-09-241-2/+4
| | | | 0-length strings. This is coverity's bugs #54-5
* * generic/tclStringObj.c: Revised ObjPrintfVA to take caredgp2006-08-281-17/+30
| | | | | | | | * generic/tclParseExpr.c: to copy only whole characters when doing %s formatting. This relieves callers of TclObjPrintf() and TclFormatToErrorInfo() from needing to fix arguments to character boundaries. Tcl_ParseExpr() simplified by taking advantage. [Bug 1547786]
* * generic/tclStringObj.c: Corrected TclFormatObj's failuredgp2006-08-281-4/+11
| | | | | to count up the number of arguments required by examining the format string. [Bug 1547681]
* Various minor object file size efficiency fixes. [Bug 1530474]dkf2006-08-101-8/+8
|
* * generic/regc_locale.c (cclass):das2006-07-201-2/+2
| | | | | | | | | | | | | * generic/tclExecute.c (TclExecuteByteCode): * generic/tclIOCmd.c (Tcl_ExecObjCmd): * generic/tclListObj.c (NewListIntRep): * generic/tclObj.c (Tcl_GetLongFromObj, Tcl_GetWideIntFromObj, FreeBignum, Tcl_SetBignumObj): * generic/tclParseExpr.c (Tcl_ParseExpr): * generic/tclStrToD.c (TclParseNumber): * generic/tclStringObj.c (TclAppendFormattedObjs): * unix/tclUnixPipe.c (TclpCreateProcess): fix signed-with-unsigned comparison and other warnings from gcc4 -Wextra.
* comment adjustmentdgp2006-03-231-1/+2
|
* * generic/tclStringObj.c: fixed incorrect handling of internal repMiguel Sofer2006-01-231-2/+2
| | | | in Tcl_GetRange [Bug 1410553]. Thanks to twylite and Peter Spjuth.
* ANSIfy (though only partially - function decls only - for tclExecute.c)dkf2005-11-021-214/+268
|
* * generic/tclBasic.c:Miguel Sofer2005-10-091-2/+3
| | | | | | | * generic/tclExecute.c: * generic/tclStrToD.c: * generic/tclStringObj.c: initialise variables to avoid compiler warnings ([Bug 1320818] among others).
* TIP#237 IMPLEMENTATIONdgp2005-10-081-38/+89
| | | | | | [kennykb-numerics-branch] Resynchronized with the HEAD; at this checkpoint [-rkennykb-numerics-branch-20051008], the HEAD and kennykb-numerics-branch contain identical code.
* * generic/tclStringObj.c (TclAppendFormattedObjs): Revisionkennykb_numerics_branch_20050915dgp2005-09-151-9/+7
| | | | to eliminate one round of string copying.
* * generic/tclStringObj.c: Bug fixes: ObjPrintfVA needed todgp2005-09-141-5/+12
| | | | | | | | | | | | | | | | | | support "*" fields and needed to interpret precision limits on %s conversions as a maximum number of bytes, not Tcl_UniChars, to take from the (char *) argument. * generic/tclBasic.c: Updated several callers to use * generic/tclCkalloc.c: TclFormatToErrorInfo() and/or * generic/tclCmdAH.c: TclObjPrintf(). * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclDictObj.c: * generic/tclExecute.c: * generic/tclIORChan.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclProc.c:
* * generic/tclStringObj.c: Bug fixes: ObjPrintfVA needed todgp2005-09-141-5/+31
| | | | | | | | | | | | | support "*" fields and needed to interpret precision limits on %s conversions as a number of bytes, not Tcl_UniChars, to take from the (char *) argument. * generic/tclBasic.c: Updated several callers to use * generic/tclCmdMZ.c: TclFormatToErrorInfo(). * generic/tclIOUtil.c: * library/init.tcl: Keep [unknown] in sync with errorInfo formatting rules.
* * generic/tclBasic.c: First caller of TclFormatToErrorInfo.dgp2005-09-141-35/+50
| | | | | | * generic/tclInt.h: Using stdarg.h conventions, add more * generic/tclStringObj.c: fixed arguments to TclFormatObj() and TclObjPrintf(). Added new routine TclFormatToErrorInfo().
* * generic/tcl.h: Explicitly standardized on the use of stdarg.hdgp2005-09-131-8/+9
| | | | | | | | | | | | | | | | | * generic/tclBasic.c: conventions for functions with variable number * generic/tclInt.h: of arguments. Support for varargs.h has been * generic/tclPanic.c: implicitly gone for some time now. All * generic/tclResult.c: TCL_VARARGS* macros purged from Tcl sources, * generic/tclStringObj.c: leaving only some deprecated #define's * tools/genStubs.tcl: in tcl.h for the sake of older extensions. * generic/tclDecls.h: make genstubs * doc/AddErrInfo.3: Replaced all documented requirement for use * doc/Eval.3: of TCL_VARARGS_START() with requirement for * doc/Panic.3: use of va_start(). * doc/SetResult.3: * doc/StringObj.3:
* 2005-09-12 Don Porter <dgp@users.sourceforge.net>dgp2005-09-121-4/+6
| | | | | | * generic/tclStringObj.c (TclAppendFormattedObjs): Bug fix: make sure %ld formats force the collection of a wide value, when the value could be a different long.
* silence compiler warningsdgp2005-09-091-5/+2
|
* * generic/tclInt.h: New internal routine TclObjPrintf()dgp2005-09-091-1/+130
| | | | | * generic/tclStringObj.c: is similar to TclFormatObj() but accepts arguments in non-Tcl_Obj format.
* added missing casts in tclStringObj.cKevin B Kenny2005-09-091-3/+3
|
* * generic/tclInt.h: New internal routines TclFormatObj()dgp2005-09-091-1/+599
| | | | | | | | | | * generic/tclStringObj.c: and TclAppendFormattedObjs() to offer sprintf()-like means to append to Tcl_Obj. Work in progress toward [RFE 572392]. * generic/tclCmdAH.c: Compiler directive NEW_FORMAT when #define'd directs the [format] command to be implemented in terms of the new TclAppendFormattedObjs() routine.
* Getting more systematic about styledkf2005-07-241-479/+516
|
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-1/+1
|
* * generic/tclExecute.c:Miguel Sofer2005-04-011-3/+2
| | | | | | | | | * generic/tclInt.h: * generic/tclObj.c: * generic/tclStringObj.c: defined new internal macros for creating and setting frequently used obj types (int,long, wideInt, double, string). Changed TEBC to use eg 'TclNewIntObj(objPtr, i)' to avoid the function call in 'objPtr = Tcl_NewIntObj(i)'
* Factorize out the code for freeing an object's internal rep.dkf2004-09-291-14/+4
|
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-7/+7
| | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]
* * generic/tclBasic.c (TclAppendObjToErrorInfo): New internal routinedgp2003-10-141-12/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | that appends a Tcl_Obj to the errorInfo, saving the caller the trouble of extracting the string rep. * generic/tclStringObj.c (TclAppendLimitedToObj): New internal routine that supports truncated appends with optional ellipsis marking. This single routine supports UTF-8-safe truncated appends needed in several places throughout the Tcl source code, mostly for error and stack messages. Clean fix for [Bug 760872]. * generic/tclInt.h: Declarations for new internal routines. * generic/tclCmdMZ.c: Updated callers to use the new routines. * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclExecute.c: * generic/tclIOUtil.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclParseExpr.c: * generic/tclProc.c: * generic/tclStringObj.c: * mac/tclMacResource.c: * library/init.tcl: Updated ::errorInfo cleanup in [unknown] to reflect slight modifications to Tcl_LogCommandInfo(). Corrects failing init-4.* tests.
* * generic/tclStringObj.c: restored Tcl_SetObjLength() side-effectdas2003-02-191-67/+45
| | | | | | | | | | | | | | | | | | | of always invalidating unicode rep (if the obj has a string rep). Added hasUnicode flag to String struct, allows decoupling of validity of unicode rep from buffer size allocated to it (improves memory allocation efficiency). [Bugs #686782, #671138, #635200] * macosx/Tcl.pbproj/project.pbxproj: * macosx/Makefile: reworked embedded build to no longer require relinking but to use install_name_tool instead to change the install_names for embedded frameworks. * macosx/Tcl.pbproj/project.pbxproj: preserve mod dates when running 'make install' to build framework (avoids bogus rebuilds of dependent frameworks because tcl headers appear changed). * tests/ioCmd.test (iocmd-1.8): fix failure when system encoding is utf-8: use iso8859-1 encoding explicitly.
* * generic/tclCompile.c (TclCompileExprWords): remove unusedMiguel Sofer2003-02-191-3/+2
| | | | | | | | | variable "range" [Bug 664743] * generic/tclExecute.c (ExprSrandFunc): remove unused variable "result" [Bug 664743] * generic/tclStringObj.c (UpdateStringOfString): remove unused variable "length" [Bug 664751] * tests/execute.test (execute-7.30): fix for [Bug 664775]
* generic/tclStringObj.c (Tcl_GetCharLength): perf tweakhobbs2003-02-151-7/+8
|
* * tests/stringObj.test:hobbs2003-02-111-7/+6
| | | | | * generic/tclStringObj.c (Tcl_GetCharLength): correct ascii char opt of 2002-11-11 to not stop early on \x00. [Bug #684699]
* stringObj unicode Tcl_SetObjLength fixesvincentdarley2003-01-241-83/+131
|
* execution trace, command trace and stringObj bug fixesvincentdarley2003-01-171-22/+48
|
* 3 small fixesvincentdarley2002-11-131-3/+3
|
* * generic/tclStringObj.c (Tcl_GetCharLength): optimize for thehobbs2002-11-121-5/+19
| | | | | | ascii char case. (Tcl_GetUniChar): remove unnecessary use of Tcl_UtfToUniChar. (FillUnicodeRep): Use TclUtfToUniChar.
* * Sought out and eliminated instances of CONST-casting that are nodgp2002-01-261-3/+3
| | | | longer needed after the TIP 27 effort.
* * typos and formattingdgp2002-01-081-4/+3
|
* * generic/tclCkalloc.c (MemoryCmd, TclFinalizeMemorySubsystem):dgp2001-12-281-4/+4
| | | | | | | | | | | | | | | | | | | Added the [memory onexit] command, intended to replace [checkmem]. * doc/DumpActiveMemory.3: * doc/memory.n: Updated documentation for [memory] and related matters. [Bug 487677] * mac/tclMacBOAMain.c (Tcl_Main, CheckmemCmd): Removed all the machinery for the [checkmem] command that is completely duplicated by code in generic/tclCkalloc.c. * generic/tclBinary.c: * generic/tclListObj.c: * generic/tclObj.c: * generic/tclStringObj.c: Removed references to [checkmem] in comments, referencing [memory active] instead, since it is documented.