summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
Commit message (Collapse)AuthorAgeFilesLines
* merge trunkKevin B Kenny2011-03-011-4/+52
|\
| * * doc/tclvars.n:Kevin B Kenny2011-01-151-3/+51
| | | | | | | | | | | | | | | | | | | | * generic/tclStrToD.c: * generic/tclUtil.c (Tcl_PrintDouble): * tests/util.test (util-16.*): Restored full Tcl 8.4 compatibility for the formatting of floating point numbers when $::tcl_precision is not zero. Added compatibility tests to make sure that excess trailing zeroes are suppressed for all eight major code paths. [Bug 3157475]
| * * generic/tclUtil.c (TclReToGlob): add extra check for multiplehobbs2010-12-031-2/+14
| | | | | | | | | | inner *s that leads to poor recursive glob matching, defer to original RE instead. tclbench RE var backtrack.
| * silence gcc warning when using -Wwrite-stringsnijtmans2010-12-031-2/+2
| | | | | | | | | | | | silence gcc warning for non-IEEE platforms [Patch #3116490] cross-compile Tcl mingw32 on unix. This makes it possible to cross-compile Tcl/Tk for Windows (either 32-bit or 64-bit) out-of-the-box on UNIX, using mingw-w64 build tools.
| * * generic/tclInt.decls, generic/tclInt.h, generic/tclIntDecls.h:hobbs2010-11-301-1/+87
| | | | | | | | | | | | | | * generic/tclStubInit.c: TclFormatInt restored at slot 24 * generic/tclUtil.c (TclFormatInt): restore TclFormatInt func from 2005-07-05 macro-ization. Benchmarks indicate it is faster, as a key int->string routine (e.g. int-indexed arrays).
| * added missing casts that MSVC complained about and deleted unused variableKevin B Kenny2010-11-291-2/+1
| |
| * 2010-11-29 Kevin B. Kenny <kennykb@acm.org>Kevin B Kenny2010-11-281-98/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.decls: * generic/tclInt.h: * generic/tclStrToD.c: * generic/tclTest.c: * generic/tclTomMath.decls: * generic/tclUtil.c: * tests/util.test: * unix/Makefile.in: * win/Makefile.in: * win/makefile.vc: Rewrite of Tcl_PrintDouble and TclDoubleDigits that (a) fixes a severe performance problem with floating point shimmering reported by Karl Lehenbauer, (b) allows TclDoubleDigits to generate the digit strings for 'e' and 'f' format, so that it can be used for tcl_precision != 0 (and possibly later for [format]), (c) fixes [Bug 3120139] by making TclPrintDouble inherently locale-independent, (d) adds test cases to util.test for correct rounding in difficult cases of TclDoubleDigits where fixed- precision results are requested. (e) adds test cases to util.test for the controversial aspects of [Bug 3105247]. As a side effect, two more modules from libtommath (bn_mp_set_int.c and bn_mp_init_set_int.c) are brought into the build, since the new code uses them.
| * * generic/tclBasic.c, generic/tclClock.c, generic/tclEncoding.c,dkf2010-10-011-12/+11
| | | | | | | | | | | | | | | | * generic/tclEnv.c, generic/tclLoad.c, generic/tclNamesp.c, * generic/tclObj.c, generic/tclRegexp.c, generic/tclResolve.c, * generic/tclResult.c, generic/tclUtil.c, macosx/tclMacOSXFCmd.c: More purging of strcpy() from locations where we already know the length of the data being copied.
* | mergeKevin B Kenny2010-12-111-3/+15
| |
* | mergeKevin B Kenny2010-12-011-99/+155
| |
* | mergeKevin B Kenny2010-10-011-12/+11
|/
* Remove many type casts which are no longernecessary as a result of [Patch ↵nijtmans2010-08-221-3/+3
| | | | 3009403]: Signature of Tcl_GetHashKey, Tcl_(Create|Find)HashEntry
* * generic/tclUtil.c (TclByteArrayMatch): patterns may not behobbs2010-08-101-2/+2
| | | | null-terminated, so account for that.
* If tclInt.h or tclPort.h is alreadynijtmans2010-04-271-2/+1
| | | | | | | included, don't include <limits.h> again. Follow-up to [Bug 2991415]: tclport.h #included before limits.h See comments in [Bug 2991415]
* Code Audit results:dkf2010-03-051-13/+12
| | | | | | | | * use do { ... } while (0) in macros * avoid shadowing one local variable with another * use clearer 'foo.bar++;' instead of '++foo.bar;' where result not required (i.e., semantically equivalent) * follow Engineering Manual rules on spacing and declarations
* More tidying up (whitespace, spelling, useless parentheses, useless casts)dkf2010-02-241-22/+22
|
* Remove unnecessary EXTERN's, which alreadynijtmans2010-02-221-2/+2
| | | | | | | | are in the global stub table. Use @EXEEXT@ in stead of @EXT_SUFFIX@ Use -DBUILD_tcl in Makefile for CYGWIN Use EXTERN to control CYGWIN exported symbols Remove some unnecessary type casts.
* Fix [Bug 2637173] by consolidating bytearray purity check.dkf2009-07-121-6/+6
|
* * generic/tclUtil.c (TclStringMatchObj): Revised the branchingdgp2009-02-251-3/+4
| | | | | | | on the strObj->typePtr so that untyped values get converted to the "string" type and pass through the Unicode matcher. [Bug 2613766] Also added checks to only perform "bytearray" optimization on pure bytearray values. [Bug 2637173].
* - eliminate some unnessary type castsnijtmans2009-02-101-5/+6
| | | | | - some internal const decorations - spacing
* Generate errorcodes for more cases.dkf2009-01-081-1/+7
|
* Style improvements - invoking callbacks without visual junk.dkf2008-10-261-10/+9
|
* 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/tclCmdAH.c: Fix minor compiler warnings when compilingnijtmans2008-10-141-5/+5
| | | | | | | | * generic/tclCmdMZ.c: with -Wwrite-strings * generic/tclIndexObj.c: * generic/tclProc.c: * generic/tclStubLib.c: * generic/tclUtil.c:
* TIP #330 IMPLEMENTATIONdgp2008-10-021-5/+6
| | | | | | | | | | * generic/tcl.h: Remove the "result" and "freeProc" fields * generic/tclBasic.c: from the default public declaration of the * generic/tclResult.c: Tcl_Interp struct. Code should no longer * generic/tclStubLib.c: be accessing these fields. Access can be * generic/tclTest.c: restored by defining USE_INTERP_RESULT, but * generic/tclUtil.c: that should only be a temporary migration aid. *** POTENTIAL INCOMPATIBILITY ***
* * generic/tclUtil.c (TclReToGlob): Added missing set of thedgp2008-08-221-9/+15
| | | | | *exactPtr value to really fix [Bug 2065115]. Also avoid possible DString overflow.
* * generic/tclUtil.c (TclReToGlob): Added missing set of thedgp2008-08-221-1/+4
| | | | | *exactPtr value to really fix [Bug 2065115]. * tests/regexpComp.test: Correct duplicate test names.
* really fix translation to escape glob-sensitive charshobbs2008-08-211-13/+24
|
* * tests/regexp.test, tests/regexpComp.test: correct re2glob ***=hobbs2008-08-211-4/+3
| | | | | * generic/tclUtil.c (TclReToGlob): translation from exact to anywhere-in-string match. [Bug 2065115]
* * generic/tclTest.c (TestconcatobjCmd):Miguel Sofer2008-08-171-6/+2
| | | | | | | | | | * generic/tclUtil.c (Tcl_ConcatObj): * tests/util.test (util-4.7): fix [Bug 1447328]; the original "fix" turned Tcl_ConcatObj() into a hairy monster. This was exposed by [Bug 2055782]. Additionally, Tcl_ConcatObj could corrupt its input under certain conditions! *** NASTY BUG FIXED ***
* Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-53/+54
|
* * generic/tclUtil.c (TclReToGlob): fix the handling of the lasthobbs2008-02-261-4/+13
| | | | | * tests/regexpComp.test: star possibly being escaped in determining right anchor. [Bug 1902436]
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* * generic/tclUtil.c (TclReToGlob): reduce escapes in conversionhobbs2007-12-111-6/+8
| | | | when not necessary
* * generic/tclInt.decls: move TclByteArrayMatch and TclReToGlobhobbs2007-12-111-3/+58
| | | | | | | | | | | | | * generic/tclIntDecls.h: to tclInt.h from stubs. * generic/tclStubInit.c: Add flags var to TclByteArrayMatch for * generic/tclInt.h: future extensibility * generic/tcl.h: define TCL_MATCH_EXACT doc for Tcl_StringCaseMatch. * doc/StrMatch.3: It is compatible with existing usage. * generic/tclExecute.c (INST_STR_MATCH): flag for TclByteArrayMatch * generic/tclUtil.c (TclByteArrayMatch, TclStringMatchObj): * generic/tclRegexp.c (Tcl_RegExpExecObj): * generic/tclCmdMZ.c (StringMatchCmd): Use TclStringMatchObj * tests/string.test (11.9.* 11.10.*): more tests
* More minor cleanupdkf2007-11-181-162/+168
|
* (TclReToGlob): remove out-dated Tcl_RegExpCompile check as it causes recursionhobbs2007-11-131-15/+1
|
* RE: [Patch 1830184] TclResetResultMiguel Sofer2007-11-121-2/+1
| | | | | | THIS PATCH WAS REVERTED: initial (mis)measurements overstated the perfomance wins, which turn out to be tiny. Not worth the complication.
* * generic/tclUtil.c (TclReToGlob): add more comments, set interphobbs2007-11-121-3/+12
| | | | result if specified on error.
* * generic/tclBasic.c: New macro TclResetResult, new iPtr flagMiguel Sofer2007-11-121-1/+2
| | | | | | | | | * generic/tclExecute.c: bit INTERP_RESULT_UNCLEAN: shortcut for * generic/tclInt.h: Tcl_ResetResult for the "normal" case: * generic/tclProc.c: TCL_OK, no return options, no errorCode * generic/tclResult.c: nor errorInfo, return at normal level. * generic/tclStubLib.c: [Patch 1830184] * generic/tclUtil.c:
* * generic/tclCompCmds.c, generic/tclCompile.c, generic/tclCompile.h:hobbs2007-11-121-1/+185
| | | | | | | | | * generic/tclExecute.c, generic/tclInt.decls, generic/tclIntDecls.h: * generic/tclRegexp.c, generic/tclRegexp.h: Add INST_REGEXP and fully * generic/tclStubInit.c, generic/tclUtil.c: compiled [regexp] for the * tests/regexpComp.test: [Bug 1830166] simple cases. Also added TclReToGlob function to convert RE to glob patterns and use these in the possible cases.
* [Patch 1830038]: Increased usage of macros to detect and take advantage of ↵Miguel Sofer2007-11-111-9/+9
| | | | objTypes.
* * generic/tclInt.decls, generic/tclIntDecls.h: Use unsigned char forhobbs2007-11-091-34/+19
| | | | | | * generic/tclExecute.c, generic/tclUtil.c: TclByteArrayMatch and don't allow a nocase option. [Bug 1828296] For INST_STR_MATCH, ignore pattern type for TclByteArrayMatch case.
* * generic/tclStubInit.c:hobbs2007-11-081-1/+190
| | | | | | | * generic/tclInt.decls, generic/tclIntDecls.h: added TclByteArrayMatch * generic/tclUtil.c (TclByteArrayMatch): for efficient glob * generic/tclExecute.c (TclExecuteByteCode): matching of ByteArray Tcl_Objs, used in INST_STR_MATCH. [Bug 1827996]
* * generic/tclUtil.c (Tcl_ConcatObj): optimise for some of theMiguel Sofer2007-10-281-13/+38
| | | | concatenees being empty objs [Bug 1447328]
* * generic/tclIOCmd.c: Revise [open] so that it interprets leadingdgp2007-10-151-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | zero strings passed as the "permissions" argument as octal numbers, even if Tcl itself no longer parses integers in that way. * unix/tclUnixFCmd.c: Revise the "-permissions" [file attribute] so that it interprets leading zero strings as octal numbers, even if Tcl itself no longer parses integers in that way. * generic/tclCompExpr.c: Corrections to code that produces * generic/tclUtil.c: extended "bad octal" error messages. * tests/cmdAH.test: Test revisions so that tests pass whether or * tests/cmdIL.test: not Tcl parses leading zero strings as octal. * tests/compExpr-old.test: * tests/compExpr.test: * tests/compile.test: * tests/expr-old.test: * tests/expr.test: * tests/incr.test: * tests/io.test: * tests/lindex.test: * tests/link.test: * tests/mathop.test: * tests/parseExpr.test: * tests/set.test: * tests/string.test: * tests/stringComp.test:
* [Tcl Bug 1706140]dgp2007-05-071-2/+2
| | | | | | | | | | | | | | | | | * generic/tclLink.c (LinkTraceProc): Update Tcl_VarTraceProcs so that * generic/tclNamesp.c (Error*Read): they call Tcl_InterpDeleted() * generic/tclTrace.c (Trace*Proc): for themselves, and do not rely * generic/tclUtil.c (TclPrecTraceProc): on (frequently buggy) setting of the TCL_INTERP_DESTROYED flag by the trace core. * generic/tclVar.c: Update callers of TclCallVarTraces to not pass in the TCL_INTERP_DESTROYED flag. Also apply filters so that public routines only pass documented flag values down to lower level routines. * generic/tclTrace.c (TclCallVarTraces): The setting of the TCL_INTERP_DESTROYED flag is now done entirely within the TclCallVarTraces routine, the only place it can be done right.
* * generic/tclExecute.c: More ckalloc -> ckrealloc conversions.dgp2007-03-211-10/+4
| | | | | | | | | * generic/tclLiteral.c: * generic/tclNamesp.c: * generic/tclParse.c: * generic/tclPreserve.c: * generic/tclStringObj.c: * generic/tclUtil.c:
* Code style improvementsdkf2007-01-181-8/+10
|
* Fix minor fault (made by aku, caught by aku)dkf2007-01-181-2/+2
|