Fix some compiler warnings for signed comparisons on Unix and Windows.

This commit is contained in:
Neal Norwitz 2007-10-31 06:33:20 +00:00
parent 706132bbae
commit 9c4382f2a3
1 changed files with 2 additions and 2 deletions

View File

@ -710,7 +710,7 @@ mmap_subscript(mmap_object *self, PyObject *item)
return NULL;
if (i < 0)
i += self->size;
if (i < 0 || i > self->size) {
if (i < 0 || (size_t)i > self->size) {
PyErr_SetString(PyExc_IndexError,
"mmap index out of range");
return NULL;
@ -851,7 +851,7 @@ mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
return -1;
if (i < 0)
i += self->size;
if (i < 0 || i > self->size) {
if (i < 0 || (size_t)i > self->size) {
PyErr_SetString(PyExc_IndexError,
"mmap index out of range");
return -1;