summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2022-03-31 08:02:34 (GMT)
committerGitHub <noreply@github.com>2022-03-31 08:02:34 (GMT)
commitf0bc69485677ae8973685866ada0982976d3878f (patch)
tree0d64ad8e39f8e7ad7835d87416b8f6bf9c3d4460 /Python/sysmodule.c
parentc14d7e4b816134b8e93ece4066a86d229631ce96 (diff)
downloadcpython-f0bc69485677ae8973685866ada0982976d3878f.zip
cpython-f0bc69485677ae8973685866ada0982976d3878f.tar.gz
cpython-f0bc69485677ae8973685866ada0982976d3878f.tar.bz2
bpo-47164: Add _PyCFunction_CAST() macro (GH-32192)
Use the macro in C files of the Python/ directory.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 6322af5..5765e9e 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1929,8 +1929,8 @@ sys_getandroidapilevel_impl(PyObject *module)
static PyMethodDef sys_methods[] = {
/* Might as well keep this in alphabetic order */
SYS_ADDAUDITHOOK_METHODDEF
- {"audit", (PyCFunction)(void(*)(void))sys_audit, METH_FASTCALL, audit_doc },
- {"breakpointhook", (PyCFunction)(void(*)(void))sys_breakpointhook,
+ {"audit", _PyCFunction_CAST(sys_audit), METH_FASTCALL, audit_doc },
+ {"breakpointhook", _PyCFunction_CAST(sys_breakpointhook),
METH_FASTCALL | METH_KEYWORDS, breakpointhook_doc},
SYS__CLEAR_TYPE_CACHE_METHODDEF
SYS__CURRENT_FRAMES_METHODDEF
@@ -1944,18 +1944,18 @@ static PyMethodDef sys_methods[] = {
SYS_GETDLOPENFLAGS_METHODDEF
SYS_GETALLOCATEDBLOCKS_METHODDEF
#ifdef Py_STATS
- {"getdxp", _Py_GetDXProfile, METH_VARARGS},
+ {"getdxp", _Py_GetDXProfile, METH_VARARGS},
#endif
SYS_GETFILESYSTEMENCODING_METHODDEF
SYS_GETFILESYSTEMENCODEERRORS_METHODDEF
SYS__GETQUICKENEDCOUNT_METHODDEF
#ifdef Py_TRACE_REFS
- {"getobjects", _Py_GetObjects, METH_VARARGS},
+ {"getobjects", _Py_GetObjects, METH_VARARGS},
#endif
SYS_GETTOTALREFCOUNT_METHODDEF
SYS_GETREFCOUNT_METHODDEF
SYS_GETRECURSIONLIMIT_METHODDEF
- {"getsizeof", (PyCFunction)(void(*)(void))sys_getsizeof,
+ {"getsizeof", _PyCFunction_CAST(sys_getsizeof),
METH_VARARGS | METH_KEYWORDS, getsizeof_doc},
SYS__GETFRAME_METHODDEF
SYS_GETWINDOWSVERSION_METHODDEF
@@ -1966,21 +1966,21 @@ static PyMethodDef sys_methods[] = {
SYS_SETSWITCHINTERVAL_METHODDEF
SYS_GETSWITCHINTERVAL_METHODDEF
SYS_SETDLOPENFLAGS_METHODDEF
- {"setprofile", sys_setprofile, METH_O, setprofile_doc},
+ {"setprofile", sys_setprofile, METH_O, setprofile_doc},
SYS_GETPROFILE_METHODDEF
SYS_SETRECURSIONLIMIT_METHODDEF
- {"settrace", sys_settrace, METH_O, settrace_doc},
+ {"settrace", sys_settrace, METH_O, settrace_doc},
SYS_GETTRACE_METHODDEF
SYS_CALL_TRACING_METHODDEF
SYS__DEBUGMALLOCSTATS_METHODDEF
SYS_SET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF
SYS_GET_COROUTINE_ORIGIN_TRACKING_DEPTH_METHODDEF
- {"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks,
+ {"set_asyncgen_hooks", _PyCFunction_CAST(sys_set_asyncgen_hooks),
METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc},
SYS_GET_ASYNCGEN_HOOKS_METHODDEF
SYS_GETANDROIDAPILEVEL_METHODDEF
SYS_UNRAISABLEHOOK_METHODDEF
- {NULL, NULL} /* sentinel */
+ {NULL, NULL} // sentinel
};