diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-03-23 20:31:23 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-03-23 20:31:23 (GMT) |
commit | 73f57b0c058debbcb05e9fefd33897ddaaae5b6f (patch) | |
tree | 1fab41668c7059c5f9268992b61f4a40bf86d486 | |
parent | c4f7bab0a0cd208bcab3c4f6cd8324ed8d08f98e (diff) | |
download | cpython-73f57b0c058debbcb05e9fefd33897ddaaae5b6f.zip cpython-73f57b0c058debbcb05e9fefd33897ddaaae5b6f.tar.gz cpython-73f57b0c058debbcb05e9fefd33897ddaaae5b6f.tar.bz2 |
Revert r61779 - It undid correct code and caused test_zlib to fail on all
platforms with a 64-bit long.
The Alpha/Tru64 test problem is a problem in either tarfile or test_tarfile,
not zlib.
crc32 and adler32 return 32-bit values. by using a long thats larger than
32-bits in these functions they were prevented from wrapping around to their
signed 32-bit value that we want them to return in python 2.x.
-rw-r--r-- | Modules/zlibmodule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index a15f2d9..384399d 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -891,8 +891,7 @@ PyZlib_adler32(PyObject *self, PyObject *args) { uLong adler32val = adler32(0L, Z_NULL, 0); Byte *buf; - int len; - long signed_val; + int len, signed_val; if (!PyArg_ParseTuple(args, "s#|k:adler32", &buf, &len, &adler32val)) return NULL; @@ -915,8 +914,7 @@ PyZlib_crc32(PyObject *self, PyObject *args) { uLong crc32val = crc32(0L, Z_NULL, 0); Byte *buf; - int len; - long signed_val; + int len, signed_val; if (!PyArg_ParseTuple(args, "s#|k:crc32", &buf, &len, &crc32val)) return NULL; |