From 38d4b1e4bc01ea5c58ee8e22c924408d94aa2e9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 26 Sep 2005 13:48:01 +0000 Subject: [PATCH] Warning fixes for BCC, VC, OW and MinGW. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/image.cpp | 8 ++++++-- src/common/imagtiff.cpp | 7 +++---- src/common/strconv.cpp | 14 ++++++-------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/common/image.cpp b/src/common/image.cpp index de70ee86db..c888353fd9 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: image.cpp +// Name: src/common/image.cpp // Purpose: wxImage // Author: Robert Roebling // RCS-ID: $Id$ @@ -1778,7 +1778,7 @@ wxImage::HSVValue wxImage::RGBtoHSV(const RGBValue& rgb) const double value = maximumRGB; - double hue, saturation; + double hue = 0.0, saturation; const double deltaRGB = maximumRGB - minimumRGB; if ( wxIsNullDouble(deltaRGB) ) { @@ -1801,6 +1801,10 @@ wxImage::HSVValue wxImage::RGBtoHSV(const RGBValue& rgb) case BLUE: hue = 4.0 + (red - green) / deltaRGB; break; + + default: + wxFAIL_MSG(wxT("hue not specified")); + break; } hue /= 6.0; diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index d824f32073..07202e5c1c 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$ @@ -53,7 +53,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; @@ -445,7 +445,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 +491,3 @@ bool wxTIFFHandler::DoCanRead( wxInputStream& stream ) #endif // wxUSE_STREAMS #endif // wxUSE_LIBTIFF - diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 080b2078a7..bdbbd20b0c 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: strconv.cpp +// Name: src/common/strconv.cpp // Purpose: Unicode conversion classes // Author: Ove Kaaven, Robert Roebling, Vadim Zeitlin, Vaclav Slavik, // Ryan Norton, Fredrik Roubert (UTF7) @@ -653,7 +653,7 @@ size_t wxMBConvUTF8::MB2WC(wchar_t *buf, const char *psz, size_t n) const } #else // !WC_UTF16 if (buf) - *buf++ = res; + *buf++ = (wchar_t)res; len++; #endif // WC_UTF16/!WC_UTF16 } @@ -674,7 +674,7 @@ size_t wxMBConvUTF8::MB2WC(wchar_t *buf, const char *psz, size_t n) const len += pa; #else if (buf) - *buf++ = wxUnicodePUA + (unsigned char)*opsz; + *buf++ = (wchar_t)(wxUnicodePUA + (unsigned char)*opsz); opsz++; len++; #endif @@ -902,7 +902,7 @@ size_t wxMBConvUTF16straight::MB2WC(wchar_t *buf, const char *psz, size_t n) con return pa; if (buf) - *buf++ = cc; + *buf++ = (wchar_t)cc; len++; psz += pa * sizeof(wxUint16); } @@ -962,7 +962,7 @@ size_t wxMBConvUTF16swap::MB2WC(wchar_t *buf, const char *psz, size_t n) const return pa; if (buf) - *buf++ = cc; + *buf++ = (wchar_t)cc; len++; psz += pa * sizeof(wxUint16); @@ -1163,7 +1163,7 @@ size_t wxMBConvUTF32straight::MB2WC(wchar_t *buf, const char *psz, size_t n) con while (*(wxUint32*)psz && (!buf || len < n)) { if (buf) - *buf++ = *(wxUint32*)psz; + *buf++ = (wchar_t)(*(wxUint32*)psz); len++; psz += sizeof(wxUint32); } @@ -2845,5 +2845,3 @@ WXDLLIMPEXP_DATA_BASE(wxMBConv) wxConvLibc, wxConvUTF8; #endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T - - -- 2.45.2