diff options
author | Georg Brandl <georg@python.org> | 2007-03-18 18:35:15 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-18 18:35:15 (GMT) |
commit | 428f0641ec34902b0cce2cfdca833c79e6fdab7c (patch) | |
tree | 24f29c55a16cb1377b721253ec847c1885c70edb /Objects/floatobject.c | |
parent | 9091e3a423b1f7a21b1b191c65381abcb5702ab6 (diff) | |
download | cpython-428f0641ec34902b0cce2cfdca833c79e6fdab7c.zip cpython-428f0641ec34902b0cce2cfdca833c79e6fdab7c.tar.gz cpython-428f0641ec34902b0cce2cfdca833c79e6fdab7c.tar.bz2 |
Remove the deprecated and useless "pend" argument from
PyFloat_FromString. (fixes bug #1650903)
Diffstat (limited to 'Objects/floatobject.c')
-rw-r--r-- | Objects/floatobject.c | 22 |
1 files changed, 2 insertions, 20 deletions
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); } |