Commits

mattip committed bef3dc9

correct types via casting

Comments (0)

Files changed (2)

pypy/module/cpyext/test/test_intobject.py

             } EnumObject;
 
             static void
-            enum_dealloc(EnumObject *op)
+            enum_dealloc(PyObject *op)
             {
-                    Py_DECREF(op->ob_name);
-                    Py_TYPE(op)->tp_free((PyObject *)op);
+                    Py_DECREF(((EnumObject *)op)->ob_name);
+                    Py_TYPE(op)->tp_free(op);
             }
 
             static PyMemberDef enum_members[] = {

pypy/module/cpyext/test/test_pyerrors.py

              PyErr_NormalizeException(&type, &val, &tb);
              if (type != PyExc_TypeError)
                  Py_RETURN_FALSE;
-             if (val->ob_type != PyExc_TypeError)
+             if (val->ob_type != (_typeobject *)PyExc_TypeError)
                  Py_RETURN_FALSE;
 
              /* Normalize again */
              PyErr_NormalizeException(&type, &val, &tb);
              if (type != PyExc_TypeError)
                  Py_RETURN_FALSE;
-             if (val->ob_type != PyExc_TypeError)
+             if (val->ob_type != (_typeobject *)PyExc_TypeError)
                  Py_RETURN_FALSE;
 
              PyErr_Restore(type, val, tb);