summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
Commit message (Collapse)AuthorAgeFilesLines
...
* * generic/tclObj.c: Simplified routines that manage the typeTable.dgp2005-08-041-36/+23
|
* * generic/tclCompExpr.c: Untangled some dependencies in thedgp2005-08-031-11/+12
| | | | | | * generic/tclEvent.c: order of finalization routines. * generic/tclInt.h: [Bug 1251399] * generic/tclObj.c:
* Getting more systematic about styledkf2005-07-171-679/+701
|
* * generic/tclObj.c: Restored registration of the "procbody"dgp2005-06-071-1/+2
| | | | Tcl_ObjType, as required by the tclcompiler application.
* Correct crash in stack.test on gcc/win32; fix compile errors in tclObj.c on ↵Kevin B Kenny2005-06-061-8/+8
| | | | hpux/native cc
* * generic/tclInt.h: Revision to the "boolean" Tcl_ObjType, sodgp2005-05-181-15/+50
| | | | | | | | | | | | * generic/tclObj.c: that only string values like "yes" and "false" * tests/obj.test: are kept as the "boolean" Tcl_ObjType. The string values "0" and "1" are kept as "int" Tcl_ObjType, which also produce quick calls to Tcl_GetBooleanFromObj(). Since this internal change means a Tcl_ConvertToType to a "boolean" Tcl_ObjType might not produce a Tcl_Obj of type "boolean", the registration of the "boolean" type is also removed. ***POTENTIAL INCOMPATIBILITY*** For callers of Tcl_GetObjType on the type name "boolean".
* * generic/tclObj.c (TclInitObjSubsystem): Removed thedgp2005-05-171-7/+1
| | | | | | | | | | | * tests/listObj.test: registration of the Tcl_ObjType's "list", * tests/obj.test: "procbody", "index", "ensembleCommand", "localVarName", and "levelReference". The only reason to register a Tcl_ObjType is to have it returned by Tcl_GetObjType, and the only reason for that is to retrieve a (Tcl_ObjType *) to pass to Tcl_ConvertToType(). None of the types above can support a Tcl_ConvertToType() call; they panic. Better not to offer something than to lead users into a panic.
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-13/+455
|
* silence compiler warningsdgp2005-04-251-2/+2
|
* The 2005-04-21 changes to Tcl_GetBooleanFromObj were done to bringdgp2005-04-221-47/+15
| | | | | | | | | | | | | | | | | | | | | | | | | it into agreement with its docs. Further investigation reveals it was the docs that were incorrect. * doc/BoolObj.3: Corrections to the documentation of Tcl_GetBooleanFromObj to bring it into agreement with what this public interface has always done, including noting the difference in function between Tcl_GetBooleanFromObj and Tcl_GetBoolean. * generic/tclGet.c: Revised Tcl_GetBoolean to no longer be a wrapper around Tcl_GetBooleanFromObj (different function!). * generic/tclObj.c: Removed TclGetTruthValueFromObj routine that was added yesterday. Revisions so that only Tcl_GetBoolean-approved values get the "boolean" Tcl_ObjType. This retains the fix for [Bug 1187123]. * generic/tclInt.h: Revert most recent change. * generic/tclBasic.c: * generic/tclCompCmds.c: * generic/tclDictObj.c: * generic/tclExecute.c: * tests/obj.test:
* stifle compiler warningdgp2005-04-211-9/+11
|
* * generic/tclGet.c: Radical code simplification. Converteddgp2005-04-211-147/+142
| | | | | | | | | | | | | | | | | | Tcl_GetFoo() routines into wrappers around Tcl_GetFooFromObj(). Reduces code duplication, and the resulting potential for inconsistency. * generic/tclObj.c: Several changes: - Fixed Tcl_GetBooleanFromObj to agree with its documentation and with Tcl_GetBoolean, accepting only "0" and "1" and not other numeric strings. [Bug 1187123] - Added new private routine TclGetTruthValueFromObj to perform the more permissive conversion of numeric values to boolean that is needed by the [expr] machinery. * generic/tclInt.h (TclGetTruthValueFromObj): New routine. * generic/tclExecute.c: Updated callers to call new routine. * tests/obj.test: Corrected bad tests that actually expected values like "47" and "0xac" to be accepted as booleans.
* Tcl_GetDoubleFromObj now avoids shimmering away a "wideInt" intrep.dgp2005-04-211-1/+4
|
* * generic/tclObj.c: Re-ordered error detection code so all valuesdgp2005-04-211-54/+39
| | | | | | | | | with trailing garbage receive a "not an integer" message instead of an "integer too large" message. Removed inactive code meant to deal with strtoul* routines that fail to parse leading signs. All of them do, and if any are detected that do not, the correct fix is replacement with compat/strtoul*.c, not a lot of special care by the callers.
* * generic/tclGet.c (Tcl_GetInt): Corrected error that did notdgp2005-04-201-36/+16
| | | | | * generic/tclObj.c (Tcl_GetIntFromObj): permit 0x80000000 to be recognized as an integer on TCL_WIDE_INT_IS_LONG systems [Bug 1090869].
* * generic/tclInt.h:Miguel Sofer2005-04-051-32/+130
| | | | | * generic/tclObj.c: Change in TclDecrRefCount and TclFreeObj, to speed up the freeing of simple Tcl_Obj [Patch 1174551]
* * generic/tclExecute.c:Miguel Sofer2005-04-011-52/+13
| | | | | | | | | * 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)'
* * generic/tclObj.c (TclSetCmdNameObj): special handling for fully qualifiedMiguel Sofer2004-12-121-1/+19
| | | | command names (as in fix [Patch 456668]).
* * generic/tclBasic.c:dgp2004-10-061-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclBinary.c: * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCmdMZ.c: * generic/tclCompExpr.c: * generic/tclDictObj.c: * generic/tclEncoding.c: * generic/tclExecute.c: * generic/tclFCmd.c: * generic/tclHistory.c: * generic/tclIndexObj.c: * generic/tclInterp.c: * generic/tclIO.c: * generic/tclIOCmd.c: * generic/tclNamesp.c: * generic/tclObj.c: * generic/tclPkg.c: * generic/tclResult.c: * generic/tclScan.c: * generic/tclTimer.c: * generic/tclTrace.c: * generic/tclUtil.c: * generic/tclVar.c: It is a poor practice to directly set or append to the value of the objResult of an interp, because that value might be shared, and in that circumstance a Tcl_Panic() will be the result. Searched for example of this practice and replaced with safer alternatives, often using the Tcl_AppendResult() routine that dkf just rehabilitated.
* Speed up [upvar] and [uplevel] by not forcing level references to be parseddkf2004-10-011-1/+2
| | | | as strings every time through. [Patch 1037357]
* Typodkf2004-09-291-2/+2
|
* Factorize out the code for freeing an object's internal rep.dkf2004-09-291-66/+18
|
* Whitespace/formatting policingdkf2004-09-271-133/+122
|
* removed some workarounds for Bug 868489Kevin B Kenny2004-09-271-6/+2
|
* * generic/tclClock.c (TclMktimeObjCmd): Corrected a bad checkKevin B Kenny2004-09-111-2/+2
| | | | | | | | | for error return from 'mktime'. * generic/tclObj.c (Tcl_GetIntFromObj): Corrected a problem where demoting a wide to an int failed on a big-endian machine. [Bug 1026125]. * tests/clock.test (clock-43.1): Added regression test for error return from 'mktime'.
* Minor mods to latest commit to correct bugs and compiler warnings ondgp2004-09-101-8/+11
| | | | TCL_WIDE_INT_IS_LONG platforms.
* One less crazy long/wide aunt in the attic [Bug 868489]dkf2004-09-101-25/+155
|
* Add missing objTypes to catalogdkf2004-07-071-1/+3
|
* Fixed [Bug 886231] properly this time rather than with a broken version thatdkf2004-06-181-2/+2
| | | | breaks the core completely. :^}
* Fix tclWinInit.c for KBK, adding comments as I go. :^)dkf2004-06-181-11/+68
|
* * generic/tclObj.c: Added missing space in panic message.dgp2004-06-171-2/+2
|
* * generic/tclInt.h:Miguel Sofer2004-05-061-19/+11
| | | | | | | | | * generic/tclObj.c (TclFreeObj): made TclFreeObj use the new macro TclFreeObjMacro(), so that the allocation and freeing of Tcl_Obj is defined in a single spot (the macros in tclInt.h), with the exception of the TCL_MEM_DEBUG case. The #ifdef logic for the corresponding macros has been reformulated to make it clearer.
* Corrected "short circuit" conversion of int to double. Reported by Kevin B Kenny2004-04-191-1/+2
| | | | Jeff Hobbs on the Tcl'ers Chat.
* Patch 922727 committed. Implements three changes:dgp2004-04-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed):
* Fixed object hashing bozo-ness. The code as it stood looked like adkf2004-03-301-22/+12
| | | | | cargo-cult hangover from the hashing code in tclHash.c, but this looks almost identical to that used for literals (which is fast.)
* Made HEAD build on Windows VC++ again.Kevin B Kenny2004-03-191-1/+3
|
* Speed improvements to SetBooleanFromAny's string handlingdkf2004-01-281-153/+204
| | | | whitespace/style policing
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-19/+19
| | | | | | | 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-38/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* * win/makefile.vc: Applied patches for bug #801467 by Joe Mistachkinpatthoyts2003-10-091-1/+2
| | | | | * win/tclAppInit.c: to fix incompatible TCL_MEM_DEBUG handling in * generic/tclObj.c: Win32 VC builds.
* TIP#112 ([namespace ensemble] command) implementation.dkf2003-09-291-1/+2
|
* * generic/tcl.h: Revert change made on 2003-07-21mdejong2003-07-241-14/+109
| | | | | | | | | | | | | | | since it made the sizeof(Tcl_Obj) different for regular vs mem debug builds. * generic/tclInt.h: Define TclDecrRefCount in terms of Tcl_DbDecrRefCount which removes one layer of inderection. * generic/tclObj.c (TclDbInitNewObj, Tcl_DbIncrRefCount, Tcl_DbDecrRefCount, Tcl_DbIsShared): Define ThreadSpecificData that contains a hashtable. The table is used to ensure that a Tcl_Obj is only acted upon in the thread that allocated it. This checking code is enabled only when mem debug and threads are enabled.
* Check that the thread incrementing or decrementingmdejong2003-07-221-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the ref count of a Tcl_Obj is the thread that originally allocated the thread. This fail fast behavior will catch programming errors that allow a single Tcl_Obj to be accessed from multiple threads. * generic/tcl.h (Tcl_Obj): Add allocThread member to Tcl_Obj. This member records the thread id the Tcl_Obj was allocated. It is used to check that any future ref count incr or decr is done from the same thread that allocated the Tcl_Obj. This member is defined only when threads and mem debug are enabled. * generic/tclInt.h (TclNewObj, TclDbNewObj, TclDecrRefCount): Define TclNewObj and TclDbNewObj using TclDbInitNewObj when mem debug is enabled. This fixes a problem where TclNewObj calls did not work the same as TclDbNewObj when mem debug was enabled. * generic/tclObj.c (TclDbInitNewObj, Tcl_DbIncrRefCount, Tcl_DbDecrRefCount): Add new helper to init Tcl_Obj members when mem debug is enabled. Init the allocThread member in TclDbInitNewObj and check it in Tcl_DbIncrRefCount and Tcl_DbDecrRefCount to make sure a Tcl_Obj allocated in one thread is not being acted upon in another thread.
* * generic/tclObj.c (tclCmdNameType): Converted internal repdgp2003-05-231-8/+18
| | | | | | | | management of the cmdName Tcl_ObjType the opposite way, to always use the twoPtrValue instead of always using the otherValuePtr. Previous fix on 2003-05-12 broke several extensions that wanted to poke around with the twoPtrValue.ptr2 value of a cmdName Tcl_Obj, like TclBlend and e4graph. [Bug 726018]
* * generic/tclObj.c (tclCmdNameType): Corrected variable use of thedgp2003-05-121-7/+4
| | | | | otherValuePtr or the twoPtrValue.ptr1 fields to store a (ResolvedCmdName *) as the internal rep. [Bug 726018].
* * generic/tcl.h Made changes so that the "wideInt" Tcl_ObjTypedgp2003-04-161-25/+9
| | | | | | | | | | | | | | | | | | | | | | * generic/tclObj.c is defined on all platforms, even those where * generic/tclPort.h TCL_WIDE_INT_IS_LONG is defined. Also made the Tcl_Value struct have a wideValue field on all platforms. This is a ***POTENTIAL INCOMPATIBILITY*** for TCL_WIDE_INT_IS_LONG platforms because that struct changes size. This is the same TIP 72 incompatibility that was seen on other platforms at the 8.4.0 release, when this change should have happened as well. [Bug 713562] * generic/tclInt.h: New internal macros TclGetWide() and TclGetLongFromWide() to deal with both forms of the "wideInt" Tcl_ObjType, so that conditional TCL_WIDE_INT_IS_LONG code is confined to the header file. * generic/tclCmdAH.c: Replaced most coding that was conditional * generic/tclCmdIL.c: on TCL_WIDE_INT_IS_LONG with code that * generic/tclExecute.c: works across platforms, sometimes using * generic/tclTest.c: the new macros above to do it. * generic/tclUtil.c: * generic/tclVar.c:
* Fixed bugs 715751 and 713562 so dict code should build everywhere and wide intsdkf2003-04-071-6/+9
| | | | be defined (though not necessarily useful) everywhere.
* Final stage of getting dictionaries into the core. Test suite should work now!dkf2003-04-051-1/+2
|
* * generic/tcl.h: Revert earlier change thatmdejong2003-01-171-1/+7
| | | | | | | | | | | | defined TCL_WIDE_INT_TYPE as long long and TCL_LL_MODIFIER as L when compiling with mingw. This change ended up causing some test case failures when compiling with mingw. * generic/tclObj.c (UpdateStringOfWideInt): Describe the warning generated by mingw and why it needs to be ignored so that someone is not tempted to "fix" this problem again in the future.
* * generic/tclUtil.c (SetEndOffsetFromAny): handle integer offsethobbs2002-11-191-10/+14
| | | | | | | | | | after the "end-" prefix. * generic/get.test: * generic/string.test: * generic/tclObj.c (SetIntFromAny, SetWideIntFromAny): * generic/tclGet.c (TclGetLong, Tcl_GetInt): simplify sign handling before calling strtoul(l). [Bug #634856]