mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
Fix some compiler warnings for signed comparisons on Unix and Windows.
This commit is contained in:
parent
706132bbae
commit
9c4382f2a3
1 changed files with 2 additions and 2 deletions
|
|
@ -710,7 +710,7 @@ mmap_subscript(mmap_object *self, PyObject *item)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
i += self->size;
|
i += self->size;
|
||||||
if (i < 0 || i > self->size) {
|
if (i < 0 || (size_t)i > self->size) {
|
||||||
PyErr_SetString(PyExc_IndexError,
|
PyErr_SetString(PyExc_IndexError,
|
||||||
"mmap index out of range");
|
"mmap index out of range");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -851,7 +851,7 @@ mmap_ass_subscript(mmap_object *self, PyObject *item, PyObject *value)
|
||||||
return -1;
|
return -1;
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
i += self->size;
|
i += self->size;
|
||||||
if (i < 0 || i > self->size) {
|
if (i < 0 || (size_t)i > self->size) {
|
||||||
PyErr_SetString(PyExc_IndexError,
|
PyErr_SetString(PyExc_IndexError,
|
||||||
"mmap index out of range");
|
"mmap index out of range");
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue