summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * generic/tclStringObj.c (SetUnicodeObj): Corrected failure ofdgp2009-02-031-43/+28
| | | | | Tcl_SetUnicodeObj() to panic on a shared object. [Bug 2561488]. Also factored out common code to reduce duplication.
* * generic/tclStringObj.c (STRING_NOMEM): Add missing cast ofdgp2009-02-021-2/+3
| | | | NULL to (char *) that upsets some compilers. [Bug 2494093].
* * generic/tclStringObj.c (Tcl_(Attempt)SetObjLength): Addeddgp2009-02-021-1/+16
| | | | | | protections against callers asking for negative lengths. It is likely when this happens that an integer overflow is to blame. [Bug 2553906].
* * generic/tclStringObj.c: New fix for [Bug 2494093] replaces thedgp2009-01-211-24/+30
| | | | flawed attempt committed 2009-01-09.
* * generic/tclStringObj.c (STRING_SIZE): Corrected failure to limitdgp2009-01-091-4/+7
| | | | | memory allocation requests to the sizes that can be supported by Tcl's memory allocation routines. [Bug 2494093].
* * generic/tclStringObj.c (STRING_UALLOC): Added missing parensdgp2009-01-081-2/+2
| | | | | required to get correct results out of things like STRING_UALLOC(num + append). [Bug 2494093].
* move variable "length" inside if()nijtmans2008-12-171-2/+2
| | | | | don't use ckfree((void *)...) but ckfree((char *)...)
* TIP #343 IMPLEMENTATION - A Binary Specifier for [format/scan]ferrieux2008-12-101-5/+12
|
* Style improvements - invoking callbacks without visual junk.dkf2008-10-261-5/+4
|
* Add "const" to many internalnijtmans2008-10-161-2/+2
| | | | | const tables. No functional or API change.
* Add "const" to many internalnijtmans2008-10-151-2/+2
| | | | | | | | const tables, so those will be put by the C-compiler in the TEXT segment in stead of the DATA segment. This makes those table sharable in shared libraries.
* * generic/tclStringObj.c (Tcl_AppendFormatToObj):rmax2008-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.