]> granicus.if.org Git - python/commitdiff
do_mkvalue(), 'I' and 'k' cases: squash legitimate
authorTim Peters <tim.peters@gmail.com>
Sat, 24 Dec 2005 06:23:41 +0000 (06:23 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 24 Dec 2005 06:23:41 +0000 (06:23 +0000)
compiler warnings about mixing signed and unsigned types
in comparisons.

Python/modsupport.c

index e77cb3614aa83f638df7fd77397485b504c8216a..7241936fe92337d6c4e77bfa9109d6780a748113 100644 (file)
@@ -307,7 +307,7 @@ do_mkvalue(const char **p_format, va_list *p_va)
                {
                        unsigned int n;
                        n = va_arg(*p_va, unsigned int);
-                       if (n > PyInt_GetMax())
+                       if (n > (unsigned long)PyInt_GetMax())
                                return PyLong_FromUnsignedLong((unsigned long)n);
                        else
                                return PyInt_FromLong(n);
@@ -320,7 +320,7 @@ do_mkvalue(const char **p_format, va_list *p_va)
                {
                        unsigned long n;
                        n = va_arg(*p_va, unsigned long);
-                       if (n > PyInt_GetMax())
+                       if (n > (unsigned long)PyInt_GetMax())
                                return PyLong_FromUnsignedLong(n);
                        else
                                return PyInt_FromLong(n);