X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec52467188b876c4f21f2528d99730827a27b76e..d23ec02c6ab52f60349601be999bab4cf6acbdc4:/src/common/imagtiff.cpp diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index d824f32073..4c09339ca7 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: imagtiff.cpp +// Name: src/common/imagtiff.cpp // Purpose: wxImage TIFF handler // Author: Robert Roebling // RCS-ID: $Id$ @@ -34,7 +34,11 @@ extern "C" #include "wx/module.h" #ifndef TIFFLINKAGEMODE - #define TIFFLINKAGEMODE LINKAGEMODE + #if defined(__WATCOMC__) && defined(__WXMGL__) + #define TIFFLINKAGEMODE cdecl + #else + #define TIFFLINKAGEMODE LINKAGEMODE + #endif #endif //----------------------------------------------------------------------------- @@ -53,7 +57,7 @@ static toff_t wxFileOffsetToTIFF(wxFileOffset ofs) return (toff_t)-1; toff_t tofs = wx_truncate_cast(toff_t, ofs); - wxCHECK_MSG( tofs == ofs, (toff_t)-1, + wxCHECK_MSG( (wxFileOffset)tofs == ofs, (toff_t)-1, _T("TIFF library doesn't support large files") ); return tofs; @@ -94,7 +98,7 @@ _tiffReadProc(thandle_t handle, tdata_t buf, tsize_t size) { wxInputStream *stream = (wxInputStream*) handle; stream->Read( (void*) buf, (size_t) size ); - return stream->LastRead(); + return wx_truncate_cast(tsize_t, stream->LastRead()); } tsize_t TIFFLINKAGEMODE @@ -102,7 +106,7 @@ _tiffWriteProc(thandle_t handle, tdata_t buf, tsize_t size) { wxOutputStream *stream = (wxOutputStream*) handle; stream->Write( (void*) buf, (size_t) size ); - return stream->LastWrite(); + return wx_truncate_cast(tsize_t, stream->LastWrite()); } toff_t TIFFLINKAGEMODE @@ -445,7 +449,7 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo if ( ptr[column*24 + bp*3] > 0 ) { // check only red as this is sufficient - reverse = reverse | 128 >> bp; + reverse = (uint8)(reverse | 128 >> bp); } } @@ -491,4 +495,3 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream ) #endif // wxUSE_STREAMS #endif // wxUSE_LIBTIFF -