summaryrefslogtreecommitdiffstats
path: root/compat/strtod.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-03-04 22:29:04 (GMT)
committernijtmans <nijtmans>2010-03-04 22:29:04 (GMT)
commitead00d5d7d7afa8be16eacf5a93a931c84b6749a (patch)
tree20424fb33bacac14f3240a09effbc1b2e5476576 /compat/strtod.c
parent4a7184ccc431e5e65151b8bccee62179269d099e (diff)
downloadtcl-ead00d5d7d7afa8be16eacf5a93a931c84b6749a.zip
tcl-ead00d5d7d7afa8be16eacf5a93a931c84b6749a.tar.gz
tcl-ead00d5d7d7afa8be16eacf5a93a931c84b6749a.tar.bz2
Split tommath stub lib source file
in separate file. Don't use -fvisibility=hidden for cygwin
Diffstat (limited to 'compat/strtod.c')
-rw-r--r--compat/strtod.c11
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;
}