diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-03 19:42:14 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 19:42:14 (GMT) |
commit | 804f2529d8e545a8d59eaf260ee032d014e681ba (patch) | |
tree | aab0f479960e57753df3789313363dd0e3e6bafc /Objects/dictobject.c | |
parent | 551d02b3e697098236bb3a6e0a855b2ad8dc0424 (diff) | |
download | cpython-804f2529d8e545a8d59eaf260ee032d014e681ba.zip cpython-804f2529d8e545a8d59eaf260ee032d014e681ba.tar.gz cpython-804f2529d8e545a8d59eaf260ee032d014e681ba.tar.bz2 |
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")
Diffstat (limited to 'Objects/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 88addfd..8a93ae9 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -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 */ }; |