Mercurial > cpython-lru_cache-weakref
diff Modules/socketmodule.c @ 33606:4d7b0d206bc7 legacy-trunk
Silence a compiler warning by supplying the correct argument type to
the htons() function.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Tue, 28 Sep 2004 02:19:40 +0000 |
| parents | 1b3ac674a57c |
| children | b0ec4c9d595b |
line wrap: on
line diff
--- a/Modules/socketmodule.c Tue Sep 28 01:51:35 2004 +0000 +++ b/Modules/socketmodule.c Tue Sep 28 02:19:40 2004 +0000 @@ -2944,10 +2944,10 @@ static PyObject * socket_getservbyport(PyObject *self, PyObject *args) { - int port; + unsigned short port; char *proto=NULL; struct servent *sp; - if (!PyArg_ParseTuple(args, "i|s:getservbyport", &port, &proto)) + if (!PyArg_ParseTuple(args, "H|s:getservbyport", &port, &proto)) return NULL; Py_BEGIN_ALLOW_THREADS sp = getservbyport(htons(port), proto);
