[Python-checkins] bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings (GH-13758)

Petr Viktorin webhook-mailer at python.org
Sun Jun 2 19:08:18 EDT 2019


https://github.com/python/cpython/commit/e584cbff1ea78e700cf9943d50467e3b58301ccc
commit: e584cbff1ea78e700cf9943d50467e3b58301ccc
branch: master
author: Petr Viktorin <encukou at gmail.com>
committer: GitHub <noreply at github.com>
date: 2019-06-03T01:08:14+02:00
summary:

bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings (GH-13758)

files:
M Modules/_testcapimodule.c
M Objects/longobject.c

diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index eed34c9802c3..40e0826ce126 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -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;
 }
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 49f1420bf64f..858e256ac0b4 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -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);



More information about the Python-checkins mailing list