summaryrefslogtreecommitdiff
path: root/Modules/_xxsubinterpretersmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-05-03 21:42:14 +0200
committerGitHub <noreply@github.com>2022-05-03 21:42:14 +0200
commit804f2529d8e545a8d59eaf260ee032d014e681ba (patch)
treeaab0f479960e57753df3789313363dd0e3e6bafc /Modules/_xxsubinterpretersmodule.c
parent551d02b3e697098236bb3a6e0a855b2ad8dc0424 (diff)
downloadcpython-git-804f2529d8e545a8d59eaf260ee032d014e681ba.tar.gz
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/_xxsubinterpretersmodule.c')
-rw-r--r--Modules/_xxsubinterpretersmodule.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/Modules/_xxsubinterpretersmodule.c b/Modules/_xxsubinterpretersmodule.c
index 0e37ce0aa3..9b1f186c5b 100644
--- a/Modules/_xxsubinterpretersmodule.c
+++ b/Modules/_xxsubinterpretersmodule.c
@@ -2559,9 +2559,9 @@ channel__channel_id(PyObject *self, PyObject *args, PyObject *kwds)
}
static PyMethodDef module_functions[] = {
- {"create", (PyCFunction)(void(*)(void))interp_create,
+ {"create", _PyCFunction_CAST(interp_create),
METH_VARARGS | METH_KEYWORDS, create_doc},
- {"destroy", (PyCFunction)(void(*)(void))interp_destroy,
+ {"destroy", _PyCFunction_CAST(interp_destroy),
METH_VARARGS | METH_KEYWORDS, destroy_doc},
{"list_all", interp_list_all,
METH_NOARGS, list_all_doc},
@@ -2569,31 +2569,31 @@ static PyMethodDef module_functions[] = {
METH_NOARGS, get_current_doc},
{"get_main", interp_get_main,
METH_NOARGS, get_main_doc},
- {"is_running", (PyCFunction)(void(*)(void))interp_is_running,
+ {"is_running", _PyCFunction_CAST(interp_is_running),
METH_VARARGS | METH_KEYWORDS, is_running_doc},
- {"run_string", (PyCFunction)(void(*)(void))interp_run_string,
+ {"run_string", _PyCFunction_CAST(interp_run_string),
METH_VARARGS | METH_KEYWORDS, run_string_doc},
- {"is_shareable", (PyCFunction)(void(*)(void))object_is_shareable,
+ {"is_shareable", _PyCFunction_CAST(object_is_shareable),
METH_VARARGS | METH_KEYWORDS, is_shareable_doc},
{"channel_create", channel_create,
METH_NOARGS, channel_create_doc},
- {"channel_destroy", (PyCFunction)(void(*)(void))channel_destroy,
+ {"channel_destroy", _PyCFunction_CAST(channel_destroy),
METH_VARARGS | METH_KEYWORDS, channel_destroy_doc},
{"channel_list_all", channel_list_all,
METH_NOARGS, channel_list_all_doc},
- {"channel_list_interpreters", (PyCFunction)(void(*)(void))channel_list_interpreters,
+ {"channel_list_interpreters", _PyCFunction_CAST(channel_list_interpreters),
METH_VARARGS | METH_KEYWORDS, channel_list_interpreters_doc},
- {"channel_send", (PyCFunction)(void(*)(void))channel_send,
+ {"channel_send", _PyCFunction_CAST(channel_send),
METH_VARARGS | METH_KEYWORDS, channel_send_doc},
- {"channel_recv", (PyCFunction)(void(*)(void))channel_recv,
+ {"channel_recv", _PyCFunction_CAST(channel_recv),
METH_VARARGS | METH_KEYWORDS, channel_recv_doc},
- {"channel_close", (PyCFunction)(void(*)(void))channel_close,
+ {"channel_close", _PyCFunction_CAST(channel_close),
METH_VARARGS | METH_KEYWORDS, channel_close_doc},
- {"channel_release", (PyCFunction)(void(*)(void))channel_release,
+ {"channel_release", _PyCFunction_CAST(channel_release),
METH_VARARGS | METH_KEYWORDS, channel_release_doc},
- {"_channel_id", (PyCFunction)(void(*)(void))channel__channel_id,
+ {"_channel_id", _PyCFunction_CAST(channel__channel_id),
METH_VARARGS | METH_KEYWORDS, NULL},
{NULL, NULL} /* sentinel */