]> granicus.if.org Git - python/commitdiff
Silence a compiler warning by supplying the correct argument type to
authorRaymond Hettinger <python@rcn.com>
Tue, 28 Sep 2004 02:19:40 +0000 (02:19 +0000)
committerRaymond Hettinger <python@rcn.com>
Tue, 28 Sep 2004 02:19:40 +0000 (02:19 +0000)
the htons() function.

Modules/socketmodule.c

index 6054c1855f77eb4fd6ba324f066fccd73485b899..521a51fd8a0d5d3784f667668747fff63246e33e 100644 (file)
@@ -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);