return state->error;
}
+static void
+simple_object_dealloc(PyObject *self)
+{
+ PyObject_Free(self);
+}
+
/* Raise _testcapi.error with test_name + ": " + msg, and return NULL. */
static PyObject *
"hashinheritancetester", /* Name of this type */
sizeof(PyObject), /* Basic object size */
0, /* Item size for varobject */
- (destructor)PyObject_Free, /* tp_dealloc */
+ simple_object_dealloc, /* tp_dealloc */
0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
}
static PyObject*
-meth_noargs(PyObject* self, PyObject* ignored)
+meth_noargs(PyObject* self, PyObject *Py_UNUSED(dummy))
{
return _null_to_none(self);
}
{"pyobject_repr_from_null", pyobject_repr_from_null, METH_NOARGS},
{"pyobject_str_from_null", pyobject_str_from_null, METH_NOARGS},
{"pyobject_bytes_from_null", pyobject_bytes_from_null, METH_NOARGS},
- {"test_capsule", (PyCFunction)test_capsule, METH_NOARGS},
- {"test_from_contiguous", (PyCFunction)test_from_contiguous, METH_NOARGS},
+ {"test_capsule", test_capsule, METH_NOARGS},
+ {"test_from_contiguous", test_from_contiguous, METH_NOARGS},
#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__GNUC__)
- {"test_pep3118_obsolete_write_locks", (PyCFunction)test_pep3118_obsolete_write_locks, METH_NOARGS},
+ {"test_pep3118_obsolete_write_locks", test_pep3118_obsolete_write_locks, METH_NOARGS},
#endif
{"getbuffer_with_null_view", getbuffer_with_null_view, METH_O},
{"PyBuffer_SizeFromFormat", test_PyBuffer_SizeFromFormat, METH_VARARGS},
PyObject *ao_iterator;
} awaitObject;
+#define awaitObject_CAST(op) ((awaitObject *)(op))
static PyObject *
awaitObject_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
static void
-awaitObject_dealloc(awaitObject *ao)
+awaitObject_dealloc(PyObject *op)
{
+ awaitObject *ao = awaitObject_CAST(op);
Py_CLEAR(ao->ao_iterator);
Py_TYPE(ao)->tp_free(ao);
}
static PyObject *
-awaitObject_await(awaitObject *ao)
+awaitObject_await(PyObject *op)
{
+ awaitObject *ao = awaitObject_CAST(op);
return Py_NewRef(ao->ao_iterator);
}
static PyAsyncMethods awaitType_as_async = {
- (unaryfunc)awaitObject_await, /* am_await */
+ awaitObject_await, /* am_await */
0, /* am_aiter */
0, /* am_anext */
0, /* am_send */
"awaitType",
sizeof(awaitObject), /* tp_basicsize */
0, /* tp_itemsize */
- (destructor)awaitObject_dealloc, /* destructor tp_dealloc */
+ awaitObject_dealloc, /* tp_dealloc */
0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
}
void
-MyList_dealloc(MyListObject* op)
+MyList_dealloc(PyObject *self)
{
+ MyListObject *op = (MyListObject *)self;
if (op->deallocated) {
/* We cannot raise exceptions here but we still want the testsuite
* to fail when we hit this */
"MyList",
sizeof(MyListObject),
0,
- (destructor)MyList_dealloc, /* tp_dealloc */
+ MyList_dealloc, /* tp_dealloc */
0, /* tp_vectorcall_offset */
0, /* tp_getattr */
0, /* tp_setattr */
{
PyGenericAliasObject *self = (PyGenericAliasObject*)op;
Py_CLEAR(self->item);
- Py_TYPE(self)->tp_free((PyObject *)self);
+ Py_TYPE(self)->tp_free(self);
}
static PyObject *
-generic_alias_mro_entries(PyObject *op, PyObject *bases)
+generic_alias_mro_entries(PyObject *op, PyObject *Py_UNUSED(bases))
{
PyGenericAliasObject *self = (PyGenericAliasObject*)op;
return PyTuple_Pack(1, self->item);
{
ContainerNoGCobject *self = (ContainerNoGCobject*)op;
Py_DECREF(self->value);
- Py_TYPE(self)->tp_free((PyObject *)self);
+ Py_TYPE(self)->tp_free(self);
}
static PyMemberDef ContainerNoGC_members[] = {