@@ -62,24 +62,8 @@ PyFloat_FromDouble(double fval)
6262 return (PyObject * ) op ;
6363}
6464
65- /**************************************************************************
66- RED_FLAG 22-Sep-2000 tim
67- PyFloat_FromString's pend argument is braindead. Prior to this RED_FLAG,
68-
69- 1. If v was a regular string, *pend was set to point to its terminating
70- null byte. That's useless (the caller can find that without any
71- help from this function!).
72-
73- 2. If v was a Unicode string, or an object convertible to a character
74- buffer, *pend was set to point into stack trash (the auto temp
75- vector holding the character buffer). That was downright dangerous.
76-
77- Since we can't change the interface of a public API function, pend is
78- still supported but now *officially* useless: if pend is not NULL,
79- *pend is set to NULL.
80- **************************************************************************/
8165PyObject *
82- PyFloat_FromString (PyObject * v , char * * pend )
66+ PyFloat_FromString (PyObject * v )
8367{
8468 const char * s , * last , * end ;
8569 double x ;
@@ -89,8 +73,6 @@ PyFloat_FromString(PyObject *v, char **pend)
8973#endif
9074 Py_ssize_t len ;
9175
92- if (pend )
93- * pend = NULL ;
9476 if (PyString_Check (v )) {
9577 s = PyString_AS_STRING (v );
9678 len = PyString_GET_SIZE (v );
@@ -852,7 +834,7 @@ float_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
852834 if (!PyArg_ParseTupleAndKeywords (args , kwds , "|O:float" , kwlist , & x ))
853835 return NULL ;
854836 if (PyString_Check (x ))
855- return PyFloat_FromString (x , NULL );
837+ return PyFloat_FromString (x );
856838 return PyNumber_Float (x );
857839}
858840
0 commit comments