summaryrefslogtreecommitdiff
path: root/Objects/floatobject.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-05-03 20:59:48 +0000
committerMark Dickinson <dickinsm@gmail.com>2009-05-03 20:59:48 +0000
commit0ea74d3dd1be202b06dd67db151889fa8a53e4cd (patch)
tree8a70cd7c7d1e556e47aa8c686d87fdf955d1c5c7 /Objects/floatobject.c
parentc34f714246034e04499adf3e29104762d76d55ae (diff)
downloadcpython-0ea74d3dd1be202b06dd67db151889fa8a53e4cd.tar.gz
Eliminate some locale-dependent calls to isspace and tolower.
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r--Objects/floatobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 58f27e68ce..9a0dbb33c2 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -214,7 +214,7 @@ PyFloat_FromString(PyObject *v, char **pend)
}
last = s + len;
- while (*s && isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
/* We don't care about overflow or underflow. If the platform
* supports them, infinities and signed zeroes (on underflow) are
@@ -235,7 +235,7 @@ PyFloat_FromString(PyObject *v, char **pend)
}
/* Since end != s, the platform made *some* kind of sense out
of the input. Trust it. */
- while (*end && isspace(Py_CHARMASK(*end)))
+ while (Py_ISSPACE(*end))
end++;
if (end != last) {
if (*end == '\0')
@@ -1220,7 +1220,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
********************/
/* leading whitespace and optional sign */
- while (isspace(*s))
+ while (Py_ISSPACE(*s))
s++;
if (*s == '-') {
s++;
@@ -1244,7 +1244,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
s_store = s;
if (*s == '0') {
s++;
- if (tolower(*s) == (int)'x')
+ if (*s == 'x' || *s == 'X')
s++;
else
s = s_store;
@@ -1274,7 +1274,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
goto insane_length_error;
/* [p <exponent>] */
- if (tolower(*s) == (int)'p') {
+ if (*s == 'p' || *s == 'P') {
s++;
exp_start = s;
if (*s == '-' || *s == '+')
@@ -1290,7 +1290,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
exp = 0;
/* optional trailing whitespace leading to the end of the string */
- while (isspace(*s))
+ while (Py_ISSPACE(*s))
s++;
if (s != s_end)
goto parse_error;