From 87a220b8e2921824ad6f35b483bf01816b863ba2 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 2 Oct 2020 14:29:17 +0200 Subject: [PATCH] more cleanup about removing useless include --- common/gr_basic.cpp | 4 ---- common/gr_text.cpp | 7 ++----- cvpcb/readwrite_dlgs.cpp | 2 -- pagelayout_editor/design_inspector.cpp | 2 +- pagelayout_editor/files.cpp | 3 --- pagelayout_editor/pl_editor_frame.cpp | 2 -- pagelayout_editor/pl_editor_layout.cpp | 2 -- pagelayout_editor/pl_editor_undo_redo.cpp | 1 - pagelayout_editor/properties_frame.cpp | 1 - pagelayout_editor/toolbars_pl_editor.cpp | 3 --- pcbnew/board_connected_item.cpp | 1 - pcbnew/board_design_settings.cpp | 2 -- pcbnew/board_items_to_polygon_shape_transform.cpp | 2 -- pcbnew/build_BOM_from_board.cpp | 1 - pcbnew/class_board.cpp | 1 - pcbnew/class_board_item.cpp | 1 - pcbnew/class_dimension.cpp | 2 -- pcbnew/class_drawsegment.cpp | 2 -- pcbnew/class_edge_mod.cpp | 1 - pcbnew/class_marker_pcb.cpp | 4 +--- pcbnew/class_module.cpp | 2 -- pcbnew/class_pad.cpp | 3 --- pcbnew/class_pcb_target.cpp | 2 -- pcbnew/class_pcb_text.cpp | 1 - pcbnew/class_text_mod.cpp | 6 +----- pcbnew/class_track.cpp | 1 - pcbnew/class_zone.cpp | 1 - pcbnew/cleanup_item.cpp | 1 - pcbnew/cross-probing.cpp | 8 +++----- pcbnew/footprint_edit_frame.cpp | 1 - pcbnew/footprint_info_impl.cpp | 3 --- pcbnew/footprint_libraries_utils.cpp | 2 -- pcbnew/footprint_viewer_frame.cpp | 1 - pcbnew/footprint_wizard_frame.cpp | 2 -- pcbnew/footprint_wizard_frame_functions.cpp | 2 -- pcbnew/graphics_cleaner.cpp | 1 - pcbnew/pcb_edit_frame.cpp | 1 - pcbnew/pcb_screen.cpp | 1 - pcbnew/pcbnew_config.cpp | 1 - pcbnew/toolbars_footprint_editor.cpp | 2 -- pcbnew/toolbars_pcb_editor.cpp | 5 ++--- 41 files changed, 10 insertions(+), 81 deletions(-) diff --git a/common/gr_basic.cpp b/common/gr_basic.cpp index abe1a3c3f2..5a06d8be75 100644 --- a/common/gr_basic.cpp +++ b/common/gr_basic.cpp @@ -24,17 +24,13 @@ /********************************/ -#include #include -#include #include -#include #include #include #include #include #include -#include #include #include // for KiROUND diff --git a/common/gr_text.cpp b/common/gr_text.cpp index 843caebd80..84ceb2b87f 100644 --- a/common/gr_text.cpp +++ b/common/gr_text.cpp @@ -29,16 +29,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include -#include #include -#include // EDA_TEXT_HJUSTIFY_T and EDA_TEXT_VJUSTIFY_T +#include // EDA_TEXT_HJUSTIFY_T and EDA_TEXT_VJUSTIFY_T #include -#include #include #include -#include // for KiROUND +#include // for KiROUND #include diff --git a/cvpcb/readwrite_dlgs.cpp b/cvpcb/readwrite_dlgs.cpp index 451f023ad1..2e3d35188a 100644 --- a/cvpcb/readwrite_dlgs.cpp +++ b/cvpcb/readwrite_dlgs.cpp @@ -24,12 +24,10 @@ */ #include -#include #include #include #include #include -#include #include #include diff --git a/pagelayout_editor/design_inspector.cpp b/pagelayout_editor/design_inspector.cpp index 3b9d7f280c..cb75878b9e 100644 --- a/pagelayout_editor/design_inspector.cpp +++ b/pagelayout_editor/design_inspector.cpp @@ -24,7 +24,7 @@ #include #include -#include + #include #include #include diff --git a/pagelayout_editor/files.cpp b/pagelayout_editor/files.cpp index c9bdfee0b4..e5a2f1b798 100644 --- a/pagelayout_editor/files.cpp +++ b/pagelayout_editor/files.cpp @@ -24,11 +24,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include -#include #include #include #include diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 7a8806f5ab..f048782358 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -23,10 +23,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include -//#include #include #include #include diff --git a/pagelayout_editor/pl_editor_layout.cpp b/pagelayout_editor/pl_editor_layout.cpp index 5ce16dadc2..2ed97b0cf2 100644 --- a/pagelayout_editor/pl_editor_layout.cpp +++ b/pagelayout_editor/pl_editor_layout.cpp @@ -29,8 +29,6 @@ #include #include -#include -#include #include #include diff --git a/pagelayout_editor/pl_editor_undo_redo.cpp b/pagelayout_editor/pl_editor_undo_redo.cpp index e21558bbd4..c9f3a32d4b 100644 --- a/pagelayout_editor/pl_editor_undo_redo.cpp +++ b/pagelayout_editor/pl_editor_undo_redo.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pagelayout_editor/properties_frame.cpp b/pagelayout_editor/properties_frame.cpp index 6648120bf4..39b99edcee 100644 --- a/pagelayout_editor/properties_frame.cpp +++ b/pagelayout_editor/properties_frame.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pagelayout_editor/toolbars_pl_editor.cpp b/pagelayout_editor/toolbars_pl_editor.cpp index 8c76c839b8..a92a3624a3 100644 --- a/pagelayout_editor/toolbars_pl_editor.cpp +++ b/pagelayout_editor/toolbars_pl_editor.cpp @@ -19,9 +19,6 @@ * with this program. If not, see . */ -#include -#include -#include #include #include #include diff --git a/pcbnew/board_connected_item.cpp b/pcbnew/board_connected_item.cpp index 57d2bbdd5a..78178a2173 100644 --- a/pcbnew/board_connected_item.cpp +++ b/pcbnew/board_connected_item.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pcbnew/board_design_settings.cpp b/pcbnew/board_design_settings.cpp index c8d308c5b4..50853b29a3 100644 --- a/pcbnew/board_design_settings.cpp +++ b/pcbnew/board_design_settings.cpp @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include #include diff --git a/pcbnew/board_items_to_polygon_shape_transform.cpp b/pcbnew/board_items_to_polygon_shape_transform.cpp index 4328e844f6..973cdffdc6 100644 --- a/pcbnew/board_items_to_polygon_shape_transform.cpp +++ b/pcbnew/board_items_to_polygon_shape_transform.cpp @@ -22,11 +22,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include // for IU_PER_MM -#include #include #include #include diff --git a/pcbnew/build_BOM_from_board.cpp b/pcbnew/build_BOM_from_board.cpp index fce0b23e3b..337399569e 100644 --- a/pcbnew/build_BOM_from_board.cpp +++ b/pcbnew/build_BOM_from_board.cpp @@ -25,7 +25,6 @@ /* build_BOM_from_board.cpp */ -#include #include #include #include diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 48410bb5a3..fc65b1e1ab 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index c6cea0cc4d..8785710bc9 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include diff --git a/pcbnew/class_dimension.cpp b/pcbnew/class_dimension.cpp index 54f6ac5895..6949771b48 100644 --- a/pcbnew/class_dimension.cpp +++ b/pcbnew/class_dimension.cpp @@ -24,8 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include #include diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index 216de870d3..385ceeed1b 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -24,8 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include #include diff --git a/pcbnew/class_edge_mod.cpp b/pcbnew/class_edge_mod.cpp index 7095a87010..175ba7c03b 100644 --- a/pcbnew/class_edge_mod.cpp +++ b/pcbnew/class_edge_mod.cpp @@ -24,7 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include // for KiROUND #include diff --git a/pcbnew/class_marker_pcb.cpp b/pcbnew/class_marker_pcb.cpp index a4407f84a6..9bc4b31bb7 100644 --- a/pcbnew/class_marker_pcb.cpp +++ b/pcbnew/class_marker_pcb.cpp @@ -23,8 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include #include @@ -78,7 +76,7 @@ MARKER_PCB* MARKER_PCB::Deserialize( const wxString& data ) (int) strtol( props[2].c_str(), nullptr, 10 ) ); std::shared_ptr drcItem = DRC_ITEM::Create( props[0] ); - + if( !drcItem ) return nullptr; diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 2e9fe27eb3..36c26b7b51 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -24,8 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include #include diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 3086dcfb8b..71a56f693d 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -28,9 +28,6 @@ * D_PAD class implementation. */ -#include -#include -#include #include #include #include diff --git a/pcbnew/class_pcb_target.cpp b/pcbnew/class_pcb_target.cpp index 17f69f56a6..9f8cea1a0f 100644 --- a/pcbnew/class_pcb_target.cpp +++ b/pcbnew/class_pcb_target.cpp @@ -29,8 +29,6 @@ * PCB_TARGET class definition - targets for photo plots, formerly called MIRE (from French 'mire optique') */ -#include -#include #include #include #include diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index c31c7fc773..9182803fd6 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pcbnew/class_text_mod.cpp b/pcbnew/class_text_mod.cpp index 4a821ae99b..4fe1260d8c 100644 --- a/pcbnew/class_text_mod.cpp +++ b/pcbnew/class_text_mod.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include @@ -457,10 +456,7 @@ wxString TEXTE_MODULE::GetShownText( int aDepth ) const std::shared_ptr TEXTE_MODULE::GetEffectiveShape( PCB_LAYER_ID aLayer ) const { - const MODULE* module = static_cast( GetParent() ); - auto shape = GetEffectiveTextShape(); - - return shape; + return GetEffectiveTextShape(); } diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index e247001dc5..d36a02ada3 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -24,7 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index c9f283e8ee..a10261c5ca 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -24,7 +24,6 @@ */ #include -#include #include #include #include diff --git a/pcbnew/cleanup_item.cpp b/pcbnew/cleanup_item.cpp index 6ff31884f1..ee14a611f3 100644 --- a/pcbnew/cleanup_item.cpp +++ b/pcbnew/cleanup_item.cpp @@ -22,7 +22,6 @@ */ -#include #include #include diff --git a/pcbnew/cross-probing.cpp b/pcbnew/cross-probing.cpp index 8148d69a76..c2e200ce2d 100644 --- a/pcbnew/cross-probing.cpp +++ b/pcbnew/cross-probing.cpp @@ -36,10 +36,8 @@ #include #include #include -#include #include #include -#include #include #include #include @@ -236,8 +234,8 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) pcb->HighLightON(); - auto merge_area = - [netcode, &bbox]( BOARD_CONNECTED_ITEM* aItem ) + auto merge_area = + [netcode, &bbox]( BOARD_CONNECTED_ITEM* aItem ) { if( aItem->GetNetCode() == netcode ) { @@ -316,7 +314,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline ) screenSize.y = std::max( 10.0, screenSize.y ); double ratio = std::max( -1.0, fabs( bbSize.y / screenSize.y ) ); // Original KiCad code for how much to scale the zoom - double kicadRatio = std::max( fabs( bbSize.x / screenSize.x ), + double kicadRatio = std::max( fabs( bbSize.x / screenSize.x ), fabs( bbSize.y / screenSize.y ) ); // LUT to scale zoom ratio to provide reasonable schematic context. Must work diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 86b0475d92..93656641b3 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index 38ecba9ebb..f3bf9dbfc7 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -23,8 +23,6 @@ #include #include -#include -#include #include #include #include @@ -32,7 +30,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_libraries_utils.cpp b/pcbnew/footprint_libraries_utils.cpp index b945f18a2b..14ee839d1e 100644 --- a/pcbnew/footprint_libraries_utils.cpp +++ b/pcbnew/footprint_libraries_utils.cpp @@ -22,7 +22,6 @@ */ #include -#include #include #include #include @@ -30,7 +29,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index bc342e8dd3..3800587d2e 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index a11a480a92..4f7eb759f7 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -24,13 +24,11 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include #include <3d_viewer/eda_3d_viewer.h> #include -#include #include #include #include diff --git a/pcbnew/footprint_wizard_frame_functions.cpp b/pcbnew/footprint_wizard_frame_functions.cpp index 5ddda80e9d..adaf7e50e8 100644 --- a/pcbnew/footprint_wizard_frame_functions.cpp +++ b/pcbnew/footprint_wizard_frame_functions.cpp @@ -23,8 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include -#include #include #include diff --git a/pcbnew/graphics_cleaner.cpp b/pcbnew/graphics_cleaner.cpp index fc07327394..589f544bbb 100644 --- a/pcbnew/graphics_cleaner.cpp +++ b/pcbnew/graphics_cleaner.cpp @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 00c111d643..2be868450a 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -20,7 +20,6 @@ * with this program. If not, see . */ -#include #include #include #include diff --git a/pcbnew/pcb_screen.cpp b/pcbnew/pcb_screen.cpp index 04b6fe0e4d..e9e8ef9ffb 100644 --- a/pcbnew/pcb_screen.cpp +++ b/pcbnew/pcb_screen.cpp @@ -24,7 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include diff --git a/pcbnew/pcbnew_config.cpp b/pcbnew/pcbnew_config.cpp index 8158cfe1e2..f84439d85a 100644 --- a/pcbnew/pcbnew_config.cpp +++ b/pcbnew/pcbnew_config.cpp @@ -24,7 +24,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#include #include #include #include diff --git a/pcbnew/toolbars_footprint_editor.cpp b/pcbnew/toolbars_footprint_editor.cpp index 676fadd2f3..9a79805578 100644 --- a/pcbnew/toolbars_footprint_editor.cpp +++ b/pcbnew/toolbars_footprint_editor.cpp @@ -20,9 +20,7 @@ * with this program. If not, see . */ -#include #include -#include #include #include #include diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index ba7f1f92d8..7d74ca7c40 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -24,16 +24,15 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include #include #include #include -#include #include -#include #include #include -#include #include #include #include