diff --git a/build/cmake/modules/FindWEBKIT2.cmake b/build/cmake/modules/FindWEBKIT2.cmake index 92a0874c60..133e7a4563 100644 --- a/build/cmake/modules/FindWEBKIT2.cmake +++ b/build/cmake/modules/FindWEBKIT2.cmake @@ -40,4 +40,8 @@ ELSE(WEBKIT2_FOUND) SET( WEBKIT2_LIBRARIES ) ENDIF(WEBKIT2_FOUND) -MARK_AS_ADVANCED(WEBKIT2_LIBRARY WEBKIT2_LIBRARIES WEBKIT2_INCLUDE_DIR) +MARK_AS_ADVANCED(WEBKIT2_LIBRARY + WEBKIT2_LIBRARIES + WEBKIT2_INCLUDE_DIR + WEBKIT2_JS_LIBRARY +) diff --git a/include/wx/msw/uxtheme.h b/include/wx/msw/uxtheme.h index 62f9cf88ee..83393c6c57 100644 --- a/include/wx/msw/uxtheme.h +++ b/include/wx/msw/uxtheme.h @@ -56,7 +56,7 @@ #endif #ifndef TMT_FONT -#define TMT_FONT 210 +#define TMT_FONT 210 #endif #ifndef HAVE_VSSYM32 diff --git a/include/wx/msw/wx.rc b/include/wx/msw/wx.rc index 44a33c0886..732793c197 100644 --- a/include/wx/msw/wx.rc +++ b/include/wx/msw/wx.rc @@ -25,7 +25,7 @@ BEGIN MENUITEM "&Cascade", 4002 MENUITEM "Tile &Horizontally", 4001 MENUITEM "Tile &Vertically", 4005 - MENUITEM "", -1 + MENUITEM "", -1 MENUITEM "&Arrange Icons", 4003 MENUITEM "&Next", 4004 END diff --git a/include/wx/x11/nanox/X11/Xlib.h b/include/wx/x11/nanox/X11/Xlib.h index 0e3aed4d23..f1ebf6fb5e 100644 --- a/include/wx/x11/nanox/X11/Xlib.h +++ b/include/wx/x11/nanox/X11/Xlib.h @@ -26,12 +26,12 @@ typedef struct { GR_FONT_ID fid; } XFontStruct; typedef struct { - short lbearing; /* origin to left edge of raster */ - short rbearing; /* origin to right edge of raster */ - short width; /* advance to next char's origin */ - short ascent; /* baseline to top edge of raster */ - short descent; /* baseline to bottom edge of raster */ - unsigned short attributes; /* per char flags (not predefined) */ + short lbearing; /* origin to left edge of raster */ + short rbearing; /* origin to right edge of raster */ + short width; /* advance to next char's origin */ + short ascent; /* baseline to top edge of raster */ + short descent; /* baseline to bottom edge of raster */ + unsigned short attributes; /* per char flags (not predefined) */ } XCharStruct; /* Configure window value mask bits */ @@ -133,8 +133,8 @@ typedef struct { #define XSetSubwindowMode(d, gc, mode) wxNoop() #define XFreeColormap(d, cmap) wxNoop() #define XSetTransientForHint(d, w, p) wxNoop() -#define XUnionRegion(sr1,sr2,r) GrUnionRegion(r,sr1,sr2) -#define XIntersectRegion(sr1,sr2,r) GrIntersectRegion(r,sr1,sr2) +#define XUnionRegion(sr1,sr2,r) GrUnionRegion(r,sr1,sr2) +#define XIntersectRegion(sr1,sr2,r) GrIntersectRegion(r,sr1,sr2) #define XEqualRegion(r1, r2) GrEqualRegion(r1, r2) #define XEmptyRegion(r) GrEmptyRegion(r) #define XOffsetRegion(r, x, y) GrOffsetRegion(r, x, y) @@ -144,7 +144,7 @@ typedef struct { /* TODO: Cannot find equivalent for this. */ #define XIconifyWindow(d, w, s) 0 #define XCreateWindowWithColor(d,p,x,y,w,h,bw,depth,cl,vis,backColor,foreColor) \ - GrNewWindow(p,x,y,w,h,bw,backColor,foreColor) + GrNewWindow(p,x,y,w,h,bw,backColor,foreColor) #define XLookupString(event, buf, len, sym, status) (*sym = (event)->scancode) #define XBell(a, b) GrBell() #define DisplayWidthMM(d, s) 100 @@ -163,45 +163,45 @@ typedef struct { * Data structure used by color operations */ typedef struct { - unsigned long pixel; - unsigned short red, green, blue; - char flags; /* do_red, do_green, do_blue */ - char pad; + unsigned long pixel; + unsigned short red, green, blue; + char flags; /* do_red, do_green, do_blue */ + char pad; } XColor; typedef struct { - int type; - Display *display; /* Display the event was read from */ - XID resourceid; /* resource id */ - unsigned long serial; /* serial number of failed request */ - unsigned char error_code; /* error code of failed request */ - unsigned char request_code; /* Major op-code of failed request */ - unsigned char minor_code; /* Minor op-code of failed request */ + int type; + Display *display; /* Display the event was read from */ + XID resourceid; /* resource id */ + unsigned long serial; /* serial number of failed request */ + unsigned char error_code; /* error code of failed request */ + unsigned char request_code; /* Major op-code of failed request */ + unsigned char minor_code; /* Minor op-code of failed request */ } XErrorEvent; /* * Visual structure; contains information about colormapping possible. */ typedef struct { - void *ext_data; /* hook for extension to hang data */ - VisualID visualid; /* visual id of this visual */ + void *ext_data; /* hook for extension to hang data */ + VisualID visualid; /* visual id of this visual */ #if defined(__cplusplus) || defined(c_plusplus) - int c_class; /* C++ class of screen (monochrome, etc.) */ + int c_class; /* C++ class of screen (monochrome, etc.) */ #else - int class; /* class of screen (monochrome, etc.) */ + int class; /* class of screen (monochrome, etc.) */ #endif - unsigned long red_mask, green_mask, blue_mask; /* mask values */ - int bits_per_rgb; /* log base 2 of distinct color values */ - int map_entries; /* color map entries */ + unsigned long red_mask, green_mask, blue_mask; /* mask values */ + int bits_per_rgb; /* log base 2 of distinct color values */ + int map_entries; /* color map entries */ } Visual; /* * Depth structure; contains information for each possible depth. - */ + */ typedef struct { - int depth; /* this depth (Z) of the depth */ - int nvisuals; /* number of Visual types at this depth */ - Visual *visuals; /* list of visuals possible at this depth */ + int depth; /* this depth (Z) of the depth */ + int nvisuals; /* number of Visual types at this depth */ + Visual *visuals; /* list of visuals possible at this depth */ } Depth; /* @@ -210,56 +210,56 @@ typedef struct { * by application code. */ -struct _XDisplay; /* Forward declare before use for C++ */ +struct _XDisplay; /* Forward declare before use for C++ */ typedef struct { - void *ext_data; /* hook for extension to hang data */ - struct _XDisplay *display;/* back pointer to display structure */ - Window root; /* Root window id. */ - int width, height; /* width and height of screen */ - int mwidth, mheight; /* width and height of in millimeters */ - int ndepths; /* number of depths possible */ - Depth *depths; /* list of allowable depths on the screen */ - int root_depth; /* bits per pixel */ - Visual *root_visual; /* root visual */ - GC default_gc; /* GC for the root root visual */ - Colormap cmap; /* default color map */ - unsigned long white_pixel; - unsigned long black_pixel; /* White and Black pixel values */ - int max_maps, min_maps; /* max and min color maps */ - int backing_store; /* Never, WhenMapped, Always */ - Bool save_unders; - long root_input_mask; /* initial root input mask */ + void *ext_data; /* hook for extension to hang data */ + struct _XDisplay *display; /* back pointer to display structure */ + Window root; /* Root window id. */ + int width, height; /* width and height of screen */ + int mwidth, mheight; /* width and height of in millimeters */ + int ndepths; /* number of depths possible */ + Depth *depths; /* list of allowable depths on the screen */ + int root_depth; /* bits per pixel */ + Visual *root_visual; /* root visual */ + GC default_gc; /* GC for the root root visual */ + Colormap cmap; /* default color map */ + unsigned long white_pixel; + unsigned long black_pixel; /* White and Black pixel values */ + int max_maps, min_maps; /* max and min color maps */ + int backing_store; /* Never, WhenMapped, Always */ + Bool save_unders; + long root_input_mask; /* initial root input mask */ } Screen; typedef struct { - int x, y; /* location of window */ + int x, y; /* location of window */ int width, height; /* width and height of window */ - int border_width; /* border width of window */ - int depth; /* depth of window */ - Visual *visual; /* the associated visual structure */ - Window root; /* root of screen containing window */ - int _class; /* InputOutput, InputOnly*/ - int bit_gravity; /* one of the bit gravity values */ - int win_gravity; /* one of the window gravity values */ + int border_width; /* border width of window */ + int depth; /* depth of window */ + Visual *visual; /* the associated visual structure */ + Window root; /* root of screen containing window */ + int _class; /* InputOutput, InputOnly*/ + int bit_gravity; /* one of the bit gravity values */ + int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preserved if possible */ unsigned long backing_pixel;/* value to be used when restoring planes */ - Bool save_under; /* boolean, should bits under be saved? */ + Bool save_under; /* boolean, should bits under be saved? */ Colormap colormap; /* color map to be associated with window */ Bool map_installed; /* boolean, is color map currently installed*/ - int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ + int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ long all_event_masks; /* set of events all people have interest in*/ long your_event_mask; /* my event mask */ long do_not_propagate_mask;/* set of events that should not propagate */ Bool override_redirect; /* boolean value for override-redirect */ - Screen *screen; /* back pointer to correct screen */ + Screen *screen; /* back pointer to correct screen */ } XWindowAttributes; -typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ - Display* /* display */, - XErrorEvent* /* error_event */ +typedef int (*XErrorHandler) (/* WARNING, this type not in Xlib spec */ + Display* /* display */, + XErrorEvent* /* error_event */ ); /* events*/ diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index db9150bb15..41e821cb83 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -1281,7 +1281,7 @@ void MyFrame::OnDropPossible( wxDataViewEvent &event ) if (event.GetDataFormat() != wxDF_UNICODETEXT) event.Veto(); else - event.SetDropEffect(wxDragMove); // check 'move' drop effect + event.SetDropEffect(wxDragMove); // check 'move' drop effect } void MyFrame::OnDrop( wxDataViewEvent &event ) diff --git a/samples/regtest/regtest.rc b/samples/regtest/regtest.rc index e8d9832066..d8ad09c9bc 100644 --- a/samples/regtest/regtest.rc +++ b/samples/regtest/regtest.rc @@ -1,9 +1,9 @@ #include "../sample.rc" -app_icon ICON "registry.ico" -icon_key1 ICON "key1.ico" -icon_key2 ICON "key2.ico" -icon_key3 ICON "key3.ico" -icon_value1 ICON "value1.ico" -icon_value2 ICON "value2.ico" +app_icon ICON "registry.ico" +icon_key1 ICON "key1.ico" +icon_key2 ICON "key2.ico" +icon_key3 ICON "key3.ico" +icon_value1 ICON "value1.ico" +icon_value2 ICON "value2.ico" diff --git a/samples/sound/sound.rc b/samples/sound/sound.rc index 21a5d21ac7..ec4bbc5beb 100644 --- a/samples/sound/sound.rc +++ b/samples/sound/sound.rc @@ -1,3 +1,3 @@ -FromResource WAVE "cuckoo.wav" +FromResource WAVE "cuckoo.wav" #include "../sample.rc" diff --git a/samples/stc/edit.cpp b/samples/stc/edit.cpp index c198afaa7d..64b7b38f03 100644 --- a/samples/stc/edit.cpp +++ b/samples/stc/edit.cpp @@ -52,8 +52,8 @@ const int ANNOTATION_STYLE = wxSTC_STYLE_LASTPREDEFINED + 1; // A small image of a hashtag symbol used in the autocompletion window. const char* hashtag_xpm[] = { "10 10 2 1", -" c None", -". c #BD08F9", +" c None", +". c #BD08F9", " .. .. ", " .. .. ", "..........", diff --git a/src/aui/tabartgtk.cpp b/src/aui/tabartgtk.cpp index 7a9949d5bd..ac6d6bb2ee 100644 --- a/src/aui/tabartgtk.cpp +++ b/src/aui/tabartgtk.cpp @@ -218,7 +218,7 @@ void wxAuiGtkTabArt::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& p if (!page.active) tab_rect.y += 2 * GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder; gap_rect_y = tab_rect.y + tab_rect.height - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder / 2; - // fall through + wxFALLTHROUGH; case wxAUI_NB_BOTTOM: gap_start = tab_rect.x - GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder / 2; gap_width = tab_rect.width; diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 066e056847..44c4df22a8 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1799,7 +1799,6 @@ wxString wxLocale::GetInfo(wxLocaleInfo index, wxLocaleCategory WXUNUSED(cat)) format.Replace("%y","%Y"); return format; } - break; default: wxFAIL_MSG( "Unknown locale info" ); diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 645fc61f73..4bf9214cae 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -148,8 +148,8 @@ wxChar wxTextInputStream::GetChar() // remember the second one for the next call, as there is no // way to fit both of them into a single wxChar in this case. m_lastWChar = wbuf[1]; -#endif // SIZEOF_WCHAR_T == 2 wxFALLTHROUGH; +#endif // SIZEOF_WCHAR_T == 2 case 1: m_validBegin = inlen + 1; diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index a4952899e6..c131cec80d 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -716,7 +716,7 @@ size_t wxStrlen(const wxChar16 *s ) { if (!s) return 0; size_t i=0; - while (*s!=0) { ++i; ++s; }; + while (*s!=0) { ++i; ++s; } return i; } diff --git a/src/generic/timectrlg.cpp b/src/generic/timectrlg.cpp index f6ed886fd7..1bb32d2aab 100644 --- a/src/generic/timectrlg.cpp +++ b/src/generic/timectrlg.cpp @@ -288,7 +288,7 @@ private: case wxTE_HT_BELOW: // This shouldn't happen for single line control. wxFAIL_MSG( "Unreachable" ); - // fall through + wxFALLTHROUGH; case wxTE_HT_BEYOND: // Select the last field. diff --git a/src/gtk/anybutton.cpp b/src/gtk/anybutton.cpp index 1b57953fb9..a35f01addc 100644 --- a/src/gtk/anybutton.cpp +++ b/src/gtk/anybutton.cpp @@ -393,7 +393,7 @@ void wxAnyButton::DoSetBitmapPosition(wxDirection dir) { default: wxFAIL_MSG( "invalid position" ); - // fall through + wxFALLTHROUGH; case wxLEFT: gtkpos = GTK_POS_LEFT; diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index 795620da3e..eb9751c85a 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -301,7 +301,7 @@ static void wxgtk_main_do_event(GdkEvent* event, void* data) // examine the event itself to distinguish between the two cases but // this would be unnecessarily complicated). cat2 = wxEVT_CATEGORY_CLIPBOARD; - // Fall through. + wxFALLTHROUGH; case GDK_PROXIMITY_IN: case GDK_PROXIMITY_OUT: diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 8b21013b7d..708e93fc9a 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -901,7 +901,7 @@ void wxMenu::GtkAppend(wxMenuItem* mitem, int pos) break; default: wxFAIL_MSG("unexpected menu item kind"); - // fall through + wxFALLTHROUGH; case wxITEM_NORMAL: #ifdef __WXGTK4__ //TODO GtkImageMenuItem is gone, have to implement it ourselves with diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index 5530d8bb5c..b617297f11 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -279,7 +279,7 @@ int wxMessageDialog::ShowModal() { default: wxFAIL_MSG(wxT("unexpected GtkMessageDialog return code")); - // fall through + wxFALLTHROUGH; case GTK_RESPONSE_CANCEL: case GTK_RESPONSE_DELETE_EVENT: diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 977b166f60..c885abf067 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -189,7 +189,7 @@ GtkPolicyType GtkPolicyFromWX(wxScrollbarVisibility visibility) default: wxFAIL_MSG( wxS("unknown scrollbar visibility") ); - // fall through + wxFALLTHROUGH; case wxSHOW_SB_ALWAYS: policy = GTK_POLICY_ALWAYS; diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 66ab0a690d..97871a0daf 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -404,7 +404,7 @@ void wxGtkStyleContext::Bg(wxColour& color, int state) const const int i = stride * (cairo_image_surface_get_height(surf) / 2); const unsigned* p = reinterpret_cast(data + i); const unsigned pixel = *p; - guchar r, g, b, a = 0xff; + guchar r = 0, g = 0, b = 0, a = 0xff; switch (cairo_image_surface_get_format(surf)) { case CAIRO_FORMAT_ARGB32: diff --git a/src/gtk/toolbar.cpp b/src/gtk/toolbar.cpp index 99be10ff57..40df27abb1 100644 --- a/src/gtk/toolbar.cpp +++ b/src/gtk/toolbar.cpp @@ -572,7 +572,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) break; default: wxFAIL_MSG("unknown toolbar child type"); - // fall through + wxFALLTHROUGH; case wxITEM_DROPDOWN: case wxITEM_NORMAL: tool->m_item = gtk_tool_button_new(NULL, ""); diff --git a/src/gtk/treeentry_gtk.c b/src/gtk/treeentry_gtk.c index 61738e0327..d2af58e181 100644 --- a/src/gtk/treeentry_gtk.c +++ b/src/gtk/treeentry_gtk.c @@ -136,6 +136,7 @@ void wx_tree_entry_set_destroy_func(wxTreeEntry* entry, /* private */ static void wx_tree_entry_class_init(void* g_class, void* class_data) { + (void)class_data; GObjectClass* gobject_class = G_OBJECT_CLASS(g_class); gobject_class->dispose = wx_tree_entry_dispose; parent_class = G_OBJECT_CLASS(g_type_class_peek_parent(g_class)); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 20cbea46c9..2e0e7f2ed2 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -5181,7 +5181,7 @@ void wxWindowGTK::GTKSendPaintEvents(const GdkRegion* region) break; } } - // fall through + wxFALLTHROUGH; case wxBG_STYLE_SYSTEM: if ( GetThemeEnabled() ) diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index fee40dfe68..b32ddf9a20 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -222,16 +222,16 @@ bool wxMask::Create( const wxBitmap& bitmap ) wxBitmap wxMask::GetBitmap() const { - wxBitmap bitmap; + wxBitmap bitmap; - if (m_bitmap) - { - bitmap.SetBitmap( m_bitmap ); - bitmap.SetWidth( m_width ); - bitmap.SetHeight( m_height ); - } + if (m_bitmap) + { + bitmap.SetBitmap( m_bitmap ); + bitmap.SetWidth( m_width ); + bitmap.SetHeight( m_height ); + } - return bitmap; + return bitmap; } diff --git a/src/html/chm.cpp b/src/html/chm.cpp index f46edd8797..a1d7e6be90 100644 --- a/src/html/chm.cpp +++ b/src/html/chm.cpp @@ -464,14 +464,14 @@ bool wxChmInputStream::Eof() const return (m_content==NULL || m_contentStream==NULL || m_contentStream->Eof() || - m_pos>m_size); + (size_t)m_pos>m_size); } size_t wxChmInputStream::OnSysRead(void *buffer, size_t bufsize) { - if ( m_pos >= m_size ) + if ( (size_t)m_pos >= m_size ) { m_lasterror = wxSTREAM_EOF; return 0; @@ -854,7 +854,7 @@ wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), /** * Doku see wxFileSystemHandler */ -wxString wxChmFSHandler::FindFirst(const wxString& spec, int flags) +wxString wxChmFSHandler::FindFirst(const wxString& spec, int WXUNUSED(flags)) { wxString right = GetRightLocation(spec); wxString left = GetLeftLocation(spec); diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp index c11e74641a..020731e580 100644 --- a/src/msw/uxtheme.cpp +++ b/src/msw/uxtheme.cpp @@ -34,11 +34,11 @@ bool wxUxThemeIsActive() { - return ::IsAppThemed() && ::IsThemeActive(); + return ::IsAppThemed() && ::IsThemeActive(); } #else bool wxUxThemeIsActive() { - return false; + return false; } #endif // wxUSE_UXTHEME diff --git a/src/osx/carbon/colordlgosx.mm b/src/osx/carbon/colordlgosx.mm index e487a06119..dfd888ceda 100644 --- a/src/osx/carbon/colordlgosx.mm +++ b/src/osx/carbon/colordlgosx.mm @@ -138,7 +138,7 @@ int wxColourDialog::ShowModal() [theColorPanel setDelegate:theCPDelegate]; // - // Start the color panel modal loop + // Start the color panel modal loop // OSXBeginModalDialog(); NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel]; diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 76888bbb7b..3e243ee927 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -472,6 +472,7 @@ wxFont::wxFont(wxOSXSystemFont font) break; case wxOSX_SYSTEM_FONT_FIXED: uifont = kCTFontUIFontUserFixedPitch; + break; default: break; } diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index 4d3a182515..9a7c2ceb22 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -197,7 +197,7 @@ WXImage wxOSXGetSystemImage(const wxString& name) return nsimage; } -wxBitmap wxOSXCreateSystemBitmap(const wxString& name, const wxString &client, const wxSize& sizeHint) +wxBitmap wxOSXCreateSystemBitmap(const wxString& name, const wxString &WXUNUSED(client), const wxSize& WXUNUSED(sizeHint)) { NSImage* nsimage = wxOSXGetSystemImage(name); if ( nsimage ) diff --git a/src/osx/cocoa/choice.mm b/src/osx/cocoa/choice.mm index c0f87584e3..c7ea9dbad7 100644 --- a/src/osx/cocoa/choice.mm +++ b/src/osx/cocoa/choice.mm @@ -116,16 +116,16 @@ public: } size_t GetNumberOfItems() const wxOVERRIDE - { + { return m_popUpMenu->GetMenuItemCount(); - } + } void RemoveItem( size_t pos ) wxOVERRIDE { m_popUpMenu->Delete( m_popUpMenu->FindItemByPosition( pos ) ); } - void SetItem(int pos, const wxString& s) wxOVERRIDE + void SetItem(int pos, const wxString& s) wxOVERRIDE { m_popUpMenu->FindItemByPosition( pos )->SetItemLabel( s ) ; } @@ -137,7 +137,7 @@ private: wxWidgetImplType* wxWidgetImpl::CreateChoice( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent), wxWindowID WXUNUSED(id), - wxMenu* menu, + wxMenu* WXUNUSED(menu), const wxPoint& pos, const wxSize& size, long WXUNUSED(style), diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 6e96482f25..69f7d914a3 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -1929,6 +1929,8 @@ outlineView:(NSOutlineView*)outlineView -(BOOL) textShouldBeginEditing:(NSText*)textEditor { + wxUnusedVar(textEditor); + currentlyEditedColumn = [self editedColumn]; currentlyEditedRow = [self editedRow]; @@ -2743,7 +2745,6 @@ wxDataObjectComposite* wxCocoaDataViewControl::GetDnDDataObjects(NSData* dataObj return NULL; } } - break; default: return NULL; } @@ -3426,7 +3427,7 @@ wxIMPLEMENT_CLASS(wxDataViewCheckIconText, wxDataViewIconText); wxDataViewCheckIconTextRenderer::wxDataViewCheckIconTextRenderer ( wxDataViewCellMode mode, - int align + int WXUNUSED(align) ) : wxDataViewRenderer(GetDefaultType(), mode,mode) { diff --git a/src/osx/cocoa/datetimectrl.mm b/src/osx/cocoa/datetimectrl.mm index 3157bc21c8..768c886c0c 100644 --- a/src/osx/cocoa/datetimectrl.mm +++ b/src/osx/cocoa/datetimectrl.mm @@ -164,7 +164,7 @@ wxDateTimeWidgetImpl::CreateDateTimePicker(wxDateTimePickerCtrl* wxpeer, const wxDateTime& dt, const wxPoint& pos, const wxSize& size, - long style, + long WXUNUSED(style), wxDateTimeWidgetKind kind) { NSRect r = wxOSXGetFrameForControl(wxpeer, pos, size); diff --git a/src/osx/cocoa/dnd.mm b/src/osx/cocoa/dnd.mm index d4a3305fdd..d8786cc2de 100644 --- a/src/osx/cocoa/dnd.mm +++ b/src/osx/cocoa/dnd.mm @@ -89,7 +89,7 @@ public: [m_item setData:(NSData*) data forType:(NSString*) format]; } - NSPasteboardItem* GetNative() { return m_item; }; + NSPasteboardItem* GetNative() { return m_item; } private: NSPasteboardItem* m_item; }; @@ -157,7 +157,7 @@ public: return (CFDataRef) [m_item dataForType:(NSString*) type]; } - NSPasteboardItem* GetNative() { return m_item; }; + NSPasteboardItem* GetNative() { return m_item; } private: NSPasteboardItem* m_item; NSPasteboard* m_pasteboard; @@ -318,6 +318,9 @@ wxDragResult NSDragOperationToWxDragResult(NSDragOperation code) - (NSDragOperation)draggingSession:(nonnull NSDraggingSession *)session sourceOperationMaskForDraggingContext:(NSDraggingContext)context { + wxUnusedVar(session); + wxUnusedVar(context); + NSDragOperation allowedDragOperations = NSDragOperationEvery; // NSDragOperationGeneric also makes a drag to the trash possible @@ -471,6 +474,7 @@ typedef NSString* NSPasteboardType; - (nonnull NSArray *)writableTypesForPasteboard:(nonnull NSPasteboard *)pasteboard { + wxUnusedVar(pasteboard); wxCFMutableArrayRef typesarray; if ( m_data ) m_data->AddSupportedTypes(typesarray, wxDataObjectBase::Direction::Get); diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index dfe7e5f381..f0ca589d42 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -69,7 +69,7 @@ static NSUInteger CalculateNSEventMaskFromEventCategory(wxEventCategory cat) if ( cat | wxEVT_CATEGORY_USER_INPUT ) { mask |= - NSLeftMouseDownMask | + NSLeftMouseDownMask | NSLeftMouseUpMask | NSRightMouseDownMask | NSRightMouseUpMask | diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index a267942860..99536113ee 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -419,7 +419,7 @@ int wxFileDialog::ShowModal() m_firstFileTypeFilter = -1; if ( m_useFileTypeFilter - && m_filterIndex >= 0 && m_filterIndex < m_filterExtensions.GetCount() ) + && m_filterIndex >= 0 && (size_t)m_filterIndex < m_filterExtensions.GetCount() ) { m_firstFileTypeFilter = m_filterIndex; } diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index f6bff5b1fb..d92f7d4494 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -87,7 +87,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, if ( GLAttrs && n1 > 1 ) { n1--; // skip the ending '0' - while ( p < n1 ) + while ( p < (unsigned)n1 ) { data[p] = (NSOpenGLPixelFormatAttribute) GLAttrs[p]; p++; @@ -98,7 +98,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, { n2--; // skip the ending '0' unsigned p2 = 0; - while ( p2 < n2 ) + while ( p2 < (unsigned)n2 ) data[p++] = (NSOpenGLPixelFormatAttribute) ctxAttrs[p2++]; } diff --git a/src/osx/cocoa/mediactrl.mm b/src/osx/cocoa/mediactrl.mm index 65efa33089..b00471536d 100644 --- a/src/osx/cocoa/mediactrl.mm +++ b/src/osx/cocoa/mediactrl.mm @@ -209,6 +209,7 @@ private: - (void)playerItemDidReachEnd:(NSNotification *)notification { + wxUnusedVar(notification); if ( m_backend ) { if ( m_backend->SendStopEvent() ) @@ -538,7 +539,7 @@ wxSize wxAVMediaBackend::GetVideoSize() const return m_bestSize; } -void wxAVMediaBackend::Move(int x, int y, int w, int h) +void wxAVMediaBackend::Move(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(w), int WXUNUSED(h)) { // as we have a native player, no need to move the video area } diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index 85eae7320d..f5e23a01e7 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -316,7 +316,7 @@ void* wxMessageDialog::ConstructNSAlert() m_buttonId[ m_buttonCount++ ] = wxID_HELP; } - wxASSERT_MSG( m_buttonCount <= WXSIZEOF(m_buttonId), "Too many buttons" ); + wxASSERT_MSG( m_buttonCount <= (int)WXSIZEOF(m_buttonId), "Too many buttons" ); return alert; } diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index f118433a03..2068807142 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -663,6 +663,9 @@ extern int wxOSXGetIdFromSelector(SEL action ); - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { + wxUnusedVar(keyPath); + wxUnusedVar(change); + if (context == EffectiveAppearanceContext) { wxNonOwnedWindowCocoaImpl* windowimpl = [(NSWindow*)object WX_implementation]; @@ -719,7 +722,7 @@ void wxNonOwnedWindowCocoaImpl::WillBeDestroyed() } } -void wxNonOwnedWindowCocoaImpl::Create( wxWindow* parent, const wxPoint& pos, const wxSize& size, +void wxNonOwnedWindowCocoaImpl::Create( wxWindow* WXUNUSED(parent), const wxPoint& pos, const wxSize& size, long style, long extraStyle, const wxString& WXUNUSED(name) ) { static wxNonOwnedWindowController* controller = NULL; diff --git a/src/osx/cocoa/notifmsg.mm b/src/osx/cocoa/notifmsg.mm index 8828aed52c..3eb3459087 100644 --- a/src/osx/cocoa/notifmsg.mm +++ b/src/osx/cocoa/notifmsg.mm @@ -219,6 +219,7 @@ int wxUserNotificationMsgImpl::ms_notifIdBase = 1000; - (void)userNotificationCenter:(NSUserNotificationCenter *)center didActivateNotification:(NSUserNotification *)notification { + wxUnusedVar(center); NSString* notifId = [notification.userInfo objectForKey:@"wxId"]; if (notifId) wxUserNotificationMsgImpl::NotificationActivated(wxCFStringRef::AsString(notifId), notification.activationType); diff --git a/src/osx/cocoa/overlay.mm b/src/osx/cocoa/overlay.mm index 6aa2211bca..939c59cab4 100644 --- a/src/osx/cocoa/overlay.mm +++ b/src/osx/cocoa/overlay.mm @@ -81,6 +81,7 @@ - (void)drawRect:(NSRect)dirtyRect { + wxUnusedVar(dirtyRect); [self.bitmapImageRep drawInRect:[self bounds]]; } diff --git a/src/osx/cocoa/preferences.mm b/src/osx/cocoa/preferences.mm index 63e6eaf9a5..4d26a958ab 100644 --- a/src/osx/cocoa/preferences.mm +++ b/src/osx/cocoa/preferences.mm @@ -236,7 +236,7 @@ private: OnSelectPageForTool(tool); } - void OnClose(wxCloseEvent& e) + void OnClose(wxCloseEvent& WXUNUSED(e)) { // Instead of destroying the window, just hide it, it could be // reused again by another invocation of the editor. diff --git a/src/osx/cocoa/settings.mm b/src/osx/cocoa/settings.mm index 472d40b424..de5f52860c 100644 --- a/src/osx/cocoa/settings.mm +++ b/src/osx/cocoa/settings.mm @@ -206,16 +206,14 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index) case wxSYS_DEFAULT_GUI_FONT : { return wxFont(wxOSX_SYSTEM_FONT_SMALL) ; - } ; - break ; + } case wxSYS_OEM_FIXED_FONT : case wxSYS_ANSI_FIXED_FONT : case wxSYS_SYSTEM_FIXED_FONT : default : { return wxFont(wxOSX_SYSTEM_FONT_FIXED) ; - } ; - break ; + } } return *wxNORMAL_FONT; diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index b556179e69..d00c43a6a0 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -71,6 +71,10 @@ - (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(int*)index { + wxUnusedVar(control); + wxUnusedVar(words); + wxUnusedVar(index); + NSMutableArray* matches = NULL; NSString* partialString; diff --git a/src/osx/cocoa/statbmp.mm b/src/osx/cocoa/statbmp.mm index 9ad43cf4e4..bdd496da6d 100644 --- a/src/osx/cocoa/statbmp.mm +++ b/src/osx/cocoa/statbmp.mm @@ -65,7 +65,7 @@ public : { } - void SetLabel( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE + void SetLabel( const wxString& WXUNUSED(title), wxFontEncoding WXUNUSED(encoding) ) wxOVERRIDE { // although NSControl has this method, NSImageView throws an exception if it is called } @@ -106,7 +106,7 @@ void wxStaticBitmap::SetScaleMode(ScaleMode scaleMode) wxWidgetImplType* wxWidgetImpl::CreateStaticBitmap( wxWindowMac* wxpeer, wxWindowMac* WXUNUSED(parent), wxWindowID WXUNUSED(id), - const wxBitmap& bitmap, + const wxBitmap& WXUNUSED(bitmap), const wxPoint& pos, const wxSize& size, long WXUNUSED(style), diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 798b275d92..f8cf958591 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -153,6 +153,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; - (BOOL)getObjectValue:(id *)obj forString:(NSString *)string errorDescription:(NSString **)error { + wxUnusedVar(error); *obj = [NSString stringWithString:string]; return YES; } @@ -160,9 +161,14 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; - (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error { + wxUnusedVar(proposedSelRangePtr); + wxUnusedVar(origString); + wxUnusedVar(origSelRange); + wxUnusedVar(error); + if ( maxLength > 0 ) { - if ( [*partialStringPtr length] > maxLength ) + if ( [*partialStringPtr length] > (unsigned)maxLength ) { field->SendMaxLenEvent(); return NO; @@ -431,6 +437,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; - (void)changeColor:(id)sender { + wxUnusedVar(sender); // Define this just to block the color change messages - these are sent from // the shared color/font panel resulting in unwanted changes of color when // shared color panel is used (as when using wxColourPickerCtrl for example). @@ -475,6 +482,7 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; -(BOOL)textView:(NSTextView *)aTextView clickedOnLink:(id)link atIndex:(NSUInteger)charIndex { + wxUnusedVar(link); wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( aTextView ); if ( impl ) { @@ -592,6 +600,10 @@ NSView* wxMacEditHelper::ms_viewCurrentlyEdited = nil; - (NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger*)index { + wxUnusedVar(control); + wxUnusedVar(words); + wxUnusedVar(index); + NSMutableArray* matches = [NSMutableArray array]; wxTextWidgetImpl* impl = (wxNSTextFieldControl * ) wxWidgetImpl::FindFromWXWidget( self ); @@ -897,7 +909,7 @@ bool wxNSTextViewControl::PositionToXY(long pos, long *x, long *y) const wxCHECK_MSG( pos >= 0, false, wxS("Invalid character position") ); NSString* txt = [m_textView string]; - if ( pos > [txt length] ) + if ( (unsigned)pos > [txt length] ) return false; // Last valid position is past the last character @@ -975,7 +987,7 @@ long wxNSTextViewControl::XYToPosition(long x, long y) const // Return error if given x position // is past the line. - if ( x >= lineRng.length ) + if ( (unsigned)x >= lineRng.length ) return -1; return lineRng.location + x; @@ -1440,7 +1452,7 @@ bool wxNSTextFieldControl::PositionToXY(long pos, long *x, long *y) const { wxCHECK_MSG( pos >= 0, false, wxS("Invalid character position") ); - if ( pos > [[m_textField stringValue] length] ) + if ( (unsigned)pos > [[m_textField stringValue] length] ) return false; if ( y ) @@ -1457,7 +1469,7 @@ long wxNSTextFieldControl::XYToPosition(long x, long y) const wxCHECK_MSG( x >= 0 && y >= 0, -1, wxS("Invalid line/column number") ); // Last valid position is after the last character. - if ( y != 0 || x > [[m_textField stringValue] length] ) + if ( y != 0 || (unsigned)x > [[m_textField stringValue] length] ) return -1; return x; diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 52eca6f00c..a1e11e68f1 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -416,6 +416,7 @@ private: - (void)setSelectable:(bool) value { + wxUnusedVar(value); m_isSelectable = true; } diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index d73bffe8b6..ed2dfaff89 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -69,6 +69,7 @@ void wxBell() - (void)applicationDidFinishLaunching:(NSNotification *)notification { + wxUnusedVar(notification); [NSApp stop:nil]; wxTheApp->OSXOnDidFinishLaunching(); } @@ -93,6 +94,9 @@ void wxBell() - (NSApplicationPrintReply)application:(NSApplication *)sender printFiles:(NSArray *)fileNames withSettings:(NSDictionary *)printSettings showPrintPanels:(BOOL)showPrintPanels { wxUnusedVar(sender); + wxUnusedVar(printSettings); + wxUnusedVar(showPrintPanels); + wxArrayString fileList; size_t i; const size_t count = [fileNames count]; @@ -141,6 +145,8 @@ void wxBell() - (void)handleQuitAppEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { + wxUnusedVar(event); + wxUnusedVar(replyEvent); if ( wxTheApp->OSXOnShouldTerminate() ) { wxTheApp->OSXOnWillTerminate(); @@ -151,6 +157,7 @@ void wxBell() - (void)handleOpenAppEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { + wxUnusedVar(event); wxUnusedVar(replyEvent); } @@ -357,7 +364,7 @@ void wxBell() /* This is needed because otherwise we don't receive any key-up events for command-key - combinations (an AppKit bug, apparently) */ + combinations (an AppKit bug, apparently) */ - (void)sendEvent:(NSEvent *)anEvent { if ([anEvent type] == NSKeyUp && ([anEvent modifierFlags] & NSCommandKeyMask)) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index d915d62ecd..bd249c3e3c 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -939,7 +939,7 @@ static void SetDrawingEnabledIfFrozenRecursive(wxWidgetCocoaImpl *impl, bool ena return NO; } -- (NSView *)hitTest:(NSPoint)aPoint; +- (NSView *)hitTest:(NSPoint)aPoint { wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( viewimpl && viewimpl->GetWXPeer() && !viewimpl->GetWXPeer()->IsEnabled() ) @@ -980,6 +980,7 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text); - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange { + wxUnusedVar(replacementRange); wxOSX_insertText(self, @selector(insertText:), aString); } @@ -992,6 +993,9 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text); - (void)setMarkedText:(id)aString selectedRange:(NSRange)selectedRange replacementRange:(NSRange)replacementRange { + wxUnusedVar(aString); + wxUnusedVar(selectedRange); + wxUnusedVar(replacementRange); } - (void)unmarkText @@ -1015,6 +1019,8 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text); - (NSAttributedString *)attributedSubstringForProposedRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { + wxUnusedVar(aRange); + wxUnusedVar(actualRange); return nil; } @@ -1025,10 +1031,13 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text); - (NSRect)firstRectForCharacterRange:(NSRange)aRange actualRange:(NSRangePointer)actualRange { + wxUnusedVar(aRange); + wxUnusedVar(actualRange); return NSMakeRect(0, 0, 0, 0); } - (NSUInteger)characterIndexForPoint:(NSPoint)aPoint { + wxUnusedVar(aPoint); return NSNotFound; } @@ -1128,7 +1137,7 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text) impl->insertText(text, self, _cmd); } -void wxOSX_panGestureEvent(NSView* self, SEL _cmd, NSPanGestureRecognizer* panGestureRecognizer) +void wxOSX_panGestureEvent(NSView* self, SEL WXUNUSED(_cmd), NSPanGestureRecognizer* panGestureRecognizer) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl == NULL ) @@ -1137,7 +1146,7 @@ void wxOSX_panGestureEvent(NSView* self, SEL _cmd, NSPanGestureRecognizer* panGe impl->PanGestureEvent(panGestureRecognizer); } -void wxOSX_zoomGestureEvent(NSView* self, SEL _cmd, NSMagnificationGestureRecognizer* magnificationGestureRecognizer) +void wxOSX_zoomGestureEvent(NSView* self, SEL WXUNUSED(_cmd), NSMagnificationGestureRecognizer* magnificationGestureRecognizer) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl == NULL ) @@ -1146,7 +1155,7 @@ void wxOSX_zoomGestureEvent(NSView* self, SEL _cmd, NSMagnificationGestureRecogn impl->ZoomGestureEvent(magnificationGestureRecognizer); } -void wxOSX_rotateGestureEvent(NSView* self, SEL _cmd, NSRotationGestureRecognizer* rotationGestureRecognizer) +void wxOSX_rotateGestureEvent(NSView* self, SEL WXUNUSED(_cmd), NSRotationGestureRecognizer* rotationGestureRecognizer) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl == NULL ) @@ -1155,7 +1164,7 @@ void wxOSX_rotateGestureEvent(NSView* self, SEL _cmd, NSRotationGestureRecognize impl->RotateGestureEvent(rotationGestureRecognizer); } -void wxOSX_longPressEvent(NSView* self, SEL _cmd, NSPressGestureRecognizer* pressGestureRecognizer) +void wxOSX_longPressEvent(NSView* self, SEL WXUNUSED(_cmd), NSPressGestureRecognizer* pressGestureRecognizer) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ==NULL ) @@ -1164,7 +1173,7 @@ void wxOSX_longPressEvent(NSView* self, SEL _cmd, NSPressGestureRecognizer* pres impl->LongPressEvent(pressGestureRecognizer); } -void wxOSX_touchesBegan(NSView* self, SEL _cmd, NSEvent *event) +void wxOSX_touchesBegan(NSView* self, SEL WXUNUSED(_cmd), NSEvent *event) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl == NULL ) @@ -1173,7 +1182,7 @@ void wxOSX_touchesBegan(NSView* self, SEL _cmd, NSEvent *event) impl->TouchesBegan(event); } -void wxOSX_touchesMoved(NSView* self, SEL _cmd, NSEvent *event) +void wxOSX_touchesMoved(NSView* self, SEL WXUNUSED(_cmd), NSEvent *event) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl == NULL ) @@ -1182,7 +1191,7 @@ void wxOSX_touchesMoved(NSView* self, SEL _cmd, NSEvent *event) impl->TouchesMoved(event); } -void wxOSX_touchesEnded(NSView* self, SEL _cmd, NSEvent *event) +void wxOSX_touchesEnded(NSView* self, SEL WXUNUSED(_cmd), NSEvent *event) { wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl == NULL ) @@ -2016,7 +2025,7 @@ void wxCocoaGesturesImpl::TouchesMoved(NSEvent* event) // Iterate through all moving touches to check if the touch corresponding to "press" // in Press and Tap event is moving. - for ( int i = 0; i < [array count]; ++i ) + for ( unsigned i = 0; i < [array count]; ++i ) { NSTouch* touch = [array objectAtIndex:i]; @@ -2099,7 +2108,7 @@ void wxCocoaGesturesImpl::TouchesEnded(NSEvent* event) bool isPressTouch = false; // Iterate through all ended touches - for( int i = 0; i < [array count]; ++i ) + for( unsigned i = 0; i < [array count]; ++i ) { NSTouch* touch = [array objectAtIndex:i]; @@ -2189,7 +2198,7 @@ void wxWidgetCocoaImpl::insertText(NSString* text, WXWidget slf, void *_cmd) } } -void wxWidgetCocoaImpl::doCommandBySelector(void* sel, WXWidget slf, void* _cmd) +void wxWidgetCocoaImpl::doCommandBySelector(void* sel, WXWidget slf, void* WXUNUSED(_cmd)) { wxLogTrace(TRACE_KEYS, "Selector %s for %s", wxDumpSelector((SEL)sel), wxDumpNSView(slf)); diff --git a/src/osx/core/evtloop_cf.cpp b/src/osx/core/evtloop_cf.cpp index a9979b980f..9004763836 100644 --- a/src/osx/core/evtloop_cf.cpp +++ b/src/osx/core/evtloop_cf.cpp @@ -249,10 +249,8 @@ int wxCFEventLoop::DoDispatchTimeout(unsigned long timeout) break; case kCFRunLoopRunStopped: return 0; - break; case kCFRunLoopRunTimedOut: return -1; - break; case kCFRunLoopRunHandledSource: default: break; diff --git a/src/osx/iphone/evtloop.mm b/src/osx/iphone/evtloop.mm index 7e0c695570..263612a604 100644 --- a/src/osx/iphone/evtloop.mm +++ b/src/osx/iphone/evtloop.mm @@ -41,35 +41,33 @@ /* static int CalculateUIEventMaskFromEventCategory(wxEventCategory cat) { - NSLeftMouseDownMask | - NSLeftMouseUpMask | - NSRightMouseDownMask | - NSRightMouseUpMask = 1 << NSRightMouseUp, - NSMouseMovedMask = 1 << NSMouseMoved, - NSLeftMouseDraggedMask = 1 << NSLeftMouseDragged, - NSRightMouseDraggedMask = 1 << NSRightMouseDragged, - NSMouseEnteredMask = 1 << NSMouseEntered, - NSMouseExitedMask = 1 << NSMouseExited, - NSScrollWheelMask = 1 << NSScrollWheel, - NSTabletPointMask = 1 << NSTabletPoint, - NSTabletProximityMask = 1 << NSTabletProximity, - NSOtherMouseDownMask = 1 << NSOtherMouseDown, - NSOtherMouseUpMask = 1 << NSOtherMouseUp, - NSOtherMouseDraggedMask = 1 << NSOtherMouseDragged, + NSLeftMouseDownMask | + NSLeftMouseUpMask | + NSRightMouseDownMask | + NSRightMouseUpMask = 1 << NSRightMouseUp, + NSMouseMovedMask = 1 << NSMouseMoved, + NSLeftMouseDraggedMask = 1 << NSLeftMouseDragged, + NSRightMouseDraggedMask = 1 << NSRightMouseDragged, + NSMouseEnteredMask = 1 << NSMouseEntered, + NSMouseExitedMask = 1 << NSMouseExited, + NSScrollWheelMask = 1 << NSScrollWheel, + NSTabletPointMask = 1 << NSTabletPoint, + NSTabletProximityMask = 1 << NSTabletProximity, + NSOtherMouseDownMask = 1 << NSOtherMouseDown, + NSOtherMouseUpMask = 1 << NSOtherMouseUp, + NSOtherMouseDraggedMask = 1 << NSOtherMouseDragged, + NSKeyDownMask = 1 << NSKeyDown, + NSKeyUpMask = 1 << NSKeyUp, + NSFlagsChangedMask = 1 << NSFlagsChanged, + NSAppKitDefinedMask = 1 << NSAppKitDefined, + NSSystemDefinedMask = 1 << NSSystemDefined, + UIApplicationDefinedMask = 1 << UIApplicationDefined, + NSPeriodicMask = 1 << NSPeriodic, + NSCursorUpdateMask = 1 << NSCursorUpdate, - NSKeyDownMask = 1 << NSKeyDown, - NSKeyUpMask = 1 << NSKeyUp, - NSFlagsChangedMask = 1 << NSFlagsChanged, - - NSAppKitDefinedMask = 1 << NSAppKitDefined, - NSSystemDefinedMask = 1 << NSSystemDefined, - UIApplicationDefinedMask = 1 << UIApplicationDefined, - NSPeriodicMask = 1 << NSPeriodic, - NSCursorUpdateMask = 1 << NSCursorUpdate, - - NSAnyEventMask = 0xffffffffU + NSAnyEventMask = 0xffffffffU } */ diff --git a/src/osx/iphone/statbmp.mm b/src/osx/iphone/statbmp.mm index 0c89368e84..91d066c067 100644 --- a/src/osx/iphone/statbmp.mm +++ b/src/osx/iphone/statbmp.mm @@ -41,7 +41,7 @@ public : { } - void SetLabel( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE + void SetLabel( const wxString& title, wxFontEncoding encoding ) wxOVERRIDE { // although NSControl has this method, NSImageView throws an exception if it is called } diff --git a/src/osx/iphone/utils.mm b/src/osx/iphone/utils.mm index 3863f68d97..cfde22b67a 100644 --- a/src/osx/iphone/utils.mm +++ b/src/osx/iphone/utils.mm @@ -58,7 +58,7 @@ return YES; } -- (void)applicationDidFinishLaunching:(UIApplication *)application { +- (void)applicationDidFinishLaunching:(UIApplication *)application { wxTheApp->OSXOnDidFinishLaunching(); } diff --git a/src/osx/uiaction_osx.cpp b/src/osx/uiaction_osx.cpp index 31b7d987ae..5f5929ee2d 100644 --- a/src/osx/uiaction_osx.cpp +++ b/src/osx/uiaction_osx.cpp @@ -60,11 +60,9 @@ CGEventType CGEventTypeForMouseDrag(int button) { case wxMOUSE_BTN_LEFT: return kCGEventLeftMouseDragged; - break; case wxMOUSE_BTN_RIGHT: return kCGEventRightMouseDragged; - break; // All the other buttons use the constant OtherMouseDown but we still // want to check for invalid parameters so assert first @@ -74,7 +72,6 @@ CGEventType CGEventTypeForMouseDrag(int button) case wxMOUSE_BTN_MIDDLE: return kCGEventOtherMouseDragged; - break; } } diff --git a/src/osx/webview_webkit.mm b/src/osx/webview_webkit.mm index 77bfc3dc9e..7cc5c72d79 100644 --- a/src/osx/webview_webkit.mm +++ b/src/osx/webview_webkit.mm @@ -450,7 +450,7 @@ bool wxWebViewWebKit::RunScript(const wxString& javascript, wxString* output) return true; } -void wxWebViewWebKit::OnSize(wxSizeEvent &event) +void wxWebViewWebKit::OnSize(wxSizeEvent &WXUNUSED(event)) { } @@ -743,6 +743,8 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr handler) - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame { + wxUnusedVar(sender); + wxUnusedVar(frame); webKitWindow->m_busy = true; } @@ -906,6 +908,8 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame { + wxUnusedVar(sender); + wxString target = wxCFStringRef::AsString([frame name]); wxWebViewEvent event(wxEVT_WEBVIEW_TITLE_CHANGED, webKitWindow->GetId(), @@ -936,6 +940,8 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) frame:(WebFrame *)frame decisionListener:(id)listener { + wxUnusedVar(sender); + wxUnusedVar(actionInformation); wxUnusedVar(frame); NSString *url = [[request URL] absoluteString]; @@ -983,6 +989,9 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) newFrameName:(NSString *)frameName decisionListener:(id < WebPolicyDecisionListener >)listener { + wxUnusedVar(sender); + wxUnusedVar(frameName); + NSString *url = [[request URL] absoluteString]; wxWebViewNavigationActionFlags flags = wxWEBVIEW_NAV_ACTION_USER; @@ -1112,6 +1121,7 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) // This method is called when window.open() is used in javascript with a target != _self // request is always nil, so it can't be used for event generation // Mark the next navigation as "new window" + wxUnusedVar(request); webKitWindow->m_nextNavigationIsNewWindow = true; return sender; } @@ -1127,6 +1137,9 @@ wxString nsErrorToWxHtmlError(NSError* error, wxWebViewNavigationError* out) - (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *) defaultMenuItems { + wxUnusedVar(sender); + wxUnusedVar(element); + if(webKitWindow->IsContextMenuEnabled()) return defaultMenuItems; else diff --git a/src/richtext/richtextdialogs.pjd b/src/richtext/richtextdialogs.pjd index 889583767a..b400b615ec 100644 --- a/src/richtext/richtextdialogs.pjd +++ b/src/richtext/richtextdialogs.pjd @@ -72,7 +72,7 @@ #endif " - " /// %BODY% + " /// %BODY% " " /*! diff --git a/src/stc/PlatWXcocoa.mm b/src/stc/PlatWXcocoa.mm index 1c5498b2be..895f032835 100644 --- a/src/stc/PlatWXcocoa.mm +++ b/src/stc/PlatWXcocoa.mm @@ -58,6 +58,7 @@ - (void)mouseEntered:(NSEvent *)evt { + wxUnusedVar(evt); wxMouseEvent wxevent(wxEVT_ENTER_WINDOW); wxevent.SetEventObject(m_wxWin); m_wxWin->ProcessWindowEvent(wxevent); @@ -65,6 +66,7 @@ - (void)mouseExited:(NSEvent *)evt { + wxUnusedVar(evt); wxMouseEvent wxevent(wxEVT_LEAVE_WINDOW); wxevent.SetEventObject(m_wxWin); m_wxWin->ProcessWindowEvent(wxevent); diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 2f69ea36e2..5537bebb05 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -1505,7 +1505,7 @@ void ScintillaWX::ImeStartComposition() { const int styleHere = pdoc->StyleIndexAt(sel.MainCaret()); LOGFONTW lf = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L"" }; int sizeZoomed = vs.styles[styleHere].size + vs.zoomLevel * SC_FONT_SIZE_MULTIPLIER; - if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1 + if (sizeZoomed <= 2 * SC_FONT_SIZE_MULTIPLIER) // Hangs if sizeZoomed <= 1 sizeZoomed = 2 * SC_FONT_SIZE_MULTIPLIER; // The negative is to allow for leading lf.lfHeight = -::MulDiv(sizeZoomed, stc->GetDPI().y, 72 * SC_FONT_SIZE_MULTIPLIER); diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index f1604a4310..01eeb97c45 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -1004,8 +1004,8 @@ void wxGTKRenderer::DrawRadioButtonBitmap(wxDC& dc, dc.SetPen(m_penDarkGrey); dc.SetBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT)); - // draw the normal border - dc.DrawCircle(xRight/2,yBottom/2,yMid); + // draw the normal border + dc.DrawCircle(xRight/2,yBottom/2,yMid); wxColor checkedCol, uncheckedCol; checkedCol = wxSCHEME_COLOUR(m_scheme, SHADOW_DARK); diff --git a/src/unix/dlunix.cpp b/src/unix/dlunix.cpp index 035546a701..08af31f4f3 100644 --- a/src/unix/dlunix.cpp +++ b/src/unix/dlunix.cpp @@ -252,6 +252,9 @@ void* wxDynamicLibrary::GetModuleFromAddress(const void* addr, wxString* path) *path = di.dli_fname; return di.dli_fbase; +#else + wxUnusedVar(addr); + wxUnusedVar(path); #endif // HAVE_DLADDR return NULL; diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index f6f1c63de2..070371268f 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -229,7 +229,7 @@ void wxNativeFontInfo::SetStyle(wxFontStyle style) break; default: wxFAIL_MSG( "unknown font style" ); - // fall through + wxFALLTHROUGH; case wxFONTSTYLE_NORMAL: pango_font_description_set_style( description, PANGO_STYLE_NORMAL ); break; diff --git a/src/unix/glegl.cpp b/src/unix/glegl.cpp index c6de82f828..eac7c5400f 100644 --- a/src/unix/glegl.cpp +++ b/src/unix/glegl.cpp @@ -479,7 +479,7 @@ bool wxGLCanvasEGL::CreateSurface() wl_registry_add_listener(registry, &wl_registry_listener, this); wl_display_roundtrip(display); if ( !m_wlCompositor || !m_wlSubcompositor ) - { + { wxFAIL_MSG("Invalid Wayland compositor or subcompositor"); return false; } diff --git a/src/unix/sound_sdl.cpp b/src/unix/sound_sdl.cpp index a2c4628b53..ebdc06b98c 100644 --- a/src/unix/sound_sdl.cpp +++ b/src/unix/sound_sdl.cpp @@ -69,18 +69,18 @@ public: m_data(NULL), m_evtHandler(NULL) {} virtual ~wxSoundBackendSDL(); - wxString GetName() const { return wxT("Simple DirectMedia Layer"); } - int GetPriority() const { return 9; } - bool IsAvailable() const; - bool HasNativeAsyncPlayback() const { return true; } + wxString GetName() const wxOVERRIDE { return wxT("Simple DirectMedia Layer"); } + int GetPriority() const wxOVERRIDE { return 9; } + bool IsAvailable() const wxOVERRIDE; + bool HasNativeAsyncPlayback() const wxOVERRIDE { return true; } bool Play(wxSoundData *data, unsigned flags, - volatile wxSoundPlaybackStatus *status); + volatile wxSoundPlaybackStatus *status) wxOVERRIDE; void FillAudioBuffer(Uint8 *stream, int len); void FinishedPlayback(); - void Stop(); - bool IsPlaying() const { return m_playing; } + void Stop() wxOVERRIDE; + bool IsPlaying() const wxOVERRIDE { return m_playing; } private: bool OpenAudio(); diff --git a/src/unix/uiactionx11.cpp b/src/unix/uiactionx11.cpp index 6bc7df4c39..fcfd677e1e 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -437,9 +437,9 @@ bool wxUIActionSimulatorX11Impl::MouseMove(long x, long y) } return ret; -#endif - +#else return DoX11MouseMove(x, y); +#endif } bool wxUIActionSimulatorX11Impl::MouseUp(int button) diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index 97c8fa5560..bd611cd2fb 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -282,7 +282,7 @@ static void wxWinHintsSetLayer(Display *display, Window rootWnd, #ifdef __WXGTK20__ static bool wxQueryWMspecSupport(Display* WXUNUSED(display), Window WXUNUSED(rootWnd), - Atom (feature)) + Atom feature) { GdkAtom gatom = gdk_x11_xatom_to_atom(feature); return gdk_x11_screen_supports_net_wm_hint(gdk_screen_get_default(), gatom); diff --git a/src/x11/nanox.c b/src/x11/nanox.c index a9619fb547..2edb62167f 100644 --- a/src/x11/nanox.c +++ b/src/x11/nanox.c @@ -84,8 +84,8 @@ int XCopyArea(Display* display, Drawable src, Drawable dest, GC gc, int dest_x, int dest_y) { GrCopyArea(dest, gc, dest_x, dest_y, - width, height, src, - src_x, src_y, 0); + width, height, src, + src_x, src_y, 0); return Success; } @@ -94,55 +94,55 @@ int XCopyPlane(Display* display, Drawable src, Drawable dest, GC gc, int dest_x, int dest_y, unsigned long plane) { GrCopyArea(dest, gc, dest_x, dest_y, - width, height, src, - src_x, src_y, 0); + width, height, src, + src_x, src_y, 0); return Success; } #if 0 typedef struct { - GR_WINDOW_ID wid; /* window id (or 0 if no such window) */ - GR_WINDOW_ID parent; /* parent window id */ - GR_WINDOW_ID child; /* first child window id (or 0) */ - GR_WINDOW_ID sibling; /* next sibling window id (or 0) */ - GR_BOOL inputonly; /* TRUE if window is input only */ - GR_BOOL mapped; /* TRUE if window is mapped */ - GR_COUNT unmapcount; /* reasons why window is unmapped */ - GR_COORD x; /* absolute x position of window */ - GR_COORD y; /* absolute y position of window */ - GR_SIZE width; /* width of window */ - GR_SIZE height; /* height of window */ - GR_SIZE bordersize; /* size of border */ - GR_COLOR bordercolor; /* color of border */ - GR_COLOR background; /* background color */ - GR_EVENT_MASK eventmask; /* current event mask for this client */ - GR_WM_PROPS props; /* window properties */ - GR_CURSOR_ID cursor; /* cursor id*/ - unsigned long processid; /* process id of owner*/ + GR_WINDOW_ID wid; /* window id (or 0 if no such window) */ + GR_WINDOW_ID parent; /* parent window id */ + GR_WINDOW_ID child; /* first child window id (or 0) */ + GR_WINDOW_ID sibling; /* next sibling window id (or 0) */ + GR_BOOL inputonly; /* TRUE if window is input only */ + GR_BOOL mapped; /* TRUE if window is mapped */ + GR_COUNT unmapcount; /* reasons why window is unmapped */ + GR_COORD x; /* absolute x position of window */ + GR_COORD y; /* absolute y position of window */ + GR_SIZE width; /* width of window */ + GR_SIZE height; /* height of window */ + GR_SIZE bordersize; /* size of border */ + GR_COLOR bordercolor; /* color of border */ + GR_COLOR background; /* background color */ + GR_EVENT_MASK eventmask; /* current event mask for this client */ + GR_WM_PROPS props; /* window properties */ + GR_CURSOR_ID cursor; /* cursor id*/ + unsigned long processid; /* process id of owner*/ } GR_WINDOW_INFO; typedef struct { - int x, y; /* location of window */ + int x, y; /* location of window */ int width, height; /* width and height of window */ - int border_width; /* border width of window */ - int depth; /* depth of window */ - Visual *visual; /* the associated visual structure */ - Window root; /* root of screen containing window */ - int class; /* InputOutput, InputOnly*/ - int bit_gravity; /* one of the bit gravity values */ - int win_gravity; /* one of the window gravity values */ + int border_width; /* border width of window */ + int depth; /* depth of window */ + Visual *visual; /* the associated visual structure */ + Window root; /* root of screen containing window */ + int class; /* InputOutput, InputOnly*/ + int bit_gravity; /* one of the bit gravity values */ + int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preserved if possible */ unsigned long backing_pixel;/* value to be used when restoring planes */ - Bool save_under; /* boolean, should bits under be saved? */ + Bool save_under; /* boolean, should bits under be saved? */ Colormap colormap; /* color map to be associated with window */ Bool map_installed; /* boolean, is color map currently installed*/ - int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ + int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ long all_event_masks; /* set of events all people have interest in*/ long your_event_mask; /* my event mask */ long do_not_propagate_mask;/* set of events that should not propagate */ Bool override_redirect; /* boolean value for override-redirect */ - Screen *screen; /* back pointer to correct screen */ + Screen *screen; /* back pointer to correct screen */ } XWindowAttributes; #endif @@ -222,7 +222,7 @@ XErrorHandler XSetErrorHandler (XErrorHandler handler) } static Screen s_screen; -Screen *XScreenOfDisplay(Display* display, +Screen *XScreenOfDisplay(Display* display, int screen_number) { /* TODO: fill in the members. See Xlib.h */ diff --git a/tests/controls/textctrltest.cpp b/tests/controls/textctrltest.cpp index cdfe5b6ef9..3990fc675b 100644 --- a/tests/controls/textctrltest.cpp +++ b/tests/controls/textctrltest.cpp @@ -342,7 +342,7 @@ void TextCtrlTestCase::Redirector() void TextCtrlTestCase::HitTestSingleLine() { #ifdef __WXQT__ - WARN("Does not work under WxQt"); + WARN("Does not work under WxQt"); #else m_text->ChangeValue("Hit me"); @@ -513,7 +513,7 @@ void TextCtrlTestCase::Style() CHECK( style.GetTextColour() == *wxRED ); CHECK( style.GetBackgroundColour() == *wxWHITE ); #else - WARN("Does not work under WxQt or OSX"); + WARN("Does not work under WxQt or OSX"); #endif }