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 /Modules/socketmodule.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 'Modules/socketmodule.c')
| -rw-r--r-- | Modules/socketmodule.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index c650b25..bedb8bb 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -4947,11 +4947,11 @@ static PyMethodDef sock_methods[] = { listen_doc}, {"recv", (PyCFunction)sock_recv, METH_VARARGS, recv_doc}, - {"recv_into", (PyCFunction)(void(*)(void))sock_recv_into, METH_VARARGS | METH_KEYWORDS, + {"recv_into", _PyCFunction_CAST(sock_recv_into), METH_VARARGS | METH_KEYWORDS, recv_into_doc}, {"recvfrom", (PyCFunction)sock_recvfrom, METH_VARARGS, recvfrom_doc}, - {"recvfrom_into", (PyCFunction)(void(*)(void))sock_recvfrom_into, METH_VARARGS | METH_KEYWORDS, + {"recvfrom_into", _PyCFunction_CAST(sock_recvfrom_into), METH_VARARGS | METH_KEYWORDS, recvfrom_into_doc}, {"send", (PyCFunction)sock_send, METH_VARARGS, send_doc}, @@ -4982,7 +4982,7 @@ static PyMethodDef sock_methods[] = { sendmsg_doc}, #endif #ifdef HAVE_SOCKADDR_ALG - {"sendmsg_afalg", (PyCFunction)(void(*)(void))sock_sendmsg_afalg, METH_VARARGS | METH_KEYWORDS, + {"sendmsg_afalg", _PyCFunction_CAST(sock_sendmsg_afalg), METH_VARARGS | METH_KEYWORDS, sendmsg_afalg_doc}, #endif {NULL, NULL} /* sentinel */ @@ -6970,7 +6970,7 @@ static PyMethodDef socket_methods[] = { {"inet_ntop", socket_inet_ntop, METH_VARARGS, inet_ntop_doc}, #endif - {"getaddrinfo", (PyCFunction)(void(*)(void))socket_getaddrinfo, + {"getaddrinfo", _PyCFunction_CAST(socket_getaddrinfo), METH_VARARGS | METH_KEYWORDS, getaddrinfo_doc}, {"getnameinfo", socket_getnameinfo, METH_VARARGS, getnameinfo_doc}, |
