From: Raymond Hettinger Date: Tue, 28 Sep 2004 02:19:40 +0000 (+0000) Subject: Silence a compiler warning by supplying the correct argument type to X-Git-Tag: v2.4b1~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87de0ca74131e9edf4c2816c7428c60af8dd2ea3;p=python Silence a compiler warning by supplying the correct argument type to the htons() function. --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 6054c1855f..521a51fd8a 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2944,10 +2944,10 @@ otherwise any protocol will match."); 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);