mirror of
https://github.com/python/cpython.git
synced 2025-09-12 11:46:52 +00:00
C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in a couple places
This commit is contained in:
parent
3fca463627
commit
429433b30b
6 changed files with 29 additions and 28 deletions
|
@ -419,7 +419,7 @@ _PyLong_NumBits(PyObject *vv)
|
|||
digit msd = v->ob_digit[ndigits - 1];
|
||||
|
||||
result = (ndigits - 1) * SHIFT;
|
||||
if (result / SHIFT != ndigits - 1)
|
||||
if (result / SHIFT != (size_t)(ndigits - 1))
|
||||
goto Overflow;
|
||||
do {
|
||||
++result;
|
||||
|
@ -953,7 +953,7 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
|
|||
|
||||
if (vv == NULL || !PyLong_Check(vv)) {
|
||||
PyErr_BadInternalCall();
|
||||
return -1;
|
||||
return (unsigned PY_LONG_LONG)-1;
|
||||
}
|
||||
|
||||
res = _PyLong_AsByteArray(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue