use wxFileSize_t instead of wxFileOffset or off_t
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -843,15 +843,15 @@ bool wxBMPHandler::LoadDib(wxImage *image, wxInputStream& stream,
|
||||
wxUint16 aWord;
|
||||
wxInt32 dbuf[4];
|
||||
wxInt8 bbuf[4];
|
||||
off_t offset;
|
||||
|
||||
offset = 0; // keep gcc quiet
|
||||
wxFileSize_t offset = 0; // keep gcc quiet
|
||||
if ( IsBmp )
|
||||
{
|
||||
// read the header off the .BMP format file
|
||||
|
||||
offset = stream.TellI();
|
||||
if (offset == wxInvalidOffset) offset = 0;
|
||||
if (offset == wxInvalidOffset)
|
||||
offset = 0;
|
||||
|
||||
stream.Read(bbuf, 2);
|
||||
stream.Read(dbuf, 16);
|
||||
|
@@ -1485,7 +1485,7 @@ bool wxImageHandler::CanRead( const wxString& name )
|
||||
|
||||
bool wxImageHandler::CallDoCanRead(wxInputStream& stream)
|
||||
{
|
||||
off_t posOld = stream.TellI();
|
||||
wxFileSize_t posOld = stream.TellI();
|
||||
if ( posOld == wxInvalidOffset )
|
||||
{
|
||||
// can't test unseekable stream
|
||||
|
@@ -1120,19 +1120,19 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
|
||||
return false;
|
||||
|
||||
// get the file size
|
||||
wxFileOffset nSize = fileMsg.Length();
|
||||
wxFileSize_t nSize = fileMsg.Length();
|
||||
if ( nSize == wxInvalidOffset )
|
||||
return false;
|
||||
|
||||
// read the whole file in memory
|
||||
m_pData = new size_t8[nSize];
|
||||
if ( fileMsg.Read(m_pData, (size_t)nSize) != (size_t)nSize ) {
|
||||
if ( fileMsg.Read(m_pData, nSize) != nSize ) {
|
||||
wxDELETEA(m_pData);
|
||||
return false;
|
||||
}
|
||||
|
||||
// examine header
|
||||
bool bValid = (size_t)nSize > sizeof(wxMsgCatalogHeader);
|
||||
bool bValid = nSize > sizeof(wxMsgCatalogHeader);
|
||||
|
||||
wxMsgCatalogHeader *pHeader = (wxMsgCatalogHeader *)m_pData;
|
||||
if ( bValid ) {
|
||||
@@ -1157,7 +1157,7 @@ bool wxMsgCatalogFile::Load(const wxChar *szDirPrefix, const wxChar *szName0,
|
||||
Swap(pHeader->ofsOrigTable));
|
||||
m_pTransTable = (wxMsgTableEntry *)(m_pData +
|
||||
Swap(pHeader->ofsTransTable));
|
||||
m_nSize = (size_t)nSize;
|
||||
m_nSize = nSize;
|
||||
|
||||
// now parse catalog's header and try to extract catalog charset and
|
||||
// plural forms formula from it:
|
||||
|
@@ -621,7 +621,7 @@ wxFileOffset wxStreamBuffer::Seek(wxFileOffset pos, wxSeekMode mode)
|
||||
|
||||
wxFileOffset wxStreamBuffer::Tell() const
|
||||
{
|
||||
wxFileOffset pos;
|
||||
wxFileSize_t pos;
|
||||
|
||||
// ask the stream for position if we have a real one
|
||||
if ( m_stream )
|
||||
@@ -889,7 +889,7 @@ wxFileOffset wxInputStream::SeekI(wxFileOffset pos, wxSeekMode mode)
|
||||
|
||||
wxFileOffset wxInputStream::TellI() const
|
||||
{
|
||||
wxFileOffset pos = OnSysTell();
|
||||
wxFileSize_t pos = OnSysTell();
|
||||
|
||||
if (pos != wxInvalidOffset)
|
||||
pos -= (m_wbacksize - m_wbackcur);
|
||||
@@ -1122,7 +1122,7 @@ wxFileOffset wxBufferedInputStream::SeekI(wxFileOffset pos, wxSeekMode mode)
|
||||
|
||||
wxFileOffset wxBufferedInputStream::TellI() const
|
||||
{
|
||||
wxFileOffset pos = m_i_streambuf->Tell();
|
||||
wxFileSize_t pos = m_i_streambuf->Tell();
|
||||
|
||||
if (pos != wxInvalidOffset)
|
||||
pos -= (m_wbacksize - m_wbackcur);
|
||||
|
@@ -97,7 +97,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
|
||||
char *strBuf, *strPtr, *strEnd;
|
||||
char ch, chLast = '\0';
|
||||
char buf[1024];
|
||||
int n, nRead;
|
||||
wxFileSize_t nRead;
|
||||
|
||||
strPtr = strBuf = new char[1024];
|
||||
strEnd = strBuf + 1024;
|
||||
@@ -112,7 +112,7 @@ bool wxTextFile::OnRead(wxMBConv& conv)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (n = 0; n < nRead; n++)
|
||||
for (wxFileSize_t n = 0; n < nRead; n++)
|
||||
{
|
||||
ch = buf[n];
|
||||
switch ( ch )
|
||||
|
@@ -69,7 +69,7 @@ size_t wxFileInputStream::GetSize() const
|
||||
|
||||
size_t wxFileInputStream::OnSysRead(void *buffer, size_t size)
|
||||
{
|
||||
wxFileOffset ret = m_file->Read(buffer, size);
|
||||
wxFileSize_t ret = m_file->Read(buffer, size);
|
||||
|
||||
// NB: we can't use a switch here because HP-UX CC doesn't allow
|
||||
// switching over long long (which off_t is in 64bit mode)
|
||||
@@ -234,9 +234,7 @@ size_t wxFFileInputStream::GetSize() const
|
||||
|
||||
size_t wxFFileInputStream::OnSysRead(void *buffer, size_t size)
|
||||
{
|
||||
wxFileOffset ret;
|
||||
|
||||
ret = m_file->Read(buffer, size);
|
||||
wxFileSize_t ret = m_file->Read(buffer, size);
|
||||
|
||||
if (m_file->Eof())
|
||||
m_lasterror = wxSTREAM_EOF;
|
||||
|
@@ -277,7 +277,7 @@ bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
|
||||
}
|
||||
|
||||
char buf[256];
|
||||
off_t count = file.Read(buf, WXSIZEOF(buf));
|
||||
wxFileSize_t count = file.Read(buf, WXSIZEOF(buf));
|
||||
if ( count == wxInvalidOffset )
|
||||
{
|
||||
wxLogError(_("Failed to read PID from lock file."));
|
||||
|
Reference in New Issue
Block a user