summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2003-04-07 10:11:54 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2003-04-07 10:11:54 (GMT)
commitd0a21c54ad4d13296bcc9f3294c4ebb63327734a (patch)
treee6b32f05316cada8391cc6f99afcce0742888c2d /generic/tclObj.c
parenteffa89fcecf29f38482d867654036429013977f6 (diff)
downloadtcl-d0a21c54ad4d13296bcc9f3294c4ebb63327734a.zip
tcl-d0a21c54ad4d13296bcc9f3294c4ebb63327734a.tar.gz
tcl-d0a21c54ad4d13296bcc9f3294c4ebb63327734a.tar.bz2
Fixed bugs 715751 and 713562 so dict code should build everywhere and wide ints
be defined (though not necessarily useful) everywhere.
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 1a9307e..a5e34e6 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.43 2003/04/05 01:41:23 dkf Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.44 2003/04/07 10:12:10 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 /* TCL_WIDE_INT_IS_LONG */
};
-#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(&tclDictType);
@@ -1108,8 +1109,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 {