off_t --> wxFileOffset changes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-09-29 16:42:36 +00:00
parent f525dc35f4
commit 3bc06221f0
2 changed files with 10 additions and 10 deletions

View File

@@ -81,8 +81,8 @@ protected:
// wxStreamBase methods // wxStreamBase methods
virtual size_t OnSysRead(void *buffer, size_t bufsize); virtual size_t OnSysRead(void *buffer, size_t bufsize);
virtual size_t OnSysWrite(const void *buffer, size_t bufsize); virtual size_t OnSysWrite(const void *buffer, size_t bufsize);
virtual off_t OnSysSeek(off_t off, wxSeekMode mode); virtual wxFileOffset OnSysSeek(wxFileOffset off, wxSeekMode mode);
virtual off_t OnSysTell() const; virtual wxFileOffset OnSysTell() const;
// helper // helper
static PyObject* getMethod(PyObject* py, char* name); static PyObject* getMethod(PyObject* py, char* name);

View File

@@ -1385,8 +1385,8 @@ PyObject* wxPyCBInputStream::getMethod(PyObject* py, char* name) {
size_t wxPyCBInputStream::GetSize() const { size_t wxPyCBInputStream::GetSize() const {
wxPyCBInputStream* self = (wxPyCBInputStream*)this; // cast off const wxPyCBInputStream* self = (wxPyCBInputStream*)this; // cast off const
if (m_seek && m_tell) { if (m_seek && m_tell) {
off_t temp = self->OnSysTell(); wxFileOffset temp = self->OnSysTell();
off_t ret = self->OnSysSeek(0, wxFromEnd); wxFileOffset ret = self->OnSysSeek(0, wxFromEnd);
self->OnSysSeek(temp, wxFromStart); self->OnSysSeek(temp, wxFromStart);
return ret; return ret;
} }
@@ -1426,10 +1426,10 @@ size_t wxPyCBInputStream::OnSysWrite(const void *buffer, size_t bufsize) {
return 0; return 0;
} }
off_t wxPyCBInputStream::OnSysSeek(off_t off, wxSeekMode mode) { wxFileOffset wxPyCBInputStream::OnSysSeek(wxFileOffset off, wxSeekMode mode) {
bool blocked = wxPyBeginBlockThreads(); bool blocked = wxPyBeginBlockThreads();
#ifdef _LARGE_FILES #if defined( __WINCE__) || defined(_LARGE_FILES) || defined(__HUGEFILES_SUPPORTED)
// off_t is a 64-bit value... // wxFileOffset is a 64-bit value...
PyObject* arglist = Py_BuildValue("(Li)", off, mode); PyObject* arglist = Py_BuildValue("(Li)", off, mode);
#else #else
PyObject* arglist = Py_BuildValue("(ii)", off, mode); PyObject* arglist = Py_BuildValue("(ii)", off, mode);
@@ -1442,14 +1442,14 @@ off_t wxPyCBInputStream::OnSysSeek(off_t off, wxSeekMode mode) {
} }
off_t wxPyCBInputStream::OnSysTell() const { wxFileOffset wxPyCBInputStream::OnSysTell() const {
bool blocked = wxPyBeginBlockThreads(); bool blocked = wxPyBeginBlockThreads();
PyObject* arglist = Py_BuildValue("()"); PyObject* arglist = Py_BuildValue("()");
PyObject* result = PyEval_CallObject(m_tell, arglist); PyObject* result = PyEval_CallObject(m_tell, arglist);
Py_DECREF(arglist); Py_DECREF(arglist);
off_t o = 0; wxFileOffset o = 0;
if (result != NULL) { if (result != NULL) {
#ifdef _LARGE_FILES #if defined( __WINCE__) || defined(_LARGE_FILES) || defined(__HUGEFILES_SUPPORTED)
if (PyLong_Check(result)) if (PyLong_Check(result))
o = PyLong_AsLongLong(result); o = PyLong_AsLongLong(result);
else else