diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-11 20:45:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-10-11 20:45:02 (GMT) |
commit | a2a6477ba0655825d164001917afcacf49741429 (patch) | |
tree | 52abf2cba648b5f9af4ba19c6c68aaefdd188b47 /Modules/_io/fileio.c | |
parent | 2c5d3cbfb88cf732adcd6c659ce875912ee70ee3 (diff) | |
download | cpython-a2a6477ba0655825d164001917afcacf49741429.zip cpython-a2a6477ba0655825d164001917afcacf49741429.tar.gz cpython-a2a6477ba0655825d164001917afcacf49741429.tar.bz2 |
Fix io.FileIO.readall() on Windows 64 bits
Use Py_off_t type (64 bits) instead of off_t (32 bits).
Diffstat (limited to 'Modules/_io/fileio.c')
-rw-r--r-- | Modules/_io/fileio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_io/fileio.c b/Modules/_io/fileio.c index a16d13c..dc59455 100644 --- a/Modules/_io/fileio.c +++ b/Modules/_io/fileio.c @@ -552,12 +552,12 @@ fileio_readinto(fileio *self, PyObject *args) static size_t new_buffersize(fileio *self, size_t currentsize #ifdef HAVE_FSTAT - , off_t pos, off_t end + , Py_off_t pos, Py_off_t end #endif ) { #ifdef HAVE_FSTAT - if (end != (off_t)-1) { + if (end != (Py_off_t)-1) { /* Files claiming a size smaller than SMALLCHUNK may actually be streaming pseudo-files. In this case, we apply the more aggressive algorithm below. @@ -584,7 +584,7 @@ fileio_readall(fileio *self) { #ifdef HAVE_FSTAT struct stat st; - off_t pos, end; + Py_off_t pos, end; #endif PyObject *result; Py_ssize_t total = 0; @@ -609,7 +609,7 @@ fileio_readall(fileio *self) if (fstat(self->fd, &st) == 0) end = st.st_size; else - end = (off_t)-1; + end = (Py_off_t)-1; #endif while (1) { #ifdef HAVE_FSTAT |