diff options
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index c7a0751202..30001754fe 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2504,7 +2504,7 @@ sock_accept_impl(PySocketSockObject *s, void *data) /* s._accept() -> (fd, address) */ static PyObject * -sock_accept(PySocketSockObject *s) +sock_accept(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { sock_addr_t addrbuf; SOCKET_T newfd; @@ -2605,7 +2605,7 @@ setblocking(False) is equivalent to settimeout(0.0)."); False if it is in non-blocking mode. */ static PyObject * -sock_getblocking(PySocketSockObject *s) +sock_getblocking(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { if (s->sock_timeout) { Py_RETURN_TRUE; @@ -2717,7 +2717,7 @@ Setting a timeout of zero is the same as setblocking(0)."); /* s.gettimeout() method. Returns the timeout associated with a socket. */ static PyObject * -sock_gettimeout(PySocketSockObject *s) +sock_gettimeout(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { if (s->sock_timeout < 0) { Py_RETURN_NONE; @@ -2930,7 +2930,7 @@ sockets the address is a tuple (ifname, proto [,pkttype [,hatype]])"); will surely fail. */ static PyObject * -sock_close(PySocketSockObject *s) +sock_close(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { SOCKET_T fd; int res; @@ -2961,7 +2961,7 @@ PyDoc_STRVAR(sock_close_doc, Close the socket. It cannot be used after this call."); static PyObject * -sock_detach(PySocketSockObject *s) +sock_detach(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { SOCKET_T fd = s->sock_fd; s->sock_fd = INVALID_SOCKET; @@ -3117,7 +3117,7 @@ instead of raising an exception when an error occurs."); /* s.fileno() method */ static PyObject * -sock_fileno(PySocketSockObject *s) +sock_fileno(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { return PyLong_FromSocket_t(s->sock_fd); } @@ -3131,7 +3131,7 @@ Return the integer file descriptor of the socket."); /* s.getsockname() method */ static PyObject * -sock_getsockname(PySocketSockObject *s) +sock_getsockname(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { sock_addr_t addrbuf; int res; @@ -3160,7 +3160,7 @@ info is a pair (hostaddr, port)."); /* s.getpeername() method */ static PyObject * -sock_getpeername(PySocketSockObject *s) +sock_getpeername(PySocketSockObject *s, PyObject *Py_UNUSED(ignored)) { sock_addr_t addrbuf; int res; @@ -6390,7 +6390,7 @@ Get host and port for a sockaddr."); /* Python API to getting and setting the default timeout value. */ static PyObject * -socket_getdefaulttimeout(PyObject *self) +socket_getdefaulttimeout(PyObject *self, PyObject *Py_UNUSED(ignored)) { if (defaulttimeout < 0) { Py_RETURN_NONE; @@ -6639,7 +6639,7 @@ static PyMethodDef socket_methods[] = { METH_VARARGS | METH_KEYWORDS, getaddrinfo_doc}, {"getnameinfo", socket_getnameinfo, METH_VARARGS, getnameinfo_doc}, - {"getdefaulttimeout", (PyCFunction)socket_getdefaulttimeout, + {"getdefaulttimeout", socket_getdefaulttimeout, METH_NOARGS, getdefaulttimeout_doc}, {"setdefaulttimeout", socket_setdefaulttimeout, METH_O, setdefaulttimeout_doc}, |