[Python-checkins] r58728 - python/trunk/Modules/mmapmodule.c

neal.norwitz python-checkins at python.org
Wed Oct 31 07:33:20 CET 2007


Author: neal.norwitz
Date: Wed Oct 31 07:33:20 2007
New Revision: 58728

Modified:
   python/trunk/Modules/mmapmodule.c
Log:
Fix some compiler warnings for signed comparisons on Unix and Windows.

Modified: python/trunk/Modules/mmapmodule.c
==============================================================================
--- python/trunk/Modules/mmapmodule.c	(original)
+++ python/trunk/Modules/mmapmodule.c	Wed Oct 31 07:33:20 2007
@@ -710,7 +710,7 @@
 			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 @@
 			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;


More information about the Python-checkins mailing list