From b6c3d4eb3265ac6521b085ffb738ac222c50c352 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:13 +0100 Subject: [PATCH 01/12] build: Don't install INSTALL.txt --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2bb85af69..ce08aaa9d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -771,10 +771,6 @@ add_custom_target( uninstall # Installation #================================================ -install( FILES INSTALL.txt - DESTINATION ${KICAD_DOCS} - COMPONENT resources ) - ### # Install scripts ### From f9516cb48c65a7f9a32be87dac89a4db90f8c93a Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:24 +0100 Subject: [PATCH 02/12] build: Use CMAKE_INSTALL_DATADIR --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ce08aaa9d6..2e2e4c9e94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -376,9 +376,9 @@ if( NOT APPLE ) CACHE PATH "Location of KiCad user-loaded plugins" ) endif() - set( KICAD_DATA share/kicad + set( KICAD_DATA ${CMAKE_INSTALL_DATADIR}/kicad CACHE PATH "Location of KiCad data files." ) - set( KICAD_DOCS share/doc/kicad + set( KICAD_DOCS ${CMAKE_INSTALL_DATADIR}/doc/kicad CACHE PATH "Location of KiCad documentation files." ) set( KICAD_DEMOS ${KICAD_DATA}/demos CACHE PATH "Location of KiCad demo files." ) From 8a62aeb18d4efdbd4586cf7559e8bf40ff5e9534 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:38 +0100 Subject: [PATCH 03/12] build: Remove dead code --- CMakeLists.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e2e4c9e94..aead9692f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -689,14 +689,6 @@ if( KICAD_SCRIPTING OR KICAD_SCRIPTING_MODULES ) endif() -if( EXISTS ${CMAKE_SOURCE_DIR}/include/config.h ) - # This file may exist ( created by an alternate process to the svn test above), - # e.g. could be created by a checkout script that produces a source tar file. - # This directive means the about box will have the svn date & revision in it, - # but the hard coded release date ( program version) will be preserved. - add_definitions( -DHAVE_SVN_REVISION ) -endif() - if( APPLE ) # Remove app bundles in ${KICAD_BIN} before installing anything new. # Must be defined before all includes so that it is executed first. From c21a2a8a5504f40beb589888375cf40dd2d341fd Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:43 +0100 Subject: [PATCH 04/12] build: Don't install *.bat scripts on Unix --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index aead9692f0..565508c893 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -770,6 +770,7 @@ if( UNIX ) install( DIRECTORY scripts DESTINATION ${KICAD_DOCS} COMPONENT resources + PATTERN "*.bat" EXCLUDE ) endif() From 2b78183bb4f322a307c58b1978d97ade170650f8 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:45 +0100 Subject: [PATCH 05/12] Fix a typo --- gerbview/class_gerbview_layer_widget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gerbview/class_gerbview_layer_widget.cpp b/gerbview/class_gerbview_layer_widget.cpp index 6e9b8e312f..498dac3975 100644 --- a/gerbview/class_gerbview_layer_widget.cpp +++ b/gerbview/class_gerbview_layer_widget.cpp @@ -367,7 +367,7 @@ void GERBER_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) /* * Virtual Function useAlternateBitmap * return true if bitmaps shown in Render layer list - * must be alternate bitmap (when a gerber iùmage is loaded), or false to use "normal" bitmap + * must be alternate bitmap (when a gerber image is loaded), or false to use "normal" bitmap */ bool GERBER_LAYER_WIDGET::useAlternateBitmap(int aRow) { From 7daaa3e9d935f77cdbe41e1ea8d0f33085450fa5 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:48 +0100 Subject: [PATCH 06/12] Remove unused #define --- eeschema/sch_screen.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/eeschema/sch_screen.cpp b/eeschema/sch_screen.cpp index f9e723487e..cb7a77c3d8 100644 --- a/eeschema/sch_screen.cpp +++ b/eeschema/sch_screen.cpp @@ -66,9 +66,6 @@ static double SchematicZoomList[] = 13.0, 16.0, 20.0, 26.0, 32.0, 48.0, 64.0, 80.0, 128.0 }; -#define MM_TO_SCH_UNITS 1000.0 / 25.4 //schematic internal unites are mils - - /* Default grid sizes for the schematic editor. * Do NOT add others values (mainly grid values in mm), because they * can break the schematic: Because wires and pins are considered as From a155a5c78030f1755c47887b35e5b08923e87c36 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:52 +0100 Subject: [PATCH 07/12] Remove some dead code --- eeschema/sch_item_struct.cpp | 7 ------- eeschema/sch_item_struct.h | 4 ---- 2 files changed, 11 deletions(-) diff --git a/eeschema/sch_item_struct.cpp b/eeschema/sch_item_struct.cpp index 6e4f98c8da..873a8921a4 100644 --- a/eeschema/sch_item_struct.cpp +++ b/eeschema/sch_item_struct.cpp @@ -40,13 +40,6 @@ const wxString traceFindItem = wxT( "KICAD_TRACE_FIND_ITEM" ); - -bool sort_schematic_items( const SCH_ITEM* aItem1, const SCH_ITEM* aItem2 ) -{ - return *aItem1 < *aItem2; -} - - /* Constructor and destructor for SCH_ITEM */ /* They are not inline because this creates problems with gcc at linking time * in debug mode diff --git a/eeschema/sch_item_struct.h b/eeschema/sch_item_struct.h index a532561e80..48409040ed 100644 --- a/eeschema/sch_item_struct.h +++ b/eeschema/sch_item_struct.h @@ -427,8 +427,4 @@ private: virtual bool doIsConnected( const wxPoint& aPosition ) const { return false; } }; - -extern bool sort_schematic_items( const SCH_ITEM* aItem1, const SCH_ITEM* aItem2 ); - - #endif /* SCH_ITEM_STRUCT_H */ From 20f3cdaaea11b916b6d90a40997f3073c1175073 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:36:55 +0100 Subject: [PATCH 08/12] Remove orphaned code files --- common/wxunittext.cpp | 142 ----------------------------------------- include/wxunittext.h | 144 ------------------------------------------ 2 files changed, 286 deletions(-) delete mode 100644 common/wxunittext.cpp delete mode 100644 include/wxunittext.h diff --git a/common/wxunittext.cpp b/common/wxunittext.cpp deleted file mode 100644 index 3efcfab7f3..0000000000 --- a/common/wxunittext.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2014 CERN - * Author: Maciej Suminski - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "wxunittext.h" -#include -#include -#include -#include -#include -#include -#include - -WX_UNIT_TEXT::WX_UNIT_TEXT( wxWindow* aParent, const wxString& aLabel, double aValue, double aStep ) : - wxPanel( aParent, wxID_ANY ), - m_step( aStep ) -{ - // Use the currently selected units - m_units = g_UserUnit; - - wxBoxSizer* sizer; - sizer = new wxBoxSizer( wxHORIZONTAL ); - - // Helper label - m_inputLabel = new wxStaticText( this, wxID_ANY, aLabel, - wxDefaultPosition, wxDefaultSize, 0 ); - wxSize size = m_inputLabel->GetMinSize(); - size.SetWidth( 150 ); - m_inputLabel->SetMinSize( size ); - sizer->Add( m_inputLabel, 1, wxALIGN_CENTER_VERTICAL | wxALL | wxEXPAND, 5 ); - - // Main input control - m_inputValue = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, - wxTE_PROCESS_ENTER ); - - SetValue( aValue ); - sizer->Add( m_inputValue, 0, wxALIGN_CENTER_VERTICAL | wxALL ); - - wxFloatingPointValidator validator( 4, NULL, wxNUM_VAL_NO_TRAILING_ZEROES ); - validator.SetRange( 0.0, std::numeric_limits::max() ); - m_inputValue->SetValidator( validator ); - - // Spin buttons for modifying values using the mouse - m_spinButton = new wxSpinButton( this, wxID_ANY ); - m_spinButton->SetRange( std::numeric_limits::min(), std::numeric_limits::max() ); - - m_spinButton->SetCanFocus( false ); - sizer->Add( m_spinButton, 0, wxALIGN_CENTER_VERTICAL | wxALL ); - - Connect( wxEVT_SPIN_UP, wxSpinEventHandler( WX_UNIT_TEXT::onSpinUpEvent ), NULL, this ); - Connect( wxEVT_SPIN_DOWN, wxSpinEventHandler( WX_UNIT_TEXT::onSpinDownEvent ), NULL, this ); - - sizer->AddSpacer( 5 ); - - // Create units label - m_unitLabel = new wxStaticText( this, wxID_ANY, GetUnitsLabel( g_UserUnit ), - wxDefaultPosition, wxDefaultSize, 0 ); - sizer->Add( m_unitLabel, 0, wxALIGN_CENTER_VERTICAL | wxALL ); - - SetSizer( sizer ); - Layout(); -} - - -WX_UNIT_TEXT::~WX_UNIT_TEXT() -{ -} - - -void WX_UNIT_TEXT::SetUnits( EDA_UNITS_T aUnits, bool aConvert ) -{ - assert( !aConvert ); // TODO conversion does not work yet - - m_unitLabel->SetLabel( GetUnitsLabel( g_UserUnit ) ); -} - - -void WX_UNIT_TEXT::SetValue( double aValue ) -{ - if( aValue >= 0.0 ) - { - m_inputValue->SetValue( wxString( Double2Str( aValue ).c_str(), wxConvUTF8 ) ); - m_inputValue->MarkDirty(); - } - else - { - m_inputValue->SetValue( DEFAULT_VALUE ); - } -} - - -OPT WX_UNIT_TEXT::GetValue() const -{ - wxString text = m_inputValue->GetValue(); - double value; - - if( text == DEFAULT_VALUE ) - return OPT( -1.0 ); - - if( !text.ToDouble( &value ) ) - return OPT(); - - return OPT( value ); -} - - -void WX_UNIT_TEXT::onSpinUpEvent( wxSpinEvent& aEvent ) -{ - SetValue( *GetValue() + m_step ); -} - - -void WX_UNIT_TEXT::onSpinDownEvent( wxSpinEvent& aEvent ) -{ - double newValue = *GetValue() - m_step; - - if( newValue >= 0.0 ) - SetValue( newValue ); -} - - -const wxString WX_UNIT_TEXT::DEFAULT_VALUE = _( "default "); diff --git a/include/wxunittext.h b/include/wxunittext.h deleted file mode 100644 index cb5beeb0f2..0000000000 --- a/include/wxunittext.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * This program source code file is part of KiCad, a free EDA CAD application. - * - * Copyright (C) 2014 CERN - * Author: Maciej Suminski - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, you may find one here: - * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html - * or you may search the http://www.gnu.org website for the version 2 license, - * or you may write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef WXUNITTEXT_H_ -#define WXUNITTEXT_H_ - -#include -#include - -namespace boost -{ - template - class optional; -} -class wxTextCtrl; -class wxSpinButton; -class wxStaticText; - -class WX_UNIT_TEXT : public wxPanel -{ -public: - /** - * Constructor. - * @param aParent is the parent window. - * @param aLabel is the label displayed next to the text input control. - * @param aValue is the initial value for the control. - * @param aStep is the step size when using spin buttons. - */ - WX_UNIT_TEXT( wxWindow* aParent, const wxString& aLabel = _( "Size:" ), - double aValue = 0.0, double aStep = 0.1 ); - - virtual ~WX_UNIT_TEXT(); - - /** - * Function SetUnits - * Changes the units used by the control. - * @param aUnits is the new unit to be used. - * @param aConvert decides if the current value should be converted to the value in new units - * or should it stay the same. - */ - void SetUnits( EDA_UNITS_T aUnits, bool aConvert = false ); - - /** - * Function SetValue - * Sets new value for the control. - * @param aValue is the new value. - */ - virtual void SetValue( double aValue ); - - /* - * Function GetValue - * Returns the current value using specified units (if currently used units are different, then - * they are converted first). - * @param aUnits is the wanted unit. - */ - //virtual double GetValue( EDA_UNITS_T aUnits ) const; - - /** - * Function GetValue - * Returns the current value in currently used units. - */ - virtual OPT GetValue() const; - - /** - * Function GetUnits - * Returns currently used units. - */ - EDA_UNITS_T GetUnits() const - { - return m_units; - } - - /** - * Function SetStep - * Sets the difference introduced by a single spin button click. - * @param aStep is new step size. - */ - void SetStep( double aStep ) - { - assert( aStep > 0.0 ); - - m_step = aStep; - } - - /** - * Function GetStep - * Returns the difference introduced by a single spin button click. - */ - double GetStep() const - { - return m_step; - } - -protected: - ///> Spin up button click event handler. - void onSpinUpEvent( wxSpinEvent& aEvent ); - - ///> Spin down button click event handler. - void onSpinDownEvent( wxSpinEvent& aEvent ); - - ///> Label for the input (e.g. "Size:") - wxStaticText* m_inputLabel; - - ///> Text input control. - wxTextCtrl* m_inputValue; - - ///> Spin buttons for changing the value using mouse. - wxSpinButton* m_spinButton; - - ///> Label showing currently used units. - wxStaticText* m_unitLabel; - - ///> Currently used units. - EDA_UNITS_T m_units; - - ///> Step size (added/subtracted difference if spin buttons are used). - double m_step; - - ///> Default value (or non-specified) - static const wxString DEFAULT_VALUE; -}; - -#endif /* WXUNITTEXT_H_ */ From 69974b73db6446934890e7ecb8400b823c80b806 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Nov 2017 21:41:29 +0100 Subject: [PATCH 09/12] Remove some extra semicolons --- 3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h | 2 +- 3d-viewer/3d_cache/sg/sg_helpers.cpp | 2 +- 3d-viewer/3d_cache/sg/sg_helpers.h | 2 +- 3d-viewer/3d_cache/sg/sg_node.h | 2 +- 3d-viewer/3d_cache/str_rsort.h | 2 +- 3d-viewer/3d_canvas/eda_3d_canvas.h | 2 +- 3d-viewer/3d_model_viewer/c3d_model_viewer.h | 2 +- 3d-viewer/3d_viewer/eda_3d_viewer.h | 2 +- common/bitmap.cpp | 4 ++-- common/eagle_parser.cpp | 4 ++-- common/single_top.cpp | 2 +- common/view/view.cpp | 2 +- common/widgets/mathplot.cpp | 6 +++--- eeschema/dialogs/dialog_bom.cpp | 2 +- eeschema/pin_shape.cpp | 2 +- eeschema/plot_schematic_HPGL.cpp | 2 +- eeschema/sch_io_mgr.cpp | 2 +- eeschema/sch_io_mgr.h | 2 +- gerbview/class_gerber_draw_item.h | 2 +- include/class_draw_panel_gal.h | 2 +- include/geometry/rtree.h | 2 +- include/plugins/3dapi/ifsg_api.h | 2 +- include/plugins/3dapi/sg_types.h | 2 +- include/system/libcontext.h | 4 ++-- include/tool/tool_base.h | 2 +- include/tool/tool_dispatcher.h | 2 +- include/ttl/halfedge/hetraits.h | 2 +- include/ttl/halfedge/hetriang.h | 4 ++-- kicad/kicad.cpp | 2 +- pcb_calculator/UnitSelector.cpp | 10 +++++----- pcbnew/class_drawsegment.cpp | 2 +- pcbnew/class_module.h | 2 +- pcbnew/class_netclass.h | 2 +- pcbnew/class_pad.h | 2 +- pcbnew/class_zone.cpp | 2 +- pcbnew/class_zone_settings.cpp | 2 +- pcbnew/dialogs/dialog_footprint_wizard_list.cpp | 6 +++--- pcbnew/exporters/export_gencad.cpp | 4 ++-- pcbnew/exporters/export_vrml.cpp | 2 +- pcbnew/moduleframe.cpp | 2 +- pcbnew/pcb_view.cpp | 2 +- pcbnew/pcb_view.h | 2 +- pcbnew/router/pns_kicad_iface.h | 2 +- pcbnew/router/pns_router.h | 2 +- pcbnew/tools/tool_event_utils.h | 2 +- pcbnew/tools/zone_create_helper.cpp | 2 +- plugins/3d/idf/s3d_plugin_idf.cpp | 2 +- plugins/3d/vrml/wrlfacet.cpp | 2 +- plugins/3d/vrml/x3d/x3d_ops.h | 2 +- polygon/clipper.cpp | 2 +- 50 files changed, 63 insertions(+), 63 deletions(-) diff --git a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h index e2de72a6a7..e6731f938c 100644 --- a/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h +++ b/3d-viewer/3d_cache/dialogs/3d_cache_dialogs.h @@ -35,6 +35,6 @@ namespace S3D wxString& prevModelSelectDir, int& prevModelWildcard, MODULE_3D_SETTINGS* aModel ); bool Configure3DPaths( wxWindow* aParent, S3D_FILENAME_RESOLVER* aResolver ); -}; +} #endif // CACHE_DIALOGS_3D_H diff --git a/3d-viewer/3d_cache/sg/sg_helpers.cpp b/3d-viewer/3d_cache/sg/sg_helpers.cpp index e2b3809435..fec16bfef3 100644 --- a/3d-viewer/3d_cache/sg/sg_helpers.cpp +++ b/3d-viewer/3d_cache/sg/sg_helpers.cpp @@ -362,7 +362,7 @@ bool S3D::degenerate( glm::dvec3* pts ) return true; return false; -}; +} static void calcTriad( glm::dvec3* pts, glm::dvec3& tri ) diff --git a/3d-viewer/3d_cache/sg/sg_helpers.h b/3d-viewer/3d_cache/sg/sg_helpers.h index a2f024139c..34de4eb1b0 100644 --- a/3d-viewer/3d_cache/sg/sg_helpers.h +++ b/3d-viewer/3d_cache/sg/sg_helpers.h @@ -242,6 +242,6 @@ namespace S3D // read an RGB color bool ReadColor( std::istream& aFile, SGCOLOR& aColor ); -}; +} #endif // SG_HELPERS_H diff --git a/3d-viewer/3d_cache/sg/sg_node.h b/3d-viewer/3d_cache/sg/sg_node.h index fc6e646f2e..575a1aad08 100644 --- a/3d-viewer/3d_cache/sg/sg_node.h +++ b/3d-viewer/3d_cache/sg/sg_node.h @@ -66,7 +66,7 @@ namespace S3D void FREE_SMESH( SMESH& aMesh); void FREE_S3DMODEL( S3DMODEL& aModel ); -}; +} /** diff --git a/3d-viewer/3d_cache/str_rsort.h b/3d-viewer/3d_cache/str_rsort.h index 13c00e05fb..35044c6d71 100644 --- a/3d-viewer/3d_cache/str_rsort.h +++ b/3d-viewer/3d_cache/str_rsort.h @@ -82,6 +82,6 @@ namespace S3D } }; -}; // end NAMESPACE +} // end NAMESPACE #endif // STR_RSORT_H diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.h b/3d-viewer/3d_canvas/eda_3d_canvas.h index 6b20a2b292..e0d601a613 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.h +++ b/3d-viewer/3d_canvas/eda_3d_canvas.h @@ -161,7 +161,7 @@ class EDA_3D_CANVAS : public wxGLCanvas void OnTimerTimeout_Redraw( wxTimerEvent& event ); - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() private: diff --git a/3d-viewer/3d_model_viewer/c3d_model_viewer.h b/3d-viewer/3d_model_viewer/c3d_model_viewer.h index 3c2e839e0e..2e8e3b8f29 100644 --- a/3d-viewer/3d_model_viewer/c3d_model_viewer.h +++ b/3d-viewer/3d_model_viewer/c3d_model_viewer.h @@ -105,7 +105,7 @@ private: void OnRightClick( wxMouseEvent &event ); - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() private: diff --git a/3d-viewer/3d_viewer/eda_3d_viewer.h b/3d-viewer/3d_viewer/eda_3d_viewer.h index d620a46588..f878029cc4 100644 --- a/3d-viewer/3d_viewer/eda_3d_viewer.h +++ b/3d-viewer/3d_viewer/eda_3d_viewer.h @@ -222,7 +222,7 @@ class EDA_3D_VIEWER : public KIWAY_PLAYER */ void RenderEngineChanged(); - DECLARE_EVENT_TABLE(); + DECLARE_EVENT_TABLE() private: diff --git a/common/bitmap.cpp b/common/bitmap.cpp index d9741ec2e1..d0af48c7c7 100644 --- a/common/bitmap.cpp +++ b/common/bitmap.cpp @@ -132,7 +132,7 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, aMenu->Append( item ); return item; -}; +} wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, @@ -153,4 +153,4 @@ wxMenuItem* AddMenuItem( wxMenu* aMenu, wxMenu* aSubMenu, int aId, aMenu->Append( item ); return item; -}; +} diff --git a/common/eagle_parser.cpp b/common/eagle_parser.cpp index dd2d10d1ea..c0d2ee94ca 100644 --- a/common/eagle_parser.cpp +++ b/common/eagle_parser.cpp @@ -934,7 +934,7 @@ ECONNECT::ECONNECT( wxXmlNode* aConnect ) gate = parseRequiredAttribute( aConnect, "gate" ); pin = parseRequiredAttribute( aConnect, "pin" ); pad = parseRequiredAttribute( aConnect, "pad" ); -}; +} EDEVICE::EDEVICE( wxXmlNode* aDevice ) @@ -957,7 +957,7 @@ EDEVICE::EDEVICE( wxXmlNode* aDevice ) connectNode = connectNode->GetNext(); } -}; +} EDEVICE_SET::EDEVICE_SET( wxXmlNode* aDeviceSet ) diff --git a/common/single_top.cpp b/common/single_top.cpp index 4370829f0e..a1f41ec25d 100644 --- a/common/single_top.cpp +++ b/common/single_top.cpp @@ -202,7 +202,7 @@ struct APP_SINGLE_TOP : public wxApp #endif }; -IMPLEMENT_APP( APP_SINGLE_TOP ); +IMPLEMENT_APP( APP_SINGLE_TOP ) bool PGM_SINGLE_TOP::OnPgmInit() diff --git a/common/view/view.cpp b/common/view/view.cpp index 65e4f19659..5244a61bfe 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -1397,4 +1397,4 @@ void VIEW::Update( VIEW_ITEM* aItem, int aUpdateFlags ) const int VIEW::TOP_LAYER_MODIFIER = -VIEW_MAX_LAYERS; -}; +} diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index 6ad1057e19..e696a23649 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -1288,13 +1288,13 @@ mpScaleXBase::mpScaleXBase( wxString name, int flags, bool ticks, unsigned int t mpScaleX::mpScaleX( wxString name, int flags, bool ticks, unsigned int type ) : mpScaleXBase( name, flags, ticks, type ) { -}; +} mpScaleXLog::mpScaleXLog( wxString name, int flags, bool ticks, unsigned int type ) : mpScaleXBase( name, flags, ticks, type ) { -}; +} void mpScaleXBase::Plot( wxDC& dc, mpWindow& w ) @@ -2701,7 +2701,7 @@ void mpWindow::SetMPScrollbars( bool status ) //// SetVirtualSize((int) (m_maxX - m_minX), (int) (m_maxY - m_minY)); // } // Refresh(false);*/ -}; +} bool mpWindow::UpdateBBox() { diff --git a/eeschema/dialogs/dialog_bom.cpp b/eeschema/dialogs/dialog_bom.cpp index 51cc37c22d..934e4bf49c 100644 --- a/eeschema/dialogs/dialog_bom.cpp +++ b/eeschema/dialogs/dialog_bom.cpp @@ -72,7 +72,7 @@ struct BOM_PLUGIN */ WX_DECLARE_OBJARRAY( BOM_PLUGIN, BOM_PLUGIN_ARRAY ); #include -WX_DEFINE_OBJARRAY( BOM_PLUGIN_ARRAY ); +WX_DEFINE_OBJARRAY( BOM_PLUGIN_ARRAY ) /** * Class BOM_CFG_READER_PARSER diff --git a/eeschema/pin_shape.cpp b/eeschema/pin_shape.cpp index f59dbb4241..4cfe64b2d9 100644 --- a/eeschema/pin_shape.cpp +++ b/eeschema/pin_shape.cpp @@ -101,4 +101,4 @@ BITMAP_DEF GetBitmap( GRAPHIC_PINSHAPE shape ) assert( !"Invalid pin shape" ); return 0; -}; +} diff --git a/eeschema/plot_schematic_HPGL.cpp b/eeschema/plot_schematic_HPGL.cpp index 0c1846ef37..4cad993072 100644 --- a/eeschema/plot_schematic_HPGL.cpp +++ b/eeschema/plot_schematic_HPGL.cpp @@ -93,7 +93,7 @@ static const wxChar* plot_sheet_list( int aSize ) } return ret; -}; +} void DIALOG_PLOT_SCHEMATIC::SetHPGLPenWidth() diff --git a/eeschema/sch_io_mgr.cpp b/eeschema/sch_io_mgr.cpp index 7a8d9e1b4e..9259147f78 100644 --- a/eeschema/sch_io_mgr.cpp +++ b/eeschema/sch_io_mgr.cpp @@ -172,4 +172,4 @@ void SCH_IO_MGR::Save( SCH_FILE_T aFileType, const wxString& aFileName, } -DECLARE_ENUM_VECTOR( SCH_IO_MGR, SCH_FILE_T ); +DECLARE_ENUM_VECTOR( SCH_IO_MGR, SCH_FILE_T ) diff --git a/eeschema/sch_io_mgr.h b/eeschema/sch_io_mgr.h index eb3f5b83d0..8818edf298 100644 --- a/eeschema/sch_io_mgr.h +++ b/eeschema/sch_io_mgr.h @@ -60,7 +60,7 @@ public: // ALTIUM, // etc. - } ); + } ) /** * Return a #SCH_PLUGIN which the caller can use to import, export, save, or load diff --git a/gerbview/class_gerber_draw_item.h b/gerbview/class_gerber_draw_item.h index a272392e34..6c9fa5aebf 100644 --- a/gerbview/class_gerber_draw_item.h +++ b/gerbview/class_gerber_draw_item.h @@ -46,7 +46,7 @@ class GBR_DISPLAY_OPTIONS; namespace KIGFX { class VIEW; -}; +} /* Shapes id for basic shapes ( .m_Shape member ) */ diff --git a/include/class_draw_panel_gal.h b/include/class_draw_panel_gal.h index b12c4b3822..ea04963062 100644 --- a/include/class_draw_panel_gal.h +++ b/include/class_draw_panel_gal.h @@ -49,7 +49,7 @@ class WX_VIEW_CONTROLS; class VIEW_CONTROLS; class PAINTER; class GAL_DISPLAY_OPTIONS; -}; +} class EDA_DRAW_PANEL_GAL : public wxScrolledCanvas diff --git a/include/geometry/rtree.h b/include/geometry/rtree.h index 1710d5aea2..8334b7734c 100644 --- a/include/geometry/rtree.h +++ b/include/geometry/rtree.h @@ -822,7 +822,7 @@ bool RTREE_QUAL::Load( const char* a_fileName ) stream.Close(); return result; -}; +} RTREE_TEMPLATE diff --git a/include/plugins/3dapi/ifsg_api.h b/include/plugins/3dapi/ifsg_api.h index 7eb88e97e2..a1d97afd31 100644 --- a/include/plugins/3dapi/ifsg_api.h +++ b/include/plugins/3dapi/ifsg_api.h @@ -193,6 +193,6 @@ namespace S3D * creates and initializes an SMESH struct */ SGLIB_API void Init3DMesh( SMESH& aMesh ); -}; +} #endif // IFSG_API_H diff --git a/include/plugins/3dapi/sg_types.h b/include/plugins/3dapi/sg_types.h index db4cadfc3e..f85cef3a4a 100644 --- a/include/plugins/3dapi/sg_types.h +++ b/include/plugins/3dapi/sg_types.h @@ -44,6 +44,6 @@ namespace S3D SGTYPE_SHAPE, SGTYPE_END }; -}; +} #endif // SG_TYPES_H diff --git a/include/system/libcontext.h b/include/system/libcontext.h index 336787bec5..e274e43157 100644 --- a/include/system/libcontext.h +++ b/include/system/libcontext.h @@ -85,11 +85,11 @@ fcontext_t LIBCONTEXT_CALL_CONVENTION make_fcontext( void* sp, size_t size, void (* fn)( intptr_t ) ); #ifdef __cplusplus -}; // namespace +} // namespace #endif #ifdef __cplusplus -}; // extern "C" +} // extern "C" #endif #endif diff --git a/include/tool/tool_base.h b/include/tool/tool_base.h index 167c51d450..0302c15858 100644 --- a/include/tool/tool_base.h +++ b/include/tool/tool_base.h @@ -42,7 +42,7 @@ namespace KIGFX { class VIEW; class VIEW_CONTROLS; -}; +} enum TOOL_TYPE { diff --git a/include/tool/tool_dispatcher.h b/include/tool/tool_dispatcher.h index 6a47342a9b..44a3c31af6 100644 --- a/include/tool/tool_dispatcher.h +++ b/include/tool/tool_dispatcher.h @@ -36,7 +36,7 @@ class ACTIONS; namespace KIGFX { class VIEW; -}; +} /** * Class TOOL_DISPATCHER diff --git a/include/ttl/halfedge/hetraits.h b/include/ttl/halfedge/hetraits.h index 04288a0ba5..a186c405ea 100644 --- a/include/ttl/halfedge/hetraits.h +++ b/include/ttl/halfedge/hetraits.h @@ -184,6 +184,6 @@ struct TTLtraits //@} // End of Geometric Predicates Group }; -}; // End of hed namespace +} // End of hed namespace #endif diff --git a/include/ttl/halfedge/hetriang.h b/include/ttl/halfedge/hetriang.h index 03ba5f9bc3..0d30b7ed2c 100644 --- a/include/ttl/halfedge/hetriang.h +++ b/include/ttl/halfedge/hetriang.h @@ -61,7 +61,7 @@ class CN_CLUSTER; namespace ttl { class TRIANGULATION_HELPER; -}; +} /** * The half-edge data structure @@ -426,6 +426,6 @@ public: friend class ttl::TRIANGULATION_HELPER; }; -}; // End of hed namespace +} // End of hed namespace #endif diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 76ffcc9f66..c919519c5d 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -262,7 +262,7 @@ struct APP_KICAD : public wxApp } }; -IMPLEMENT_APP( APP_KICAD ); +IMPLEMENT_APP( APP_KICAD ) // The C++ project manager supports one open PROJECT, so Prj() calls within diff --git a/pcb_calculator/UnitSelector.cpp b/pcb_calculator/UnitSelector.cpp index 06b3768628..913fce1213 100644 --- a/pcb_calculator/UnitSelector.cpp +++ b/pcb_calculator/UnitSelector.cpp @@ -40,7 +40,7 @@ UNIT_SELECTOR_LEN::UNIT_SELECTOR_LEN( wxWindow *parent, wxWindowID id, Append( _( "cm" ) ); Append( _( "mil" ) ); Append( _( "inch" ) ); -}; +} /* @@ -73,7 +73,7 @@ UNIT_SELECTOR_THICKNESS::UNIT_SELECTOR_THICKNESS( wxWindow *parent, wxWindowID i Append( _( "mil" ) ); Append( _( "inch" ) ); Append( _( "oz/ft^2" ) ); -}; +} /* @@ -105,7 +105,7 @@ UNIT_SELECTOR_FREQUENCY::UNIT_SELECTOR_FREQUENCY( wxWindow *parent, wxWindowID i Append( _( "MHz" ) ); Append( _( "KHz" ) ); Append( _( "Hz" ) ); -}; +} /* * Function GetUnitScale @@ -132,7 +132,7 @@ UNIT_SELECTOR_ANGLE::UNIT_SELECTOR_ANGLE( wxWindow *parent, wxWindowID id, { Append( _( "Radian" ) ); Append( _( "Degree" ) ); -}; +} /* * Function GetUnitScale @@ -157,7 +157,7 @@ UNIT_SELECTOR_RESISTOR::UNIT_SELECTOR_RESISTOR( wxWindow *parent, wxWindowID id, { Append( _( "Ohm" ) ); Append( _( "KOhm" ) ); -}; +} /* diff --git a/pcbnew/class_drawsegment.cpp b/pcbnew/class_drawsegment.cpp index fc547ce14a..989a28f372 100644 --- a/pcbnew/class_drawsegment.cpp +++ b/pcbnew/class_drawsegment.cpp @@ -102,7 +102,7 @@ void DRAWSEGMENT::Rotate( const wxPoint& aRotCentre, double aAngle ) + ShowShape( m_Shape ) ) ); break; } -}; +} void DRAWSEGMENT::Flip( const wxPoint& aCentre ) { diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index f8f74a6fc6..c92fbafcf6 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -56,7 +56,7 @@ class MSG_PANEL_ITEM; namespace KIGFX { class VIEW; -}; +} enum INCLUDE_NPTH_T { diff --git a/pcbnew/class_netclass.h b/pcbnew/class_netclass.h index 7d35bd13b7..f6ebaddf5e 100644 --- a/pcbnew/class_netclass.h +++ b/pcbnew/class_netclass.h @@ -219,7 +219,7 @@ public: DECL_SPTR_FOR_SWIG( NETCLASSPTR, NETCLASS ) -DECL_MAP_FOR_SWIG( NETCLASS_MAP, wxString, NETCLASSPTR ); +DECL_MAP_FOR_SWIG( NETCLASS_MAP, wxString, NETCLASSPTR ) /** diff --git a/pcbnew/class_pad.h b/pcbnew/class_pad.h index 274553f3ba..b767d0bc10 100644 --- a/pcbnew/class_pad.h +++ b/pcbnew/class_pad.h @@ -57,7 +57,7 @@ class MSG_PANEL_INFO; namespace KIGFX { class VIEW; -}; +} // Helper class to store parameters used to draw a pad class PAD_DRAWINFO diff --git a/pcbnew/class_zone.cpp b/pcbnew/class_zone.cpp index 97a7687d61..5b5bfc60a1 100644 --- a/pcbnew/class_zone.cpp +++ b/pcbnew/class_zone.cpp @@ -655,7 +655,7 @@ void ZONE_CONTAINER::SetCornerRadius( unsigned int aRadius ) m_cornerRadius = aRadius; if( m_cornerRadius > (unsigned int) Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ) ) m_cornerRadius = Mils2iu( MAX_ZONE_CORNER_RADIUS_MILS ); -}; +} bool ZONE_CONTAINER::HitTest( const wxPoint& aPosition ) const diff --git a/pcbnew/class_zone_settings.cpp b/pcbnew/class_zone_settings.cpp index d9a3f6bba1..b55efa66b8 100644 --- a/pcbnew/class_zone_settings.cpp +++ b/pcbnew/class_zone_settings.cpp @@ -142,4 +142,4 @@ void ZONE_SETTINGS::SetCornerRadius( int aRadius ) m_cornerRadius = 0; else m_cornerRadius = aRadius; -}; +} diff --git a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp index 1e32a827d8..ab0bf3be71 100644 --- a/pcbnew/dialogs/dialog_footprint_wizard_list.cpp +++ b/pcbnew/dialogs/dialog_footprint_wizard_list.cpp @@ -39,9 +39,9 @@ #include #else // Dummy functions, actually defined in python_scripting.h when KICAD_SCRIPTING is enabled -static void pcbnewGetWizardsBackTrace( wxString& aText ) {}; -static void pcbnewGetScriptsSearchPaths( wxString& aText ) {}; -static void pcbnewGetUnloadableScriptNames( wxString& aText ) {}; +static void pcbnewGetWizardsBackTrace( wxString& aText ) {} +static void pcbnewGetScriptsSearchPaths( wxString& aText ) {} +static void pcbnewGetUnloadableScriptNames( wxString& aText ) {} #endif enum FPGeneratorRowNames diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index ac84c2055b..aa8ebac35f 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -156,7 +156,7 @@ static std::string GenCADLayerName( int aCuCount, PCB_LAYER_ID aId ) return txt; } -}; +} static const PCB_LAYER_ID gc_seq[] = { @@ -204,7 +204,7 @@ static std::string GenCADLayerNameFlipped( int aCuCount, PCB_LAYER_ID aId ) } return GenCADLayerName( aCuCount, aId ); -}; +} static wxString escapeString( const wxString& aString ) diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 66dda6b64a..a88fca39cb 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -1618,7 +1618,7 @@ static SGNODE* getSGColor( VRML_COLOR_INDEX colorIdx ) sgmaterial[colorIdx] = vcolor.GetRawPtr(); return sgmaterial[colorIdx]; -}; +} static void create_vrml_plane( IFSG_TRANSFORM& PcbOutput, VRML_COLOR_INDEX colorID, diff --git a/pcbnew/moduleframe.cpp b/pcbnew/moduleframe.cpp index 8c891b107b..903813c10f 100644 --- a/pcbnew/moduleframe.cpp +++ b/pcbnew/moduleframe.cpp @@ -398,7 +398,7 @@ const wxString FOOTPRINT_EDIT_FRAME::getLibPath() const wxString FOOTPRINT_EDIT_FRAME::GetCurrentLib() const { return Prj().GetRString( PROJECT::PCB_LIB_NICKNAME ); -}; +} void FOOTPRINT_EDIT_FRAME::retainLastFootprint() diff --git a/pcbnew/pcb_view.cpp b/pcbnew/pcb_view.cpp index 48e7609bb7..f4f913eaf3 100644 --- a/pcbnew/pcb_view.cpp +++ b/pcbnew/pcb_view.cpp @@ -107,4 +107,4 @@ void PCB_VIEW::UpdateDisplayOptions( PCB_DISPLAY_OPTIONS* aOptions ) settings->LoadDisplayOptions( aOptions ); } -}; +} diff --git a/pcbnew/pcb_view.h b/pcbnew/pcb_view.h index 2782c5d526..c05b67389a 100644 --- a/pcbnew/pcb_view.h +++ b/pcbnew/pcb_view.h @@ -59,6 +59,6 @@ private: PCB_LAYER_ID m_routeLayerBottom; }; -}; +} #endif diff --git a/pcbnew/router/pns_kicad_iface.h b/pcbnew/router/pns_kicad_iface.h index 3d9b6e223a..18e6c8b3eb 100644 --- a/pcbnew/router/pns_kicad_iface.h +++ b/pcbnew/router/pns_kicad_iface.h @@ -37,7 +37,7 @@ class PCB_TOOL; namespace KIGFX { class VIEW; -}; +} class PNS_KICAD_IFACE : public PNS::ROUTER_IFACE { public: diff --git a/pcbnew/router/pns_router.h b/pcbnew/router/pns_router.h index 67e6b9dd5d..5ee6bd28f7 100644 --- a/pcbnew/router/pns_router.h +++ b/pcbnew/router/pns_router.h @@ -42,7 +42,7 @@ namespace KIGFX class VIEW; class VIEW_GROUP; -}; +} namespace PNS { diff --git a/pcbnew/tools/tool_event_utils.h b/pcbnew/tools/tool_event_utils.h index d633d281ef..c8331625c1 100644 --- a/pcbnew/tools/tool_event_utils.h +++ b/pcbnew/tools/tool_event_utils.h @@ -72,6 +72,6 @@ namespace TOOL_EVT_UTILS */ int GetEventRotationAngle( const PCB_BASE_EDIT_FRAME& aFrame, const TOOL_EVENT& aEvt ); -}; +} #endif // TOOL_EVENT_UTILS_H diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index 131f2d30f5..f72409032d 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -181,7 +181,7 @@ void ZONE_CREATE_HELPER::commitZone( std::unique_ptr aZone ) break; } } -}; +} bool ZONE_CREATE_HELPER::OnFirstPoint() diff --git a/plugins/3d/idf/s3d_plugin_idf.cpp b/plugins/3d/idf/s3d_plugin_idf.cpp index 39068ec3c4..e45c1f3c45 100644 --- a/plugins/3d/idf/s3d_plugin_idf.cpp +++ b/plugins/3d/idf/s3d_plugin_idf.cpp @@ -169,7 +169,7 @@ static SGNODE* getColor( IFSG_SHAPE& shape, int colorIdx ) cidx = 1; return material.GetRawPtr(); -}; +} const char* GetKicadPluginName( void ) diff --git a/plugins/3d/vrml/wrlfacet.cpp b/plugins/3d/vrml/wrlfacet.cpp index f09d5637c4..04c408017b 100644 --- a/plugins/3d/vrml/wrlfacet.cpp +++ b/plugins/3d/vrml/wrlfacet.cpp @@ -62,7 +62,7 @@ static bool VDegenerate( glm::vec3* pts ) return true; return false; -}; +} static WRLVEC3F VCalcTriNorm( const WRLVEC3F& p1, const WRLVEC3F& p2, const WRLVEC3F& p3 ) diff --git a/plugins/3d/vrml/x3d/x3d_ops.h b/plugins/3d/vrml/x3d/x3d_ops.h index b1d8712858..e724613ea9 100644 --- a/plugins/3d/vrml/x3d/x3d_ops.h +++ b/plugins/3d/vrml/x3d/x3d_ops.h @@ -48,7 +48,7 @@ namespace X3D bool ParseSFVec3( const wxString& aSource, WRLVEC3F& aResult ); bool ParseSFRotation( const wxString& aSource, WRLROTATION& aResult ); -}; +} #endif // X3D_OPS_H diff --git a/polygon/clipper.cpp b/polygon/clipper.cpp index a912f7cc44..448aff4856 100644 --- a/polygon/clipper.cpp +++ b/polygon/clipper.cpp @@ -429,7 +429,7 @@ Int128 Int128Mul( long64 lhs, long64 rhs ) tmp = -tmp; return tmp; -}; +} #endif // ------------------------------------------------------------------------------ From c36d666dde15126b167473a4747269fef370c708 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Wed, 1 Nov 2017 21:29:51 +0100 Subject: [PATCH 10/12] Remove duplicate #include --- common/class_undoredo_container.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/class_undoredo_container.cpp b/common/class_undoredo_container.cpp index ada087480e..88eec3001d 100644 --- a/common/class_undoredo_container.cpp +++ b/common/class_undoredo_container.cpp @@ -25,8 +25,6 @@ #include #include -#include - #include #include From 273437641cef9ae5f8f2843f157da6a95755b5ad Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Wed, 1 Nov 2017 21:33:32 +0100 Subject: [PATCH 11/12] Remove some else-after-return's --- common/class_undoredo_container.cpp | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/common/class_undoredo_container.cpp b/common/class_undoredo_container.cpp index 88eec3001d..e3f974eb38 100644 --- a/common/class_undoredo_container.cpp +++ b/common/class_undoredo_container.cpp @@ -178,8 +178,8 @@ EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItem( unsigned int aIdx ) const { if( aIdx < m_ItemsList.size() ) return m_ItemsList[aIdx].GetItem(); - else - return NULL; + + return NULL; } @@ -187,8 +187,8 @@ EDA_ITEM* PICKED_ITEMS_LIST::GetPickedItemLink( unsigned int aIdx ) const { if( aIdx < m_ItemsList.size() ) return m_ItemsList[aIdx].GetLink(); - else - return NULL; + + return NULL; } @@ -196,8 +196,8 @@ UNDO_REDO_T PICKED_ITEMS_LIST::GetPickedItemStatus( unsigned int aIdx ) const { if( aIdx < m_ItemsList.size() ) return m_ItemsList[aIdx].GetStatus(); - else - return UR_UNSPECIFIED; + + return UR_UNSPECIFIED; } @@ -205,8 +205,8 @@ STATUS_FLAGS PICKED_ITEMS_LIST::GetPickerFlags( unsigned aIdx ) const { if( aIdx < m_ItemsList.size() ) return m_ItemsList[aIdx].GetFlags(); - else - return 0; + + return 0; } @@ -217,8 +217,8 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, unsigned aIdx ) m_ItemsList[aIdx].SetItem( aItem ); return true; } - else - return false; + + return false; } @@ -229,8 +229,8 @@ bool PICKED_ITEMS_LIST::SetPickedItemLink( EDA_ITEM* aLink, unsigned aIdx ) m_ItemsList[aIdx].SetLink( aLink ); return true; } - else - return false; + + return false; } @@ -242,8 +242,8 @@ bool PICKED_ITEMS_LIST::SetPickedItem( EDA_ITEM* aItem, UNDO_REDO_T aStatus, uns m_ItemsList[aIdx].SetStatus( aStatus ); return true; } - else - return false; + + return false; } @@ -254,8 +254,8 @@ bool PICKED_ITEMS_LIST::SetPickedItemStatus( UNDO_REDO_T aStatus, unsigned aIdx m_ItemsList[aIdx].SetStatus( aStatus ); return true; } - else - return false; + + return false; } @@ -266,8 +266,8 @@ bool PICKED_ITEMS_LIST::SetPickerFlags( STATUS_FLAGS aFlags, unsigned aIdx ) m_ItemsList[aIdx].SetFlags( aFlags ); return true; } - else - return false; + + return false; } @@ -275,6 +275,7 @@ bool PICKED_ITEMS_LIST::RemovePicker( unsigned aIdx ) { if( aIdx >= m_ItemsList.size() ) return false; + m_ItemsList.erase( m_ItemsList.begin() + aIdx ); return true; } From 5e013e916bf756b17be5a193041256d5e059d008 Mon Sep 17 00:00:00 2001 From: Marvin Schmidt Date: Thu, 2 Feb 2017 13:07:49 +0100 Subject: [PATCH 12/12] Use std::remove_pointer instead of own implementation (NFC) --- include/core/typeinfo.h | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/include/core/typeinfo.h b/include/core/typeinfo.h index 34c3324e63..537171348b 100644 --- a/include/core/typeinfo.h +++ b/include/core/typeinfo.h @@ -28,19 +28,7 @@ #ifndef SWIG -#include - -template -struct remove_pointer -{ - typedef T type; -}; - -template -struct remove_pointer -{ - typedef typename remove_pointer::type type; -}; +#include /** * Function IsA() @@ -52,13 +40,13 @@ struct remove_pointer template bool IsA( const I* aObject ) { - return aObject && remove_pointer::type::ClassOf( aObject ); + return aObject && std::remove_pointer::type::ClassOf( aObject ); } template bool IsA( const I& aObject ) { - return remove_pointer::type::ClassOf( &aObject ); + return std::remove_pointer::type::ClassOf( &aObject ); } /** @@ -72,10 +60,10 @@ bool IsA( const I& aObject ) template Casted dyn_cast( From aObject ) { - if( remove_pointer::type::ClassOf ( aObject ) ) + if( std::remove_pointer::type::ClassOf ( aObject ) ) return static_cast( aObject ); - return NULL; + return nullptr; } class EDA_ITEM;