diff options
author | dgp <dgp@noemail.net> | 2003-04-16 23:31:33 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2003-04-16 23:31:33 (GMT) |
commit | 21b342be9b57db2c1700a6aba0222b82772ea0bf (patch) | |
tree | 467609e01abca9216802d76c8cfaa88a2d166c0c /generic/tclUtil.c | |
parent | ca5061330484362dc803f737669f1203f31f0141 (diff) | |
download | tcl-21b342be9b57db2c1700a6aba0222b82772ea0bf.zip tcl-21b342be9b57db2c1700a6aba0222b82772ea0bf.tar.gz tcl-21b342be9b57db2c1700a6aba0222b82772ea0bf.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:
FossilOrigin-Name: 4657eb7ea0eed71ec0569f92079583a33c22ba62
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r-- | generic/tclUtil.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c index a4d783b..2572891 100644 --- a/generic/tclUtil.c +++ b/generic/tclUtil.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUtil.c,v 1.36 2002/11/19 02:34:50 hobbs Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.36.2.1 2003/04/16 23:31:46 dgp Exp $ */ #include "tclInt.h" @@ -2220,9 +2220,7 @@ TclGetIntForIndex(interp, objPtr, endValue, indexPtr) { char *bytes; int offset; -#ifndef TCL_WIDE_INT_IS_LONG Tcl_WideInt wideOffset; -#endif /* * If the object is already an integer, use it. @@ -2237,16 +2235,14 @@ TclGetIntForIndex(interp, objPtr, endValue, indexPtr) * If the object is already a wide-int, and it is not out of range * for an integer, use it. [Bug #526717] */ -#ifndef TCL_WIDE_INT_IS_LONG if (objPtr->typePtr == &tclWideIntType) { - Tcl_WideInt wideOffset = objPtr->internalRep.wideValue; + TclGetWide(wideOffset,objPtr); if (wideOffset >= Tcl_LongAsWide(INT_MIN) && wideOffset <= Tcl_LongAsWide(INT_MAX)) { *indexPtr = (int) Tcl_WideAsLong(wideOffset); return TCL_OK; } } -#endif /* TCL_WIDE_INT_IS_LONG */ if (SetEndOffsetFromAny(NULL, objPtr) == TCL_OK) { /* @@ -2256,15 +2252,6 @@ TclGetIntForIndex(interp, objPtr, endValue, indexPtr) *indexPtr = endValue + objPtr->internalRep.longValue; -#ifdef TCL_WIDE_INT_IS_LONG - } else if (Tcl_GetIntFromObj(NULL, objPtr, &offset) == TCL_OK) { - /* - * If the object can be converted to an integer, use that. - */ - - *indexPtr = offset; - -#else /* !TCL_WIDE_INT_IS_LONG */ } else if (Tcl_GetWideIntFromObj(NULL, objPtr, &wideOffset) == TCL_OK) { /* * If the object can be converted to a wide integer, use @@ -2283,7 +2270,6 @@ TclGetIntForIndex(interp, objPtr, endValue, indexPtr) } *indexPtr = offset; -#endif /* TCL_WIDE_INT_IS_LONG */ } else { /* * Report a parse error. |