summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-03 19:42:14 (GMT)
committerGitHub <noreply@github.com>2022-05-03 19:42:14 (GMT)
commit804f2529d8e545a8d59eaf260ee032d014e681ba (patch)
treeaab0f479960e57753df3789313363dd0e3e6bafc /Modules/faulthandler.c
parent551d02b3e697098236bb3a6e0a855b2ad8dc0424 (diff)
downloadcpython-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 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index 4f709ed..08c4083 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -1229,7 +1229,7 @@ PyDoc_STRVAR(module_doc,
static PyMethodDef module_methods[] = {
{"enable",
- (PyCFunction)(void(*)(void))faulthandler_py_enable, METH_VARARGS|METH_KEYWORDS,
+ _PyCFunction_CAST(faulthandler_py_enable), METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("enable(file=sys.stderr, all_threads=True): "
"enable the fault handler")},
{"disable", faulthandler_disable_py, METH_NOARGS,
@@ -1237,12 +1237,12 @@ static PyMethodDef module_methods[] = {
{"is_enabled", faulthandler_is_enabled, METH_NOARGS,
PyDoc_STR("is_enabled()->bool: check if the handler is enabled")},
{"dump_traceback",
- (PyCFunction)(void(*)(void))faulthandler_dump_traceback_py, METH_VARARGS|METH_KEYWORDS,
+ _PyCFunction_CAST(faulthandler_dump_traceback_py), METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("dump_traceback(file=sys.stderr, all_threads=True): "
"dump the traceback of the current thread, or of all threads "
"if all_threads is True, into file")},
{"dump_traceback_later",
- (PyCFunction)(void(*)(void))faulthandler_dump_traceback_later, METH_VARARGS|METH_KEYWORDS,
+ _PyCFunction_CAST(faulthandler_dump_traceback_later), METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("dump_traceback_later(timeout, repeat=False, file=sys.stderrn, exit=False):\n"
"dump the traceback of all threads in timeout seconds,\n"
"or each timeout seconds if repeat is True. If exit is True, "
@@ -1253,13 +1253,13 @@ static PyMethodDef module_methods[] = {
"to dump_traceback_later().")},
#ifdef FAULTHANDLER_USER
{"register",
- (PyCFunction)(void(*)(void))faulthandler_register_py, METH_VARARGS|METH_KEYWORDS,
+ _PyCFunction_CAST(faulthandler_register_py), METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("register(signum, file=sys.stderr, all_threads=True, chain=False): "
"register a handler for the signal 'signum': dump the "
"traceback of the current thread, or of all threads if "
"all_threads is True, into file")},
{"unregister",
- (PyCFunction)(void(*)(void))faulthandler_unregister_py, METH_VARARGS|METH_KEYWORDS,
+ _PyCFunction_CAST(faulthandler_unregister_py), METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("unregister(signum): unregister the handler of the signal "
"'signum' registered by register()")},
#endif