bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)

Use the macro in C files of the Python/ directory.
This commit is contained in:
Victor Stinner 2022-03-31 10:02:34 +02:00 committed by GitHub
parent c14d7e4b81
commit f0bc694856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 36 deletions

View file

@ -2845,14 +2845,14 @@ hamt_py_values(PyHamtObject *self, PyObject *args)
}
static PyObject *
hamt_py_keys(PyHamtObject *self, PyObject *args)
hamt_py_keys(PyHamtObject *self, PyObject *Py_UNUSED(args))
{
return _PyHamt_NewIterKeys(self);
}
#ifdef Py_DEBUG
static PyObject *
hamt_py_dump(PyHamtObject *self, PyObject *args)
hamt_py_dump(PyHamtObject *self, PyObject *Py_UNUSED(args))
{
return hamt_dump(self);
}
@ -2860,14 +2860,14 @@ hamt_py_dump(PyHamtObject *self, PyObject *args)
static PyMethodDef PyHamt_methods[] = {
{"set", (PyCFunction)hamt_py_set, METH_VARARGS, NULL},
{"get", (PyCFunction)hamt_py_get, METH_VARARGS, NULL},
{"delete", (PyCFunction)hamt_py_delete, METH_O, NULL},
{"items", (PyCFunction)hamt_py_items, METH_NOARGS, NULL},
{"keys", (PyCFunction)hamt_py_keys, METH_NOARGS, NULL},
{"values", (PyCFunction)hamt_py_values, METH_NOARGS, NULL},
{"set", _PyCFunction_CAST(hamt_py_set), METH_VARARGS, NULL},
{"get", _PyCFunction_CAST(hamt_py_get), METH_VARARGS, NULL},
{"delete", _PyCFunction_CAST(hamt_py_delete), METH_O, NULL},
{"items", _PyCFunction_CAST(hamt_py_items), METH_NOARGS, NULL},
{"keys", _PyCFunction_CAST(hamt_py_keys), METH_NOARGS, NULL},
{"values", _PyCFunction_CAST(hamt_py_values), METH_NOARGS, NULL},
#ifdef Py_DEBUG
{"__dump__", (PyCFunction)hamt_py_dump, METH_NOARGS, NULL},
{"__dump__", _PyCFunction_CAST(hamt_py_dump), METH_NOARGS, NULL},
#endif
{NULL, NULL}
};