summaryrefslogtreecommitdiffstats
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-04-18 20:19:17 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-04-18 20:19:17 (GMT)
commit332424777f4bf213b1db1b7dcfa592d2fe5ae772 (patch)
tree19a9cfc10db15f04688eaaaa2ddbd06b5a956af3 /Objects/floatobject.c
parent7abf8d4066e9b4dd21f9a498427ac1ec8914c0ab (diff)
downloadcpython-332424777f4bf213b1db1b7dcfa592d2fe5ae772.zip
cpython-332424777f4bf213b1db1b7dcfa592d2fe5ae772.tar.gz
cpython-332424777f4bf213b1db1b7dcfa592d2fe5ae772.tar.bz2
Revert accidental changes to Objects/floatobject.c
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index f78f7df..b7b5220 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -15,11 +15,6 @@
#define MAX(x, y) ((x) < (y) ? (y) : (x))
#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
#include <ieeefp.h>
#endif
@@ -193,7 +188,7 @@ PyFloat_FromString(PyObject *v)
}
last = s + len;
- while (*s && ISSPACE(Py_CHARMASK(*s)))
+ while (*s && isspace(Py_CHARMASK(*s)))
s++;
if (*s == '\0') {
PyErr_SetString(PyExc_ValueError, "empty string for float()");
@@ -250,7 +245,7 @@ PyFloat_FromString(PyObject *v)
}
/* Since end != s, the platform made *some* kind of sense out
of the input. Trust it. */
- while (*end && ISSPACE(Py_CHARMASK(*end)))
+ while (*end && isspace(Py_CHARMASK(*end)))
end++;
if (*end != '\0') {
PyOS_snprintf(buffer, sizeof(buffer),
@@ -1280,7 +1275,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
********************/
/* leading whitespace and optional sign */
- while (ISSPACE(Py_CHARMASK(*s)))
+ while (isspace(Py_CHARMASK(*s)))
s++;
if (*s == '-') {
s++;
@@ -1304,7 +1299,6 @@ float_fromhex(PyObject *cls, PyObject *arg)
s_store = s;
if (*s == '0') {
s++;
- if (*s == 'x' || *s == 'X')
if (tolower(*s) == (int)'x')
s++;
else
@@ -1351,7 +1345,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
exp = 0;
/* optional trailing whitespace leading to the end of the string */
- while (ISSPACE(Py_CHARMASK(*s)))
+ while (isspace(Py_CHARMASK(*s)))
s++;
if (s != s_end)
goto parse_error;