From 66bb49e2daf11bf41fbb8a250d5a2bf0a7f2730e Mon Sep 17 00:00:00 2001 From: aris-kimi Date: Tue, 16 Apr 2024 11:11:50 +0000 Subject: [PATCH] Silence some GCC warnings --- common/lib_tree_model_adapter.cpp | 3 ++- common/tool/actions.cpp | 26 +++++++++++++------------- common/widgets/split_button.cpp | 2 +- common/widgets/std_bitmap_button.cpp | 2 +- kicad/project_tree_pane.cpp | 3 --- 5 files changed, 17 insertions(+), 19 deletions(-) diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index 42b2dc8aa6..3aca05329c 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -416,7 +416,8 @@ wxDataViewColumn* LIB_TREE_MODEL_ADAPTER::doAddColumn( const wxString& aHeader, wxDataViewColumn* col = new wxDataViewColumn( translatedHeader, new LIB_TREE_RENDERER(), index, m_colWidths[aHeader], wxALIGN_NOT, - wxDATAVIEW_CELL_INERT | wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_COL_SORTABLE ); + wxDATAVIEW_CELL_INERT | static_cast( wxDATAVIEW_COL_RESIZABLE ) + | static_cast( wxDATAVIEW_COL_SORTABLE ) ); m_widget->AppendColumn( col ); col->SetMinWidth( headerMinWidth.x ); diff --git a/common/tool/actions.cpp b/common/tool/actions.cpp index a74717c9f3..5c6c5ec606 100644 --- a/common/tool/actions.cpp +++ b/common/tool/actions.cpp @@ -444,7 +444,7 @@ TOOL_ACTION ACTIONS::findNext( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::findPrevious( TOOL_ACTION_ARGS() .Name( "common.Interactive.findPrevious" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_SHIFT + WXK_F3 ) + .DefaultHotkey( MD_SHIFT + static_cast( WXK_F3 ) ) .LegacyHotkeyName( "Find Previous" ) .FriendlyName( _( "Find Previous" ) ) .Tooltip( _( "Find previous match" ) ) @@ -453,7 +453,7 @@ TOOL_ACTION ACTIONS::findPrevious( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::findNextMarker( TOOL_ACTION_ARGS() .Name( "common.Interactive.findNextMarker" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + MD_SHIFT + WXK_F3 ) + .DefaultHotkey( MD_CTRL + MD_SHIFT + static_cast( WXK_F3 ) ) .LegacyHotkeyName( "Find Next Marker" ) .FriendlyName( _( "Find Next Marker" ) ) .Icon( BITMAPS::find ) ); @@ -528,7 +528,7 @@ TOOL_ACTION ACTIONS::zoomFitScreen( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::zoomFitObjects( TOOL_ACTION_ARGS() .Name( "common.Control.zoomFitObjects" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_HOME ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_HOME ) ) .FriendlyName( _( "Zoom to Objects" ) ) .Icon( BITMAPS::zoom_fit_to_objects ) ); @@ -607,7 +607,7 @@ TOOL_ACTION ACTIONS::zoomCenter( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::zoomTool( TOOL_ACTION_ARGS() .Name( "common.Control.zoomTool" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_F5 ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_F5 ) ) .LegacyHotkeyName( "Zoom to Selection" ) .FriendlyName( _( "Zoom to Selection" ) ) .Icon( BITMAPS::zoom_area ) @@ -673,7 +673,7 @@ TOOL_ACTION ACTIONS::cursorRight( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::cursorUpFast( TOOL_ACTION_ARGS() .Name( "common.Control.cursorUpFast" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_UP ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_UP ) ) .FriendlyName( _( "Cursor Up Fast" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_UP_FAST ) ); @@ -681,7 +681,7 @@ TOOL_ACTION ACTIONS::cursorUpFast( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::cursorDownFast( TOOL_ACTION_ARGS() .Name( "common.Control.cursorDownFast" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_DOWN ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_DOWN ) ) .FriendlyName( _( "Cursor Down Fast" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_DOWN_FAST ) ); @@ -689,7 +689,7 @@ TOOL_ACTION ACTIONS::cursorDownFast( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::cursorLeftFast( TOOL_ACTION_ARGS() .Name( "common.Control.cursorLeftFast" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_LEFT ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_LEFT ) ) .FriendlyName( _( "Cursor Left Fast" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_LEFT_FAST ) ); @@ -697,7 +697,7 @@ TOOL_ACTION ACTIONS::cursorLeftFast( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::cursorRightFast( TOOL_ACTION_ARGS() .Name( "common.Control.cursorRightFast" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_RIGHT ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_RIGHT ) ) .FriendlyName( _( "Cursor Right Fast" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_RIGHT_FAST ) ); @@ -741,7 +741,7 @@ TOOL_ACTION ACTIONS::unpinLibrary( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::panUp( TOOL_ACTION_ARGS() .Name( "common.Control.panUp" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_SHIFT + WXK_UP ) + .DefaultHotkey( MD_SHIFT + static_cast( WXK_UP ) ) .FriendlyName( _( "Pan Up" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_UP ) ); @@ -749,7 +749,7 @@ TOOL_ACTION ACTIONS::panUp( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::panDown( TOOL_ACTION_ARGS() .Name( "common.Control.panDown" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_SHIFT + WXK_DOWN ) + .DefaultHotkey( MD_SHIFT + static_cast( WXK_DOWN ) ) .FriendlyName( _( "Pan Down" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_DOWN ) ); @@ -757,7 +757,7 @@ TOOL_ACTION ACTIONS::panDown( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::panLeft( TOOL_ACTION_ARGS() .Name( "common.Control.panLeft" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_SHIFT + WXK_LEFT ) + .DefaultHotkey( MD_SHIFT + static_cast( WXK_LEFT ) ) .FriendlyName( _( "Pan Left" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_LEFT ) ); @@ -765,7 +765,7 @@ TOOL_ACTION ACTIONS::panLeft( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::panRight( TOOL_ACTION_ARGS() .Name( "common.Control.panRight" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_SHIFT + WXK_RIGHT ) + .DefaultHotkey( MD_SHIFT + static_cast( WXK_RIGHT ) ) .FriendlyName( _( "Pan Right" ) ) .Flags( AF_NONE ) .Parameter( CURSOR_RIGHT ) ); @@ -1113,7 +1113,7 @@ TOOL_ACTION ACTIONS::about( TOOL_ACTION_ARGS() TOOL_ACTION ACTIONS::listHotKeys( TOOL_ACTION_ARGS() .Name( "common.SuiteControl.listHotKeys" ) .Scope( AS_GLOBAL ) - .DefaultHotkey( MD_CTRL + WXK_F1 ) + .DefaultHotkey( MD_CTRL + static_cast( WXK_F1 ) ) .LegacyHotkeyName( "List Hotkeys" ) .FriendlyName( _( "List Hotkeys..." ) ) .Tooltip( _( "Displays current hotkeys table and corresponding commands" ) ) diff --git a/common/widgets/split_button.cpp b/common/widgets/split_button.cpp index 8b85f8f40c..38024afc15 100644 --- a/common/widgets/split_button.cpp +++ b/common/widgets/split_button.cpp @@ -175,7 +175,7 @@ void SPLIT_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent ) wxASSERT( pEventHandler ); pEventHandler->CallAfter( - [=]() + [this]() { wxCommandEvent evt( wxEVT_BUTTON, GetId() ); evt.SetEventObject( this ); diff --git a/common/widgets/std_bitmap_button.cpp b/common/widgets/std_bitmap_button.cpp index 4ea205d451..0c89c3dac9 100644 --- a/common/widgets/std_bitmap_button.cpp +++ b/common/widgets/std_bitmap_button.cpp @@ -157,7 +157,7 @@ void STD_BITMAP_BUTTON::OnLeftButtonUp( wxMouseEvent& aEvent ) wxASSERT( pEventHandler ); pEventHandler->CallAfter( - [=]() + [this]() { wxCommandEvent evt( wxEVT_BUTTON, GetId() ); evt.SetEventObject( this ); diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp index ee21351940..58ea02aab9 100644 --- a/kicad/project_tree_pane.cpp +++ b/kicad/project_tree_pane.cpp @@ -712,10 +712,7 @@ bool PROJECT_TREE_PANE::hasChangedFiles() if( !repo ) return false; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-field-initializers" git_status_options opts = GIT_STATUS_OPTIONS_INIT; -#pragma clang diagnostic pop opts.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR; opts.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX