diff options
author | Christian Heimes <christian@cheimes.de> | 2008-03-25 14:56:36 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-03-25 14:56:36 (GMT) |
commit | cc47b05fe5c66bb2f1e520234039070044dad218 (patch) | |
tree | ddb338df6405af349936b697cc17d6cb9d4be887 /Modules | |
parent | afbc266bb68e67987f0763707f37891c8cea84e9 (diff) | |
download | cpython-cc47b05fe5c66bb2f1e520234039070044dad218.zip cpython-cc47b05fe5c66bb2f1e520234039070044dad218.tar.gz cpython-cc47b05fe5c66bb2f1e520234039070044dad218.tar.bz2 |
Merged revisions 61834,61841-61842,61851-61853,61863-61864,61869-61870,61874,61889 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r61834 | raymond.hettinger | 2008-03-24 07:07:49 +0100 (Mon, 24 Mar 2008) | 1 line
Tighten documentation for Random.triangular.
........
r61841 | raymond.hettinger | 2008-03-24 09:17:39 +0100 (Mon, 24 Mar 2008) | 1 line
Issue 2460: Make Ellipsis objects copyable.
........
r61842 | georg.brandl | 2008-03-24 10:34:34 +0100 (Mon, 24 Mar 2008) | 2 lines
#1700821: add a note to audioop docs about signedness of sample formats.
........
r61851 | christian.heimes | 2008-03-24 20:57:42 +0100 (Mon, 24 Mar 2008) | 1 line
Added quick hack for bzr
........
r61852 | christian.heimes | 2008-03-24 20:58:17 +0100 (Mon, 24 Mar 2008) | 1 line
Added quick hack for bzr
........
r61853 | amaury.forgeotdarc | 2008-03-24 22:04:10 +0100 (Mon, 24 Mar 2008) | 4 lines
Issue2469: Correct a typo I introduced at r61793: compilation error with UCS4 builds.
All buildbots compile with UCS2...
........
r61863 | neal.norwitz | 2008-03-25 05:17:38 +0100 (Tue, 25 Mar 2008) | 2 lines
Fix a bunch of UnboundLocalErrors when the tests fail.
........
r61864 | neal.norwitz | 2008-03-25 05:18:18 +0100 (Tue, 25 Mar 2008) | 2 lines
Try to fix a bunch of compiler warnings on Win64.
........
r61869 | neal.norwitz | 2008-03-25 07:35:10 +0100 (Tue, 25 Mar 2008) | 3 lines
Don't try to close a non-open file.
Don't let file removal cause the test to fail.
........
r61870 | neal.norwitz | 2008-03-25 08:00:39 +0100 (Tue, 25 Mar 2008) | 7 lines
Try to get this test to be more stable:
* disable gc during the test run because we are spawning objects and there
was an exception when calling Popen.__del__
* Always set an alarm handler so the process doesn't exit if the test fails
(should probably add assertions on the value of hndl_called in more places)
* Using a negative time causes Linux to treat it as zero, so disable that test.
........
r61874 | gregory.p.smith | 2008-03-25 08:31:28 +0100 (Tue, 25 Mar 2008) | 2 lines
Use a 32-bit unsigned int here, a long is not needed.
........
r61889 | georg.brandl | 2008-03-25 12:59:51 +0100 (Tue, 25 Mar 2008) | 2 lines
Move declarations to block start.
........
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/binascii.c | 8 | ||||
-rw-r--r-- | Modules/zlibmodule.c | 11 |
2 files changed, 11 insertions, 8 deletions
diff --git a/Modules/binascii.c b/Modules/binascii.c index b90905f..b65bdab 100644 --- a/Modules/binascii.c +++ b/Modules/binascii.c @@ -784,13 +784,15 @@ PyDoc_STRVAR(doc_crc32, static PyObject * binascii_crc32(PyObject *self, PyObject *args) { - uLong crc32val = 0; /* crc32(0L, Z_NULL, 0) */ + unsigned int crc32val = 0; /* crc32(0L, Z_NULL, 0) */ Byte *buf; Py_ssize_t len; + int signed_val; + if (!PyArg_ParseTuple(args, "s#|I:crc32", &buf, &len, &crc32val)) return NULL; - crc32val = crc32(crc32val, buf, len); - return PyLong_FromUnsignedLong(crc32val & 0xffffffffU); + signed_val = crc32(crc32val, buf, len); + return PyLong_FromUnsignedLong(signed_val & 0xffffffffU); } #else /* USE_ZLIB_CRC32 */ /* Crc - 32 BIT ANSI X3.66 CRC checksum files diff --git a/Modules/zlibmodule.c b/Modules/zlibmodule.c index cecb9cf..24efb00 100644 --- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -915,7 +915,7 @@ PyDoc_STRVAR(adler32__doc__, static PyObject * PyZlib_adler32(PyObject *self, PyObject *args) { - uLong adler32val = 1; /* adler32(0L, Z_NULL, 0) */ + unsigned int adler32val = 1; /* adler32(0L, Z_NULL, 0) */ Byte *buf; int len; @@ -934,13 +934,14 @@ PyDoc_STRVAR(crc32__doc__, static PyObject * PyZlib_crc32(PyObject *self, PyObject *args) { - uLong crc32val = 0; /* crc32(0L, Z_NULL, 0) */ + unsigned int crc32val = 0; /* crc32(0L, Z_NULL, 0) */ Byte *buf; - int len; + int len, signed_val; + if (!PyArg_ParseTuple(args, "s#|I:crc32", &buf, &len, &crc32val)) return NULL; - crc32val = crc32(crc32val, buf, len); - return PyLong_FromUnsignedLong(crc32val & 0xffffffffU); + signed_val = crc32(crc32val, buf, len); + return PyLong_FromUnsignedLong(signed_val & 0xffffffffU); } |