]> granicus.if.org Git - python/commitdiff
Correct fix by Mark Favas for the cast problems.
authorGuido van Rossum <guido@python.org>
Mon, 10 Apr 2000 21:34:37 +0000 (21:34 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 10 Apr 2000 21:34:37 +0000 (21:34 +0000)
Modules/mmapmodule.c

index 3fe1f1ca20425884336e34eb1f7070a203aa47d3..a79812d9338968bfee47cfe4b91627e050005d65 100644 (file)
@@ -116,9 +116,10 @@ mmap_read_byte_method (mmap_object * self,
                           PyObject * args)
 {
        char value;
-       char * where = (self->data+self->pos);
+       char * where;
        CHECK_VALID(NULL);
-       if ((where >= (char *)0) && (where < (self->data+self->size))) {
+       if (self->pos >= 0 && self->pos < self->size) {
+               where = self->data + self->pos;
                value = (char) *(where);
                self->pos += 1;
                return Py_BuildValue("c", (char) *(where));
@@ -593,7 +594,7 @@ mmap_ass_slice(self, ilow, ihigh, v)
        int ilow, ihigh;
        PyObject *v;
 {
-       unsigned char *buf;
+       const char *buf;
 
        CHECK_VALID(-1);
        if (ilow < 0)
@@ -628,7 +629,7 @@ mmap_ass_item(self, i, v)
        int i;
        PyObject *v;
 {
-       unsigned char *buf;
+       const char *buf;
  
        CHECK_VALID(-1);
        if (i < 0 || i >= self->size) {