]> git.saurik.com Git - wxWidgets.git/commitdiff
fix a couple of harmless warnings during wxOSX build
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 18 Jun 2009 22:54:21 +0000 (22:54 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 18 Jun 2009 22:54:21 +0000 (22:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61124 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/aui/framemanager.cpp
src/generic/listbkg.cpp
src/generic/renderg.cpp
src/osx/carbon/dcscreen.cpp
src/osx/carbon/font.cpp
src/osx/cocoa/scrolbar.mm
src/osx/core/bitmap.cpp
src/osx/core/glgrab.cpp
src/unix/evtloopunix.cpp

index 62b3281b91394671ad6e7a74ea9c155adb396c1d..9e0e2ae07a31800996ed7199b8e7b16f7472a199 100644 (file)
@@ -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;
index 96eed8b9556b7f1c8920594a78ecc2d0e0281b3e..e7dd71235d75033d4d0aaffee3fd294fb552946d 100644 (file)
@@ -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) )
     {
index 4fcd52f56f57e2eaa33d46bd6ccca1436d8ce2d9..c2c74c54bf76082ff6f911b3d68d5e727f471cf7 100644 (file)
@@ -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
index b7acdc8476f92aa691c085a834ca17c81c9ba62f..0777c55d525f5fef20ad7f574f1517077237e32f 100644 (file)
@@ -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);
index dc5a0ce72fd3c7eadd58f0b6e33581b680ec7e76..e6fd9cc650ad03ce4e29859779a34dfe23a88da0 100644 (file)
@@ -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<wxFont *>(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<wxFont *>(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
+}
index eec8756cfc3930f52a7b3d9c31a7c23e7fea7bc8..4814d87f64284cd688b04b951698a584d86cf812 100644 (file)
@@ -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
index 71b8bda63aee43da5861312831e3a684d68bcb1d..5b45d7bdaa80a4d4d7eb7380adc85dc1344b706c 100644 (file)
@@ -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))
 {
index 4dff0202a8c60e2feef4e6fb95644ed5c1de8306..a3ab6634751f2d8543ace3b5ba012688ac55379f 100644 (file)
@@ -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
index 4edf70e6969dbaed9077ecacd548510efe8bf811..5797b5eedb9e88abcf1f18143dea2c43e00ad959 100644 (file)
@@ -200,7 +200,8 @@ bool wxConsoleEventLoop::Pending() const
 
 bool wxConsoleEventLoop::Dispatch()
 {
-    DispatchTimeout(wxFDIODispatcher::TIMEOUT_INFINITE);
+    DispatchTimeout(static_cast<unsigned long>(
+        wxFDIODispatcher::TIMEOUT_INFINITE));
 
     return true;
 }