fix (harmless) warnings in release mingw32 build

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59108 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-02-23 21:15:45 +00:00
parent 4b87142167
commit 36e5a9a7c4
5 changed files with 25 additions and 7 deletions

View File

@@ -549,6 +549,7 @@ void wxDataOutputStream::WriteDouble(double d)
#if wxUSE_APPLE_IEEE #if wxUSE_APPLE_IEEE
wxConvertToIeeeExtended(d, (wxInt8 *)buf); wxConvertToIeeeExtended(d, (wxInt8 *)buf);
#else #else
wxUnusedVar(d);
#if !defined(__VMS__) && !defined(__GNUG__) #if !defined(__VMS__) && !defined(__GNUG__)
# pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!" # pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!"
#endif #endif

View 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 // 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 // wxSHOW_SB_ALWAYS case show the scrollbar even if it's not needed by
// passing a special range value to SetScrollbar() // passing a special range value to SetScrollbar()
int range wxDUMMY_INITIALIZE(0); int range;
switch ( visibility ) switch ( visibility )
{ {
case wxSHOW_SB_NEVER: case wxSHOW_SB_NEVER:
range = 0; range = 0;
break; break;
case wxSHOW_SB_ALWAYS:
range = scrollUnits ? scrollUnits : -1;
break;
default:
wxFAIL_MSG( wxS("unknown scrollbar visibility") );
// fall through
case wxSHOW_SB_DEFAULT: case wxSHOW_SB_DEFAULT:
range = scrollUnits; range = scrollUnits;
break; break;
case wxSHOW_SB_ALWAYS:
range = scrollUnits ? scrollUnits : -1;
break;
} }
m_win->SetScrollbar(orient, scrollPosition, scrollLinesPerPage, range); m_win->SetScrollbar(orient, scrollPosition, scrollLinesPerPage, range);

View File

@@ -1724,7 +1724,7 @@ void wxMSWDCImpl::SetRop(WXHDC dc)
if ( !dc || m_logicalFunction < 0 ) if ( !dc || m_logicalFunction < 0 )
return; return;
int rop wxDUMMY_INITIALIZE(0); int rop;
switch (m_logicalFunction) switch (m_logicalFunction)
{ {
@@ -1744,6 +1744,9 @@ void wxMSWDCImpl::SetRop(WXHDC dc)
case wxNAND: rop = R2_NOTMASKPEN; break; case wxNAND: rop = R2_NOTMASKPEN; break;
case wxOR: rop = R2_MERGEPEN; break; case wxOR: rop = R2_MERGEPEN; break;
case wxSET: rop = R2_WHITE; break; case wxSET: rop = R2_WHITE; break;
default:
wxFAIL_MSG( wxS("unknown logical function") );
return;
} }
SetROP2(GetHdc(), rop); SetROP2(GetHdc(), rop);

View File

@@ -535,7 +535,12 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
if ( idx != wxNOT_FOUND ) if ( idx != wxNOT_FOUND )
{ {
idx = MSWFromNativeIdx(idx); 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 //else: ignore clicks outside any column
} }

View 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) // 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 && if ( ::GetFocus() == hwndList &&
ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED) == item ) ListView_GetNextItem(
hwndList, static_cast<WPARAM>(-1), LVNI_FOCUSED) == item )
{ {
nmcd.uItemState |= CDIS_FOCUS; nmcd.uItemState |= CDIS_FOCUS;
} }