]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-111178: Fix function signatures for test_os (#131227)
authorVictor Stinner <vstinner@python.org>
Fri, 14 Mar 2025 13:53:06 +0000 (14:53 +0100)
committerGitHub <noreply@github.com>
Fri, 14 Mar 2025 13:53:06 +0000 (13:53 +0000)
Modules/_queuemodule.c
Modules/socketmodule.c
Objects/structseq.c

index 4233ac5736c61e4fba37bb564ac4ebea1a8eccce..3ee14b61b821d663ea0cae8b570310dad11ca3ca 100644 (file)
@@ -272,8 +272,10 @@ typedef struct {
 } HandoffData;
 
 static void
-maybe_handoff_item(HandoffData *data, PyObject **item, int has_more_waiters)
+maybe_handoff_item(void *arg, void *park_arg, int has_more_waiters)
 {
+    HandoffData *data = (HandoffData*)arg;
+    PyObject **item = (PyObject**)park_arg;
     if (item == NULL) {
         // No threads were waiting
         data->handed_off = false;
@@ -313,7 +315,7 @@ _queue_SimpleQueue_put_impl(simplequeueobject *self, PyObject *item,
     if (self->has_threads_waiting) {
         // Try to hand the item off directly if there are threads waiting
         _PyParkingLot_Unpark(&self->has_threads_waiting,
-                             (_Py_unpark_fn_t *)maybe_handoff_item, &data);
+                             maybe_handoff_item, &data);
     }
     if (!data.handed_off) {
         if (RingBuf_Put(&self->buf, item) < 0) {
index 9622dfed976dffcd35b0bf3a260f892c61f65d2e..795451d48e7b3594128e3adc3f79cb1f276c6558 100644 (file)
@@ -1731,8 +1731,9 @@ idna_cleanup(struct maybe_idna *data)
 }
 
 static int
-idna_converter(PyObject *obj, struct maybe_idna *data)
+idna_converter(PyObject *obj, void *arg)
 {
+    struct maybe_idna *data = (struct maybe_idna*)arg;
     size_t len;
     PyObject *obj2;
     if (obj == NULL) {
index b62317e1cf37323e1859f0664367b5dfb3148312..b7741209df926434a5ac28ab8138eea5bf29da6e 100644 (file)
@@ -334,8 +334,9 @@ error:
 
 
 static PyObject *
-structseq_reduce(PyStructSequence* self, PyObject *Py_UNUSED(ignored))
+structseq_reduce(PyObject *op, PyObject *Py_UNUSED(ignored))
 {
+    PyStructSequence *self = (PyStructSequence*)op;
     PyObject* tup = NULL;
     PyObject* dict = NULL;
     PyObject* result;
@@ -379,8 +380,9 @@ error:
 
 
 static PyObject *
-structseq_replace(PyStructSequence *self, PyObject *args, PyObject *kwargs)
+structseq_replace(PyObject *op, PyObject *args, PyObject *kwargs)
 {
+    PyStructSequence *self = (PyStructSequence*)op;
     PyStructSequence *result = NULL;
     Py_ssize_t n_fields, n_unnamed_fields, i;
 
@@ -449,7 +451,7 @@ error:
 }
 
 static PyMethodDef structseq_methods[] = {
-    {"__reduce__", (PyCFunction)structseq_reduce, METH_NOARGS, NULL},
+    {"__reduce__", structseq_reduce, METH_NOARGS, NULL},
     {"__replace__", _PyCFunction_CAST(structseq_replace), METH_VARARGS | METH_KEYWORDS,
      PyDoc_STR("__replace__($self, /, **changes)\n--\n\n"
         "Return a copy of the structure with new values for the specified fields.")},