summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2009-10-05 21:09:00 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2009-10-05 21:09:00 (GMT)
commite1b60d4849111f5e1bacb1cf511ec7e7e97c205b (patch)
tree5095747a78ef46bf1eb304639c5952e237e5fae6 /Modules
parent7e2ef573ed48dce066a5dc0367bda4099614bc3a (diff)
downloadcpython-e1b60d4849111f5e1bacb1cf511ec7e7e97c205b.zip
cpython-e1b60d4849111f5e1bacb1cf511ec7e7e97c205b.tar.gz
cpython-e1b60d4849111f5e1bacb1cf511ec7e7e97c205b.tar.bz2
Merged revisions 75258 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75258 | amaury.forgeotdarc | 2009-10-05 22:18:05 +0200 (lun., 05 oct. 2009) | 2 lines Fix compilation warning on Windows, where size_t is 32bit but file offsets are 64bit. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_io/bufferedio.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c
index d8b6471..3dec67b 100644
--- a/Modules/_io/bufferedio.c
+++ b/Modules/_io/bufferedio.c
@@ -1688,7 +1688,8 @@ bufferedwriter_write(buffered *self, PyObject *args)
{
PyObject *res = NULL;
Py_buffer buf;
- Py_ssize_t written, avail, remaining, n;
+ Py_ssize_t written, avail, remaining;
+ Py_off_t offset;
CHECK_INITIALIZED(self)
if (!PyArg_ParseTuple(args, "y*:write", &buf)) {
@@ -1763,18 +1764,18 @@ bufferedwriter_write(buffered *self, PyObject *args)
the raw stream by itself).
Fixes issue #6629.
*/
- n = RAW_OFFSET(self);
- if (n != 0) {
- if (_buffered_raw_seek(self, -n, 1) < 0)
+ offset = RAW_OFFSET(self);
+ if (offset != 0) {
+ if (_buffered_raw_seek(self, -offset, 1) < 0)
goto error;
- self->raw_pos -= n;
+ self->raw_pos -= offset;
}
/* Then write buf itself. At this point the buffer has been emptied. */
remaining = buf.len;
written = 0;
while (remaining > self->buffer_size) {
- n = _bufferedwriter_raw_write(
+ Py_ssize_t n = _bufferedwriter_raw_write(
self, (char *) buf.buf + written, buf.len - written);
if (n == -1) {
Py_ssize_t *w = _buffered_check_blocking_error();