]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111178: Fix function signatures for test_ctypes (#131660)
authorVictor Stinner <vstinner@python.org>
Mon, 24 Mar 2025 13:30:13 +0000 (14:30 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Mar 2025 13:30:13 +0000 (14:30 +0100)
Modules/_ctypes/_ctypes.c
Modules/_ctypes/callproc.c
Modules/_ctypes/cfield.c

index 2c2d09625a98254c1ec33d46f950c0b4ee2f5a97..6d817bdaecfa4ebf407393b11466b9060db0da93 100644 (file)
@@ -3805,8 +3805,9 @@ _validate_paramflags(ctypes_state *st, PyTypeObject *type, PyObject *paramflags)
 }
 
 static int
-_get_name(PyObject *obj, const char **pname)
+_get_name(PyObject *obj, void *arg)
 {
+    const char **pname = (const char **)arg;
 #ifdef MS_WIN32
     if (PyLong_Check(obj)) {
         /* We have to use MAKEINTRESOURCEA for Windows CE.
index c652634a13743161e3ee913913053a752c9d45db..80b66afb3625d1ff8b9fca3fa99a399ce45e6e33 100644 (file)
@@ -1353,8 +1353,9 @@ PyObject *_ctypes_callproc(ctypes_state *st,
 }
 
 static int
-_parse_voidp(PyObject *obj, void **address)
+_parse_voidp(PyObject *obj, void *arg)
 {
+    void **address = (void **)arg;
     *address = PyLong_AsVoidPtr(obj);
     if (*address == NULL)
         return 0;
@@ -1846,8 +1847,9 @@ addressof(PyObject *self, PyObject *obj)
 }
 
 static int
-converter(PyObject *obj, void **address)
+converter(PyObject *obj, void *arg)
 {
+    void **address = (void **)arg;
     *address = PyLong_AsVoidPtr(obj);
     return *address != NULL;
 }
index 7086ba2010607de80212b89aa8ef3e60dbc62d2b..fe0839a809f8db5a33f47adf763babad644b1ddf 100644 (file)
@@ -266,7 +266,7 @@ PyCField_set(PyObject *op, PyObject *inst, PyObject *value)
 }
 
 static PyObject *
-PyCField_get(PyObject *op, PyObject *inst, PyTypeObject *type)
+PyCField_get(PyObject *op, PyObject *inst, PyObject *type)
 {
     CDataObject *src;
     CFieldObject *self = _CFieldObject_CAST(op);