mirror of
https://github.com/python/cpython.git
synced 2025-09-25 09:50:37 +00:00
Merged revisions 72253 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72253 | mark.dickinson | 2009-05-03 21:59:48 +0100 (Sun, 03 May 2009) | 2 lines Eliminate some locale-dependent calls to isspace and tolower. ........
This commit is contained in:
parent
fb85dfc685
commit
aa77d26009
2 changed files with 10 additions and 10 deletions
|
@ -767,13 +767,13 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
|
||||||
|
|
||||||
/* position on first nonblank */
|
/* position on first nonblank */
|
||||||
start = s;
|
start = s;
|
||||||
while (*s && isspace(Py_CHARMASK(*s)))
|
while (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
if (*s == '(') {
|
if (*s == '(') {
|
||||||
/* Skip over possible bracket from repr(). */
|
/* Skip over possible bracket from repr(). */
|
||||||
got_bracket = 1;
|
got_bracket = 1;
|
||||||
s++;
|
s++;
|
||||||
while (*s && isspace(Py_CHARMASK(*s)))
|
while (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* trailing whitespace and closing bracket */
|
/* trailing whitespace and closing bracket */
|
||||||
while (*s && isspace(Py_CHARMASK(*s)))
|
while (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
if (got_bracket) {
|
if (got_bracket) {
|
||||||
/* if there was an opening parenthesis, then the corresponding
|
/* if there was an opening parenthesis, then the corresponding
|
||||||
|
@ -864,7 +864,7 @@ complex_subtype_from_string(PyTypeObject *type, PyObject *v)
|
||||||
if (*s != ')')
|
if (*s != ')')
|
||||||
goto parse_error;
|
goto parse_error;
|
||||||
s++;
|
s++;
|
||||||
while (*s && isspace(Py_CHARMASK(*s)))
|
while (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ PyFloat_FromString(PyObject *v)
|
||||||
}
|
}
|
||||||
last = s + len;
|
last = s + len;
|
||||||
|
|
||||||
while (*s && isspace(Py_CHARMASK(*s)))
|
while (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
/* We don't care about overflow or underflow. If the platform
|
/* We don't care about overflow or underflow. If the platform
|
||||||
* supports them, infinities and signed zeroes (on underflow) are
|
* supports them, infinities and signed zeroes (on underflow) are
|
||||||
|
@ -196,7 +196,7 @@ PyFloat_FromString(PyObject *v)
|
||||||
x = PyOS_string_to_double(s, (char **)&end, NULL);
|
x = PyOS_string_to_double(s, (char **)&end, NULL);
|
||||||
if (x == -1.0 && PyErr_Occurred())
|
if (x == -1.0 && PyErr_Occurred())
|
||||||
goto error;
|
goto error;
|
||||||
while (*end && isspace(Py_CHARMASK(*end)))
|
while (Py_ISSPACE(*end))
|
||||||
end++;
|
end++;
|
||||||
if (end == last)
|
if (end == last)
|
||||||
result = PyFloat_FromDouble(x);
|
result = PyFloat_FromDouble(x);
|
||||||
|
@ -1223,7 +1223,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
|
||||||
********************/
|
********************/
|
||||||
|
|
||||||
/* leading whitespace and optional sign */
|
/* leading whitespace and optional sign */
|
||||||
while (isspace(Py_CHARMASK(*s)))
|
while (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
if (*s == '-') {
|
if (*s == '-') {
|
||||||
s++;
|
s++;
|
||||||
|
@ -1247,7 +1247,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
|
||||||
s_store = s;
|
s_store = s;
|
||||||
if (*s == '0') {
|
if (*s == '0') {
|
||||||
s++;
|
s++;
|
||||||
if (tolower(*s) == (int)'x')
|
if (*s == 'x' || *s == 'X')
|
||||||
s++;
|
s++;
|
||||||
else
|
else
|
||||||
s = s_store;
|
s = s_store;
|
||||||
|
@ -1277,7 +1277,7 @@ float_fromhex(PyObject *cls, PyObject *arg)
|
||||||
goto insane_length_error;
|
goto insane_length_error;
|
||||||
|
|
||||||
/* [p <exponent>] */
|
/* [p <exponent>] */
|
||||||
if (tolower(*s) == (int)'p') {
|
if (*s == 'p' || *s == 'P') {
|
||||||
s++;
|
s++;
|
||||||
exp_start = s;
|
exp_start = s;
|
||||||
if (*s == '-' || *s == '+')
|
if (*s == '-' || *s == '+')
|
||||||
|
@ -1293,7 +1293,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 (Py_ISSPACE(*s))
|
||||||
s++;
|
s++;
|
||||||
if (s != s_end)
|
if (s != s_end)
|
||||||
goto parse_error;
|
goto parse_error;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue