]> git.saurik.com Git - wxWidgets.git/commitdiff
Warning fixes for BCC, VC, OW and MinGW.
authorWłodzimierz Skiba <abx@abx.art.pl>
Mon, 26 Sep 2005 13:48:01 +0000 (13:48 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Mon, 26 Sep 2005 13:48:01 +0000 (13:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/image.cpp
src/common/imagtiff.cpp
src/common/strconv.cpp

index de70ee86db99df9361e4d92d4fb4b076557f6ebf..c888353fd9b801ee1bd972f4bc67ed7d23c02d78 100644 (file)
@@ -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;
index d824f320737178c49fb006c5cf012ac9bd9784df..07202e5c1cab2cacbdd1d1f14ca013cd4b40e8b1 100644 (file)
@@ -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
-
index 080b2078a7952ded3c5bbfeb4005d84f6913ec86..bdbbd20b0c897c3c4da350e3406116c03cfeb67a 100644 (file)
@@ -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
-
-