From c22ace4dff0629aa55f5afb9fa7d77334d27409b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 18 Jun 2009 22:54:21 +0000 Subject: [PATCH] fix a couple of harmless warnings during wxOSX build git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/framemanager.cpp | 1 + src/generic/listbkg.cpp | 2 +- src/generic/renderg.cpp | 10 +++------- src/osx/carbon/dcscreen.cpp | 18 +++++++----------- src/osx/carbon/font.cpp | 6 +++--- src/osx/cocoa/scrolbar.mm | 3 ++- src/osx/core/bitmap.cpp | 9 ++++++--- src/osx/core/glgrab.cpp | 4 ++-- src/unix/evtloopunix.cpp | 3 ++- 9 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 62b3281b91..9e0e2ae07a 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -874,6 +874,7 @@ bool wxAuiManager_HasLiveResize(wxAuiManager& manager) // With Core Graphics on Mac, it's not possible to show sash feedback, // so we'll always use live update instead. #if defined(__WXMAC__) + wxUnusedVar(manager); return true; #else return (manager.GetFlags() & wxAUI_MGR_LIVE_RESIZE) == wxAUI_MGR_LIVE_RESIZE; diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index 96eed8b955..e7dd71235d 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -298,9 +298,9 @@ bool wxListbook::SetPageImage(size_t n, int imageId) void wxListbook::SetImageList(wxImageList *imageList) { +#ifdef CAN_USE_REPORT_VIEW wxListView * const list = GetListView(); -#ifdef CAN_USE_REPORT_VIEW // If imageList presence has changed, we update the list control view if ( (imageList != NULL) != (GetImageList() != NULL) ) { diff --git a/src/generic/renderg.cpp b/src/generic/renderg.cpp index 4fcd52f56f..c2c74c54bf 100644 --- a/src/generic/renderg.cpp +++ b/src/generic/renderg.cpp @@ -647,17 +647,10 @@ wxRendererGeneric::DrawPushButton(wxWindow *win, } void -#ifdef __WXMAC__ wxRendererGeneric::DrawItemSelectionRect(wxWindow * win, wxDC& dc, const wxRect& rect, int flags) -#else -wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win), - wxDC& dc, - const wxRect& rect, - int flags) -#endif { wxBrush brush; if ( flags & wxCONTROL_SELECTED ) @@ -687,6 +680,9 @@ wxRendererGeneric::DrawItemSelectionRect(wxWindow * WXUNUSED(win), dc.SetPen( *wxTRANSPARENT_PEN ); dc.DrawRectangle( rect ); + + // it's unused everywhere except in wxOSX/Carbon + wxUnusedVar(win); } void diff --git a/src/osx/carbon/dcscreen.cpp b/src/osx/carbon/dcscreen.cpp index b7acdc8476..0777c55d52 100644 --- a/src/osx/carbon/dcscreen.cpp +++ b/src/osx/carbon/dcscreen.cpp @@ -64,17 +64,13 @@ wxScreenDCImpl::~wxScreenDCImpl() wxBitmap wxScreenDCImpl::DoGetAsBitmap(const wxRect *subrect) const { - CGRect srcRect = CGRectMake(0, 0, m_width, m_height); - if (subrect) - { - srcRect.origin.x = subrect->GetX(); - srcRect.origin.y = subrect->GetY(); - srcRect.size.width = subrect->GetWidth(); - srcRect.size.height = subrect->GetHeight(); - } - wxBitmap bmp = wxBitmap(srcRect.size.width, srcRect.size.height, 32); -#if wxOSX_USE_IPHONE -#else + wxRect rect = subrect ? *subrect : wxRect(0, 0, m_width, m_height); + + wxBitmap bmp(rect.GetSize(), 32); + +#if !wxOSX_USE_IPHONE + CGRect srcRect = CGRectMake(rect.x, rect.y, rect.width, rect.height); + CGContextRef context = (CGContextRef)bmp.GetHBITMAP(); CGContextSaveGState(context); diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index dc5a0ce72f..e6fd9cc650 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -784,7 +784,7 @@ void * wxFont::MacGetATSUStyle() const #if WXWIN_COMPATIBILITY_2_8 wxUint32 wxFont::MacGetATSUFontID() const { - wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") ); + wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") ); // cast away constness otherwise lazy font resolution is not possible const_cast(this)->RealizeResource(); @@ -794,7 +794,7 @@ wxUint32 wxFont::MacGetATSUFontID() const wxUint32 wxFont::MacGetATSUAdditionalQDStyles() const { - wxCHECK_MSG( M_FONTDATA != NULL , NULL, wxT("invalid font") ); + wxCHECK_MSG( M_FONTDATA != NULL, 0, wxT("invalid font") ); // cast away constness otherwise lazy font resolution is not possible const_cast(this)->RealizeResource(); @@ -1303,4 +1303,4 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding_) encoding_ = wxFont::GetDefaultEncoding(); m_encoding = encoding_; // not reflected in native descriptors -} \ No newline at end of file +} diff --git a/src/osx/cocoa/scrolbar.mm b/src/osx/cocoa/scrolbar.mm index eec8756cfc..4814d87f64 100644 --- a/src/osx/cocoa/scrolbar.mm +++ b/src/osx/cocoa/scrolbar.mm @@ -19,6 +19,7 @@ #include "wx/settings.h" #endif +#include "wx/math.h" #include "wx/osx/private.h" @interface wxNSScroller : NSScroller @@ -67,7 +68,7 @@ public : virtual wxInt32 GetValue() const { - return [(wxNSScroller*) m_osxView floatValue] * m_maximum; + return wxRound([(wxNSScroller*) m_osxView floatValue] * m_maximum); } virtual wxInt32 GetMaximum() const diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index 71b8bda63a..5b45d7bdaa 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -1654,8 +1654,11 @@ public: SetType(wxBITMAP_TYPE_PICT_RESOURCE); }; - virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight); + virtual bool LoadFile(wxBitmap *bitmap, + const wxString& name, + wxBitmapType type, + int desiredWidth, + int desiredHeight); }; IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) @@ -1663,7 +1666,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, - long WXUNUSED(flags), + wxBitmapType WXUNUSED(type), int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight)) { diff --git a/src/osx/core/glgrab.cpp b/src/osx/core/glgrab.cpp index 4dff0202a8..a3ab663475 100644 --- a/src/osx/core/glgrab.cpp +++ b/src/osx/core/glgrab.cpp @@ -146,8 +146,8 @@ CGImageRef grabViaOpenGL(CGDirectDisplayID display, CGRect srcRect) glReadBuffer(GL_FRONT); - width = srcRect.size.width; - height = srcRect.size.height; + width = (GLint)srcRect.size.width; + height = (GLint)srcRect.size.height; bytewidth = width * 4; // Assume 4 bytes/pixel for now diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index 4edf70e696..5797b5eedb 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -200,7 +200,8 @@ bool wxConsoleEventLoop::Pending() const bool wxConsoleEventLoop::Dispatch() { - DispatchTimeout(wxFDIODispatcher::TIMEOUT_INFINITE); + DispatchTimeout(static_cast( + wxFDIODispatcher::TIMEOUT_INFINITE)); return true; } -- 2.45.2