From d4e73e35a539d6ef6a6fbe03ac5b8a4f7c0ff142 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 24 Mar 2025 13:27:03 +0100 Subject: [PATCH] gh-111178: Fix function signatures for test_ctypes --- Modules/_ctypes/_ctypes.c | 3 ++- Modules/_ctypes/callproc.c | 6 ++++-- Modules/_ctypes/cfield.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index cc06759f2d0d59..df803c2917b17b 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -3801,8 +3801,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. diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c index c6b6460126ca90..a00bfbe9b2e298 100644 --- a/Modules/_ctypes/callproc.c +++ b/Modules/_ctypes/callproc.c @@ -1355,8 +1355,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; @@ -1848,8 +1849,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; } diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 9924d62c0881d1..f0e826286fe5b0 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -217,7 +217,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);