From 1043eb857885d1336664ba0b80cb8fce03a3d90c Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 7 Apr 2003 12:27:21 +0000 Subject: Make sure that tclWideIntType is defined and somewhat sensible everywhere. [Bug 713562] --- ChangeLog | 6 ++++++ generic/tclObj.c | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 607a653..86ab1da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-04-07 Donal K. Fellows + + * generic/tclObj.c (tclWideIntType, TclInitObjSubsystem): + (SetBooleanFromAny): Make sure that tclWideIntType is defined and + somewhat sensible everywhere. [Bug 713562] + 2003-04-02 Mo DeJong * win/configure: Regen. diff --git a/generic/tclObj.c b/generic/tclObj.c index f9cee12..6320060 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.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: tclObj.c,v 1.42 2003/01/17 22:11:02 mdejong Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.42.2.1 2003/04/07 12:27:30 dkf Exp $ */ #include "tclInt.h" @@ -126,15 +126,18 @@ Tcl_ObjType tclIntType = { SetIntFromAny /* setFromAnyProc */ }; -#ifndef TCL_WIDE_INT_IS_LONG Tcl_ObjType tclWideIntType = { "wideInt", /* name */ (Tcl_FreeInternalRepProc *) NULL, /* freeIntRepProc */ (Tcl_DupInternalRepProc *) NULL, /* dupIntRepProc */ +#ifdef TCL_WIDE_INT_IS_LONG + UpdateStringOfInt, /* updateStringProc */ + SetIntFromAny /* setFromAnyProc */ +#else /* !TCL_WIDE_INT_IS_LONG */ UpdateStringOfWideInt, /* updateStringProc */ SetWideIntFromAny /* setFromAnyProc */ -}; #endif +}; /* * The structure below defines the Tcl obj hash key type. @@ -233,9 +236,7 @@ TclInitObjSubsystem() Tcl_RegisterObjType(&tclDoubleType); Tcl_RegisterObjType(&tclEndOffsetType); Tcl_RegisterObjType(&tclIntType); -#ifndef TCL_WIDE_INT_IS_LONG Tcl_RegisterObjType(&tclWideIntType); -#endif Tcl_RegisterObjType(&tclStringType); Tcl_RegisterObjType(&tclListType); Tcl_RegisterObjType(&tclByteCodeType); @@ -1107,8 +1108,10 @@ SetBooleanFromAny(interp, objPtr) newBool = (objPtr->internalRep.longValue != 0); } else if (objPtr->typePtr == &tclDoubleType) { newBool = (objPtr->internalRep.doubleValue != 0.0); -#ifndef TCL_WIDE_INT_IS_LONG } else if (objPtr->typePtr == &tclWideIntType) { +#ifdef TCL_WIDE_INT_IS_LONG + newBool = (objPtr->internalRep.longValue != 0); +#else /* !TCL_WIDE_INT_IS_LONG */ newBool = (objPtr->internalRep.wideValue != Tcl_LongAsWide(0)); #endif /* TCL_WIDE_INT_IS_LONG */ } else { -- cgit v0.12