diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c index 3ad1c9ef1fa..ff2440554bf 100644 --- a/Modules/_ctypes/cfield.c +++ b/Modules/_ctypes/cfield.c @@ -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; diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c index 2718b6942ca..05c09d84105 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 */ }