]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-33012: Fix compilation warnings in memoryobject.c and _collectionsmodule.c (GH...
authorStéphane Wirtel <stephane@wirtel.be>
Tue, 5 Mar 2019 15:10:53 +0000 (16:10 +0100)
committerVictor Stinner <vstinner@redhat.com>
Tue, 5 Mar 2019 15:10:53 +0000 (16:10 +0100)
Cast function pointers to (void(*)(void)) before casting to (PyCFunction)
to make "warning: cast between incompatible function types" false alarm quiet.

Modules/_collectionsmodule.c
Objects/memoryobject.c

index 1c9e866e62f04891cb87fcfb298c39d0db4aee5f..afd2731b8264eec2ec8786bad0d02f1fbdf3f35c 100644 (file)
@@ -2453,7 +2453,7 @@ static PyMemberDef tuplegetter_members[] = {
 };
 
 static PyMethodDef tuplegetter_methods[] = {
-    {"__reduce__", (PyCFunction) tuplegetter_reduce, METH_NOARGS, NULL},
+    {"__reduce__", (PyCFunction)(void(*)(void))tuplegetter_reduce, METH_NOARGS, NULL},
     {NULL},
 };
 
index d835704bdaae306fc2dd18a9a64d7f01d1d50119..6bbb413c3c106abfe0a4fad42f88a745a00c5e5c 100644 (file)
@@ -3109,7 +3109,7 @@ Return a readonly version of the memoryview.");
 
 static PyMethodDef memory_methods[] = {
     {"release",     (PyCFunction)memory_release, METH_NOARGS, memory_release_doc},
-    {"tobytes",     (PyCFunction)memory_tobytes, METH_VARARGS|METH_KEYWORDS, memory_tobytes_doc},
+    {"tobytes",     (PyCFunction)(void(*)(void))memory_tobytes, METH_VARARGS|METH_KEYWORDS, memory_tobytes_doc},
     {"hex",         (PyCFunction)memory_hex, METH_NOARGS, memory_hex_doc},
     {"tolist",      (PyCFunction)memory_tolist, METH_NOARGS, memory_tolist_doc},
     {"cast",        (PyCFunction)(void(*)(void))memory_cast, METH_VARARGS|METH_KEYWORDS, memory_cast_doc},