/* position on first nonblank */
start = s;
- while (*s && isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
if (*s == '(') {
/* Skip over possible bracket from repr(). */
got_bracket = 1;
s++;
- while (*s && isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
}
}
/* trailing whitespace and closing bracket */
- while (*s && isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
if (got_bracket) {
/* if there was an opening parenthesis, then the corresponding
if (*s != ')')
goto parse_error;
s++;
- while (*s && isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
}
}
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
x = PyOS_string_to_double(s, (char **)&end, NULL);
if (x == -1.0 && PyErr_Occurred())
goto error;
- while (*end && isspace(Py_CHARMASK(*end)))
+ while (Py_ISSPACE(*end))
end++;
if (end == last)
result = PyFloat_FromDouble(x);
********************/
/* leading whitespace and optional sign */
- while (isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
if (*s == '-') {
s++;
s_store = s;
if (*s == '0') {
s++;
- if (tolower(*s) == (int)'x')
+ if (*s == 'x' || *s == 'X')
s++;
else
s = s_store;
goto insane_length_error;
/* [p <exponent>] */
- if (tolower(*s) == (int)'p') {
+ if (*s == 'p' || *s == 'P') {
s++;
exp_start = s;
if (*s == '-' || *s == '+')
exp = 0;
/* optional trailing whitespace leading to the end of the string */
- while (isspace(Py_CHARMASK(*s)))
+ while (Py_ISSPACE(*s))
s++;
if (s != s_end)
goto parse_error;