diff options
author | dgp <dgp@users.sourceforge.net> | 2006-06-21 03:10:38 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-06-21 03:10:38 (GMT) |
commit | 91cc250daf9aa5acf716c0ca9bf549d6425721ad (patch) | |
tree | 30cb949d48ee47880f9006db35d4132ddddcdcfa /generic/tclObj.c | |
parent | 641e35486f4483506ffcdba37e016ce03ddc3f9a (diff) | |
download | tcl-91cc250daf9aa5acf716c0ca9bf549d6425721ad.zip tcl-91cc250daf9aa5acf716c0ca9bf549d6425721ad.tar.gz tcl-91cc250daf9aa5acf716c0ca9bf549d6425721ad.tar.bz2 |
* generic/tclIOUtil.c: Changed default configuration to
* generic/tclInt.decls: #undef USE_OBSOLETE_FS_HOOKS which disables
* generic/tclTest.c: access to the Tcl 8.3 internal routines for
hooking into filesystem operations. Everyone ought to have migrated
to Tcl_Filesystems by now.
***POTENTIAL INCOMPATIBILITY*** for any code still stuck in the
pre-Tcl_Filesystem era.
* generic/tclIntDecls.h: make genstubs
* generic/tclStubInit.c:
* generic/tclStrToD.c: Removed dead code that permitted disabling
of recognition of the new 0b and 0o numeric formats.
* generic/tclExecute.c: Removed dead code that implemented alternative
* generic/tclObj.c: design where numeric values did not
automatically narrow to the smallest Tcl_ObjType required to hold
them.
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r-- | generic/tclObj.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c index dca6e8d..7d89f98 100644 --- a/generic/tclObj.c +++ b/generic/tclObj.c @@ -12,7 +12,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.107 2006/03/29 15:09:04 dgp Exp $ + * RCS: @(#) $Id: tclObj.c,v 1.108 2006/06/21 03:10:39 dgp Exp $ */ #include "tclInt.h" @@ -20,8 +20,6 @@ #include "tommath.h" #include <float.h> -#define BIGNUM_AUTO_NARROW 1 - /* * Table of all object types. */ @@ -1300,11 +1298,7 @@ Tcl_GetBooleanFromObj( return TCL_OK; } if (objPtr->typePtr == &tclBignumType) { -#ifdef BIGNUM_AUTO_NARROW *boolPtr = 1; -#else - *boolPtr = ((objPtr->internalRep.ptrAndLongRep.value & 0x7fff)!=0); -#endif return TCL_OK; } #ifndef NO_WIDE_TYPE @@ -1358,22 +1352,14 @@ SetBooleanFromAny( goto badBoolean; } -#ifdef BIGNUM_AUTO_NARROW if (objPtr->typePtr == &tclBignumType) { goto badBoolean; } -#else - /* - * TODO: Consider tests to discover values 0 and 1 while preserving - * pure bignum. For now, pass through string rep. - */ -#endif #ifndef NO_WIDE_TYPE - /* - * TODO: Consider tests to discover values 0 and 1 while preserving - * pure wide. For now, pass through string rep. - */ + if (objPtr->typePtr == &tclWideIntType) { + goto badBoolean; + } #endif if (objPtr->typePtr == &tclDoubleType) { @@ -2607,11 +2593,7 @@ UpdateStringOfBignum( if (status != MP_OKAY) { Tcl_Panic("radix size failure in UpdateStringOfBignum"); } - if (size == 3 -#ifndef BIGNUM_AUTO_NARROW - && bignumVal.used > 1 -#endif - ) { + if (size == 3) { /* * mp_radix_size() returns 3 when more than INT_MAX bytes would be * needed to hold the string rep (because mp_radix_size ignores @@ -2889,7 +2871,6 @@ Tcl_SetBignumObj( if (Tcl_IsShared(objPtr)) { Tcl_Panic("Tcl_SetBignumObj called with shared object"); } -#ifdef BIGNUM_AUTO_NARROW if (bignumValue->used <= (CHAR_BIT * sizeof(long) + DIGIT_BIT - 1) / DIGIT_BIT) { unsigned long value = 0, numBytes = sizeof(long); @@ -2939,7 +2920,6 @@ Tcl_SetBignumObj( } tooLargeForWide: #endif -#endif TclInvalidateStringRep(objPtr); TclFreeIntRep(objPtr); TclSetBignumIntRep(objPtr, bignumValue); |