bpo-33029: Fix signatures of getter and setter functions. (GH-10746)
Fix also return type for few other functions (clear, releasebuffer).
(cherry picked from commit d4f9cf5545d6d8844e0726552ef2e366f5cc3abd)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 793a809..b0e8770 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -644,14 +644,14 @@
}
static PyObject *
-gen_get_name(PyGenObject *op)
+gen_get_name(PyGenObject *op, void *Py_UNUSED(ignored))
{
Py_INCREF(op->gi_name);
return op->gi_name;
}
static int
-gen_set_name(PyGenObject *op, PyObject *value)
+gen_set_name(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
/* Not legal to del gen.gi_name or to set it to anything
* other than a string object. */
@@ -666,14 +666,14 @@
}
static PyObject *
-gen_get_qualname(PyGenObject *op)
+gen_get_qualname(PyGenObject *op, void *Py_UNUSED(ignored))
{
Py_INCREF(op->gi_qualname);
return op->gi_qualname;
}
static int
-gen_set_qualname(PyGenObject *op, PyObject *value)
+gen_set_qualname(PyGenObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
/* Not legal to del gen.__qualname__ or to set it to anything
* other than a string object. */
@@ -688,7 +688,7 @@
}
static PyObject *
-gen_getyieldfrom(PyGenObject *gen)
+gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored))
{
PyObject *yf = _PyGen_yf(gen);
if (yf == NULL)
@@ -927,7 +927,7 @@
}
static PyObject *
-coro_get_cr_await(PyCoroObject *coro)
+coro_get_cr_await(PyCoroObject *coro, void *Py_UNUSED(ignored))
{
PyObject *yf = _PyGen_yf((PyGenObject *) coro);
if (yf == NULL)