diff options
Diffstat (limited to 'compat/strtod.c')
-rw-r--r-- | compat/strtod.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/compat/strtod.c b/compat/strtod.c index 1147825..cb9f76d 100644 --- a/compat/strtod.c +++ b/compat/strtod.c @@ -11,7 +11,6 @@ */ #include "tclInt.h" -#include <ctype.h> #ifndef TRUE #define TRUE 1 @@ -21,12 +20,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, @@ -61,7 +60,7 @@ static double powersOf10[] = { /* Table giving binary powers of 10. Entry */ double strtod( - CONST char *string, /* A decimal ASCII floating-point number, + const char *string, /* A decimal ASCII floating-point number, * optionally preceded by white space. Must * have form "-I.FE-X", where I is the integer * part of the mantissa, F is the fractional @@ -76,8 +75,9 @@ strtod( * address here. */ { int sign, expSign = FALSE; - double fraction, dblExp, *d; - register CONST char *p; + double fraction, dblExp; + const double *d; + register const char *p; register int c; int exp = 0; /* Exponent read from "EX" field. */ int fracExp = 0; /* Exponent that derives from the fractional @@ -92,7 +92,7 @@ strtod( int mantSize; /* Number of digits in mantissa. */ int decPt; /* Number of mantissa digits BEFORE decimal * point. */ - CONST char *pExp; /* Temporarily holds location of exponent in + const char *pExp; /* Temporarily holds location of exponent in * string. */ /* @@ -229,7 +229,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; } |