diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-23 05:08:37 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2008-03-23 05:08:37 (GMT) |
commit | acbd6420e35754d31039e53333171f3ee50fcdc6 (patch) | |
tree | d1511e34ca69f63d94ff865b30785f385af6943a /Modules | |
parent | 3bda069c5ab3a172c46f5f81b972a7e05161196a (diff) | |
download | cpython-acbd6420e35754d31039e53333171f3ee50fcdc6.zip cpython-acbd6420e35754d31039e53333171f3ee50fcdc6.tar.gz cpython-acbd6420e35754d31039e53333171f3ee50fcdc6.tar.bz2 |
Fix test_tarfile failures on Alpha (Tru64). The problem was caused in r61449
which made the return value signed. On the Alpha that also lost data
since sizeof(int) != sizeof(long) and apparently adler32/crc32 return
64 bits of data. This change keeps the signedness and continues to store the
data in a long rather than an int as was the case before r61449.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/zlibmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index 384399d..a15f2d9 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -891,7 +891,8 @@ PyZlib_adler32(PyObject *self, PyObject *args) { uLong adler32val = adler32(0L, Z_NULL, 0); Byte *buf; - int len, signed_val; + int len; + long signed_val; if (!PyArg_ParseTuple(args, "s#|k:adler32", &buf, &len, &adler32val)) return NULL; @@ -914,7 +915,8 @@ PyZlib_crc32(PyObject *self, PyObject *args) { uLong crc32val = crc32(0L, Z_NULL, 0); Byte *buf; - int len, signed_val; + int len; + long signed_val; if (!PyArg_ParseTuple(args, "s#|k:crc32", &buf, &len, &crc32val)) return NULL; |