Mercurial > cpython-lru_cache-weakref
diff Objects/floatobject.c @ 14050:6e2dba45c83e legacy-trunk
PyFloat_FromString(): Move s_buffer[] up to the top-level function
scope. Previously, s_buffer[] was defined inside the
PyUnicode_Check() scope, but referred to in the outer scope via
assignment to s. This quiets an Insure portability warning.
| author | Barry Warsaw <barry@python.org> |
|---|---|
| date | Fri, 18 Aug 2000 05:00:03 +0000 |
| parents | 5ada9fa54801 |
| children | 6f6f965c5e2d |
line wrap: on
line diff
--- a/Objects/floatobject.c Fri Aug 18 04:57:32 2000 +0000 +++ b/Objects/floatobject.c Fri Aug 18 05:00:03 2000 +0000 @@ -133,6 +133,7 @@ const char *s, *last, *end; double x; char buffer[256]; /* For errors */ + char s_buffer[256]; int len; if (PyString_Check(v)) { @@ -140,8 +141,6 @@ len = PyString_GET_SIZE(v); } else if (PyUnicode_Check(v)) { - char s_buffer[256]; - if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) { PyErr_SetString(PyExc_ValueError, "float() literal too large to convert");
