diff options
author | dgp <dgp@users.sourceforge.net> | 2008-03-13 17:14:18 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-03-13 17:14:18 (GMT) |
commit | f3a4d1009e8743428b1f3fab2037a0a42b3c8ace (patch) | |
tree | 2b18a0335925ce0d0b70b34a7537fabfa8e9fbdf | |
parent | 95763ee86a3d5527c812166ac2bc3815011c9a6f (diff) | |
download | tcl-f3a4d1009e8743428b1f3fab2037a0a42b3c8ace.zip tcl-f3a4d1009e8743428b1f3fab2037a0a42b3c8ace.tar.gz tcl-f3a4d1009e8743428b1f3fab2037a0a42b3c8ace.tar.bz2 |
* generic/tclStrToD.c: Resolve identifier conflict over "pow10"
with libm in Cygwin and DJGPP. Thanks to Gordon Schumacher and
Philip Moore. [Patch 1800636]
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | generic/tclStrToD.c | 18 |
2 files changed, 13 insertions, 9 deletions
@@ -2,6 +2,10 @@ * changes: Updated for 8.5.2 release. + * generic/tclStrToD.c: Resolve identifier conflict over "pow10" + with libm in Cygwin and DJGPP. Thanks to Gordon Schumacher and + Philip Moore. [Patch 1800636] + 2008-03-12 Daniel Steffen <das@users.sourceforge.net> * macosx/Tcl.xcodeproj/project.pbxproj: add support for Xcode 3.1 diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 8e4cead..e5e863b 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStrToD.c,v 1.32 2007/12/13 15:23:20 dgp Exp $ + * RCS: @(#) $Id: tclStrToD.c,v 1.33 2008/03/13 17:14:19 dgp Exp $ * *---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ static int maxpow10_wide; /* The powers of ten that can be represented * exactly as wide integers. */ static Tcl_WideUInt *pow10_wide; #define MAXPOW 22 -static double pow10[MAXPOW+1]; /* The powers of ten that can be represented +static double pow10vals[MAXPOW+1]; /* The powers of ten that can be represented * exactly as IEEE754 doubles. */ static int mmaxpow; /* Largest power of ten that can be * represented exactly in a 'double'. */ @@ -1323,7 +1323,7 @@ MakeLowPrecisionDouble( * without special handling. */ - retval = (double)(Tcl_WideInt)significand * pow10[ exponent ]; + retval = (double)(Tcl_WideInt)significand * pow10vals[ exponent ]; goto returnValue; } else { int diff = DBL_DIG - numSigDigs; @@ -1336,8 +1336,8 @@ MakeLowPrecisionDouble( */ volatile double factor = - (double)(Tcl_WideInt)significand * pow10[diff]; - retval = factor * pow10[exponent-diff]; + (double)(Tcl_WideInt)significand * pow10vals[diff]; + retval = factor * pow10vals[exponent-diff]; goto returnValue; } } @@ -1349,7 +1349,7 @@ MakeLowPrecisionDouble( * only one rounding. */ - retval = (double)(Tcl_WideInt)significand / pow10[-exponent]; + retval = (double)(Tcl_WideInt)significand / pow10vals[-exponent]; goto returnValue; } } @@ -2178,7 +2178,7 @@ TclInitDoubleConversion(void) mmaxpow = MAXPOW; } for (i=0 ; i<=mmaxpow ; ++i) { - pow10[i] = d; + pow10vals[i] = d; d *= 10.0; } @@ -2571,7 +2571,7 @@ Pow10TimesFrExp( * Multiply by 10**exponent */ - retval = frexp(retval * pow10[exponent&0xf], &j); + retval = frexp(retval * pow10vals[exponent&0xf], &j); expt += j; for (i=4; i<9; ++i) { if (exponent & (1<<i)) { @@ -2584,7 +2584,7 @@ Pow10TimesFrExp( * Divide by 10**-exponent */ - retval = frexp(retval / pow10[(-exponent) & 0xf], &j); + retval = frexp(retval / pow10vals[(-exponent) & 0xf], &j); expt += j; for (i=4; i<9; ++i) { if ((-exponent) & (1<<i)) { |