} 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;
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) {
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;
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;
}
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.")},