diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 2 | ||||
-rw-r--r-- | Objects/floatobject.c | 22 |
2 files changed, 3 insertions, 21 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index a301287..5a34b96 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -968,7 +968,7 @@ PyNumber_Float(PyObject *o) PyFloatObject *po = (PyFloatObject *)o; return PyFloat_FromDouble(po->ob_fval); } - return PyFloat_FromString(o, NULL); + return PyFloat_FromString(o); } /* Operations on sequences */ diff --git a/Objects/floatobject.c b/Objects/floatobject.c index 514dd39..9e6db54 100644 --- a/Objects/floatobject.c +++ b/Objects/floatobject.c @@ -62,24 +62,8 @@ PyFloat_FromDouble(double fval) return (PyObject *) op; } -/************************************************************************** -RED_FLAG 22-Sep-2000 tim -PyFloat_FromString's pend argument is braindead. Prior to this RED_FLAG, - -1. If v was a regular string, *pend was set to point to its terminating - null byte. That's useless (the caller can find that without any - help from this function!). - -2. If v was a Unicode string, or an object convertible to a character - buffer, *pend was set to point into stack trash (the auto temp - vector holding the character buffer). That was downright dangerous. - -Since we can't change the interface of a public API function, pend is -still supported but now *officially* useless: if pend is not NULL, -*pend is set to NULL. -**************************************************************************/ PyObject * -PyFloat_FromString(PyObject *v, char **pend) +PyFloat_FromString(PyObject *v) { const char *s, *last, *end; double x; @@ -89,8 +73,6 @@ PyFloat_FromString(PyObject *v, char **pend) #endif Py_ssize_t len; - if (pend) - *pend = NULL; if (PyString_Check(v)) { s = PyString_AS_STRING(v); len = PyString_GET_SIZE(v); @@ -852,7 +834,7 @@ float_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O:float", kwlist, &x)) return NULL; if (PyString_Check(x)) - return PyFloat_FromString(x, NULL); + return PyFloat_FromString(x); return PyNumber_Float(x); } |