[Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.18,2.19
Fredrik Lundh
python-dev@python.org
Sun, 9 Jul 2000 06:16:16 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory slayer.i.sourceforge.net:/tmp/cvs-serv27974/Modules
Modified Files:
mmapmodule.c
Log Message:
- added (long) casts to a couple of Py_BuildValue calls,
just for the sake of it.
note that this only covers the unlikely case that size_t
is smaller than a long; it's probably more likely that
there are platforms out there where size_t is *larger*
than a long, and mmapmodule cannot really deal with that
today.
Index: mmapmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v
retrieving revision 2.18
retrieving revision 2.19
diff -C2 -r2.18 -r2.19
*** mmapmodule.c 2000年07月08日 22:05:01 2.18
--- mmapmodule.c 2000年07月09日 13:16:13 2.19
***************
*** 261,268 ****
if (self->file_handle != (INT_PTR) -1) {
return (Py_BuildValue (
! "l",
GetFileSize ((HANDLE)self->file_handle, NULL)));
} else {
! return (Py_BuildValue ("l", self->size) );
}
#endif /* MS_WIN32 */
--- 261,268 ----
if (self->file_handle != (INT_PTR) -1) {
return (Py_BuildValue (
! "l", (long)
GetFileSize ((HANDLE)self->file_handle, NULL)));
} else {
! return (Py_BuildValue ("l", (long) self->size) );
}
#endif /* MS_WIN32 */
***************
*** 275,279 ****
return NULL;
}
! return (Py_BuildValue ("l", buf.st_size) );
}
#endif /* UNIX */
--- 275,279 ----
return NULL;
}
! return (Py_BuildValue ("l", (long) buf.st_size) );
}
#endif /* UNIX */
***************
*** 372,376 ****
if (!PyArg_ParseTuple(args, ":tell"))
return NULL;
! return (Py_BuildValue ("l", self->pos) );
}
--- 372,376 ----
if (!PyArg_ParseTuple(args, ":tell"))
return NULL;
! return (Py_BuildValue ("l", (long) self->pos) );
}
***************
*** 389,394 ****
} else {
#ifdef MS_WIN32
! return (Py_BuildValue (
! "l", FlushViewOfFile (self->data+offset, size)));
#endif /* MS_WIN32 */
#ifdef UNIX
--- 389,394 ----
} else {
#ifdef MS_WIN32
! return (Py_BuildValue("l", (long)
! FlushViewOfFile(self->data+offset, size)));
#endif /* MS_WIN32 */
#ifdef UNIX
***************
*** 401,405 ****
return NULL;
}
! return Py_BuildValue ("l", 0);
#endif /* UNIX */
}
--- 401,405 ----
return NULL;
}
! return Py_BuildValue ("l", (long) 0);
#endif /* UNIX */
}