From: John Darrington Date: Mon, 3 Dec 2012 21:10:00 +0000 (+0100) Subject: Replaced strtod with c_strtod where appropriate X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20121211030505%2Fpspp;p=pspp Replaced strtod with c_strtod where appropriate Should LC_NUMERIC ever get set, this will become important. --- diff --git a/src/data/data-in.c b/src/data/data-in.c index 5d4496cf90..db99aa4fb8 100644 --- a/src/data/data-in.c +++ b/src/data/data-in.c @@ -1044,7 +1044,7 @@ parse_minute_second (struct data_in *i, double *time) *cp++ = ss_get_byte (&i->input); *cp = '\0'; - *time += strtod (buf, NULL); + *time += c_strtod (buf, NULL); return NULL; } diff --git a/src/data/gnumeric-reader.c b/src/data/gnumeric-reader.c index b9def31cb6..a1a7415ca1 100644 --- a/src/data/gnumeric-reader.c +++ b/src/data/gnumeric-reader.c @@ -20,6 +20,7 @@ #include "libpspp/misc.h" #include "gl/minmax.h" +#include "gl/c-strtod.h" #include "gettext.h" #define _(msgid) gettext (msgid) @@ -257,7 +258,7 @@ convert_xml_string_to_value (struct ccase *c, const struct variable *var, char *endptr; errno = 0; - v->f = strtod (text, &endptr); + v->f = c_strtod (text, &endptr); if ( errno != 0 || endptr == text) v->f = SYSMIS; } diff --git a/src/data/sys-file-reader.c b/src/data/sys-file-reader.c index 4a7476ae04..83da9ee82e 100644 --- a/src/data/sys-file-reader.c +++ b/src/data/sys-file-reader.c @@ -50,6 +50,7 @@ #include "libpspp/str.h" #include "libpspp/stringi-set.h" +#include "gl/c-strtod.h" #include "gl/c-ctype.h" #include "gl/inttostr.h" #include "gl/localcharset.h" @@ -1437,7 +1438,7 @@ parse_mrsets (struct sfm_reader *r, const struct sfm_extension_record *record, mrset->width = width; value_init (&mrset->counted, width); if (width == 0) - mrset->counted.f = strtod (counted, NULL); + mrset->counted.f = c_strtod (counted, NULL); else value_copy_str_rpad (&mrset->counted, width, (const uint8_t *) counted, ' '); diff --git a/src/language/lexer/scan.c b/src/language/lexer/scan.c index caf294a9d1..de75eeef3b 100644 --- a/src/language/lexer/scan.c +++ b/src/language/lexer/scan.c @@ -27,6 +27,7 @@ #include "libpspp/cast.h" #include "gl/c-ctype.h" +#include "gl/c-strtod.h" #include "gl/xmemdup0.h" enum @@ -379,7 +380,7 @@ scan_number__ (struct substring s) else p = xmemdup0 (s.string, s.length); - number = strtod (p, NULL); + number = c_strtod (p, NULL); if (p != buf) free (p);