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")
This commit is contained in:
Victor Stinner 2022-05-03 21:42:14 +02:00 committed by GitHub
parent 551d02b3e6
commit 804f2529d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 146 additions and 146 deletions

View file

@ -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},