]> granicus.if.org Git - python/commitdiff
Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for
authorMark Dickinson <dickinsm@gmail.com>
Tue, 5 May 2009 17:41:47 +0000 (17:41 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Tue, 5 May 2009 17:41:47 +0000 (17:41 +0000)
the patch.

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

index ef0be455f578ee58c15d68f9206fa38fe8c768c3..bf247bc41b7faac8d406a25c92fb7c4c39ddf8cf 100644 (file)
@@ -372,7 +372,7 @@ get_ulong(PyObject *v, unsigned long *p)
                return -1;
        }
        x = PyInt_AsUnsignedLongMask(v);
-       if (x == -1 && PyErr_Occurred())
+       if (x == (unsigned long)-1 && PyErr_Occurred())
                return -1;
        *p = x;
        return 0;
@@ -410,7 +410,7 @@ get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
                return -1;
        }
        x = PyInt_AsUnsignedLongLongMask(v);
-       if (x == -1 && PyErr_Occurred())
+       if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())
                return -1;
        *p = x;
        return 0;
index ebad311af6db95b1791826fd68c61c5597b2909d..b45f24396bfa587afe48beff50d3a2707fd69e28 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 */
        }