]> git.saurik.com Git - wxWidgets.git/commitdiff
fix (harmless) warnings in release mingw32 build
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Feb 2009 21:15:45 +0000 (21:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 23 Feb 2009 21:15:45 +0000 (21:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/datstrm.cpp
src/generic/scrlwing.cpp
src/msw/dc.cpp
src/msw/headerctrl.cpp
src/msw/listctrl.cpp

index 8a97eca767c0fe20bfd006a9373cb552c696e1b4..e480fef05e4f24804caddadfe1f56a749b56d136 100644 (file)
@@ -549,6 +549,7 @@ void wxDataOutputStream::WriteDouble(double d)
 #if wxUSE_APPLE_IEEE
   wxConvertToIeeeExtended(d, (wxInt8 *)buf);
 #else
+  wxUnusedVar(d);
 #if !defined(__VMS__) && !defined(__GNUG__)
 # pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!"
 #endif
index ef7dce44374e46475e55c1a2fab7887abc331922..85e2ef3bae51be147d570530810a5e6c0d504d99 100644 (file)
@@ -1280,20 +1280,25 @@ wxScrollHelper::DoAdjustScrollbar(int orient,
     // in wxSHOW_SB_NEVER case don't show the scrollbar even if it's needed, in
     // wxSHOW_SB_ALWAYS case show the scrollbar even if it's not needed by
     // passing a special range value to SetScrollbar()
-    int range wxDUMMY_INITIALIZE(0);
+    int range;
     switch ( visibility )
     {
         case wxSHOW_SB_NEVER:
             range = 0;
             break;
 
+        case wxSHOW_SB_ALWAYS:
+            range = scrollUnits ? scrollUnits : -1;
+            break;
+
+        default:
+            wxFAIL_MSG( wxS("unknown scrollbar visibility") );
+            // fall through
+
         case wxSHOW_SB_DEFAULT:
             range = scrollUnits;
             break;
 
-        case wxSHOW_SB_ALWAYS:
-            range = scrollUnits ? scrollUnits : -1;
-            break;
     }
 
     m_win->SetScrollbar(orient, scrollPosition, scrollLinesPerPage, range);
index 8b84775f38a81b0c354014e1212f5ff9e5d6e3ef..b47befb24ee5f9935a863fe8caa6884165034c11 100644 (file)
@@ -1724,7 +1724,7 @@ void wxMSWDCImpl::SetRop(WXHDC dc)
     if ( !dc || m_logicalFunction < 0 )
         return;
 
-    int rop wxDUMMY_INITIALIZE(0);
+    int rop;
 
     switch (m_logicalFunction)
     {
@@ -1744,6 +1744,9 @@ void wxMSWDCImpl::SetRop(WXHDC dc)
         case wxNAND:         rop = R2_NOTMASKPEN;    break;
         case wxOR:           rop = R2_MERGEPEN;      break;
         case wxSET:          rop = R2_WHITE;         break;
+        default:
+            wxFAIL_MSG( wxS("unknown logical function") );
+            return;
     }
 
     SetROP2(GetHdc(), rop);
index c4beb2534df2adbb8e60de1139ec59af98c422a3..1eb17c1e8e5162cfbb0830a7d0f42940bf476a45 100644 (file)
@@ -535,7 +535,12 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                 if ( idx != wxNOT_FOUND )
                 {
                     idx = MSWFromNativeIdx(idx);
-                    evtType = GetClickEventType(code == NM_RDBLCLK, 1);
+
+                    // due to a bug in mingw32 headers NM_RDBLCLK is signed
+                    // there so we need a cast to avoid warnings about signed/
+                    // unsigned comparison
+                    evtType = GetClickEventType(
+                                code == static_cast<UINT>(NM_RDBLCLK), 1);
                 }
                 //else: ignore clicks outside any column
             }
index 77d37d2738a03cbe26977805fe9bd8b05b6563a0..b102317312d3c7f79836f04a2564af17e07a0335 100644 (file)
@@ -2713,8 +2713,12 @@ static void HandleItemPaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont)
     }
 
     // same thing for CDIS_FOCUS (except simpler as there is only one of them)
+    //
+    // NB: cast is needed to work around the bug in mingw32 headers which don't
+    //     have it inside ListView_GetNextItem() itself (unlike SDK ones)
     if ( ::GetFocus() == hwndList &&
-            ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED) == item )
+            ListView_GetNextItem(
+                hwndList, static_cast<WPARAM>(-1), LVNI_FOCUSED) == item )
     {
         nmcd.uItemState |= CDIS_FOCUS;
     }