Commit bc8ccce7 authored by Victor Stinner's avatar Victor Stinner

Issue #9566: zlib: Explicit cast to unsigned int to fix a compiler warning on Windows x64

parent 9a282975
......@@ -1094,10 +1094,10 @@ PyZlib_adler32(PyObject *self, PyObject *args)
buf += (size_t) UINT_MAX;
len -= (size_t) UINT_MAX;
}
adler32val = adler32(adler32val, buf, len);
adler32val = adler32(adler32val, buf, (unsigned int)len);
Py_END_ALLOW_THREADS
} else {
adler32val = adler32(adler32val, pbuf.buf, pbuf.len);
adler32val = adler32(adler32val, pbuf.buf, (unsigned int)pbuf.len);
}
PyBuffer_Release(&pbuf);
return PyLong_FromUnsignedLong(adler32val & 0xffffffffU);
......@@ -1132,10 +1132,10 @@ PyZlib_crc32(PyObject *self, PyObject *args)
buf += (size_t) UINT_MAX;
len -= (size_t) UINT_MAX;
}
signed_val = crc32(crc32val, buf, len);
signed_val = crc32(crc32val, buf, (unsigned int)len);
Py_END_ALLOW_THREADS
} else {
signed_val = crc32(crc32val, pbuf.buf, pbuf.len);
signed_val = crc32(crc32val, pbuf.buf, (unsigned int)pbuf.len);
}
PyBuffer_Release(&pbuf);
return PyLong_FromUnsignedLong(signed_val & 0xffffffffU);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment