X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fstrtod.c;h=fdfc09f1bc0ca61909db5116774e57d134d5b896;hb=0ce7f76658b09f777589767563e64d34356708a7;hp=b8aab679e9d4e929b9bea403c0e0bf07e9adcb4b;hpb=f28381080bf5e484b48e766fe5804017f9af5f57;p=gnulib.git diff --git a/lib/strtod.c b/lib/strtod.c index b8aab679e..fdfc09f1b 100644 --- a/lib/strtod.c +++ b/lib/strtod.c @@ -14,24 +14,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include #include -#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) -# define IN_CTYPE_DOMAIN(c) 1 -#else -# define IN_CTYPE_DOMAIN(c) isascii(c) -#endif - -#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) -#define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) -#define TOLOWER(c) (IN_CTYPE_DOMAIN (c) ? tolower(c) : (c)) - #include #include @@ -64,7 +52,7 @@ strtod (const char *nptr, char **endptr) s = nptr; /* Eat whitespace. */ - while (ISSPACE (*s)) + while (isspace ((unsigned char) *s)) ++s; /* Get the sign. */ @@ -78,7 +66,7 @@ strtod (const char *nptr, char **endptr) exponent = 0; for (;; ++s) { - if (ISDIGIT (*s)) + if ('0' <= *s && *s <= '9') { got_digit = 1; @@ -111,7 +99,7 @@ strtod (const char *nptr, char **endptr) if (!got_digit) goto noconv; - if (TOLOWER (*s) == 'e') + if (tolower ((unsigned char) *s) == 'e') { /* Get the exponent specified after the `e' or `E'. */ int save = errno;