]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 72344 via svnmerge from
authorMark Dickinson <dickinsm@gmail.com>
Tue, 5 May 2009 17:54:36 +0000 (17:54 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Tue, 5 May 2009 17:54:36 +0000 (17:54 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72344 | mark.dickinson | 2009-05-05 18:41:47 +0100 (Tue, 05 May 2009) | 3 lines

  Issue #5933: Fix some gcc -Wextra warnings.  Thanks Victor Stinner for
  the patch.
........

Modules/_ctypes/cfield.c
Modules/_randommodule.c

index 3ad1c9ef1fa5f0673cea58550adf8eed8d741006..ff2440554bfd0a554e913beacc183eeac6dfbaab 100644 (file)
@@ -362,7 +362,7 @@ get_ulong(PyObject *v, unsigned long *p)
                return -1;
        }
        x = PyLong_AsUnsignedLongMask(v);
-       if (x == -1 && PyErr_Occurred())
+       if (x == (unsigned long)-1 && PyErr_Occurred())
                return -1;
        *p = x;
        return 0;
@@ -400,7 +400,7 @@ get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
                return -1;
        }
        x = PyLong_AsUnsignedLongLongMask(v);
-       if (x == -1 && PyErr_Occurred())
+       if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())
                return -1;
        *p = x;
        return 0;
index 2718b6942ca0e510f80ec48856d84665cd808e0f..05c09d84105e63fa0f15fe62682162ff43133d8e 100644 (file)
@@ -355,7 +355,7 @@ random_setstate(RandomObject *self, PyObject *state)
 
        for (i=0; i<N ; i++) {
                element = PyLong_AsUnsignedLong(PyTuple_GET_ITEM(state, i));
-               if (element == -1 && PyErr_Occurred())
+               if (element == (unsigned long)-1 && PyErr_Occurred())
                        return NULL;
                self->state[i] = element & 0xffffffffUL; /* Make sure we get sane state */
        }