gh-91320: Use _PyCFunction_CAST() (#92251)

Replace "(PyCFunction)(void(*)(void))func" cast with
_PyCFunction_CAST(func).

Change generated by the command:

sed -i -e \
  's!(PyCFunction)(void(\*)(void)) *\([A-Za-z0-9_]\+\)!_PyCFunction_CAST(\1)!g' \
  $(find -name "*.c")
This commit is contained in:
Victor Stinner 2022-05-03 21:42:14 +02:00 committed by GitHub
parent 551d02b3e6
commit 804f2529d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 146 additions and 146 deletions

View file

@ -3655,9 +3655,9 @@ PyDoc_STRVAR(values__doc__,
static PyMethodDef mapp_methods[] = {
DICT___CONTAINS___METHODDEF
{"__getitem__", (PyCFunction)(void(*)(void))dict_subscript, METH_O | METH_COEXIST,
{"__getitem__", _PyCFunction_CAST(dict_subscript), METH_O | METH_COEXIST,
getitem__doc__},
{"__sizeof__", (PyCFunction)(void(*)(void))dict_sizeof, METH_NOARGS,
{"__sizeof__", _PyCFunction_CAST(dict_sizeof), METH_NOARGS,
sizeof__doc__},
DICT_GET_METHODDEF
DICT_SETDEFAULT_METHODDEF
@ -3669,7 +3669,7 @@ static PyMethodDef mapp_methods[] = {
items__doc__},
{"values", dictvalues_new, METH_NOARGS,
values__doc__},
{"update", (PyCFunction)(void(*)(void))dict_update, METH_VARARGS | METH_KEYWORDS,
{"update", _PyCFunction_CAST(dict_update), METH_VARARGS | METH_KEYWORDS,
update__doc__},
DICT_FROMKEYS_METHODDEF
{"clear", (PyCFunction)dict_clear, METH_NOARGS,
@ -4026,9 +4026,9 @@ dictiter_reduce(dictiterobject *di, PyObject *Py_UNUSED(ignored));
PyDoc_STRVAR(reduce_doc, "Return state information for pickling.");
static PyMethodDef dictiter_methods[] = {
{"__length_hint__", (PyCFunction)(void(*)(void))dictiter_len, METH_NOARGS,
{"__length_hint__", _PyCFunction_CAST(dictiter_len), METH_NOARGS,
length_hint_doc},
{"__reduce__", (PyCFunction)(void(*)(void))dictiter_reduce, METH_NOARGS,
{"__reduce__", _PyCFunction_CAST(dictiter_reduce), METH_NOARGS,
reduce_doc},
{NULL, NULL} /* sentinel */
};
@ -5079,7 +5079,7 @@ PyDoc_STRVAR(reversed_keys_doc,
static PyMethodDef dictkeys_methods[] = {
{"isdisjoint", (PyCFunction)dictviews_isdisjoint, METH_O,
isdisjoint_doc},
{"__reversed__", (PyCFunction)(void(*)(void))dictkeys_reversed, METH_NOARGS,
{"__reversed__", _PyCFunction_CAST(dictkeys_reversed), METH_NOARGS,
reversed_keys_doc},
{NULL, NULL} /* sentinel */
};