From: Robin Dunn Date: Wed, 29 Sep 2004 16:42:36 +0000 (+0000) Subject: off_t --> wxFileOffset changes X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3bc06221f04615811781ab91b46b2e44c5e9c4a4 off_t --> wxFileOffset changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29544 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/include/wx/wxPython/pyistream.h b/wxPython/include/wx/wxPython/pyistream.h index ef1941b557..793315adaf 100644 --- a/wxPython/include/wx/wxPython/pyistream.h +++ b/wxPython/include/wx/wxPython/pyistream.h @@ -81,8 +81,8 @@ protected: // wxStreamBase methods virtual size_t OnSysRead(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 off_t OnSysTell() const; + virtual wxFileOffset OnSysSeek(wxFileOffset off, wxSeekMode mode); + virtual wxFileOffset OnSysTell() const; // helper static PyObject* getMethod(PyObject* py, char* name); diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index f411f31ee8..a17498e304 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -1385,8 +1385,8 @@ PyObject* wxPyCBInputStream::getMethod(PyObject* py, char* name) { size_t wxPyCBInputStream::GetSize() const { wxPyCBInputStream* self = (wxPyCBInputStream*)this; // cast off const if (m_seek && m_tell) { - off_t temp = self->OnSysTell(); - off_t ret = self->OnSysSeek(0, wxFromEnd); + wxFileOffset temp = self->OnSysTell(); + wxFileOffset ret = self->OnSysSeek(0, wxFromEnd); self->OnSysSeek(temp, wxFromStart); return ret; } @@ -1426,10 +1426,10 @@ size_t wxPyCBInputStream::OnSysWrite(const void *buffer, size_t bufsize) { return 0; } -off_t wxPyCBInputStream::OnSysSeek(off_t off, wxSeekMode mode) { +wxFileOffset wxPyCBInputStream::OnSysSeek(wxFileOffset off, wxSeekMode mode) { bool blocked = wxPyBeginBlockThreads(); -#ifdef _LARGE_FILES - // off_t is a 64-bit value... +#if defined( __WINCE__) || defined(_LARGE_FILES) || defined(__HUGEFILES_SUPPORTED) + // wxFileOffset is a 64-bit value... PyObject* arglist = Py_BuildValue("(Li)", off, mode); #else 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(); PyObject* arglist = Py_BuildValue("()"); PyObject* result = PyEval_CallObject(m_tell, arglist); Py_DECREF(arglist); - off_t o = 0; + wxFileOffset o = 0; if (result != NULL) { -#ifdef _LARGE_FILES +#if defined( __WINCE__) || defined(_LARGE_FILES) || defined(__HUGEFILES_SUPPORTED) if (PyLong_Check(result)) o = PyLong_AsLongLong(result); else