From: Mark Dickinson Date: Tue, 5 May 2009 17:41:47 +0000 (+0000) Subject: Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for X-Git-Tag: v2.7a1~1274 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=929ab934891719ea1561a623ee1b2e502b59e022;p=python Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for the patch. --- diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index ef0be455f5..bf247bc41b 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -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; diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index ebad311af6..b45f24396b 100644 --- a/Modules/_randommodule.c +++ b/Modules/_randommodule.c @@ -355,7 +355,7 @@ random_setstate(RandomObject *self, PyObject *state) for (i=0; istate[i] = element & 0xffffffffUL; /* Make sure we get sane state */ }