X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/79fa23744b2c622ebe9ff89a3ee8c8ec8017ee3b..a0c6a355b7b53866286ec6263b99f787cfdbe731:/src/common/imagiff.cpp diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp index 25d700bc37..5722969269 100644 --- a/src/common/imagiff.cpp +++ b/src/common/imagiff.cpp @@ -12,7 +12,7 @@ // by the author of xv, John Bradley for using the iff loading part // in wxWindows has been gratefully given. -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "imagiff.h" #endif @@ -34,6 +34,10 @@ #include "wx/log.h" #include "wx/intl.h" +#if wxUSE_PALETTE + #include "wx/palette.h" +#endif // wxUSE_PALETTE + #include #include @@ -235,7 +239,7 @@ bool wxIFFDecoder::CanRead() if ( !m_f->Read(buf, WXSIZEOF(buf)) ) return FALSE; - m_f->SeekI(-WXSIZEOF(buf), wxFromCurrent); + m_f->SeekI(-(off_t)WXSIZEOF(buf), wxFromCurrent); return (memcmp(buf, "FORM", 4) == 0) && (memcmp(buf+8, "ILBM", 4) == 0); } @@ -785,14 +789,9 @@ bool wxIFFHandler::SaveFile(wxImage * WXUNUSED(image), bool wxIFFHandler::DoCanRead(wxInputStream& stream) { - wxIFFDecoder *decod; - bool ok; + wxIFFDecoder decod(&stream); - decod = new wxIFFDecoder(&stream); - ok = decod->CanRead(); - delete decod; - - return ok; + return decod.CanRead(); } #endif // wxUSE_STREAMS