mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Use METH_VARARGS instead of numeric constant 1 in method def. tables
This commit is contained in:
parent
14f515844d
commit
e365fb8d1f
12 changed files with 178 additions and 107 deletions
|
@ -1344,49 +1344,49 @@ of the socket (flag == 1), or both ends (flag == 2).";
|
|||
/* List of methods for socket objects */
|
||||
|
||||
static PyMethodDef PySocketSock_methods[] = {
|
||||
{"accept", (PyCFunction)PySocketSock_accept, 1,
|
||||
{"accept", (PyCFunction)PySocketSock_accept, METH_VARARGS,
|
||||
accept_doc},
|
||||
{"bind", (PyCFunction)PySocketSock_bind, 1,
|
||||
{"bind", (PyCFunction)PySocketSock_bind, METH_VARARGS,
|
||||
bind_doc},
|
||||
{"close", (PyCFunction)PySocketSock_close, 1,
|
||||
{"close", (PyCFunction)PySocketSock_close, METH_VARARGS,
|
||||
close_doc},
|
||||
{"connect", (PyCFunction)PySocketSock_connect, 1,
|
||||
{"connect", (PyCFunction)PySocketSock_connect, METH_VARARGS,
|
||||
connect_doc},
|
||||
{"connect_ex", (PyCFunction)PySocketSock_connect_ex, 1,
|
||||
{"connect_ex", (PyCFunction)PySocketSock_connect_ex, METH_VARARGS,
|
||||
connect_ex_doc},
|
||||
#ifndef NO_DUP
|
||||
{"dup", (PyCFunction)PySocketSock_dup, 1,
|
||||
{"dup", (PyCFunction)PySocketSock_dup, METH_VARARGS,
|
||||
dup_doc},
|
||||
#endif
|
||||
{"fileno", (PyCFunction)PySocketSock_fileno, 1,
|
||||
{"fileno", (PyCFunction)PySocketSock_fileno, METH_VARARGS,
|
||||
fileno_doc},
|
||||
#ifdef HAVE_GETPEERNAME
|
||||
{"getpeername", (PyCFunction)PySocketSock_getpeername, 1,
|
||||
{"getpeername", (PyCFunction)PySocketSock_getpeername, METH_VARARGS,
|
||||
getpeername_doc},
|
||||
#endif
|
||||
{"getsockname", (PyCFunction)PySocketSock_getsockname, 1,
|
||||
{"getsockname", (PyCFunction)PySocketSock_getsockname, METH_VARARGS,
|
||||
getsockname_doc},
|
||||
{"getsockopt", (PyCFunction)PySocketSock_getsockopt, 1,
|
||||
{"getsockopt", (PyCFunction)PySocketSock_getsockopt, METH_VARARGS,
|
||||
getsockopt_doc},
|
||||
{"listen", (PyCFunction)PySocketSock_listen, 1,
|
||||
{"listen", (PyCFunction)PySocketSock_listen, METH_VARARGS,
|
||||
listen_doc},
|
||||
#ifndef NO_DUP
|
||||
{"makefile", (PyCFunction)PySocketSock_makefile, 1,
|
||||
{"makefile", (PyCFunction)PySocketSock_makefile, METH_VARARGS,
|
||||
makefile_doc},
|
||||
#endif
|
||||
{"recv", (PyCFunction)PySocketSock_recv, 1,
|
||||
{"recv", (PyCFunction)PySocketSock_recv, METH_VARARGS,
|
||||
recv_doc},
|
||||
{"recvfrom", (PyCFunction)PySocketSock_recvfrom, 1,
|
||||
{"recvfrom", (PyCFunction)PySocketSock_recvfrom, METH_VARARGS,
|
||||
recvfrom_doc},
|
||||
{"send", (PyCFunction)PySocketSock_send, 1,
|
||||
{"send", (PyCFunction)PySocketSock_send, METH_VARARGS,
|
||||
send_doc},
|
||||
{"sendto", (PyCFunction)PySocketSock_sendto, 1,
|
||||
{"sendto", (PyCFunction)PySocketSock_sendto, METH_VARARGS,
|
||||
sendto_doc},
|
||||
{"setblocking", (PyCFunction)PySocketSock_setblocking, 1,
|
||||
{"setblocking", (PyCFunction)PySocketSock_setblocking, METH_VARARGS,
|
||||
setblocking_doc},
|
||||
{"setsockopt", (PyCFunction)PySocketSock_setsockopt, 1,
|
||||
{"setsockopt", (PyCFunction)PySocketSock_setsockopt, METH_VARARGS,
|
||||
setsockopt_doc},
|
||||
{"shutdown", (PyCFunction)PySocketSock_shutdown, 1,
|
||||
{"shutdown", (PyCFunction)PySocketSock_shutdown, METH_VARARGS,
|
||||
shutdown_doc},
|
||||
{NULL, NULL} /* sentinel */
|
||||
};
|
||||
|
@ -2199,24 +2199,39 @@ static PyObject *SSL_SSLread(SSLObject *self, PyObject *args)
|
|||
/* List of functions exported by this module. */
|
||||
|
||||
static PyMethodDef PySocket_methods[] = {
|
||||
{"gethostbyname", PySocket_gethostbyname, 1, gethostbyname_doc},
|
||||
{"gethostbyname_ex", PySocket_gethostbyname_ex, 1, ghbn_ex_doc},
|
||||
{"gethostbyaddr", PySocket_gethostbyaddr, 1, gethostbyaddr_doc},
|
||||
{"gethostname", PySocket_gethostname, 1, gethostname_doc},
|
||||
{"getservbyname", PySocket_getservbyname, 1, getservbyname_doc},
|
||||
{"getprotobyname", PySocket_getprotobyname, 1,getprotobyname_doc},
|
||||
{"socket", PySocket_socket, 1, socket_doc},
|
||||
{"gethostbyname", PySocket_gethostbyname,
|
||||
METH_VARARGS, gethostbyname_doc},
|
||||
{"gethostbyname_ex", PySocket_gethostbyname_ex,
|
||||
METH_VARARGS, ghbn_ex_doc},
|
||||
{"gethostbyaddr", PySocket_gethostbyaddr,
|
||||
METH_VARARGS, gethostbyaddr_doc},
|
||||
{"gethostname", PySocket_gethostname,
|
||||
METH_VARARGS, gethostname_doc},
|
||||
{"getservbyname", PySocket_getservbyname,
|
||||
METH_VARARGS, getservbyname_doc},
|
||||
{"getprotobyname", PySocket_getprotobyname,
|
||||
METH_VARARGS,getprotobyname_doc},
|
||||
{"socket", PySocket_socket,
|
||||
METH_VARARGS, socket_doc},
|
||||
#ifndef NO_DUP
|
||||
{"fromfd", PySocket_fromfd, 1, fromfd_doc},
|
||||
{"fromfd", PySocket_fromfd,
|
||||
METH_VARARGS, fromfd_doc},
|
||||
#endif
|
||||
{"ntohs", PySocket_ntohs, 1, ntohs_doc},
|
||||
{"ntohl", PySocket_ntohl, 1, ntohl_doc},
|
||||
{"htons", PySocket_htons, 1, htons_doc},
|
||||
{"htonl", PySocket_htonl, 1, htonl_doc},
|
||||
{"inet_aton", PySocket_inet_aton, 1, inet_aton_doc},
|
||||
{"inet_ntoa", PySocket_inet_ntoa, 1, inet_ntoa_doc},
|
||||
{"ntohs", PySocket_ntohs,
|
||||
METH_VARARGS, ntohs_doc},
|
||||
{"ntohl", PySocket_ntohl,
|
||||
METH_VARARGS, ntohl_doc},
|
||||
{"htons", PySocket_htons,
|
||||
METH_VARARGS, htons_doc},
|
||||
{"htonl", PySocket_htonl,
|
||||
METH_VARARGS, htonl_doc},
|
||||
{"inet_aton", PySocket_inet_aton,
|
||||
METH_VARARGS, inet_aton_doc},
|
||||
{"inet_ntoa", PySocket_inet_ntoa,
|
||||
METH_VARARGS, inet_ntoa_doc},
|
||||
#ifdef USE_SSL
|
||||
{"ssl", PySocket_ssl, 1, ssl_doc},
|
||||
{"ssl", PySocket_ssl,
|
||||
METH_VARARGS, ssl_doc},
|
||||
#endif /* USE_SSL */
|
||||
{NULL, NULL} /* Sentinel */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue