Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 35c3f4f

Browse files
committed
do_mkvalue(), 'I' and 'k' cases: squash legitimate
compiler warnings about mixing signed and unsigned types in comparisons.
1 parent c3d12ac commit 35c3f4f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Python/modsupport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ do_mkvalue(const char **p_format, va_list *p_va)
307307
{
308308
unsigned int n;
309309
n = va_arg(*p_va, unsigned int);
310-
if (n > PyInt_GetMax())
310+
if (n > (unsigned long)PyInt_GetMax())
311311
return PyLong_FromUnsignedLong((unsigned long)n);
312312
else
313313
return PyInt_FromLong(n);
@@ -320,7 +320,7 @@ do_mkvalue(const char **p_format, va_list *p_va)
320320
{
321321
unsigned long n;
322322
n = va_arg(*p_va, unsigned long);
323-
if (n > PyInt_GetMax())
323+
if (n > (unsigned long)PyInt_GetMax())
324324
return PyLong_FromUnsignedLong(n);
325325
else
326326
return PyInt_FromLong(n);

0 commit comments

Comments
 (0)