summaryrefslogtreecommitdiffstats
path: root/compat/strtod.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/strtod.c')
-rw-r--r--compat/strtod.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/compat/strtod.c b/compat/strtod.c
index cb9f76d..1147825 100644
--- a/compat/strtod.c
+++ b/compat/strtod.c
@@ -11,6 +11,7 @@
*/
#include "tclInt.h"
+#include <ctype.h>
#ifndef TRUE
#define TRUE 1
@@ -20,12 +21,12 @@
#define NULL 0
#endif
-static const int maxExponent = 511; /* Largest possible base 10 exponent. Any
+static 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 const double powersOf10[] = { /* Table giving binary powers of 10. Entry */
+static 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,
@@ -60,7 +61,7 @@ static const 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
@@ -75,9 +76,8 @@ strtod(
* address here. */
{
int sign, expSign = FALSE;
- double fraction, dblExp;
- const double *d;
- register const char *p;
+ double fraction, dblExp, *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) {
+ for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
if (exp & 01) {
dblExp *= *d;
}