Commit 673189cd authored by Benjamin Peterson's avatar Benjamin Peterson

remove strange casts

parent 274bc2bf
...@@ -208,7 +208,7 @@ PyInt_AsSsize_t(register PyObject *op) ...@@ -208,7 +208,7 @@ PyInt_AsSsize_t(register PyObject *op)
{ {
#if SIZEOF_SIZE_T != SIZEOF_LONG #if SIZEOF_SIZE_T != SIZEOF_LONG
PyNumberMethods *nb; PyNumberMethods *nb;
PyIntObject *io; PyObject *io;
Py_ssize_t val; Py_ssize_t val;
#endif #endif
...@@ -232,15 +232,15 @@ PyInt_AsSsize_t(register PyObject *op) ...@@ -232,15 +232,15 @@ PyInt_AsSsize_t(register PyObject *op)
} }
if (nb->nb_long != 0) if (nb->nb_long != 0)
io = (PyIntObject*) (*nb->nb_long) (op); io = (*nb->nb_long)(op);
else else
io = (PyIntObject*) (*nb->nb_int) (op); io = (*nb->nb_int)(op);
if (io == NULL) if (io == NULL)
return -1; return -1;
if (!PyInt_Check(io)) { if (!PyInt_Check(io)) {
if (PyLong_Check(io)) { if (PyLong_Check(io)) {
/* got a long? => retry int conversion */ /* got a long? => retry int conversion */
val = _PyLong_AsSsize_t((PyObject *)io); val = _PyLong_AsSsize_t(io);
Py_DECREF(io); Py_DECREF(io);
if ((val == -1) && PyErr_Occurred()) if ((val == -1) && PyErr_Occurred())
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment