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 /Tools/peg_generator | |
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 'Tools/peg_generator')
-rw-r--r-- | Tools/peg_generator/peg_extension/peg_extension.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tools/peg_generator/peg_extension/peg_extension.c b/Tools/peg_generator/peg_extension/peg_extension.c index bb4c1b0..3ebb7bd 100644 --- a/Tools/peg_generator/peg_extension/peg_extension.c +++ b/Tools/peg_generator/peg_extension/peg_extension.c @@ -151,8 +151,8 @@ dump_memo_stats(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(ignored)) } static PyMethodDef ParseMethods[] = { - {"parse_file", (PyCFunction)(void(*)(void))parse_file, METH_VARARGS|METH_KEYWORDS, "Parse a file."}, - {"parse_string", (PyCFunction)(void(*)(void))parse_string, METH_VARARGS|METH_KEYWORDS, "Parse a string."}, + {"parse_file", _PyCFunction_CAST(parse_file), METH_VARARGS|METH_KEYWORDS, "Parse a file."}, + {"parse_string", _PyCFunction_CAST(parse_string), METH_VARARGS|METH_KEYWORDS, "Parse a string."}, {"clear_memo_stats", clear_memo_stats, METH_NOARGS}, {"dump_memo_stats", dump_memo_stats, METH_NOARGS}, {"get_memo_stats", get_memo_stats, METH_NOARGS}, |