[Python-checkins] cpython (2.7): remove strange casts

benjamin.peterson python-checkins at python.org
Sun Nov 23 19:59:08 CET 2014


https://hg.python.org/cpython/rev/863a7bf95f18
changeset:   93555:863a7bf95f18
branch:      2.7
user:        Benjamin Peterson <benjamin at python.org>
date:        Sun Nov 23 12:58:54 2014 -0600
summary:
  remove strange casts

files:
  Objects/intobject.c |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Objects/intobject.c b/Objects/intobject.c
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -208,7 +208,7 @@
 {
 #if SIZEOF_SIZE_T != SIZEOF_LONG
     PyNumberMethods *nb;
-    PyIntObject *io;
+    PyObject *io;
     Py_ssize_t val;
 #endif
 
@@ -232,15 +232,15 @@
     }
 
     if (nb->nb_long != 0)
-        io = (PyIntObject*) (*nb->nb_long) (op);
+        io = (*nb->nb_long)(op);
     else
-        io = (PyIntObject*) (*nb->nb_int) (op);
+        io = (*nb->nb_int)(op);
     if (io == NULL)
         return -1;
     if (!PyInt_Check(io)) {
         if (PyLong_Check(io)) {
             /* got a long? => retry int conversion */
-            val = _PyLong_AsSsize_t((PyObject *)io);
+            val = _PyLong_AsSsize_t(io);
             Py_DECREF(io);
             if ((val == -1) && PyErr_Occurred())
                 return -1;

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list