bpo-33029: Fix signatures of getter and setter functions. (GH-10746)

Fix also return type for few other functions (clear, releasebuffer).
This commit is contained in:
Serhiy Storchaka 2018-11-27 19:34:35 +02:00 committed by GitHub
parent 1005c84535
commit d4f9cf5545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 128 additions and 122 deletions

View file

@ -645,14 +645,14 @@ gen_repr(PyGenObject *gen)
}
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. */
@ -667,14 +667,14 @@ gen_set_name(PyGenObject *op, PyObject *value)
}
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. */
@ -689,7 +689,7 @@ gen_set_qualname(PyGenObject *op, PyObject *value)
}
static PyObject *
gen_getyieldfrom(PyGenObject *gen)
gen_getyieldfrom(PyGenObject *gen, void *Py_UNUSED(ignored))
{
PyObject *yf = _PyGen_yf(gen);
if (yf == NULL)
@ -926,7 +926,7 @@ coro_await(PyCoroObject *coro)
}
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)