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

@ -1078,7 +1078,7 @@ warnings_warn_explicit(PyObject *self, PyObject *args, PyObject *kwds)
}
static PyObject *
warnings_filters_mutated(PyObject *self, PyObject *args)
warnings_filters_mutated(PyObject *self, PyObject *Py_UNUSED(args))
{
PyInterpreterState *interp = get_current_interp();
if (interp == NULL) {
@ -1353,9 +1353,9 @@ PyDoc_STRVAR(warn_explicit_doc,
static PyMethodDef warnings_functions[] = {
WARNINGS_WARN_METHODDEF
{"warn_explicit", (PyCFunction)(void(*)(void))warnings_warn_explicit,
{"warn_explicit", _PyCFunction_CAST(warnings_warn_explicit),
METH_VARARGS | METH_KEYWORDS, warn_explicit_doc},
{"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS,
{"_filters_mutated", _PyCFunction_CAST(warnings_filters_mutated), METH_NOARGS,
NULL},
/* XXX(brett.cannon): add showwarning? */
/* XXX(brett.cannon): Reasonable to add formatwarning? */