From: Neal Norwitz Date: Mon, 21 Aug 2006 18:44:09 +0000 (+0000) Subject: Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-dev X-Git-Tag: v2.5c2~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47f0ffa7ee22a58802e206780a563997df1cc326;p=thirdparty%2FPython%2Fcpython.git Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-dev --- diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 73871ac96c42..b8dd02d68766 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -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 * diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 71ba01b3ecb5..5249f1cdc0d0 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -922,7 +922,7 @@ file_readinto(PyFileObject *f, PyObject *args) ndone += nnow; ntodo -= nnow; } - return PyInt_FromLong((long)ndone); + return PyInt_FromSsize_t(ndone); } /**************************************************************************