Commit fad543a7 authored by Mark Dickinson's avatar Mark Dickinson

Revert accidental changes to Objects/floatobject.c

parent c4c0807e
...@@ -15,11 +15,6 @@ ...@@ -15,11 +15,6 @@
#define MAX(x, y) ((x) < (y) ? (y) : (x)) #define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y))
/* ascii character tests (as opposed to locale tests) */
#define ISSPACE(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || \
(c) == '\r' || (c) == '\t' || (c) == '\v')
#define ISDIGIT(c) ((c) >= '0' && (c) <= '9')
#ifdef HAVE_IEEEFP_H #ifdef HAVE_IEEEFP_H
#include <ieeefp.h> #include <ieeefp.h>
#endif #endif
...@@ -193,7 +188,7 @@ PyFloat_FromString(PyObject *v) ...@@ -193,7 +188,7 @@ PyFloat_FromString(PyObject *v)
} }
last = s + len; last = s + len;
while (*s && ISSPACE(Py_CHARMASK(*s))) while (*s && isspace(Py_CHARMASK(*s)))
s++; s++;
if (*s == '\0') { if (*s == '\0') {
PyErr_SetString(PyExc_ValueError, "empty string for float()"); PyErr_SetString(PyExc_ValueError, "empty string for float()");
...@@ -250,7 +245,7 @@ PyFloat_FromString(PyObject *v) ...@@ -250,7 +245,7 @@ PyFloat_FromString(PyObject *v)
} }
/* Since end != s, the platform made *some* kind of sense out /* Since end != s, the platform made *some* kind of sense out
of the input. Trust it. */ of the input. Trust it. */
while (*end && ISSPACE(Py_CHARMASK(*end))) while (*end && isspace(Py_CHARMASK(*end)))
end++; end++;
if (*end != '\0') { if (*end != '\0') {
PyOS_snprintf(buffer, sizeof(buffer), PyOS_snprintf(buffer, sizeof(buffer),
...@@ -1280,7 +1275,7 @@ float_fromhex(PyObject *cls, PyObject *arg) ...@@ -1280,7 +1275,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
********************/ ********************/
/* leading whitespace and optional sign */ /* leading whitespace and optional sign */
while (ISSPACE(Py_CHARMASK(*s))) while (isspace(Py_CHARMASK(*s)))
s++; s++;
if (*s == '-') { if (*s == '-') {
s++; s++;
...@@ -1304,7 +1299,6 @@ float_fromhex(PyObject *cls, PyObject *arg) ...@@ -1304,7 +1299,6 @@ float_fromhex(PyObject *cls, PyObject *arg)
s_store = s; s_store = s;
if (*s == '0') { if (*s == '0') {
s++; s++;
if (*s == 'x' || *s == 'X')
if (tolower(*s) == (int)'x') if (tolower(*s) == (int)'x')
s++; s++;
else else
...@@ -1351,7 +1345,7 @@ float_fromhex(PyObject *cls, PyObject *arg) ...@@ -1351,7 +1345,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
exp = 0; exp = 0;
/* optional trailing whitespace leading to the end of the string */ /* optional trailing whitespace leading to the end of the string */
while (ISSPACE(Py_CHARMASK(*s))) while (isspace(Py_CHARMASK(*s)))
s++; s++;
if (s != s_end) if (s != s_end)
goto parse_error; goto parse_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment