mirror of
https://github.com/python/cpython.git
synced 2025-09-02 06:57:58 +00:00
bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)
Use the macro in C files of the Python/ directory.
This commit is contained in:
parent
c14d7e4b81
commit
f0bc694856
8 changed files with 57 additions and 36 deletions
|
@ -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? */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue