diff --git a/3d-viewer/3d_rendering/buffers_debug.cpp b/3d-viewer/3d_rendering/buffers_debug.cpp index b5132cef52..3318900a15 100644 --- a/3d-viewer/3d_rendering/buffers_debug.cpp +++ b/3d-viewer/3d_rendering/buffers_debug.cpp @@ -39,7 +39,7 @@ * @param aXSize * @param aYSize */ -static void dbg_save_rgb_buffer( wxString aFileName, +static void dbg_save_rgb_buffer( const wxString& aFileName, unsigned char *aRGBpixelBuffer, unsigned int aXSize, unsigned int aYSize ) @@ -52,7 +52,7 @@ static void dbg_save_rgb_buffer( wxString aFileName, } -void DBG_SaveBuffer( wxString aFileName, +void DBG_SaveBuffer( const wxString& aFileName, const unsigned char *aInBuffer, unsigned int aXSize, unsigned int aYSize ) @@ -75,7 +75,7 @@ void DBG_SaveBuffer( wxString aFileName, } -void DBG_SaveBuffer( wxString aFileName, +void DBG_SaveBuffer( const wxString& aFileName, const float *aInBuffer, unsigned int aXSize, unsigned int aYSize ) @@ -99,7 +99,7 @@ void DBG_SaveBuffer( wxString aFileName, } -void DBG_SaveBuffer( wxString aFileName, +void DBG_SaveBuffer( const wxString& aFileName, const SFVEC3F *aInBuffer, unsigned int aXSize, unsigned int aYSize ) @@ -123,7 +123,7 @@ void DBG_SaveBuffer( wxString aFileName, } -void DBG_SaveNormalsBuffer( wxString aFileName, +void DBG_SaveNormalsBuffer( const wxString& aFileName, const SFVEC3F *aInNormalsBuffer, unsigned int aXSize, unsigned int aYSize ) diff --git a/3d-viewer/3d_rendering/buffers_debug.h b/3d-viewer/3d_rendering/buffers_debug.h index bb6b385974..c64975d7af 100644 --- a/3d-viewer/3d_rendering/buffers_debug.h +++ b/3d-viewer/3d_rendering/buffers_debug.h @@ -33,21 +33,21 @@ #include #include -void DBG_SaveBuffer( wxString aFileName, +void DBG_SaveBuffer( const wxString& aFileName, const unsigned char *aInBuffer, unsigned int aXSize, unsigned int aYSize ); -void DBG_SaveBuffer( wxString aFileName, +void DBG_SaveBuffer( const wxString& aFileName, const float *aInBuffer, unsigned int aXSize, unsigned int aYSize ); -void DBG_SaveBuffer( wxString aFileName, +void DBG_SaveBuffer( const wxString& aFileName, const SFVEC3F *aInBuffer, unsigned int aXSize, unsigned int aYSize ); -void DBG_SaveNormalsBuffer( wxString aFileName, +void DBG_SaveNormalsBuffer( const wxString& aFileName, const SFVEC3F *aInNormalsBuffer, unsigned int aXSize, unsigned int aYSize ); diff --git a/3d-viewer/3d_rendering/cimage.cpp b/3d-viewer/3d_rendering/cimage.cpp index 755ef0b889..78622970b5 100644 --- a/3d-viewer/3d_rendering/cimage.cpp +++ b/3d-viewer/3d_rendering/cimage.cpp @@ -512,7 +512,7 @@ void CIMAGE::SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray ) } -void CIMAGE::SaveAsPNG( wxString aFileName ) const +void CIMAGE::SaveAsPNG( const wxString& aFileName ) const { DBG_SaveBuffer( aFileName, m_pixels, m_width, m_height ); } diff --git a/3d-viewer/3d_rendering/cimage.h b/3d-viewer/3d_rendering/cimage.h index 341dc54d34..1cf079268e 100644 --- a/3d-viewer/3d_rendering/cimage.h +++ b/3d-viewer/3d_rendering/cimage.h @@ -186,7 +186,7 @@ public: * each of RGB channel will have the 8bit-channel from the image. * @param aFileName fime name (without extension) */ - void SaveAsPNG( wxString aFileName ) const; + void SaveAsPNG( const wxString& aFileName ) const; /** * Function SetPixelsFromNormalizedFloat diff --git a/common/confirm.cpp b/common/confirm.cpp index e5e0838906..5921f33645 100644 --- a/common/confirm.cpp +++ b/common/confirm.cpp @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -84,7 +85,7 @@ void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) } -void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxString aExtraInfo ) +void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxString& aExtraInfo ) { wxRichMessageDialog* dlg; @@ -101,7 +102,7 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aText, const wxStri } -void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxString aExtraInfo ) +void DisplayInfoMessage( wxWindow* aParent, const wxString& aMessage, const wxString& aExtraInfo ) { wxRichMessageDialog* dlg; diff --git a/common/footprint_info.cpp b/common/footprint_info.cpp index a39de4fe3c..1744129404 100644 --- a/common/footprint_info.cpp +++ b/common/footprint_info.cpp @@ -47,6 +47,7 @@ #include #include #include +#include #include @@ -205,7 +206,7 @@ int FOOTPRINT_ASYNC_LOADER::GetProgress() const void FOOTPRINT_ASYNC_LOADER::SetCompletionCallback( std::function aCallback ) { - m_completion_cb = aCallback; + m_completion_cb = std::move(aCallback); } diff --git a/common/gal/gal_display_options.cpp b/common/gal/gal_display_options.cpp index 92d46dedfc..e3ef839f71 100644 --- a/common/gal/gal_display_options.cpp +++ b/common/gal/gal_display_options.cpp @@ -69,7 +69,7 @@ GAL_DISPLAY_OPTIONS::GAL_DISPLAY_OPTIONS() {} -void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, wxString aBaseName ) +void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, const wxString& aBaseName ) { long readLong; // Temp value buffer @@ -100,7 +100,7 @@ void GAL_DISPLAY_OPTIONS::ReadConfig( wxConfigBase* aCfg, wxString aBaseName ) } -void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase* aCfg, wxString aBaseName ) +void GAL_DISPLAY_OPTIONS::WriteConfig( wxConfigBase* aCfg, const wxString& aBaseName ) { aCfg->Write( aBaseName + GalGLAntialiasingKeyword, UTIL::GetConfigForVal( aaModeConfigVals, gl_antialiasing_mode ) ); diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index e712553cd4..608c117144 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -1545,7 +1545,7 @@ void OPENGL_GAL::drawPolygon( GLdouble* aPoints, int aPointCount ) } -void OPENGL_GAL::drawPolyline( std::function aPointGetter, int aPointCount ) +void OPENGL_GAL::drawPolyline( const std::function& aPointGetter, int aPointCount ) { if( aPointCount < 2 ) return; diff --git a/common/geometry/shape_file_io.cpp b/common/geometry/shape_file_io.cpp index 6bcbafb444..2d3a700953 100644 --- a/common/geometry/shape_file_io.cpp +++ b/common/geometry/shape_file_io.cpp @@ -115,7 +115,7 @@ SHAPE* SHAPE_FILE_IO::Read() } -void SHAPE_FILE_IO::BeginGroup( const std::string aName ) +void SHAPE_FILE_IO::BeginGroup( const std::string& aName ) { assert( m_mode != IOM_READ ); @@ -139,7 +139,7 @@ void SHAPE_FILE_IO::EndGroup() } -void SHAPE_FILE_IO::Write( const SHAPE* aShape, const std::string aName ) +void SHAPE_FILE_IO::Write( const SHAPE* aShape, const std::string& aName ) { assert( m_mode != IOM_READ ); diff --git a/common/geometry/shape_poly_set.cpp b/common/geometry/shape_poly_set.cpp index 0d0878532b..b1cba0e2c8 100644 --- a/common/geometry/shape_poly_set.cpp +++ b/common/geometry/shape_poly_set.cpp @@ -1657,7 +1657,7 @@ int SHAPE_POLY_SET::Distance( VECTOR2I aPoint ) } -int SHAPE_POLY_SET::Distance( SEG aSegment, int aSegmentWidth ) +int SHAPE_POLY_SET::Distance( const SEG& aSegment, int aSegmentWidth ) { int currentDistance; int minDistance = DistanceToPolygon( aSegment, 0 ); diff --git a/common/incremental_text_ctrl.cpp b/common/incremental_text_ctrl.cpp index cc814c7973..c68af69d4f 100644 --- a/common/incremental_text_ctrl.cpp +++ b/common/incremental_text_ctrl.cpp @@ -24,6 +24,8 @@ #include +#include + /** * Check that a string looks like a floating point number that can * be dealt with. @@ -61,7 +63,7 @@ void INCREMENTAL_TEXT_CTRL::SetStep( double aMin, double aMax, m_minVal = std::min( aMin, aMax ); m_maxVal = std::max( aMin, aMax ); - m_stepFunc = aStepFunc; + m_stepFunc = std::move( aStepFunc ); // finally, clamp the current value and re-display updateTextValue(); diff --git a/common/search_stack.cpp b/common/search_stack.cpp index 9982f4147f..6c96c3fa5c 100644 --- a/common/search_stack.cpp +++ b/common/search_stack.cpp @@ -34,7 +34,7 @@ #endif -int SEARCH_STACK::Split( wxArrayString* aResult, const wxString aPathString ) +int SEARCH_STACK::Split( wxArrayString* aResult, const wxString& aPathString ) { wxStringTokenizer tokenizer( aPathString, PATH_SEPS, wxTOKEN_STRTOK ); diff --git a/common/tool/tool_action.cpp b/common/tool/tool_action.cpp index 622bb5e7ff..8693bcdd07 100644 --- a/common/tool/tool_action.cpp +++ b/common/tool/tool_action.cpp @@ -28,7 +28,7 @@ #include TOOL_ACTION::TOOL_ACTION( const std::string& aName, TOOL_ACTION_SCOPE aScope, - int aDefaultHotKey, const wxString aMenuItem, const wxString& aMenuDesc, + int aDefaultHotKey, const wxString& aMenuItem, const wxString& aMenuDesc, const BITMAP_OPAQUE* aIcon, TOOL_ACTION_FLAGS aFlags, void* aParam ) : m_name( aName ), m_scope( aScope ), m_defaultHotKey( aDefaultHotKey ), m_menuItem( aMenuItem ), m_menuDescription( aMenuDesc ), diff --git a/common/widgets/mathplot.cpp b/common/widgets/mathplot.cpp index e696a23649..48517ade8b 100644 --- a/common/widgets/mathplot.cpp +++ b/common/widgets/mathplot.cpp @@ -452,7 +452,7 @@ double mpScaleY::P2x( mpWindow& w, double x ) IMPLEMENT_ABSTRACT_CLASS( mpFX, mpLayer ) -mpFX::mpFX( wxString name, int flags ) +mpFX::mpFX( const wxString& name, int flags ) { SetName( name ); m_flags = flags; @@ -529,7 +529,7 @@ void mpFX::Plot( wxDC& dc, mpWindow& w ) IMPLEMENT_ABSTRACT_CLASS( mpFY, mpLayer ) -mpFY::mpFY( wxString name, int flags ) +mpFY::mpFY( const wxString& name, int flags ) { SetName( name ); m_flags = flags; @@ -598,7 +598,7 @@ void mpFY::Plot( wxDC& dc, mpWindow& w ) IMPLEMENT_ABSTRACT_CLASS( mpFXY, mpLayer ) -mpFXY::mpFXY( wxString name, int flags ) +mpFXY::mpFXY( const wxString& name, int flags ) { SetName( name ); m_flags = flags; @@ -790,7 +790,7 @@ void mpFXY::Plot( wxDC& dc, mpWindow& w ) IMPLEMENT_ABSTRACT_CLASS( mpProfile, mpLayer ) -mpProfile::mpProfile( wxString name, int flags ) +mpProfile::mpProfile( const wxString& name, int flags ) { SetName( name ); m_flags = flags; @@ -1273,7 +1273,7 @@ IMPLEMENT_ABSTRACT_CLASS( mpScaleXBase, mpLayer ) IMPLEMENT_DYNAMIC_CLASS( mpScaleX, mpScaleXBase ) IMPLEMENT_DYNAMIC_CLASS( mpScaleXLog, mpScaleXBase ) -mpScaleXBase::mpScaleXBase( wxString name, int flags, bool ticks, unsigned int type ) +mpScaleXBase::mpScaleXBase( const wxString& name, int flags, bool ticks, unsigned int type ) { SetName( name ); SetFont( (wxFont&) *wxSMALL_FONT ); @@ -1285,13 +1285,13 @@ mpScaleXBase::mpScaleXBase( wxString name, int flags, bool ticks, unsigned int t } -mpScaleX::mpScaleX( wxString name, int flags, bool ticks, unsigned int type ) : +mpScaleX::mpScaleX( const 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 ) : +mpScaleXLog::mpScaleXLog( const wxString& name, int flags, bool ticks, unsigned int type ) : mpScaleXBase( name, flags, ticks, type ) { } @@ -1501,7 +1501,7 @@ void mpScaleXBase::Plot( wxDC& dc, mpWindow& w ) IMPLEMENT_DYNAMIC_CLASS( mpScaleY, mpLayer ) -mpScaleY::mpScaleY( wxString name, int flags, bool ticks ) +mpScaleY::mpScaleY( const wxString& name, int flags, bool ticks ) { SetName( name ); SetFont( (wxFont&) *wxSMALL_FONT ); @@ -3268,7 +3268,7 @@ void mpWindow::SetColourTheme( const wxColour& bgColour, IMPLEMENT_DYNAMIC_CLASS( mpFXYVector, mpFXY ) // Constructor -mpFXYVector::mpFXYVector( wxString name, int flags ) : mpFXY( name, flags ) +mpFXYVector::mpFXYVector( const wxString& name, int flags ) : mpFXY( name, flags ) { m_index = 0; // printf("FXYVector::FXYVector!\n"); @@ -3425,7 +3425,7 @@ IMPLEMENT_DYNAMIC_CLASS( mpText, mpLayer ) * @param offsetx x position in percentage (0-100) * @param offsetx y position in percentage (0-100) */ -mpText::mpText( wxString name, int offsetx, int offsety ) +mpText::mpText( const wxString& name, int offsetx, int offsety ) { SetName( name ); diff --git a/eeschema/bom_table_column.cpp b/eeschema/bom_table_column.cpp index 113b8a40e7..2a602bd8f6 100644 --- a/eeschema/bom_table_column.cpp +++ b/eeschema/bom_table_column.cpp @@ -82,7 +82,7 @@ BOM_COLUMN* BOM_COLUMN_LIST::GetColumnById( unsigned int aColId ) /** * Return a column based on its string title */ -BOM_COLUMN* BOM_COLUMN_LIST::GetColumnByTitle( wxString aColTitle ) +BOM_COLUMN* BOM_COLUMN_LIST::GetColumnByTitle( const wxString& aColTitle ) { for( unsigned int ii=0; ii FIELD_VALUE_MAP; class BOM_FIELD_VALUES { public: - BOM_FIELD_VALUES( wxString aRefDes, FIELD_VALUE_MAP* aTemplate ); + BOM_FIELD_VALUES( const wxString& aRefDes, FIELD_VALUE_MAP* aTemplate ); /** * Return the current value for the provided field ID @@ -218,7 +218,7 @@ public: BOM_TABLE_COMPONENT( BOM_TABLE_GROUP* aParent, BOM_COLUMN_LIST* aColumnList, BOM_FIELD_VALUES* aValues ); - bool AddUnit( SCH_REFERENCE aUnit ); + bool AddUnit( const SCH_REFERENCE& aUnit ); virtual wxString GetFieldValue( unsigned int aFieldId ) const override; diff --git a/eeschema/dialogs/dialog_annotate.cpp b/eeschema/dialogs/dialog_annotate.cpp index 3c1cd7b08c..6b7cf21754 100644 --- a/eeschema/dialogs/dialog_annotate.cpp +++ b/eeschema/dialogs/dialog_annotate.cpp @@ -52,7 +52,7 @@ class wxConfigBase; class DIALOG_ANNOTATE: public DIALOG_ANNOTATE_BASE { public: - DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, wxString message ); + DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& message ); private: @@ -98,7 +98,7 @@ private: }; -DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, wxString message ) +DIALOG_ANNOTATE::DIALOG_ANNOTATE( SCH_EDIT_FRAME* parent, const wxString& message ) : DIALOG_ANNOTATE_BASE( parent ) { m_Parent = parent; @@ -311,7 +311,7 @@ int DIALOG_ANNOTATE::GetAnnotateAlgo() } -int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, wxString message ) +int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, const wxString& message ) { DIALOG_ANNOTATE dlg( aCaller, message ); diff --git a/eeschema/invoke_sch_dialog.h b/eeschema/invoke_sch_dialog.h index 1691d2e03d..08a9c7c461 100644 --- a/eeschema/invoke_sch_dialog.h +++ b/eeschema/invoke_sch_dialog.h @@ -67,7 +67,7 @@ int InvokeDialogRescueEach( SCH_EDIT_FRAME* aCaller, RESCUER& aRescuer, bool aAs /// Create and show DIALOG_ANNOTATE and return whatever /// DIALOG_ANNOTATE::ShowModal() returns. -int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, wxString message = "" ); +int InvokeDialogAnnotate( SCH_EDIT_FRAME* aCaller, const wxString& message = "" ); /// Create the modeless DIALOG_ERC and show it, return something to /// destroy or close it. The dialog will have ID_DIALOG_ERC from id.h diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index 6d7befcd24..0e78f98195 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -91,7 +91,7 @@ static void get_components( std::vector& aComponents ) * @param aLibs - the loaded PART_LIBS * @param aCached - whether we are looking for the cached part */ -static LIB_PART* find_component( wxString aName, PART_LIBS* aLibs, bool aCached ) +static LIB_PART* find_component( const wxString& aName, PART_LIBS* aLibs, bool aCached ) { LIB_PART *part = NULL; diff --git a/eeschema/sch_component.cpp b/eeschema/sch_component.cpp index 5455d4b6c6..21e154b029 100644 --- a/eeschema/sch_component.cpp +++ b/eeschema/sch_component.cpp @@ -900,7 +900,7 @@ SCH_FIELD* SCH_COMPONENT::GetField( int aFieldNdx ) const } -wxString SCH_COMPONENT::GetFieldText( wxString aFieldName, bool aIncludeDefaultFields ) const +wxString SCH_COMPONENT::GetFieldText( const wxString& aFieldName, bool aIncludeDefaultFields ) const { // Field name for comparison wxString cmpFieldName; diff --git a/eeschema/sch_component.h b/eeschema/sch_component.h index 68abcf78bc..dd98547437 100644 --- a/eeschema/sch_component.h +++ b/eeschema/sch_component.h @@ -334,7 +334,7 @@ public: * @param aIncludeDefaultFields is used to search the default library symbol fields in the * search. */ - wxString GetFieldText( wxString aFieldName, bool aIncludeDefaultFields = true ) const; + wxString GetFieldText( const wxString& aFieldName, bool aIncludeDefaultFields = true ) const; /** * Populates a std::vector with SCH_FIELDs. diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 5a2a08daf2..79a040501f 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -52,7 +52,7 @@ #include -SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_COMPONENT* aParent, wxString aName ) : +SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_COMPONENT* aParent, const wxString& aName ) : SCH_ITEM( aParent, SCH_FIELD_T ), EDA_TEXT() { diff --git a/eeschema/sch_field.h b/eeschema/sch_field.h index 7d48701035..030b1c8aea 100644 --- a/eeschema/sch_field.h +++ b/eeschema/sch_field.h @@ -61,7 +61,7 @@ class SCH_FIELD : public SCH_ITEM, public EDA_TEXT public: SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_COMPONENT* aParent, - wxString aName = wxEmptyString ); + const wxString& aName = wxEmptyString ); // Do not create a copy constructor. The one generated by the compiler is adequate. diff --git a/eeschema/sch_sheet_path.cpp b/eeschema/sch_sheet_path.cpp index 45cc8eee08..a883251633 100644 --- a/eeschema/sch_sheet_path.cpp +++ b/eeschema/sch_sheet_path.cpp @@ -436,7 +436,7 @@ SCH_SHEET_LIST::SCH_SHEET_LIST( SCH_SHEET* aSheet ) } -SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheetByPath( const wxString aPath, bool aHumanReadable ) +SCH_SHEET_PATH* SCH_SHEET_LIST::GetSheetByPath( const wxString& aPath, bool aHumanReadable ) { wxString sheetPath; diff --git a/eeschema/sch_sheet_path.h b/eeschema/sch_sheet_path.h index ca6e368a11..b417985381 100644 --- a/eeschema/sch_sheet_path.h +++ b/eeschema/sch_sheet_path.h @@ -349,7 +349,7 @@ public: * @return The sheet that matches \a aPath or NULL if no sheet matching * \a aPath is found. */ - SCH_SHEET_PATH* GetSheetByPath( const wxString aPath, bool aHumanReadable = true ); + SCH_SHEET_PATH* GetSheetByPath( const wxString& aPath, bool aHumanReadable = true ); /** * Function IsModified diff --git a/include/class_board_item.h b/include/class_board_item.h index 8cc841f3df..39d6d343d4 100644 --- a/include/class_board_item.h +++ b/include/class_board_item.h @@ -71,7 +71,7 @@ class BOARD_ITEM : public EDA_ITEM protected: PCB_LAYER_ID m_Layer; - static int getTrailingInt( wxString aStr ); + static int getTrailingInt( const wxString& aStr ); static int getNextNumberInSequence( const std::set& aSeq, bool aFillSequenceGaps ); public: diff --git a/include/confirm.h b/include/confirm.h index 5769f7ecec..0cedcc6930 100644 --- a/include/confirm.h +++ b/include/confirm.h @@ -66,7 +66,7 @@ void DisplayError( wxWindow* parent, const wxString& aMessage, int displaytime = * @param aMessage is the message text to display * @param aExtraInfo is extra data that can be optionally displayed in a collapsible pane */ -void DisplayErrorMessage( wxWindow* aParent, const wxString& aMessage, const wxString aExtraInfo = wxEmptyString ); +void DisplayErrorMessage( wxWindow* aParent, const wxString& aMessage, const wxString& aExtraInfo = wxEmptyString ); /** @@ -77,7 +77,7 @@ void DisplayErrorMessage( wxWindow* aParent, const wxString& aMessage, const wxS * @param aMessage is the message text to display * @param aExtraInfo is the extra data that can be optionally displayed in a collapsible pane */ -void DisplayInfoMessage( wxWindow* parent, const wxString& aMessage, const wxString aExtraInfo = wxEmptyString ); +void DisplayInfoMessage( wxWindow* parent, const wxString& aMessage, const wxString& aExtraInfo = wxEmptyString ); /** * Function IsOK diff --git a/include/gal/gal_display_options.h b/include/gal/gal_display_options.h index 606c410dc0..55c7e190f6 100644 --- a/include/gal/gal_display_options.h +++ b/include/gal/gal_display_options.h @@ -66,8 +66,8 @@ namespace KIGFX public: GAL_DISPLAY_OPTIONS(); - void ReadConfig ( wxConfigBase* aCfg, wxString aBaseName ); - void WriteConfig( wxConfigBase* aCfg, wxString aBaseName ); + void ReadConfig ( wxConfigBase* aCfg, const wxString& aBaseName ); + void WriteConfig( wxConfigBase* aCfg, const wxString& aBaseName ); void NotifyChanged(); diff --git a/include/gal/opengl/opengl_gal.h b/include/gal/opengl/opengl_gal.h index 30a3b70769..7ab14c3a60 100644 --- a/include/gal/opengl/opengl_gal.h +++ b/include/gal/opengl/opengl_gal.h @@ -376,7 +376,7 @@ private: * @param aPointGetter is a function to obtain coordinates of n-th vertex. * @param aPointCount is the number of points to be drawn. */ - void drawPolyline( std::function aPointGetter, int aPointCount ); + void drawPolyline( const std::function& aPointGetter, int aPointCount ); /** * @brief Draws a filled polygon. It does not need the last point to have the same coordinates diff --git a/include/geometry/shape_file_io.h b/include/geometry/shape_file_io.h index ce7bfa7906..19a68a1123 100644 --- a/include/geometry/shape_file_io.h +++ b/include/geometry/shape_file_io.h @@ -49,12 +49,12 @@ class SHAPE_FILE_IO SHAPE_FILE_IO( const std::string& aFilename, IO_MODE aMode = IOM_READ ); ~SHAPE_FILE_IO(); - void BeginGroup( const std::string aName = ""); + void BeginGroup( const std::string& aName = ""); void EndGroup(); SHAPE* Read(); - void Write( const SHAPE* aShape, const std::string aName = "" ); + void Write( const SHAPE* aShape, const std::string& aName = "" ); void Write( const SHAPE& aShape, const std::string aName = "" ) { diff --git a/include/geometry/shape_poly_set.h b/include/geometry/shape_poly_set.h index 70d2a14703..9df221030c 100644 --- a/include/geometry/shape_poly_set.h +++ b/include/geometry/shape_poly_set.h @@ -1058,7 +1058,7 @@ class SHAPE_POLY_SET : public SHAPE * @return int - The minimum distance between aSegment and all the polygons in the set. * If the point is contained in the polygon, the distance is zero. */ - int Distance( SEG aSegment, int aSegmentWidth = 0 ); + int Distance( const SEG& aSegment, int aSegmentWidth = 0 ); /** * Function IsVertexInHole. diff --git a/include/search_stack.h b/include/search_stack.h index 2c6af7808a..4133cc78b7 100644 --- a/include/search_stack.h +++ b/include/search_stack.h @@ -105,7 +105,7 @@ public: * @param aPathString is concatonated string with interposing ';' or ':' separators. * @return int - the count of paths found in aPathString */ - static int Split( wxArrayString* aResult, const wxString aPathString ); + static int Split( wxArrayString* aResult, const wxString& aPathString ); #if 1 // this function is so poorly designed it deserves not to exist. /** diff --git a/include/tool/tool_action.h b/include/tool/tool_action.h index c0d7e4a15f..81d9ba2c17 100644 --- a/include/tool/tool_action.h +++ b/include/tool/tool_action.h @@ -47,7 +47,7 @@ class TOOL_ACTION { public: TOOL_ACTION( const std::string& aName, TOOL_ACTION_SCOPE aScope = AS_CONTEXT, - int aDefaultHotKey = 0, const wxString aMenuItem = wxEmptyString, + int aDefaultHotKey = 0, const wxString& aMenuItem = wxEmptyString, const wxString& aMenuDesc = wxEmptyString, const BITMAP_OPAQUE* aIcon = NULL, TOOL_ACTION_FLAGS aFlags = AF_NONE, void* aParam = NULL ); diff --git a/include/widgets/mathplot.h b/include/widgets/mathplot.h index e0f5bbfba4..256522326e 100644 --- a/include/widgets/mathplot.h +++ b/include/widgets/mathplot.h @@ -525,7 +525,7 @@ public: /** @param name Label * @param flags Label alignment, pass one of #mpALIGN_RIGHT, #mpALIGN_CENTER, #mpALIGN_LEFT. */ - mpFX( wxString name = wxEmptyString, int flags = mpALIGN_RIGHT ); + mpFX( const wxString& name = wxEmptyString, int flags = mpALIGN_RIGHT ); /** Get function value for argument. * Override this function in your implementation. @@ -557,7 +557,7 @@ public: /** @param name Label * @param flags Label alignment, pass one of #mpALIGN_BOTTOM, #mpALIGN_CENTER, #mpALIGN_TOP. */ - mpFY( wxString name = wxEmptyString, int flags = mpALIGN_TOP ); + mpFY( const wxString& name = wxEmptyString, int flags = mpALIGN_TOP ); /** Get function value for argument. * Override this function in your implementation. @@ -591,7 +591,7 @@ public: /** @param name Label * @param flags Label alignment, pass one of #mpALIGN_NE, #mpALIGN_NW, #mpALIGN_SW, #mpALIGN_SE. */ - mpFXY( wxString name = wxEmptyString, int flags = mpALIGN_NE ); + mpFXY( const wxString& name = wxEmptyString, int flags = mpALIGN_NE ); /** Rewind value enumeration with mpFXY::GetNextXY. * Override this function in your implementation. @@ -650,7 +650,7 @@ public: /** @param name Label * @param flags Label alignment, pass one of #mpALIGN_BOTTOM, #mpALIGN_CENTER, #mpALIGN_TOP. */ - mpProfile( wxString name = wxEmptyString, int flags = mpALIGN_TOP ); + mpProfile( const wxString& name = wxEmptyString, int flags = mpALIGN_TOP ); /** Get function value for argument. * Override this function in your implementation. @@ -845,7 +845,7 @@ public: * @param ticks Select ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid. * @param type mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds. */ - mpScaleXBase( wxString name = wxT("X"), int flags = mpALIGN_CENTER, + mpScaleXBase( const wxString& name = wxT("X"), int flags = mpALIGN_CENTER, bool ticks = true, unsigned int type = mpX_NORMAL ); virtual ~mpScaleXBase() {}; @@ -871,7 +871,7 @@ public: * @param flags Set the position of the scale with respect to the window. * @param ticks Select ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid. * @param type mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds. */ - mpScaleX( wxString name = wxT("X"), int flags = mpALIGN_CENTER, + mpScaleX( const wxString& name = wxT("X"), int flags = mpALIGN_CENTER, bool ticks = true, unsigned int type = mpX_NORMAL ); /** Layer plot handler. @@ -900,7 +900,7 @@ public: * @param ticks Select ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid. * @param type mpX_NORMAL for normal labels, mpX_TIME for time axis in hours, minutes, seconds. */ - mpScaleXLog( wxString name = wxT("log(X)"), int flags = mpALIGN_CENTER, + mpScaleXLog( const wxString& name = wxT("log(X)"), int flags = mpALIGN_CENTER, bool ticks = true, unsigned int type = mpX_NORMAL ); virtual double TransformToPlot( double x ) override; @@ -942,7 +942,7 @@ public: * @param flags Set position of the scale respect to the window. * @param ticks Select ticks or grid. Give TRUE (default) for drawing axis ticks, FALSE for drawing the grid */ - mpScaleY( wxString name = wxT("Y"), int flags = mpALIGN_CENTER, bool ticks = true ); + mpScaleY( const wxString& name = wxT("Y"), int flags = mpALIGN_CENTER, bool ticks = true ); virtual bool IsHorizontal() override { return false; } @@ -1544,7 +1544,7 @@ public: /** @param name Label * @param flags Label alignment, pass one of #mpALIGN_NE, #mpALIGN_NW, #mpALIGN_SW, #mpALIGN_SE. */ - mpFXYVector( wxString name = wxEmptyString, int flags = mpALIGN_NE ); + mpFXYVector( const wxString& name = wxEmptyString, int flags = mpALIGN_NE ); virtual ~mpFXYVector() {} @@ -1644,7 +1644,7 @@ public: /** @param name text to be drawn in the plot * @param offsetx holds offset for the X location in percentage (0-100) * @param offsety holds offset for the Y location in percentage (0-100) */ - mpText( wxString name = wxT("Title"), int offsetx = 5, int offsety = 50 ); + mpText( const wxString& name = wxT("Title"), int offsetx = 5, int offsety = 50 ); /** Text Layer plot handler. * This implementation will plot text adjusted to the visible area. */ diff --git a/kicad/commandframe.cpp b/kicad/commandframe.cpp index 89cb8934a9..364c8f088b 100644 --- a/kicad/commandframe.cpp +++ b/kicad/commandframe.cpp @@ -109,7 +109,7 @@ void LAUNCHER_PANEL::CreateCommandToolbar() * @param aBitmap is the image to be used * @param aToolTip is the button mouse-over tool tip */ -void LAUNCHER_PANEL::AddButton( wxWindowID aId, const wxBitmap& aBitmap, wxString aToolTip ) +void LAUNCHER_PANEL::AddButton( wxWindowID aId, const wxBitmap& aBitmap, const wxString& aToolTip ) { wxSize buttSize( aBitmap.GetWidth() + 2 * BUTTON_EXPANSION, aBitmap.GetHeight() + 2 * BUTTON_EXPANSION ); diff --git a/kicad/kicad.h b/kicad/kicad.h index cdaa66b5f4..9a304ed118 100644 --- a/kicad/kicad.h +++ b/kicad/kicad.h @@ -339,7 +339,7 @@ private: */ void CreateCommandToolbar( void ); - void AddButton( wxWindowID aId, const wxBitmap& aBitmap, wxString aToolTip ); + void AddButton( wxWindowID aId, const wxBitmap& aBitmap, const wxString& aToolTip ); }; // The C++ project manager includes a single PROJECT in its link image. diff --git a/lib_dxf/drw_objects.cpp b/lib_dxf/drw_objects.cpp index 128ab8d2d7..6b63eeab3b 100644 --- a/lib_dxf/drw_objects.cpp +++ b/lib_dxf/drw_objects.cpp @@ -11,6 +11,7 @@ ******************************************************************************/ #include +#include #include #include "drw_objects.h" #include "intern/dxfreader.h" @@ -731,7 +732,7 @@ void DRW_ImageDef::parseCode( int code, dxfReader* reader ) } -void DRW_Header::addComment( std::string c ) +void DRW_Header::addComment( const std::string& c ) { if( !comments.empty() ) comments += '\n'; @@ -1303,7 +1304,7 @@ void DRW_Header::write( dxfWriter* writer, DRW::Version ver ) } -void DRW_Header::addDouble( std::string key, double value, int code ) +void DRW_Header::addDouble( const std::string& key, double value, int code ) { curr = new DRW_Variant(); curr->addDouble( value ); @@ -1312,7 +1313,7 @@ void DRW_Header::addDouble( std::string key, double value, int code ) } -void DRW_Header::addInt( std::string key, int value, int code ) +void DRW_Header::addInt( const std::string& key, int value, int code ) { curr = new DRW_Variant(); curr->addInt( value ); @@ -1321,16 +1322,16 @@ void DRW_Header::addInt( std::string key, int value, int code ) } -void DRW_Header::addStr( std::string key, std::string value, int code ) +void DRW_Header::addStr( const std::string& key, std::string value, int code ) { curr = new DRW_Variant(); - curr->addString( value ); + curr->addString( std::move(value) ); curr->code = code; vars[key] = curr; } -void DRW_Header::addCoord( std::string key, DRW_Coord value, int code ) +void DRW_Header::addCoord( const std::string& key, DRW_Coord value, int code ) { curr = new DRW_Variant(); curr->addCoord( value ); @@ -1339,7 +1340,7 @@ void DRW_Header::addCoord( std::string key, DRW_Coord value, int code ) } -bool DRW_Header::getDouble( std::string key, double* varDouble ) +bool DRW_Header::getDouble( const std::string& key, double* varDouble ) { bool result = false; std::map::iterator it; @@ -1363,7 +1364,7 @@ bool DRW_Header::getDouble( std::string key, double* varDouble ) } -bool DRW_Header::getInt( std::string key, int* varInt ) +bool DRW_Header::getInt( const std::string& key, int* varInt ) { bool result = false; std::map::iterator it; @@ -1387,7 +1388,7 @@ bool DRW_Header::getInt( std::string key, int* varInt ) } -bool DRW_Header::getStr( std::string key, std::string* varStr ) +bool DRW_Header::getStr( const std::string& key, std::string* varStr ) { bool result = false; std::map::iterator it; @@ -1411,7 +1412,7 @@ bool DRW_Header::getStr( std::string key, std::string* varStr ) } -bool DRW_Header::getCoord( std::string key, DRW_Coord* varCoord ) +bool DRW_Header::getCoord( const std::string& key, DRW_Coord* varCoord ) { bool result = false; std::map::iterator it; diff --git a/lib_dxf/drw_objects.h b/lib_dxf/drw_objects.h index 46c9a3ca1d..5de2d61814 100644 --- a/lib_dxf/drw_objects.h +++ b/lib_dxf/drw_objects.h @@ -426,22 +426,22 @@ public: vars.clear(); } - void addDouble( std::string key, double value, int code ); - void addInt( std::string key, int value, int code ); - void addStr( std::string key, std::string value, int code ); - void addCoord( std::string key, DRW_Coord value, int code ); + void addDouble( const std::string& key, double value, int code ); + void addInt( const std::string& key, int value, int code ); + void addStr( const std::string& key, std::string value, int code ); + void addCoord( const std::string& key, DRW_Coord value, int code ); std::string getComments() const { return comments; } void parseCode( int code, dxfReader* reader ); void write( dxfWriter* writer, DRW::Version ver ); - void addComment( std::string c ); + void addComment( const std::string& c ); private: - bool getDouble( std::string key, double* varDouble ); - bool getInt( std::string key, int* varInt ); - bool getStr( std::string key, std::string* varStr ); - bool getCoord( std::string key, DRW_Coord* varStr ); + bool getDouble( const std::string& key, double* varDouble ); + bool getInt( const std::string& key, int* varInt ); + bool getStr( const std::string& key, std::string* varStr ); + bool getCoord( const std::string& key, DRW_Coord* varStr ); public: std::map vars; diff --git a/lib_dxf/intern/drw_textcodec.cpp b/lib_dxf/intern/drw_textcodec.cpp index b640bc95a8..fc587c3a1d 100644 --- a/lib_dxf/intern/drw_textcodec.cpp +++ b/lib_dxf/intern/drw_textcodec.cpp @@ -235,7 +235,7 @@ std::string DRW_ConvTable::toUtf8( std::string* s ) } -std::string DRW_Converter::encodeText( std::string stmp ) +std::string DRW_Converter::encodeText( const std::string& stmp ) { int code; diff --git a/lib_dxf/intern/drw_textcodec.h b/lib_dxf/intern/drw_textcodec.h index d6a8977f66..530f72aae4 100644 --- a/lib_dxf/intern/drw_textcodec.h +++ b/lib_dxf/intern/drw_textcodec.h @@ -43,7 +43,7 @@ public: virtual ~DRW_Converter() {} virtual std::string fromUtf8( std::string* s ) { return *s; } virtual std::string toUtf8( std::string* s ); - std::string encodeText( std::string stmp ); + std::string encodeText( const std::string& stmp ); std::string decodeText( int c ); std::string encodeNum( int c ); int decodeNum( std::string s, int* b ); diff --git a/lib_dxf/intern/dxfwriter.cpp b/lib_dxf/intern/dxfwriter.cpp index fcd9fe7ced..112f8243e4 100644 --- a/lib_dxf/intern/dxfwriter.cpp +++ b/lib_dxf/intern/dxfwriter.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include "dxfwriter.h" #ifdef DRW_DBG @@ -100,7 +101,7 @@ bool dxfWriter::writeUtf8String( int code, std::string text ) { - std::string t = encoder.fromUtf8( text ); + std::string t = encoder.fromUtf8( std::move(text) ); return writeString( code, t ); } @@ -108,7 +109,7 @@ bool dxfWriter::writeUtf8String( int code, std::string text ) bool dxfWriter::writeUtf8Caps( int code, std::string text ) { - std::string strname = text; + std::string strname = std::move(text); std::transform( strname.begin(), strname.end(), strname.begin(), ::toupper ); std::string t = encoder.fromUtf8( strname ); diff --git a/lib_dxf/libdxfrw.cpp b/lib_dxf/libdxfrw.cpp index adc8b61a1b..3a0da7d27b 100644 --- a/lib_dxf/libdxfrw.cpp +++ b/lib_dxf/libdxfrw.cpp @@ -1685,7 +1685,7 @@ bool dxfRW::writeViewport( DRW_Viewport* ent ) } -DRW_ImageDef* dxfRW::writeImage( DRW_Image* ent, std::string name ) +DRW_ImageDef* dxfRW::writeImage( DRW_Image* ent, const std::string& name ) { if( version > DRW::AC1009 ) { @@ -1741,7 +1741,7 @@ DRW_ImageDef* dxfRW::writeImage( DRW_Image* ent, std::string name ) } -bool dxfRW::writeBlockRecord( std::string name ) +bool dxfRW::writeBlockRecord( const std::string& name ) { if( version > DRW::AC1009 ) { diff --git a/lib_dxf/libdxfrw.h b/lib_dxf/libdxfrw.h index c37dcb2f3e..e9e5d47c45 100644 --- a/lib_dxf/libdxfrw.h +++ b/lib_dxf/libdxfrw.h @@ -59,14 +59,14 @@ public: bool writeLWPolyline( DRW_LWPolyline* ent ); bool writePolyline( DRW_Polyline* ent ); bool writeSpline( DRW_Spline* ent ); - bool writeBlockRecord( std::string name ); + bool writeBlockRecord( const std::string& name ); bool writeBlock( DRW_Block* ent ); bool writeInsert( DRW_Insert* ent ); bool writeMText( DRW_MText* ent ); bool writeText( DRW_Text* ent ); bool writeHatch( DRW_Hatch* ent ); bool writeViewport( DRW_Viewport* ent ); - DRW_ImageDef* writeImage( DRW_Image* ent, std::string name ); + DRW_ImageDef* writeImage( DRW_Image* ent, const std::string& name ); bool writeLeader( DRW_Leader* ent ); bool writeDimension( DRW_Dimension* ent ); diff --git a/pcb_calculator/datafile_read_write.cpp b/pcb_calculator/datafile_read_write.cpp index 349dd411d8..f8f367ed33 100644 --- a/pcb_calculator/datafile_read_write.cpp +++ b/pcb_calculator/datafile_read_write.cpp @@ -177,7 +177,7 @@ PCB_CALCULATOR_DATAFILE_PARSER::PCB_CALCULATOR_DATAFILE_PARSER( LINE_READER* aRe } -PCB_CALCULATOR_DATAFILE_PARSER::PCB_CALCULATOR_DATAFILE_PARSER( char* aLine, wxString aSource ) : +PCB_CALCULATOR_DATAFILE_PARSER::PCB_CALCULATOR_DATAFILE_PARSER( char* aLine, const wxString& aSource ) : PCB_CALCULATOR_DATAFILE_LEXER( aLine, aSource ) { } diff --git a/pcb_calculator/datafile_read_write.h b/pcb_calculator/datafile_read_write.h index ecf303d635..1b05e52472 100644 --- a/pcb_calculator/datafile_read_write.h +++ b/pcb_calculator/datafile_read_write.h @@ -56,7 +56,7 @@ class PCB_CALCULATOR_DATAFILE_PARSER : public PCB_CALCULATOR_DATAFILE_LEXER { public: PCB_CALCULATOR_DATAFILE_PARSER( LINE_READER* aReader ); - PCB_CALCULATOR_DATAFILE_PARSER( char* aLine, wxString aSource ); + PCB_CALCULATOR_DATAFILE_PARSER( char* aLine, const wxString& aSource ); LINE_READER* GetReader() { return reader; }; void Parse( PCB_CALCULATOR_DATAFILE* aDataList ); void ParseRegulatorDescr( PCB_CALCULATOR_DATAFILE* aDataList ); diff --git a/pcbnew/class_action_plugin.cpp b/pcbnew/class_action_plugin.cpp index 171e0f2a6b..50a05885fc 100644 --- a/pcbnew/class_action_plugin.cpp +++ b/pcbnew/class_action_plugin.cpp @@ -76,7 +76,7 @@ int ACTION_PLUGINS::GetActionMenu( int aIndex ) } -ACTION_PLUGIN* ACTION_PLUGINS::GetAction( wxString aName ) +ACTION_PLUGIN* ACTION_PLUGINS::GetAction( const wxString& aName ) { int max = GetActionsCount(); diff --git a/pcbnew/class_action_plugin.h b/pcbnew/class_action_plugin.h index 8853107528..2d3eeffd2f 100644 --- a/pcbnew/class_action_plugin.h +++ b/pcbnew/class_action_plugin.h @@ -127,7 +127,7 @@ public: * @param aName is the action plugin name * @return a action object by it's name or NULL if it isn't available. */ - static ACTION_PLUGIN* GetAction( wxString aName ); + static ACTION_PLUGIN* GetAction( const wxString& aName ); /** * Function SetActionMenu diff --git a/pcbnew/class_board_item.cpp b/pcbnew/class_board_item.cpp index bcaeb371d1..0e42dd4912 100644 --- a/pcbnew/class_board_item.cpp +++ b/pcbnew/class_board_item.cpp @@ -198,7 +198,7 @@ void BOARD_ITEM::ViewGetLayers( int aLayers[], int& aCount ) const } -int BOARD_ITEM::getTrailingInt( wxString aStr ) +int BOARD_ITEM::getTrailingInt( const wxString& aStr ) { int number = 0; int base = 1; diff --git a/pcbnew/class_footprint_wizard.cpp b/pcbnew/class_footprint_wizard.cpp index 473007e4d5..6787bc25e5 100644 --- a/pcbnew/class_footprint_wizard.cpp +++ b/pcbnew/class_footprint_wizard.cpp @@ -50,7 +50,7 @@ FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( int aIndex ) } -FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( wxString aName ) +FOOTPRINT_WIZARD* FOOTPRINT_WIZARDS::GetWizard( const wxString& aName ) { int max = GetWizardsCount(); diff --git a/pcbnew/class_footprint_wizard.h b/pcbnew/class_footprint_wizard.h index 69c286ae1c..ef82f92282 100644 --- a/pcbnew/class_footprint_wizard.h +++ b/pcbnew/class_footprint_wizard.h @@ -204,7 +204,7 @@ public: * @param aName is the footprint wizard name * @return a wizard object by it's name or NULL if it isn't available. */ - static FOOTPRINT_WIZARD* GetWizard( wxString aName ); + static FOOTPRINT_WIZARD* GetWizard( const wxString& aName ); /** * Function GetWizard diff --git a/pcbnew/class_module.cpp b/pcbnew/class_module.cpp index 791ee007be..c1faeeaf13 100644 --- a/pcbnew/class_module.cpp +++ b/pcbnew/class_module.cpp @@ -850,7 +850,7 @@ EDA_ITEM* MODULE::Clone() const } -void MODULE::RunOnChildren( std::function aFunction ) +void MODULE::RunOnChildren( const std::function& aFunction ) { try { diff --git a/pcbnew/class_module.h b/pcbnew/class_module.h index f987ff575b..3eca1a0152 100644 --- a/pcbnew/class_module.h +++ b/pcbnew/class_module.h @@ -589,7 +589,7 @@ public: * Invokes a function on all BOARD_ITEMs that belong to the module (pads, drawings, texts). * @param aFunction is the function to be invoked. */ - void RunOnChildren( std::function aFunction ); + void RunOnChildren( const std::function& aFunction ); virtual void ViewGetLayers( int aLayers[], int& aCount ) const override; diff --git a/pcbnew/class_netclass.cpp b/pcbnew/class_netclass.cpp index bd5b6f6ceb..c94987cea5 100644 --- a/pcbnew/class_netclass.cpp +++ b/pcbnew/class_netclass.cpp @@ -99,7 +99,7 @@ NETCLASSES::~NETCLASSES() } -bool NETCLASSES::Add( NETCLASSPTR aNetClass ) +bool NETCLASSES::Add( const NETCLASSPTR& aNetClass ) { const wxString& name = aNetClass->GetName(); diff --git a/pcbnew/class_netclass.h b/pcbnew/class_netclass.h index f6ebaddf5e..67abe19140 100644 --- a/pcbnew/class_netclass.h +++ b/pcbnew/class_netclass.h @@ -284,7 +284,7 @@ public: * @return true if the name within aNetclass is unique and it could be inserted OK, * else false because the name was not unique. */ - bool Add( NETCLASSPTR aNetclass ); + bool Add( const NETCLASSPTR& aNetclass ); /** * Function Remove diff --git a/pcbnew/class_netinfo.h b/pcbnew/class_netinfo.h index e878744012..cf69dba94b 100644 --- a/pcbnew/class_netinfo.h +++ b/pcbnew/class_netinfo.h @@ -117,7 +117,7 @@ public: * Function SetClass * sets \a aNetclass into this NET */ - void SetClass( NETCLASSPTR aNetClass ); + void SetClass( const NETCLASSPTR& aNetClass ); NETCLASSPTR GetNetClass() { diff --git a/pcbnew/class_netinfo_item.cpp b/pcbnew/class_netinfo_item.cpp index 93ee60c298..5c9ec0a5fd 100644 --- a/pcbnew/class_netinfo_item.cpp +++ b/pcbnew/class_netinfo_item.cpp @@ -78,7 +78,7 @@ void NETINFO_ITEM::Draw( EDA_DRAW_PANEL* panel, } -void NETINFO_ITEM::SetClass( NETCLASSPTR aNetClass ) +void NETINFO_ITEM::SetClass( const NETCLASSPTR& aNetClass ) { wxCHECK( m_parent, /* void */ ); m_NetClass = aNetClass ? aNetClass : m_parent->GetDesignSettings().m_NetClasses.GetDefault(); diff --git a/pcbnew/clean.cpp b/pcbnew/clean.cpp index ea5393aa0d..bcfd5b7d94 100644 --- a/pcbnew/clean.cpp +++ b/pcbnew/clean.cpp @@ -617,7 +617,7 @@ static bool parallelismTest( int dx1, int dy1, int dx2, int dy2 ) * else return NULL */ -static void updateConn( TRACK *track, std::shared_ptr connectivity ) +static void updateConn( TRACK *track, const std::shared_ptr& connectivity ) { for( auto pad : connectivity->GetConnectedPads( track ) ) { diff --git a/pcbnew/connectivity_algo.cpp b/pcbnew/connectivity_algo.cpp index 0229f667ab..88913b2bd2 100644 --- a/pcbnew/connectivity_algo.cpp +++ b/pcbnew/connectivity_algo.cpp @@ -34,7 +34,7 @@ using namespace std::placeholders; -bool operator<( const CN_ANCHOR_PTR a, const CN_ANCHOR_PTR b ) +bool operator<( const CN_ANCHOR_PTR& a, const CN_ANCHOR_PTR& b ) { if( a->Pos().x == b->Pos().x ) return a->Pos().y < b->Pos().y; @@ -1033,35 +1033,35 @@ void CN_CONNECTIVITY_ALGO::Clear() } -void CN_CONNECTIVITY_ALGO::ForEachItem( std::function aFunc ) +void CN_CONNECTIVITY_ALGO::ForEachItem( const std::function& aFunc ) { for( auto item : m_padList ) - aFunc( item ); + aFunc( *item ); for( auto item : m_viaList ) - aFunc( item ); + aFunc( *item ); for( auto item : m_trackList ) - aFunc( item ); + aFunc( *item ); for( auto item : m_zoneList ) - aFunc( item ); + aFunc( *item ); } -void CN_CONNECTIVITY_ALGO::ForEachAnchor( std::function aFunc ) +void CN_CONNECTIVITY_ALGO::ForEachAnchor( const std::function& aFunc ) { for( auto anchor : m_padList.Anchors() ) - aFunc( anchor ); + aFunc( *anchor ); for( auto anchor : m_viaList.Anchors() ) - aFunc( anchor ); + aFunc( *anchor ); for( auto anchor : m_trackList.Anchors() ) - aFunc( anchor ); + aFunc( *anchor ); for( auto anchor : m_zoneList.Anchors() ) - aFunc( anchor ); + aFunc( *anchor ); } diff --git a/pcbnew/connectivity_algo.h b/pcbnew/connectivity_algo.h index c1bcd04f51..514e22bf04 100644 --- a/pcbnew/connectivity_algo.h +++ b/pcbnew/connectivity_algo.h @@ -896,14 +896,14 @@ public: CN_PAD_LIST& PadList() { return m_padList; } - void ForEachAnchor( std::function aFunc ); - void ForEachItem( std::function aFunc ); + void ForEachAnchor( const std::function& aFunc ); + void ForEachItem( const std::function& aFunc ); void MarkNetAsDirty( int aNet ); void SetProgressReporter( PROGRESS_REPORTER* aReporter ); }; -bool operator<( const CN_ANCHOR_PTR a, const CN_ANCHOR_PTR b ); +bool operator<( const CN_ANCHOR_PTR& a, const CN_ANCHOR_PTR& b ); #endif diff --git a/pcbnew/connectivity_data.cpp b/pcbnew/connectivity_data.cpp index 3ce92e2764..b5a4f7aa6d 100644 --- a/pcbnew/connectivity_data.cpp +++ b/pcbnew/connectivity_data.cpp @@ -122,7 +122,7 @@ void CONNECTIVITY_DATA::updateRatsnest() } -void CONNECTIVITY_DATA::addRatsnestCluster( std::shared_ptr aCluster ) +void CONNECTIVITY_DATA::addRatsnestCluster( const std::shared_ptr& aCluster ) { auto rnNet = m_nets[ aCluster->OriginNet() ]; @@ -281,7 +281,7 @@ void CONNECTIVITY_DATA::ComputeDynamicRatsnest( const std::vector& void CONNECTIVITY_DATA::ClearDynamicRatsnest() { - m_connAlgo->ForEachAnchor( [] (CN_ANCHOR_PTR anchor ) { anchor->SetNoLine( false ); } ); + m_connAlgo->ForEachAnchor( [] ( CN_ANCHOR& anchor ) { anchor.SetNoLine( false ); } ); HideDynamicRatsnest(); } @@ -359,11 +359,11 @@ const std::vector CONNECTIVITY_DATA::GetNetItems( int aNe std::set items; std::vector rv; - m_connAlgo->ForEachItem( [&items, aNetCode, &aTypes] ( CN_ITEM* aItem ) + m_connAlgo->ForEachItem( [&items, aNetCode, &aTypes] ( CN_ITEM& aItem ) { - if( aItem->Valid() && aItem->Net() == aNetCode ) + if( aItem.Valid() && ( aItem.Net() == aNetCode ) ) { - KICAD_T itemType = aItem->Parent()->Type(); + KICAD_T itemType = aItem.Parent()->Type(); for( int i = 0; aTypes[i] > 0; ++i ) { @@ -371,7 +371,7 @@ const std::vector CONNECTIVITY_DATA::GetNetItems( int aNe if( itemType == aTypes[i] ) { - items.insert( aItem->Parent() ); + items.insert( aItem.Parent() ); break; } } diff --git a/pcbnew/connectivity_data.h b/pcbnew/connectivity_data.h index af0acc1f05..fb614f07a3 100644 --- a/pcbnew/connectivity_data.h +++ b/pcbnew/connectivity_data.h @@ -230,7 +230,7 @@ public: private: void updateRatsnest(); - void addRatsnestCluster( std::shared_ptr aCluster ); + void addRatsnestCluster( const std::shared_ptr& aCluster ); std::unique_ptr m_dynamicConnectivity; std::shared_ptr m_connAlgo; diff --git a/pcbnew/dialogs/dialog_create_array.cpp b/pcbnew/dialogs/dialog_create_array.cpp index 934c9578dc..2e8de48342 100644 --- a/pcbnew/dialogs/dialog_create_array.cpp +++ b/pcbnew/dialogs/dialog_create_array.cpp @@ -265,7 +265,7 @@ static bool validateNumberingTypeAndOffset( const wxTextCtrl& offsetEntry, */ static bool validateLongEntry( const wxTextEntry& entry, long& dest, - const wxString description, + const wxString& description, wxArrayString& errors ) { bool ok = true; diff --git a/pcbnew/dialogs/dialog_design_rules.cpp b/pcbnew/dialogs/dialog_design_rules.cpp index 49bad04eb0..61d0eade6f 100644 --- a/pcbnew/dialogs/dialog_design_rules.cpp +++ b/pcbnew/dialogs/dialog_design_rules.cpp @@ -473,7 +473,7 @@ void DIALOG_DESIGN_RULES::InitializeRulesSelectionBoxes() /* Initialize the rules list from board */ -static void class2gridRow( wxGrid* grid, int row, NETCLASSPTR nc ) +static void class2gridRow( wxGrid* grid, int row, const NETCLASSPTR& nc ) { wxString msg; @@ -532,7 +532,7 @@ void DIALOG_DESIGN_RULES::InitRulesList() } -static void gridRow2class( wxGrid* grid, int row, NETCLASSPTR nc ) +static void gridRow2class( wxGrid* grid, int row, const NETCLASSPTR& nc ) { #define MYCELL( col ) \ ValueFromString( g_UserUnit, grid->GetCellValue( row, col ) ) diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index 2e46154522..5f52e2f921 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -501,7 +501,7 @@ void DRC::updatePointers() } -bool DRC::doNetClass( NETCLASSPTR nc, wxString& msg ) +bool DRC::doNetClass( const NETCLASSPTR& nc, wxString& msg ) { bool ret = true; diff --git a/pcbnew/drc_stuff.h b/pcbnew/drc_stuff.h index 9d33d36293..85166e1030 100644 --- a/pcbnew/drc_stuff.h +++ b/pcbnew/drc_stuff.h @@ -305,7 +305,7 @@ private: //---------------------------------------------- - bool doNetClass( std::shared_ptr aNetClass, wxString& msg ); + bool doNetClass( const std::shared_ptr& aNetClass, wxString& msg ); /** * Function doPadToPadsDrc diff --git a/pcbnew/footprint_info_impl.cpp b/pcbnew/footprint_info_impl.cpp index 23743ff997..56bf260cbb 100644 --- a/pcbnew/footprint_info_impl.cpp +++ b/pcbnew/footprint_info_impl.cpp @@ -66,7 +66,7 @@ void FOOTPRINT_INFO_IMPL::load() } -bool FOOTPRINT_LIST_IMPL::CatchErrors( std::function aFunc ) +bool FOOTPRINT_LIST_IMPL::CatchErrors( const std::function& aFunc ) { try { diff --git a/pcbnew/footprint_info_impl.h b/pcbnew/footprint_info_impl.h index 82ddd7d311..fd539655e9 100644 --- a/pcbnew/footprint_info_impl.h +++ b/pcbnew/footprint_info_impl.h @@ -68,7 +68,7 @@ class FOOTPRINT_LIST_IMPL : public FOOTPRINT_LIST * * @return true if no error occurred. */ - bool CatchErrors( std::function aFunc ); + bool CatchErrors( const std::function& aFunc ); protected: virtual void StartWorkers( FP_LIB_TABLE* aTable, wxString const* aNickname, diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index 3165eb6d0f..382b7a4e98 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -103,7 +104,7 @@ class FP_THREAD_IFACE void SetCurrentFootprint( LIB_ID aFp ) { MUTLOCK lock( m_lock ); - m_current_fp = aFp; + m_current_fp = std::move( aFp ); } /** diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp index a4c1db2517..e2aef01dfd 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.cpp @@ -109,7 +109,7 @@ XNODE* FindPinMap( XNODE* aNode ) } -double StrToDoublePrecisionUnits( wxString aStr, char aAxe, wxString aActualConversion ) +double StrToDoublePrecisionUnits( const wxString& aStr, char aAxe, const wxString& aActualConversion ) { wxString ls; double i; @@ -168,13 +168,13 @@ double StrToDoublePrecisionUnits( wxString aStr, char aAxe, wxString aActualConv } -int StrToIntUnits( wxString aStr, char aAxe, wxString aActualConversion ) +int StrToIntUnits( const wxString& aStr, char aAxe, const wxString& aActualConversion ) { return KiROUND( StrToDoublePrecisionUnits( aStr, aAxe, aActualConversion ) ); } -wxString GetAndCutWordWithMeasureUnits( wxString* aStr, wxString aDefaultMeasurementUnit ) +wxString GetAndCutWordWithMeasureUnits( wxString* aStr, const wxString& aDefaultMeasurementUnit ) { wxString result; @@ -213,7 +213,7 @@ wxString GetAndCutWordWithMeasureUnits( wxString* aStr, wxString aDefaultMeasure } -int StrToInt1Units( wxString aStr ) +int StrToInt1Units( const wxString& aStr ) { double num, precision = 10; @@ -244,10 +244,10 @@ wxString ValidateReference( wxString aRef ) } -void SetWidth( wxString aStr, - wxString aDefaultMeasurementUnit, - int* aWidth, - wxString aActualConversion ) +void SetWidth( wxString aStr, + const wxString& aDefaultMeasurementUnit, + int* aWidth, + const wxString& aActualConversion ) { *aWidth = StrToIntUnits( GetAndCutWordWithMeasureUnits( &aStr, aDefaultMeasurementUnit ), wxT( ' ' ), @@ -255,10 +255,10 @@ void SetWidth( wxString aStr, } -void SetHeight( wxString aStr, - wxString aDefaultMeasurementUnit, - int* aHeight, - wxString aActualConversion ) +void SetHeight( wxString aStr, + const wxString& aDefaultMeasurementUnit, + int* aHeight, + const wxString& aActualConversion ) { *aHeight = StrToIntUnits( GetAndCutWordWithMeasureUnits( &aStr, aDefaultMeasurementUnit ), wxT( ' ' ), @@ -266,11 +266,11 @@ void SetHeight( wxString aStr, } -void SetPosition( wxString aStr, - wxString aDefaultMeasurementUnit, - int* aX, - int* aY, - wxString aActualConversion ) +void SetPosition( wxString aStr, + const wxString& aDefaultMeasurementUnit, + int* aX, + int* aY, + const wxString& aActualConversion ) { *aX = StrToIntUnits( GetAndCutWordWithMeasureUnits( &aStr, aDefaultMeasurementUnit ), wxT( 'X' ), @@ -281,11 +281,11 @@ void SetPosition( wxString aStr, } -void SetDoublePrecisionPosition( wxString aStr, - wxString aDefaultMeasurementUnit, - double* aX, - double* aY, - wxString aActualConversion ) +void SetDoublePrecisionPosition( wxString aStr, + const wxString& aDefaultMeasurementUnit, + double* aX, + double* aY, + const wxString& aActualConversion ) { *aX = StrToDoublePrecisionUnits( GetAndCutWordWithMeasureUnits( &aStr, aDefaultMeasurementUnit ), wxT( 'X' ), @@ -296,7 +296,7 @@ void SetDoublePrecisionPosition( wxString aStr, } -TTEXT_JUSTIFY GetJustifyIdentificator( wxString aJustify ) +TTEXT_JUSTIFY GetJustifyIdentificator( const wxString& aJustify ) { TTEXT_JUSTIFY id; @@ -323,10 +323,10 @@ TTEXT_JUSTIFY GetJustifyIdentificator( wxString aJustify ) } -void SetTextParameters( XNODE* aNode, - TTEXTVALUE* aTextValue, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void SetTextParameters( XNODE* aNode, + TTEXTVALUE* aTextValue, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* tNode; wxString str; @@ -377,10 +377,10 @@ void SetTextParameters( XNODE* aNode, } -void SetFontProperty( XNODE* aNode, - TTEXTVALUE* aTextValue, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void SetFontProperty( XNODE* aNode, + TTEXTVALUE* aTextValue, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { wxString n, propValue; @@ -558,7 +558,7 @@ void SetTextSizeFromTrueTypeFontHeight( EDA_TEXT* aText, int aTextHeight ) } -XNODE* FindNode( XNODE* aChild, wxString aTag ) +XNODE* FindNode( XNODE* aChild, const wxString& aTag ) { aChild = aChild->GetChildren(); @@ -573,7 +573,7 @@ XNODE* FindNode( XNODE* aChild, wxString aTag ) return NULL; } -wxString FindNodeGetContent( XNODE* aChild, wxString aTag ) +wxString FindNodeGetContent( XNODE* aChild, const wxString& aTag ) { wxString str = wxEmptyString; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.h b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.h index 68e5571a37..1dbfb6ecbf 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcad2kicad_common.h @@ -69,43 +69,42 @@ typedef struct _TTEXTVALUE extern wxString GetWord( wxString* aStr ); extern XNODE* FindPinMap( XNODE* aNode ); -extern int StrToIntUnits( wxString aStr, char aAxe, wxString aActualConversion ); -extern wxString GetAndCutWordWithMeasureUnits( wxString* aStr, - wxString aDefaultMeasurementUnit ); -extern int StrToInt1Units( wxString aStr ); +extern int StrToIntUnits( const wxString& aStr, char aAxe, const wxString& aActualConversion ); +extern wxString GetAndCutWordWithMeasureUnits( wxString* aStr, + const wxString& aDefaultMeasurementUnit ); +extern int StrToInt1Units( const wxString& aStr ); extern wxString ValidateName( wxString aName ); extern wxString ValidateReference( wxString aRef ); -extern void SetWidth( wxString aStr, - wxString aDefaultMeasurementUnit, - int* aWidth, - wxString aActualConversion ); -extern void SetPosition( wxString aStr, - wxString aDefaultMeasurementUnit, - int* aX, - int* aY, - wxString aActualConversion ); -extern void SetDoublePrecisionPosition( wxString aStr, - wxString aDefaultMeasurementUnit, - double* aX, - double* aY, - wxString aActualConversion ); -extern TTEXT_JUSTIFY GetJustifyIdentificator( wxString aJustify ); -extern void SetTextParameters( XNODE* aNode, - TTEXTVALUE* aTextValue, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); -extern void SetFontProperty( XNODE* aNode, - TTEXTVALUE* aTextValue, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); +extern void SetWidth( wxString aStr, + const wxString& aDefaultMeasurementUnit, + int* aWidth, + const wxString& aActualConversion ); +extern void SetPosition( wxString aStr, + const wxString& aDefaultMeasurementUnit, + int* aX, + int* aY, + const wxString& aActualConversion ); +extern void SetDoublePrecisionPosition( wxString aStr, + const wxString& aDefaultMeasurementUnit, + double* aX, + double* aY, + const wxString& aActualConversion ); +extern TTEXT_JUSTIFY GetJustifyIdentificator( const wxString& aJustify ); +extern void SetTextParameters( XNODE* aNode, + TTEXTVALUE* aTextValue, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); +extern void SetFontProperty( XNODE* aNode, + TTEXTVALUE* aTextValue, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); extern void SetTextJustify( EDA_TEXT* aText, TTEXT_JUSTIFY aJustify ); extern int CalculateTextLengthSize( TTEXTVALUE* aText ); extern void CorrectTextPosition( TTEXTVALUE* aValue ); -extern void SetTextSizeFromStrokeFontHeight( EDA_TEXT* aText, - int aTextHeight ); +extern void SetTextSizeFromStrokeFontHeight( EDA_TEXT* aText, int aTextHeight ); extern void SetTextSizeFromTrueTypeFontHeight( EDA_TEXT* aText, int aTextHeight ); -extern XNODE* FindNode( XNODE* aChild, wxString aTag ); -extern wxString FindNodeGetContent( XNODE* aChild, wxString aTag ); +extern XNODE* FindNode( XNODE* aChild, const wxString& aTag ); +extern wxString FindNodeGetContent( XNODE* aChild, const wxString& aTag ); extern void InitTTextValue( TTEXTVALUE* aTextValue ); } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp index 35ed2fee31..c42add6459 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb.cpp @@ -133,7 +133,7 @@ int PCB::GetNetCode( wxString aNetName ) return 0; } -XNODE* PCB::FindCompDefName( XNODE* aNode, wxString aName ) +XNODE* PCB::FindCompDefName( XNODE* aNode, const wxString& aName ) { XNODE* result = NULL, * lNode; wxString propValue; @@ -162,8 +162,9 @@ XNODE* PCB::FindCompDefName( XNODE* aNode, wxString aName ) void PCB::SetTextProperty( XNODE* aNode, TTEXTVALUE* aTextValue, - wxString aPatGraphRefName, wxString aXmlName, - wxString aActualConversion ) + const wxString& aPatGraphRefName, + const wxString& aXmlName, + const wxString& aActualConversion ) { XNODE* tNode, * t1Node; wxString n, nnew, pn, propValue, str; @@ -233,7 +234,7 @@ void PCB::SetTextProperty( XNODE* aNode, TTEXTVALUE* aTextValue, void PCB::DoPCBComponents( XNODE* aNode, wxXmlDocument* aXmlDoc, - wxString aActualConversion, + const wxString& aActualConversion, wxStatusBar* aStatusBar ) { XNODE* lNode, * tNode, * mNode; @@ -420,7 +421,9 @@ void PCB::DoPCBComponents( XNODE* aNode, } -void PCB::ConnectPinToNet( wxString aCompRef, wxString aPinRef, wxString aNetName ) +void PCB::ConnectPinToNet( const wxString& aCompRef, + const wxString& aPinRef, + const wxString& aNetName ) { PCB_MODULE* module; PCB_PAD* cp; @@ -447,7 +450,7 @@ void PCB::ConnectPinToNet( wxString aCompRef, wxString aPinRef, wxString aNetNam } -int PCB::FindLayer( wxString aLayerName ) +int PCB::FindLayer( const wxString& aLayerName ) { for( LAYER_NUM i = 0; i < (int)m_layersStackup.GetCount(); ++i ) { @@ -575,7 +578,7 @@ double PCB::GetDistance( wxRealPoint* aPoint1, wxRealPoint* aPoint2 ) ( aPoint1->y - aPoint2->y ) ); } -void PCB::GetBoardOutline( wxXmlDocument* aXmlDoc, wxString aActualConversion ) +void PCB::GetBoardOutline( wxXmlDocument* aXmlDoc, const wxString& aActualConversion ) { XNODE* iNode, *lNode, *pNode; long PCadLayer = 0; @@ -666,7 +669,7 @@ void PCB::GetBoardOutline( wxXmlDocument* aXmlDoc, wxString aActualConversion ) } } -void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc, wxString aActualConversion ) +void PCB::ParseBoard( wxStatusBar* aStatusBar, wxXmlDocument* aXmlDoc, const wxString& aActualConversion ) { XNODE* aNode;//, *aaNode; PCB_NET* net; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb.h b/pcbnew/pcad2kicadpcb_plugin/pcb.h index a8cfdf3029..f1e074d94f 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb.h @@ -53,15 +53,15 @@ public: PCB( BOARD* aBoard ); ~PCB(); - PCB_LAYER_ID GetKiCadLayer( int aPCadLayer ) override; + PCB_LAYER_ID GetKiCadLayer( int aPCadLayer ) override; LAYER_TYPE_T GetLayerType( int aPCadLayer ) override; wxString GetLayerNetNameRef( int aPCadLayer ) override; int GetNewTimestamp() override; int GetNetCode( wxString aNetName ) override; - void ParseBoard( wxStatusBar* aStatusBar, - wxXmlDocument* aXmlDoc, - wxString aActualConversion ); + void ParseBoard( wxStatusBar* aStatusBar, + wxXmlDocument* aXmlDoc, + const wxString& aActualConversion ); void AddToBoard() override; @@ -69,22 +69,25 @@ private: int m_timestamp_cnt; wxArrayString m_layersStackup; - XNODE* FindCompDefName( XNODE* aNode, wxString aName ); - void SetTextProperty( XNODE* aNode, - TTEXTVALUE* aTextValue, - wxString aPatGraphRefName, - wxString aXmlName, - wxString aActualConversion ); - void DoPCBComponents( XNODE* aNode, - wxXmlDocument* aXmlDoc, - wxString aActualConversion, - wxStatusBar* aStatusBar ); - void ConnectPinToNet( wxString aCr, wxString aPr, wxString aNetName ); - int FindLayer( wxString aLayerName ); + XNODE* FindCompDefName( XNODE* aNode, const wxString& aName ); + void SetTextProperty( XNODE* aNode, + TTEXTVALUE* aTextValue, + const wxString& aPatGraphRefName, + const wxString& aXmlName, + const wxString& aActualConversion ); + void DoPCBComponents( XNODE* aNode, + wxXmlDocument* aXmlDoc, + const wxString& aActualConversion, + wxStatusBar* aStatusBar ); + void ConnectPinToNet( const wxString& aCr, + const wxString& aPr, + const wxString& aNetName ); + int FindLayer( const wxString& aLayerName ); void MapLayer( XNODE* aNode ); int FindOutlinePoint( VERTICES_ARRAY* aOutline, wxRealPoint aPoint ); double GetDistance( wxRealPoint* aPoint1, wxRealPoint* aPoint2 ); - void GetBoardOutline( wxXmlDocument* aXmlDoc, wxString aActualConversion ); + void GetBoardOutline( wxXmlDocument* aXmlDoc, + const wxString& aActualConversion ); }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_arc.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_arc.cpp index 38fa914d2c..71c895cdf1 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_arc.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_arc.cpp @@ -52,10 +52,10 @@ PCB_ARC::~PCB_ARC() } -void PCB_ARC::Parse( XNODE* aNode, - int aLayer, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_ARC::Parse( XNODE* aNode, + int aLayer, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; double a = 0.0; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_arc.h b/pcbnew/pcad2kicadpcb_plugin/pcb_arc.h index 9f1022299a..e8b90b2035 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_arc.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_arc.h @@ -47,8 +47,10 @@ public: PCB_ARC( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_ARC(); - virtual void Parse( XNODE* aNode, int aLayer, - wxString aDefaultMeasurementUnit, wxString aActualConversion ); + virtual void Parse( XNODE* aNode, + int aLayer, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); virtual void SetPosOffset( int aX_offs, int aY_offs ) override; virtual void Flip() override; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp index 3d60888b09..c438744187 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.cpp @@ -50,9 +50,9 @@ PCB_COPPER_POUR::~PCB_COPPER_POUR() } -bool PCB_COPPER_POUR::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +bool PCB_COPPER_POUR::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; wxString pourType, str, propValue; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h index b556fa8b41..feb5e99ee9 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_copper_pour.h @@ -44,8 +44,8 @@ public: ~PCB_COPPER_POUR(); virtual bool Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) override; + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) override; }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.cpp index 4499783ea7..39a0d6fca4 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.cpp @@ -46,9 +46,9 @@ PCB_CUTOUT::~PCB_CUTOUT() } -bool PCB_CUTOUT::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +bool PCB_CUTOUT::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h b/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h index 1265df2edb..86f7b9ce83 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_cutout.h @@ -43,9 +43,9 @@ public: PCB_CUTOUT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard, int aPCadLayer ); ~PCB_CUTOUT(); - virtual bool Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) override; + virtual bool Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& actualConversion ) override; }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.cpp index d6305b3343..8aee07fdb4 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.cpp @@ -49,9 +49,9 @@ PCB_KEEPOUT::~PCB_KEEPOUT() } -bool PCB_KEEPOUT::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +bool PCB_KEEPOUT::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h b/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h index fbd1c57a47..dde8904353 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_keepout.h @@ -43,8 +43,8 @@ public: ~PCB_KEEPOUT(); virtual bool Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) override; + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) override; }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_line.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_line.cpp index bc24d297cd..7bcd1d7805 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_line.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_line.cpp @@ -51,10 +51,10 @@ PCB_LINE::~PCB_LINE() } -void PCB_LINE::Parse( XNODE* aNode, - int aLayer, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_LINE::Parse( XNODE* aNode, + int aLayer, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; wxString propValue; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_line.h b/pcbnew/pcad2kicadpcb_plugin/pcb_line.h index 3bbec94ca0..556e888225 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_line.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_line.h @@ -47,10 +47,10 @@ public: PCB_LINE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_LINE(); - virtual void Parse( XNODE* aNode, - int aLayer, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); + virtual void Parse( XNODE* aNode, + int aLayer, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); virtual void SetPosOffset( int aX_offs, int aY_offs ) override; virtual void Flip() override; void AddToModule( MODULE* aModule ) override; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp index 44946ecbd3..ec039b3b59 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_module.cpp @@ -68,7 +68,7 @@ PCB_MODULE::~PCB_MODULE() } -XNODE* PCB_MODULE::FindModulePatternDefName( XNODE* aNode, wxString aName ) +XNODE* PCB_MODULE::FindModulePatternDefName( XNODE* aNode, const wxString& aName ) { XNODE* result, * lNode; wxString propValue1, propValue2; @@ -218,8 +218,8 @@ void PCB_MODULE::DoLayerContentsObjects( XNODE* aNode, PCB_MODULE* aPCBModule, PCB_COMPONENTS_ARRAY* aList, wxStatusBar* aStatusBar, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { PCB_ARC* arc; PCB_POLYGON* polygon; @@ -369,7 +369,7 @@ void PCB_MODULE::DoLayerContentsObjects( XNODE* aNode, } -void PCB_MODULE::SetName( wxString aPin, wxString aName ) +void PCB_MODULE::SetName( const wxString& aPin, const wxString& aName ) { int i; long num; @@ -388,7 +388,8 @@ void PCB_MODULE::SetName( wxString aPin, wxString aName ) void PCB_MODULE::Parse( XNODE* aNode, wxStatusBar* aStatusBar, - wxString aDefaultMeasurementUnit, wxString aActualConversion ) + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode, * tNode, * mNode; PCB_PAD* pad; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_module.h b/pcbnew/pcad2kicadpcb_plugin/pcb_module.h index 356e36b32c..c2da5bb699 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_module.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_module.h @@ -48,19 +48,20 @@ public: PCB_MODULE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_MODULE(); - XNODE* FindModulePatternDefName( XNODE* aNode, wxString aName ); + XNODE* FindModulePatternDefName( XNODE* aNode, const wxString& aName ); void DoLayerContentsObjects( XNODE* aNode, PCB_MODULE* aPCBModule, PCB_COMPONENTS_ARRAY* aList, wxStatusBar* aStatusBar, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); - void SetName( wxString aPin, wxString aName ); + void SetName( const wxString& aPin, const wxString& aName ); virtual void Parse( XNODE* aNode, wxStatusBar* aStatusBar, - wxString aDefaultMeasurementUnit, wxString aActualConversion ); + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); virtual void Flip() override; void AddToBoard() override; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp index f8f44e65ee..0d0923733b 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.cpp @@ -56,8 +56,9 @@ PCB_PAD::~PCB_PAD() } -void PCB_PAD::Parse( XNODE* aNode, wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_PAD::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode, *cNode; long num; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h index 3bf76ddc8d..a14a101e78 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad.h @@ -48,9 +48,9 @@ public: PCB_PAD( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_PAD(); - virtual void Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); + virtual void Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); virtual void Flip() override; void AddToModule( MODULE* aModule ) override { diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.cpp index 699f51fac1..82ca1c92e5 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.cpp @@ -50,9 +50,9 @@ PCB_PAD_SHAPE::~PCB_PAD_SHAPE() } -void PCB_PAD_SHAPE::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_PAD_SHAPE::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { wxString str, s; long num; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.h b/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.h index 518f0898dc..5398eab2c9 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_pad_shape.h @@ -47,9 +47,9 @@ public: PCB_PAD_SHAPE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_PAD_SHAPE(); - virtual void Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); + virtual void Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); void AddToBoard() override; }; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp index 29e8b2bbaf..d4075f61c6 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.cpp @@ -49,9 +49,9 @@ PCB_PLANE::~PCB_PLANE() } -bool PCB_PLANE::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +bool PCB_PLANE::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; wxString pourType, str, propValue; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h index 93a8524fcf..6a173162b5 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_plane.h @@ -43,8 +43,8 @@ public: ~PCB_PLANE(); virtual bool Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) override; + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) override; }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp index e6cd534adc..38dabf553e 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.cpp @@ -79,7 +79,7 @@ PCB_POLYGON::~PCB_POLYGON() } } -void PCB_POLYGON::AssignNet( wxString aNetName ) +void PCB_POLYGON::AssignNet( const wxString& aNetName ) { m_net = aNetName; m_netCode = GetNetCode( m_net ); @@ -102,7 +102,8 @@ void PCB_POLYGON::SetOutline( VERTICES_ARRAY* aOutline ) } void PCB_POLYGON::FormPolygon( XNODE* aNode, VERTICES_ARRAY* aPolygon, - wxString aDefaultMeasurementUnit, wxString aActualConversion ) + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; double x, y; @@ -123,9 +124,9 @@ void PCB_POLYGON::FormPolygon( XNODE* aNode, VERTICES_ARRAY* aPolygon, } -bool PCB_POLYGON::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +bool PCB_POLYGON::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; wxString propValue; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h index a6623edd7f..c0eb27ae12 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_polygon.h @@ -52,8 +52,8 @@ public: ~PCB_POLYGON(); virtual bool Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); virtual void SetPosOffset( int aX_offs, int aY_offs ) override; virtual void Flip() override; @@ -61,11 +61,12 @@ public: void AddToBoard() override; // protected: - void AssignNet( wxString aNetName ); + void AssignNet( const wxString& aNetName ); void SetOutline( VERTICES_ARRAY* aOutline ); void FormPolygon( XNODE* aNode, VERTICES_ARRAY* aPolygon, - wxString aDefaultMeasurementUnit, wxString actualConversion ); + const wxString& aDefaultMeasurementUnit, + const wxString& actualConversion ); protected: bool m_filled; }; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp index 5c1b19a349..2d0e33c6c1 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_text.cpp @@ -48,10 +48,10 @@ PCB_TEXT::~PCB_TEXT() } -void PCB_TEXT::Parse( XNODE* aNode, - int aLayer, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_TEXT::Parse( XNODE* aNode, + int aLayer, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; wxString str; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_text.h b/pcbnew/pcad2kicadpcb_plugin/pcb_text.h index 1fe856b2cd..d623d05037 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_text.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_text.h @@ -44,10 +44,10 @@ public: PCB_TEXT( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_TEXT(); - virtual void Parse( XNODE* aNode, - int aLayer, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ); + virtual void Parse( XNODE* aNode, + int aLayer, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ); void AddToModule( MODULE* aModule ) override; void AddToBoard() override; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_via.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_via.cpp index 49789d1d5e..92ed1e4426 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_via.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_via.cpp @@ -46,8 +46,9 @@ PCB_VIA::~PCB_VIA() } -void PCB_VIA::Parse( XNODE* aNode, wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_VIA::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode, * tNode; wxString propValue; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_via.h b/pcbnew/pcad2kicadpcb_plugin/pcb_via.h index d29ac7d8f8..557c7ac161 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_via.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_via.h @@ -44,9 +44,9 @@ public: PCB_VIA( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_VIA(); - virtual void Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) override; + virtual void Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) override; }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.cpp b/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.cpp index 70e6d609cd..3aeedf7da5 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.cpp @@ -47,9 +47,9 @@ PCB_VIA_SHAPE::~PCB_VIA_SHAPE() } -void PCB_VIA_SHAPE::Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) +void PCB_VIA_SHAPE::Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) { XNODE* lNode; wxString str; diff --git a/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.h b/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.h index 9eb222d020..42a5262e3d 100644 --- a/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.h +++ b/pcbnew/pcad2kicadpcb_plugin/pcb_via_shape.h @@ -42,9 +42,9 @@ public: PCB_VIA_SHAPE( PCB_CALLBACKS* aCallbacks, BOARD* aBoard ); ~PCB_VIA_SHAPE(); - virtual void Parse( XNODE* aNode, - wxString aDefaultMeasurementUnit, - wxString aActualConversion ) override; + virtual void Parse( XNODE* aNode, + const wxString& aDefaultMeasurementUnit, + const wxString& aActualConversion ) override; }; } // namespace PCAD2KICAD diff --git a/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp b/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp index 19ec21db8a..74625ba338 100644 --- a/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp +++ b/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.cpp @@ -26,9 +26,10 @@ * @file s_expr_loader.cpp */ +#include + #include #include -#include #include namespace PCAD2KICAD { @@ -36,7 +37,7 @@ namespace PCAD2KICAD { static KEYWORD empty_keywords[1] = {}; static const char ACCEL_ASCII_KEYWORD[] = "ACCEL_ASCII"; -void LoadInputFile( wxString aFileName, wxXmlDocument* aXmlDoc ) +void LoadInputFile( const wxString& aFileName, wxXmlDocument* aXmlDoc ) { char line[sizeof( ACCEL_ASCII_KEYWORD )]; int tok; diff --git a/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.h b/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.h index 02c1857a06..6076802f05 100644 --- a/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.h +++ b/pcbnew/pcad2kicadpcb_plugin/s_expr_loader.h @@ -29,9 +29,12 @@ #ifndef S_EXPR_LOADER_H_ #define S_EXPR_LOADER_H_ +#include +#include + namespace PCAD2KICAD { - void LoadInputFile( wxString aFileName, wxXmlDocument* aXmlDoc ); + void LoadInputFile( const wxString& aFileName, wxXmlDocument* aXmlDoc ); } #endif // S_EXPR_LOADER_H_ diff --git a/pcbnew/ratsnest_viewitem.cpp b/pcbnew/ratsnest_viewitem.cpp index 00867cebcc..522de670b2 100644 --- a/pcbnew/ratsnest_viewitem.cpp +++ b/pcbnew/ratsnest_viewitem.cpp @@ -35,13 +35,14 @@ #include #include +#include #include namespace KIGFX { RATSNEST_VIEWITEM::RATSNEST_VIEWITEM( std::shared_ptr aData ) : - EDA_ITEM( NOT_USED ), m_data( aData ) + EDA_ITEM( NOT_USED ), m_data( std::move(aData) ) { } diff --git a/pcbnew/router/pns_diff_pair.cpp b/pcbnew/router/pns_diff_pair.cpp index f301304e9d..67f93c0d18 100644 --- a/pcbnew/router/pns_diff_pair.cpp +++ b/pcbnew/router/pns_diff_pair.cpp @@ -423,7 +423,7 @@ static VECTOR2I makeGapVector( VECTOR2I dir, int length ) return rv; } -void DP_GATEWAYS::BuildFromPrimitivePair( DP_PRIMITIVE_PAIR aPair, bool aPreferDiagonal ) +void DP_GATEWAYS::BuildFromPrimitivePair( const DP_PRIMITIVE_PAIR& aPair, bool aPreferDiagonal ) { VECTOR2I majorDirection; VECTOR2I p0_p, p0_n; @@ -587,7 +587,7 @@ void DP_GATEWAYS::buildEntries( const VECTOR2I& p0_p, const VECTOR2I& p0_n ) } -void DP_GATEWAYS::buildDpContinuation( DP_PRIMITIVE_PAIR aPair, bool aIsDiagonal ) +void DP_GATEWAYS::buildDpContinuation( const DP_PRIMITIVE_PAIR& aPair, bool aIsDiagonal ) { DP_GATEWAY gw( aPair.AnchorP(), aPair.AnchorN(), aIsDiagonal ); gw.SetPriority( 100 ); diff --git a/pcbnew/router/pns_diff_pair.h b/pcbnew/router/pns_diff_pair.h index be074ffc11..25a288e7e4 100644 --- a/pcbnew/router/pns_diff_pair.h +++ b/pcbnew/router/pns_diff_pair.h @@ -219,7 +219,7 @@ class DP_GATEWAYS void BuildForCursor( const VECTOR2I& aCursorPos ); void BuildOrthoProjections( DP_GATEWAYS &aEntries, const VECTOR2I& aCursorPos, int aOrthoScore ); void BuildGeneric( const VECTOR2I& p0_p, const VECTOR2I& p0_n, bool aBuildEntries = false, bool aViaMode = false ); - void BuildFromPrimitivePair( DP_PRIMITIVE_PAIR aPair, bool aPreferDiagonal ); + void BuildFromPrimitivePair( const DP_PRIMITIVE_PAIR& aPair, bool aPreferDiagonal ); bool FitGateways( DP_GATEWAYS& aEntry, DP_GATEWAYS& aTarget, bool aPrefDiagonal, DIFF_PAIR& aDp ); @@ -244,7 +244,7 @@ class DP_GATEWAYS }; bool checkDiagonalAlignment( const VECTOR2I& a, const VECTOR2I& b ) const; - void buildDpContinuation( DP_PRIMITIVE_PAIR aPair, bool aIsDiagonal ); + void buildDpContinuation( const DP_PRIMITIVE_PAIR& aPair, bool aIsDiagonal ); void buildEntries( const VECTOR2I& p0_p, const VECTOR2I& p0_n ); int m_gap; diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index efb29e8600..8db250f2d2 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -84,7 +84,7 @@ private: }; int localPadClearance( const PNS::ITEM* aItem ) const; - int matchDpSuffix( wxString aNetName, wxString& aComplementNet, wxString& aBaseDpName ); + int matchDpSuffix( const wxString& aNetName, wxString& aComplementNet, wxString& aBaseDpName ); PNS::ROUTER* m_router; BOARD* m_board; @@ -225,7 +225,7 @@ void PNS_PCBNEW_RULE_RESOLVER::OverrideClearance( bool aEnable, int aNetA, int a } -int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( wxString aNetName, wxString& aComplementNet, wxString& aBaseDpName ) +int PNS_PCBNEW_RULE_RESOLVER::matchDpSuffix( const wxString& aNetName, wxString& aComplementNet, wxString& aBaseDpName ) { int rv = 0; diff --git a/pcbnew/router/pns_logger.cpp b/pcbnew/router/pns_logger.cpp index 161b800fd4..39611c8f48 100644 --- a/pcbnew/router/pns_logger.cpp +++ b/pcbnew/router/pns_logger.cpp @@ -72,7 +72,7 @@ void LOGGER::EndGroup() } -void LOGGER::Log ( const ITEM* aItem, int aKind, const std::string aName ) +void LOGGER::Log ( const ITEM* aItem, int aKind, const std::string& aName ) { m_theLog << "item " << aKind << " " << aName << " "; m_theLog << aItem->Net() << " " << aItem->Layers().Start() << " " << @@ -122,7 +122,7 @@ void LOGGER::Log ( const ITEM* aItem, int aKind, const std::string aName ) } -void LOGGER::Log( const SHAPE_LINE_CHAIN *aL, int aKind, const std::string aName ) +void LOGGER::Log( const SHAPE_LINE_CHAIN *aL, int aKind, const std::string& aName ) { m_theLog << "item " << aKind << " " << aName << " "; m_theLog << 0 << " " << 0 << " " << 0 << " " << 0 << " " << 0; @@ -134,7 +134,7 @@ void LOGGER::Log( const SHAPE_LINE_CHAIN *aL, int aKind, const std::string aName void LOGGER::Log( const VECTOR2I& aStart, const VECTOR2I& aEnd, - int aKind, const std::string aName) + int aKind, const std::string& aName) { } diff --git a/pcbnew/router/pns_logger.h b/pcbnew/router/pns_logger.h index bcc9c91d05..f9c3c410f8 100644 --- a/pcbnew/router/pns_logger.h +++ b/pcbnew/router/pns_logger.h @@ -48,10 +48,10 @@ public: void NewGroup( const std::string& aName, int aIter = 0 ); void EndGroup(); - void Log( const ITEM* aItem, int aKind = 0, const std::string aName = std::string() ); - void Log( const SHAPE_LINE_CHAIN *aL, int aKind = 0, const std::string aName = std::string() ); + void Log( const ITEM* aItem, int aKind = 0, const std::string& aName = std::string() ); + void Log( const SHAPE_LINE_CHAIN *aL, int aKind = 0, const std::string& aName = std::string() ); void Log( const VECTOR2I& aStart, const VECTOR2I& aEnd, int aKind = 0, - const std::string aName = std::string() ); + const std::string& aName = std::string() ); private: void dumpShape( const SHAPE* aSh ); diff --git a/pcbnew/specctra.cpp b/pcbnew/specctra.cpp index ff193f753e..b09e4a10e8 100644 --- a/pcbnew/specctra.cpp +++ b/pcbnew/specctra.cpp @@ -3435,7 +3435,7 @@ void SPECCTRA_DB::doSUPPLY_PIN( SUPPLY_PIN* growth ) } -void SPECCTRA_DB::ExportPCB( wxString aFilename, bool aNameChange ) +void SPECCTRA_DB::ExportPCB( const wxString& aFilename, bool aNameChange ) { if( pcb ) { @@ -3449,7 +3449,7 @@ void SPECCTRA_DB::ExportPCB( wxString aFilename, bool aNameChange ) } -void SPECCTRA_DB::ExportSESSION( wxString aFilename ) +void SPECCTRA_DB::ExportSESSION( const wxString& aFilename ) { if( session ) { diff --git a/pcbnew/specctra.h b/pcbnew/specctra.h index ac6fb94beb..5b86e276c0 100644 --- a/pcbnew/specctra.h +++ b/pcbnew/specctra.h @@ -3819,7 +3819,7 @@ class SPECCTRA_DB : public SPECCTRA_LEXER * Function exportNETCLASS * exports \a aNetClass to the DSN file. */ - void exportNETCLASS( std::shared_ptr aNetClass, BOARD* aBoard ); + void exportNETCLASS( const std::shared_ptr& aNetClass, BOARD* aBoard ); //----------------------------------------------------------- @@ -3931,7 +3931,7 @@ public: * and also to to be changed in the output file. * @throw IO_ERROR, if an i/o error occurs saving the file. */ - void ExportPCB( wxString aFilename, bool aNameChange=false ); + void ExportPCB( const wxString& aFilename, bool aNameChange=false ); /** * Function FromBOARD @@ -3962,7 +3962,7 @@ public: * * @param aFilename The file to save to. */ - void ExportSESSION( wxString aFilename ); + void ExportSESSION( const wxString& aFilename ); /** * Function FlipMODULEs diff --git a/pcbnew/specctra_export.cpp b/pcbnew/specctra_export.cpp index 587fc3a0e9..71a0c24844 100644 --- a/pcbnew/specctra_export.cpp +++ b/pcbnew/specctra_export.cpp @@ -1497,7 +1497,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) } -void SPECCTRA_DB::exportNETCLASS( NETCLASSPTR aNetClass, BOARD* aBoard ) +void SPECCTRA_DB::exportNETCLASS( const NETCLASSPTR& aNetClass, BOARD* aBoard ) { /* From page 11 of specctra spec: * diff --git a/pcbnew/tools/edit_constraints.cpp b/pcbnew/tools/edit_constraints.cpp index b73ac0c5a8..33b51f4490 100644 --- a/pcbnew/tools/edit_constraints.cpp +++ b/pcbnew/tools/edit_constraints.cpp @@ -29,6 +29,8 @@ #include +#include + void EC_VERTICAL::Apply( EDIT_POINT& aHandle ) { VECTOR2I point = aHandle.GetPosition(); @@ -178,7 +180,7 @@ void EC_CONVERGING::Apply( EDIT_LINE& aHandle ) EC_SNAPLINE::EC_SNAPLINE( EDIT_LINE& aLine, V2D_TRANSFORM_FUN aSnapFun ) : - EDIT_CONSTRAINT( aLine ), m_snapFun( aSnapFun ) + EDIT_CONSTRAINT( aLine ), m_snapFun( std::move(aSnapFun) ) {} diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index e240c02666..7ce4e61c4e 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -37,6 +37,8 @@ #include +#include + #include "pcb_actions.h" #include "selection_tool.h" #include "pcb_selection_conditions.h" @@ -71,7 +73,7 @@ public: PAD_CONTEXT_MENU( bool aEditingFootprint, SHOW_FUNCTOR aHaveGlobalPadSetting ): m_editingFootprint( aEditingFootprint ), - m_haveGlobalPadSettings( aHaveGlobalPadSetting ) + m_haveGlobalPadSettings( std::move( aHaveGlobalPadSetting ) ) { SetIcon( pad_xpm ); SetTitle( _( "Pads" ) ); diff --git a/polygon/poly2tri/sweep/cdt.cc b/polygon/poly2tri/sweep/cdt.cc index d7838257c7..cae6157f86 100644 --- a/polygon/poly2tri/sweep/cdt.cc +++ b/polygon/poly2tri/sweep/cdt.cc @@ -30,11 +30,13 @@ */ #include "cdt.h" +#include + namespace p2t { CDT::CDT(std::vector polyline) { - sweep_context_ = new SweepContext(polyline); + sweep_context_ = new SweepContext( std::move( polyline ) ); sweep_ = new Sweep; } diff --git a/polygon/poly2tri/sweep/sweep_context.cc b/polygon/poly2tri/sweep/sweep_context.cc index 6c0b0447dd..fe5f06b6b0 100644 --- a/polygon/poly2tri/sweep/sweep_context.cc +++ b/polygon/poly2tri/sweep/sweep_context.cc @@ -30,6 +30,7 @@ */ #include "sweep_context.h" #include +#include #include "advancing_front.h" namespace p2t { @@ -45,7 +46,7 @@ SweepContext::SweepContext(std::vector polyline) : basin = Basin(); edge_event = EdgeEvent(); - points_ = polyline; + points_ = std::move( polyline ); InitEdges(points_); } diff --git a/utils/idftools/dxf2idf.cpp b/utils/idftools/dxf2idf.cpp index c921365b74..7c4571bf9b 100644 --- a/utils/idftools/dxf2idf.cpp +++ b/utils/idftools/dxf2idf.cpp @@ -49,7 +49,7 @@ DXF2IDF::~DXF2IDF() } -bool DXF2IDF::ReadDxf( const std::string aFile ) +bool DXF2IDF::ReadDxf( const std::string& aFile ) { dxfRW* reader = new dxfRW( aFile.c_str() ); diff --git a/utils/idftools/dxf2idf.h b/utils/idftools/dxf2idf.h index 6b6d0bcd4d..59b9680042 100644 --- a/utils/idftools/dxf2idf.h +++ b/utils/idftools/dxf2idf.h @@ -41,7 +41,7 @@ public: DXF2IDF() : m_scale( 1.0 ) {}; ~DXF2IDF(); - bool ReadDxf( const std::string aFile ); + bool ReadDxf( const std::string& aFile ); bool WriteOutline( FILE* aFile, bool isInch ); private: diff --git a/utils/idftools/idf_common.cpp b/utils/idftools/idf_common.cpp index b742c12076..a4b522b806 100644 --- a/utils/idftools/idf_common.cpp +++ b/utils/idftools/idf_common.cpp @@ -330,8 +330,8 @@ IDF_DRILL_DATA::IDF_DRILL_DATA() IDF_DRILL_DATA::IDF_DRILL_DATA( double aDrillDia, double aPosX, double aPosY, IDF3::KEY_PLATING aPlating, - const std::string aRefDes, - const std::string aHoleType, + const std::string& aRefDes, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner ) { if( aDrillDia < 0.3 ) diff --git a/utils/idftools/idf_common.h b/utils/idftools/idf_common.h index 8e29f55310..8dda141a9e 100644 --- a/utils/idftools/idf_common.h +++ b/utils/idftools/idf_common.h @@ -401,8 +401,8 @@ public: */ IDF_DRILL_DATA( double aDrillDia, double aPosX, double aPosY, IDF3::KEY_PLATING aPlating, - const std::string aRefDes, - const std::string aHoleType, + const std::string& aRefDes, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner ); /** diff --git a/utils/idftools/idf_outlines.cpp b/utils/idftools/idf_outlines.cpp index a53ea200f1..1cef84e225 100644 --- a/utils/idftools/idf_outlines.cpp +++ b/utils/idftools/idf_outlines.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -1556,7 +1557,7 @@ OTHER_OUTLINE::OTHER_OUTLINE( IDF3_BOARD* aParent ) return; } -bool OTHER_OUTLINE::SetOutlineIdentifier( const std::string aUniqueID ) +bool OTHER_OUTLINE::SetOutlineIdentifier( const std::string& aUniqueID ) { #ifndef DISABLE_IDF_OWNERSHIP if( !CheckOwnership( __LINE__, __FUNCTION__, parent, owner, outlineType, errormsg ) ) @@ -2730,7 +2731,7 @@ bool GROUP_OUTLINE::SetGroupName( std::string aGroupName ) return false; #endif - groupName = aGroupName; + groupName = std::move(aGroupName); return true; } diff --git a/utils/idftools/idf_outlines.h b/utils/idftools/idf_outlines.h index 74149ab4f1..36f1905130 100644 --- a/utils/idftools/idf_outlines.h +++ b/utils/idftools/idf_outlines.h @@ -382,7 +382,7 @@ public: * sets the Outline Identifier string of this OTHER_OUTLINE object * as per IDFv3 spec. */ - virtual bool SetOutlineIdentifier( const std::string aUniqueID ); + virtual bool SetOutlineIdentifier( const std::string& aUniqueID ); /** * Function GetOutlineIdentifier diff --git a/utils/idftools/idf_parser.cpp b/utils/idftools/idf_parser.cpp index fc159f328e..3ea410e4e3 100644 --- a/utils/idftools/idf_parser.cpp +++ b/utils/idftools/idf_parser.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -717,7 +718,7 @@ bool IDF3_COMP_OUTLINE_DATA::readPlaceData( std::istream &aBoardFile, void IDF3_COMP_OUTLINE_DATA::writePlaceData( std::ostream& aBoardFile, double aXpos, double aYpos, double aAngle, - const std::string aRefDes, + const std::string& aRefDes, IDF3::IDF_PLACEMENT aPlacement, IDF3::IDF_LAYER aSide ) { @@ -988,7 +989,7 @@ const std::string& IDF3_COMPONENT::GetRefDes( void ) IDF_DRILL_DATA* IDF3_COMPONENT::AddDrill( double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, - const std::string aHoleType, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner ) { IDF_DRILL_DATA* dp = new IDF_DRILL_DATA( aDia, aXpos, aYpos, aPlating, @@ -1422,7 +1423,7 @@ IDF3::CAD_TYPE IDF3_BOARD::GetCadType( void ) void IDF3_BOARD::SetBoardName( std::string aBoardName ) { - boardName = aBoardName; + boardName = std::move(aBoardName); return; } @@ -3405,7 +3406,7 @@ const std::list< IDF_OUTLINE* >*const IDF3_BOARD::GetBoardOutlines( void ) IDF_DRILL_DATA* IDF3_BOARD::AddBoardDrill( double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, - const std::string aHoleType, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner ) { IDF_DRILL_DATA* drill = new IDF_DRILL_DATA( aDia, aXpos, aYpos, aPlating, @@ -3599,7 +3600,7 @@ bool IDF3_BOARD::AddSlot( double aWidth, double aLength, double aOrientation, do IDF_DRILL_DATA* IDF3_BOARD::addCompDrill( double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, - const std::string aHoleType, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner, const std::string& aRefDes ) { @@ -3723,7 +3724,7 @@ IDF_DRILL_DATA* IDF3_BOARD::addCompDrill( IDF_DRILL_DATA* aDrilledHole ) } -bool IDF3_BOARD::delCompDrill( double aDia, double aXpos, double aYpos, std::string aRefDes ) +bool IDF3_BOARD::delCompDrill( double aDia, double aXpos, double aYpos, const std::string& aRefDes ) { errormsg.clear(); @@ -3831,7 +3832,7 @@ std::map< std::string, IDF3_COMPONENT* >*const IDF3_BOARD::GetComponents( void ) } -IDF3_COMPONENT* IDF3_BOARD::FindComponent( std::string aRefDes ) +IDF3_COMPONENT* IDF3_BOARD::FindComponent( const std::string& aRefDes ) { std::map::iterator it = components.find( aRefDes ); @@ -3844,7 +3845,7 @@ IDF3_COMPONENT* IDF3_BOARD::FindComponent( std::string aRefDes ) // returns a pointer to a component outline object or NULL // if the object doesn't exist -IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( wxString aFullFileName ) +IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( const wxString& aFullFileName ) { std::string fname = TO_UTF8( aFullFileName ); wxFileName idflib( aFullFileName ); @@ -4054,7 +4055,7 @@ IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( wxString aFullFileName ) // returns a pointer to the component outline object with the // unique ID aComponentID -IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( std::string aComponentID ) +IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( const std::string& aComponentID ) { std::map< std::string, IDF3_COMP_OUTLINE*>::iterator its = compOutlines.find( aComponentID ); diff --git a/utils/idftools/idf_parser.h b/utils/idftools/idf_parser.h index b64fcf8b0d..c3b25c95e1 100644 --- a/utils/idftools/idf_parser.h +++ b/utils/idftools/idf_parser.h @@ -110,7 +110,7 @@ private: * @return bool: true if data was successfully written, otherwise false */ void writePlaceData( std::ostream& aBoardFile, double aXpos, double aYpos, double aAngle, - const std::string aRefDes, IDF3::IDF_PLACEMENT aPlacement, + const std::string& aRefDes, IDF3::IDF_PLACEMENT aPlacement, IDF3::IDF_LAYER aSide ); public: @@ -318,7 +318,7 @@ public: */ IDF_DRILL_DATA* AddDrill( double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, - const std::string aHoleType, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner ); /** @@ -516,13 +516,13 @@ private: IDF_DRILL_DATA* addCompDrill( double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, - const std::string aHoleType, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner, const std::string& aRefDes ); IDF_DRILL_DATA* addCompDrill( IDF_DRILL_DATA* aDrilledHole ); - bool delCompDrill( double aDia, double aXpos, double aYpos, std::string aRefDes ); + bool delCompDrill( double aDia, double aXpos, double aYpos, const std::string& aRefDes ); // read the DRILLED HOLES section void readBrdDrills( std::istream& aBoardFile, IDF3::FILE_STATE& aBoardState ); @@ -676,7 +676,7 @@ public: IDF_DRILL_DATA* AddBoardDrill( double aDia, double aXpos, double aYpos, IDF3::KEY_PLATING aPlating, - const std::string aHoleType, + const std::string& aHoleType, IDF3::KEY_OWNER aOwner ); IDF_DRILL_DATA* AddDrill( IDF_DRILL_DATA* aDrilledHole ); @@ -693,15 +693,15 @@ public: bool DelComponent( size_t aIndex ); size_t GetComponentsSize( void ); std::map< std::string, IDF3_COMPONENT* >*const GetComponents( void ); - IDF3_COMPONENT* FindComponent( std::string aRefDes ); + IDF3_COMPONENT* FindComponent( const std::string& aRefDes ); // returns a pointer to a component outline object or NULL // if the object doesn't exist - IDF3_COMP_OUTLINE* GetComponentOutline( wxString aFullFileName ); + IDF3_COMP_OUTLINE* GetComponentOutline( const wxString& aFullFileName ); // returns a pointer to the component outline object with the // unique ID aComponentID - IDF3_COMP_OUTLINE* GetComponentOutline( std::string aComponentID ); + IDF3_COMP_OUTLINE* GetComponentOutline( const std::string& aComponentID ); // returns a pointer to the outline "NOGEOM NOPART" which is substituted // whenever a true outline cannot be found or is defective