]> granicus.if.org Git - python/commitdiff
bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings (GH-13758)
authorPetr Viktorin <encukou@gmail.com>
Sun, 2 Jun 2019 23:08:14 +0000 (01:08 +0200)
committerGitHub <noreply@github.com>
Sun, 2 Jun 2019 23:08:14 +0000 (01:08 +0200)
Modules/_testcapimodule.c
Objects/longobject.c

index eed34c9802c3416934446a5585b1269c1daf5c41..40e0826ce1263ab913cd2a6167c7f32c08182564 100644 (file)
@@ -5854,7 +5854,7 @@ MethodDescriptor_vectorcall(PyObject *callable, PyObject *const *args,
 static PyObject *
 MethodDescriptor_new(PyTypeObject* type, PyObject* args, PyObject *kw)
 {
-    MethodDescriptorObject *op = type->tp_alloc(type, 0);
+    MethodDescriptorObject *op = (MethodDescriptorObject *)type->tp_alloc(type, 0);
     op->vectorcall = MethodDescriptor_vectorcall;
     return (PyObject *)op;
 }
index 49f1420bf64f983c3213f2aa47418a053c6c0b4a..858e256ac0b417a7c50812c366a9d766d3bed90c 100644 (file)
@@ -4243,7 +4243,7 @@ long_invmod(PyLongObject *a, PyLongObject *n)
 
     Py_DECREF(c);
     Py_DECREF(n);
-    if (long_compare(a, _PyLong_One)) {
+    if (long_compare(a, (PyObject *)_PyLong_One)) {
         /* a != 1; we don't have an inverse. */
         Py_DECREF(a);
         Py_DECREF(b);