]> granicus.if.org Git - python/commitdiff
Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-dev
authorNeal Norwitz <nnorwitz@gmail.com>
Mon, 21 Aug 2006 18:44:09 +0000 (18:44 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Mon, 21 Aug 2006 18:44:09 +0000 (18:44 +0000)
Modules/mmapmodule.c
Objects/fileobject.c

index 73871ac96c42865e8b53ba4de1f5ec9210a44968..b8dd02d687662e4fd96d2237fd7e68b96b5c5af1 100644 (file)
@@ -470,7 +470,7 @@ static PyObject *
 mmap_tell_method(mmap_object *self, PyObject *unused)
 {
        CHECK_VALID(NULL);
-       return PyInt_FromLong((long) self->pos);
+       return PyInt_FromSsize_t(self->pos);
 }
 
 static PyObject *
index 71ba01b3ecb58ed5b8abe7c8efa43dd00ae5fa9d..5249f1cdc0d0853f457d8db7976ebeb7d7521823 100644 (file)
@@ -922,7 +922,7 @@ file_readinto(PyFileObject *f, PyObject *args)
                ndone += nnow;
                ntodo -= nnow;
        }
-       return PyInt_FromLong((long)ndone);
+       return PyInt_FromSsize_t(ndone);
 }
 
 /**************************************************************************