summaryrefslogtreecommitdiff
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-11-27 09:58:07 -0800
committerGitHub <noreply@github.com>2018-11-27 09:58:07 -0800
commit5ceb7018dc63fab96f81d05e62bbe704e9f10cb9 (patch)
tree0cb8b6b5a3f6652b41b83003afa04a433f631385 /Objects/funcobject.c
parentd669154ee52048f98ac63ba177f3fd1cf62f0174 (diff)
downloadcpython-git-5ceb7018dc63fab96f81d05e62bbe704e9f10cb9.tar.gz
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>
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index 241685d5b7..413a590f17 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -242,14 +242,14 @@ static PyMemberDef func_memberlist[] = {
};
static PyObject *
-func_get_code(PyFunctionObject *op)
+func_get_code(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
Py_INCREF(op->func_code);
return op->func_code;
}
static int
-func_set_code(PyFunctionObject *op, PyObject *value)
+func_set_code(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
Py_ssize_t nfree, nclosure;
@@ -277,14 +277,14 @@ func_set_code(PyFunctionObject *op, PyObject *value)
}
static PyObject *
-func_get_name(PyFunctionObject *op)
+func_get_name(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
Py_INCREF(op->func_name);
return op->func_name;
}
static int
-func_set_name(PyFunctionObject *op, PyObject *value)
+func_set_name(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
/* Not legal to del f.func_name or to set it to anything
* other than a string object. */
@@ -299,14 +299,14 @@ func_set_name(PyFunctionObject *op, PyObject *value)
}
static PyObject *
-func_get_qualname(PyFunctionObject *op)
+func_get_qualname(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
Py_INCREF(op->func_qualname);
return op->func_qualname;
}
static int
-func_set_qualname(PyFunctionObject *op, PyObject *value)
+func_set_qualname(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
/* Not legal to del f.__qualname__ or to set it to anything
* other than a string object. */
@@ -321,7 +321,7 @@ func_set_qualname(PyFunctionObject *op, PyObject *value)
}
static PyObject *
-func_get_defaults(PyFunctionObject *op)
+func_get_defaults(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
if (op->func_defaults == NULL) {
Py_RETURN_NONE;
@@ -331,7 +331,7 @@ func_get_defaults(PyFunctionObject *op)
}
static int
-func_set_defaults(PyFunctionObject *op, PyObject *value)
+func_set_defaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
/* Legal to del f.func_defaults.
* Can only set func_defaults to NULL or a tuple. */
@@ -348,7 +348,7 @@ func_set_defaults(PyFunctionObject *op, PyObject *value)
}
static PyObject *
-func_get_kwdefaults(PyFunctionObject *op)
+func_get_kwdefaults(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
if (op->func_kwdefaults == NULL) {
Py_RETURN_NONE;
@@ -358,7 +358,7 @@ func_get_kwdefaults(PyFunctionObject *op)
}
static int
-func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
+func_set_kwdefaults(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
if (value == Py_None)
value = NULL;
@@ -375,7 +375,7 @@ func_set_kwdefaults(PyFunctionObject *op, PyObject *value)
}
static PyObject *
-func_get_annotations(PyFunctionObject *op)
+func_get_annotations(PyFunctionObject *op, void *Py_UNUSED(ignored))
{
if (op->func_annotations == NULL) {
op->func_annotations = PyDict_New();
@@ -387,7 +387,7 @@ func_get_annotations(PyFunctionObject *op)
}
static int
-func_set_annotations(PyFunctionObject *op, PyObject *value)
+func_set_annotations(PyFunctionObject *op, PyObject *value, void *Py_UNUSED(ignored))
{
if (value == Py_None)
value = NULL;