diff options
author | dgp <dgp@users.sourceforge.net> | 2003-04-16 23:33:43 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2003-04-16 23:33:43 (GMT) |
commit | 221d64cae9a7781a4b3dd2a2e2e273fd6196c09e (patch) | |
tree | 4156c4da5bb0e708ca942f78b5c01ec34686f8bb /generic/tclVar.c | |
parent | caa2e40c5ef3e6d45edebe3e156b25903fb30eba (diff) | |
download | tcl-221d64cae9a7781a4b3dd2a2e2e273fd6196c09e.zip tcl-221d64cae9a7781a4b3dd2a2e2e273fd6196c09e.tar.gz tcl-221d64cae9a7781a4b3dd2a2e2e273fd6196c09e.tar.bz2 |
* generic/tcl.h Made changes so that the "wideInt" Tcl_ObjType
* 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:
Diffstat (limited to 'generic/tclVar.c')
-rw-r--r-- | generic/tclVar.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/generic/tclVar.c b/generic/tclVar.c index 65dad51..2d36e3a 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.70 2003/03/24 00:49:00 msofer Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.71 2003/04/16 23:33:44 dgp Exp $ */ #include "tclInt.h" @@ -1839,17 +1839,9 @@ TclPtrIncrVar(interp, varPtr, arrayPtr, part1, part2, incrAmount, flags) varValuePtr = Tcl_DuplicateObj(varValuePtr); createdNewObj = 1; } -#ifdef TCL_WIDE_INT_IS_LONG - if (Tcl_GetLongFromObj(interp, varValuePtr, &i) != TCL_OK) { - if (createdNewObj) { - Tcl_DecrRefCount(varValuePtr); /* free unneeded copy */ - } - return NULL; - } - Tcl_SetLongObj(varValuePtr, (i + incrAmount)); -#else if (varValuePtr->typePtr == &tclWideIntType) { - Tcl_WideInt wide = varValuePtr->internalRep.wideValue; + Tcl_WideInt wide; + TclGetWide(wide,varValuePtr); Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount)); } else if (varValuePtr->typePtr == &tclIntType) { i = varValuePtr->internalRep.longValue; @@ -1872,7 +1864,6 @@ TclPtrIncrVar(interp, varPtr, arrayPtr, part1, part2, incrAmount, flags) Tcl_SetWideIntObj(varValuePtr, wide + Tcl_LongAsWide(incrAmount)); } } -#endif /* * Store the variable's new value and run any write traces. |