diff options
Diffstat (limited to 'compat/strtod.c')
-rw-r--r-- | compat/strtod.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compat/strtod.c b/compat/strtod.c index aa73ab0..7171101 100644 --- a/compat/strtod.c +++ b/compat/strtod.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strtod.c,v 1.9 2008/04/27 22:21:28 dkf Exp $ + * RCS: @(#) $Id: strtod.c,v 1.10 2010/03/04 22:29:05 nijtmans Exp $ */ #include "tclInt.h" @@ -23,12 +23,12 @@ #define NULL 0 #endif -static int maxExponent = 511; /* Largest possible base 10 exponent. Any +static const int maxExponent = 511; /* Largest possible base 10 exponent. Any * exponent larger than this will already * produce underflow or overflow, so there's * no need to worry about additional digits. */ -static double powersOf10[] = { /* Table giving binary powers of 10. Entry */ +static const double powersOf10[] = { /* Table giving binary powers of 10. Entry */ 10., /* is 10^2^i. Used to convert decimal */ 100., /* exponents into floating-point numbers. */ 1.0e4, @@ -78,7 +78,8 @@ strtod( * address here. */ { int sign, expSign = FALSE; - double fraction, dblExp, *d; + double fraction, dblExp; + const double *d; register const char *p; register int c; int exp = 0; /* Exponent read from "EX" field. */ @@ -231,7 +232,7 @@ strtod( errno = ERANGE; } dblExp = 1.0; - for (d = powersOf10; exp != 0; exp >>= 1, d += 1) { + for (d = powersOf10; exp != 0; exp >>= 1, ++d) { if (exp & 01) { dblExp *= *d; } |