From de0d209531f148e8d4b18149d0a3ca25dbc88075 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Mon, 23 Mar 2009 15:24:04 +0000 Subject: [PATCH] fixing warning in osx core and carbon git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/osx/carbon/app.cpp | 9 +++++++++ src/osx/carbon/combobox.cpp | 2 +- src/osx/carbon/dnd.cpp | 2 ++ src/osx/carbon/font.cpp | 4 ++-- src/osx/carbon/graphics.cpp | 8 +++++--- src/osx/carbon/mdi.cpp | 2 ++ src/osx/carbon/renderer.cpp | 1 + src/osx/carbon/statbrma.cpp | 2 +- src/osx/carbon/utilscocoa.mm | 2 +- src/osx/core/mimetype.cpp | 4 ++-- 10 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index aca2178127..0ec20f24c4 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -1516,6 +1516,15 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess event.m_y = wherey; event.SetTimestamp(when); event.SetEventObject(focus); +#else + wxUnusedVar(event); + wxUnusedVar(focus); + wxUnusedVar(keymessage); + wxUnusedVar(modifiers); + wxUnusedVar(when); + wxUnusedVar(wherex); + wxUnusedVar(wherey); + wxUnusedVar(uniChar); #endif } diff --git a/src/osx/carbon/combobox.cpp b/src/osx/carbon/combobox.cpp index 6792bbf1ae..53b729485e 100644 --- a/src/osx/carbon/combobox.cpp +++ b/src/osx/carbon/combobox.cpp @@ -659,7 +659,7 @@ bool wxComboBox::CanRedo() const return false; } -bool wxComboBox::OSXHandleClicked( double timestampsec ) +bool wxComboBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) { /* For consistency with other platforms, clicking in the text area does not constitute a selection diff --git a/src/osx/carbon/dnd.cpp b/src/osx/carbon/dnd.cpp index bc0f7e5485..1c06491e9a 100644 --- a/src/osx/carbon/dnd.cpp +++ b/src/osx/carbon/dnd.cpp @@ -302,6 +302,8 @@ wxDragResult wxDropSource::DoDragDrop(int flags) DisposeDrag( theDrag ); CFRelease( pasteboard ); gTrackingGlobals.m_currentSource = NULL; +#else + wxUnusedVar(flags); #endif return gTrackingGlobals.m_result; diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index de2fbe7024..250fecd35a 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -283,7 +283,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) #if wxOSX_USE_CORE_TEXT if ( UMAGetSystemVersion() >= 0x1050 ) { - CTFontUIFontType uifont; + CTFontUIFontType uifont = kCTFontSystemFontType; switch( font ) { case wxOSX_SYSTEM_FONT_NORMAL: @@ -323,7 +323,7 @@ wxFontRefData::wxFontRefData(wxOSXSystemFont font, int size) { #if !wxOSX_USE_CARBON // not needed outside - ThemeFontID m_macThemeFontID; + ThemeFontID m_macThemeFontID = kThemeSystemFont; #endif switch( font ) { diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 27a0424788..e81a541cb5 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1806,7 +1806,7 @@ bool wxMacCoreGraphicsContext::SetCompositionMode(wxCompositionMode op) void wxMacCoreGraphicsContext::BeginLayer(wxDouble opacity) { CGContextSaveGState(m_cgContext); - CGContextSetAlpha(m_cgContext, opacity); + CGContextSetAlpha(m_cgContext, (CGFloat) opacity); CGContextBeginTransparencyLayer(m_cgContext, 0); } @@ -2179,7 +2179,7 @@ void wxMacCoreGraphicsContext::DoDrawText( const wxString &str, wxDouble x, wxDo y += CTFontGetAscent(font); CGContextSaveGState(m_cgContext); - CGContextTranslateCTM(m_cgContext, x, y); + CGContextTranslateCTM(m_cgContext, (CGFloat) x, (CGFloat) y); CGContextScaleCTM(m_cgContext, 1, -1); CGContextSetTextPosition(m_cgContext, 0, 0); CTLineDraw( line, m_cgContext ); @@ -2352,7 +2352,8 @@ void wxMacCoreGraphicsContext::GetTextExtent( const wxString &str, wxDouble *wid wxCFRef attrtext( CFAttributedStringCreate(kCFAllocatorDefault, text, attributes) ); wxCFRef line( CTLineCreateWithAttributedString(attrtext) ); - CGFloat w, a, d, l; + double w; + CGFloat a, d, l; w = CTLineGetTypographicBounds(line, &a, &d, &l) ; @@ -2703,6 +2704,7 @@ wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeWindow( vo #if wxOSX_USE_CARBON return new wxMacCoreGraphicsContext(this,(WindowRef)window); #else + wxUnusedVar(window); return NULL; #endif } diff --git a/src/osx/carbon/mdi.cpp b/src/osx/carbon/mdi.cpp index daf448f6ff..eb86566919 100644 --- a/src/osx/carbon/mdi.cpp +++ b/src/osx/carbon/mdi.cpp @@ -71,6 +71,8 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate ) #endif } #elif defined(wxOSX_USE_COCOA) + wxUnusedVar(inActivate); + wxUnusedVar(inWindowRef); // TODO: implement me! #endif } diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index f8e770f425..49e9c18244 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -38,6 +38,7 @@ // check if we're currently in a paint event inline bool wxInPaintEvent(wxWindow* win, wxDC& dc) { + wxUnusedVar(dc); return ( win->MacGetCGContextRef() != NULL ); } diff --git a/src/osx/carbon/statbrma.cpp b/src/osx/carbon/statbrma.cpp index a1f4cb28f6..3898d12d56 100644 --- a/src/osx/carbon/statbrma.cpp +++ b/src/osx/carbon/statbrma.cpp @@ -70,7 +70,7 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, return true; } -void wxStatusBarMac::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int textHeight) +void wxStatusBarMac::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int WXUNUSED(textHeight)) { int w, h; GetSize( &w , &h ); diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index bf7392e892..0b8eaa3618 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -95,7 +95,7 @@ void* wxMacCocoaRetain( void* obj ) WX_NSFont wxFont::CreateNSFont(wxOSXSystemFont font, wxNativeFontInfo* info) { - NSFont* nsfont; + NSFont* nsfont = nil; switch( font ) { case wxOSX_SYSTEM_FONT_NORMAL: diff --git a/src/osx/core/mimetype.cpp b/src/osx/core/mimetype.cpp index 59fd12a0db..6bfd38a8b9 100644 --- a/src/osx/core/mimetype.cpp +++ b/src/osx/core/mimetype.cpp @@ -298,8 +298,8 @@ void wxMimeTypesManagerImpl::InitIfNeeded() // read system and user mailcaps and other files -void wxMimeTypesManagerImpl::Initialize(int mailcapStyles, - const wxString& sExtraDir) +void wxMimeTypesManagerImpl::Initialize(int WXUNUSED(mailcapStyles), + const wxString& WXUNUSED(sExtraDir)) { #ifdef __VMS // XDG tables are never installed on OpenVMS -- 2.45.2