summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-02-21 19:05:08 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-02-21 19:05:08 (GMT)
commit3d32664271bfda1e94f5f3ef5e712d5a5966bf1b (patch)
tree58a74e13138eb5fbdf64379561750917d41f56d7
parent97b67216d5dcceb74566fd770e9bb6790b5ea21a (diff)
downloadcpython-3d32664271bfda1e94f5f3ef5e712d5a5966bf1b.zip
cpython-3d32664271bfda1e94f5f3ef5e712d5a5966bf1b.tar.gz
cpython-3d32664271bfda1e94f5f3ef5e712d5a5966bf1b.tar.bz2
Fix issues on 32-bit systems introduced by r88460
-rw-r--r--Modules/zlibmodule.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c
index e439c5b..0189e77 100644
--- a/Modules/zlibmodule.c
+++ b/Modules/zlibmodule.c
@@ -951,10 +951,10 @@ PyZlib_adler32(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
/* Avoid truncation of length for very large buffers. adler32() takes
length as an unsigned int, which may be narrower than Py_ssize_t. */
- while (len > (Py_ssize_t)UINT_MAX) {
+ while (len > (size_t) UINT_MAX) {
adler32val = adler32(adler32val, buf, UINT_MAX);
- buf += UINT_MAX;
- len -= UINT_MAX;
+ buf += (size_t) UINT_MAX;
+ len -= (size_t) UINT_MAX;
}
adler32val = adler32(adler32val, buf, len);
Py_END_ALLOW_THREADS
@@ -989,10 +989,10 @@ PyZlib_crc32(PyObject *self, PyObject *args)
Py_BEGIN_ALLOW_THREADS
/* Avoid truncation of length for very large buffers. crc32() takes
length as an unsigned int, which may be narrower than Py_ssize_t. */
- while (len > (Py_ssize_t)UINT_MAX) {
+ while (len > (size_t) UINT_MAX) {
crc32val = crc32(crc32val, buf, UINT_MAX);
- buf += UINT_MAX;
- len -= UINT_MAX;
+ buf += (size_t) UINT_MAX;
+ len -= (size_t) UINT_MAX;
}
signed_val = crc32(crc32val, buf, len);
Py_END_ALLOW_THREADS