summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2003-04-07 12:27:20 (GMT)
committerdkf <dkf@noemail.net>2003-04-07 12:27:20 (GMT)
commit755e721a94f0a5f5bf866a0b01c3f47dd307c9f0 (patch)
tree0e61e053df1ec51dacbe03937e69076a4eb4aef2 /generic/tclObj.c
parentb8afc4c910ce87526b8cf3387136d0cdef278984 (diff)
downloadtcl-755e721a94f0a5f5bf866a0b01c3f47dd307c9f0.zip
tcl-755e721a94f0a5f5bf866a0b01c3f47dd307c9f0.tar.gz
tcl-755e721a94f0a5f5bf866a0b01c3f47dd307c9f0.tar.bz2
Make sure that tclWideIntType is defined and somewhat sensible everywhere. [Bug 713562]
FossilOrigin-Name: be174d7910f3db5c05a4b1a86d8ad31ee35ddfb3
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c15
1 files changed, 9 insertions, 6 deletions
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 {