]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use a 32-bit unsigned int here, a long is not needed.
authorGregory P. Smith <greg@mad-scientist.com>
Tue, 25 Mar 2008 07:31:28 +0000 (07:31 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Tue, 25 Mar 2008 07:31:28 +0000 (07:31 +0000)
Modules/binascii.c
Modules/zlibmodule.c

index dfc3b7a5c96badd340a4007e87a317a96a27f420..defd8b21f25969cebbd8dd8c425573c59b9c4ea0 100644 (file)
@@ -756,12 +756,12 @@ 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#|k:crc32", &buf, &len, &crc32val))
+    if (!PyArg_ParseTuple(args, "s#|I:crc32", &buf, &len, &crc32val))
        return NULL;
     /* In Python 2.x we return a signed integer regardless of native platform
      * long size (the 32bit unsigned long is treated as 32-bit signed and sign
index 7637deb73c43ecb97d21eba6453a688fedd891c8..f59343f298a986fe976a52d604a2dfcebfb40083 100644 (file)
@@ -889,11 +889,11 @@ 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, signed_val;
 
-    if (!PyArg_ParseTuple(args, "s#|k:adler32", &buf, &len, &adler32val))
+    if (!PyArg_ParseTuple(args, "s#|I:adler32", &buf, &len, &adler32val))
        return NULL;
     /* In Python 2.x we return a signed integer regardless of native platform
      * long size (the 32bit unsigned long is treated as 32-bit signed and sign
@@ -912,11 +912,11 @@ 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, signed_val;
 
-    if (!PyArg_ParseTuple(args, "s#|k:crc32", &buf, &len, &crc32val))
+    if (!PyArg_ParseTuple(args, "s#|I:crc32", &buf, &len, &crc32val))
        return NULL;
     /* In Python 2.x we return a signed integer regardless of native platform
      * long size (the 32bit unsigned long is treated as 32-bit signed and sign