Issue #22156: Fix "comparison between signed and unsigned integers" compiler

warnings in the Objects/ subdirectory.

PyType_FromSpecWithBases() and PyType_FromSpec() now reject explicitly negative
slot identifiers.
This commit is contained in:
Victor Stinner 2014-08-15 23:17:38 +02:00
parent 98ea54c35c
commit 12174a5dca
5 changed files with 13 additions and 12 deletions

View file

@ -5094,13 +5094,13 @@ _PyLong_Init(void)
* to the original refcnt + 1 */
Py_REFCNT(op) = refcnt + 1;
assert(Py_SIZE(op) == size);
assert(v->ob_digit[0] == abs(ival));
assert(v->ob_digit[0] == (digit)abs(ival));
}
else {
(void)PyObject_INIT(v, &PyLong_Type);
}
Py_SIZE(v) = size;
v->ob_digit[0] = abs(ival);
v->ob_digit[0] = (digit)abs(ival);
}
#endif
/* initialize int_info */