diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp index e4881d148e..6f3fdb764f 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_createscene_ogl_legacy.cpp @@ -186,17 +186,17 @@ void C3D_RENDER_OGL_LEGACY::add_object_to_triangle_layer( const CROUNDSEGMENT2D float aZtop, float aZbot ) { - const SFVEC2F leftStart = aSeg->GetLeftStar(); - const SFVEC2F leftEnd = aSeg->GetLeftEnd(); - const SFVEC2F leftDir = aSeg->GetLeftDir(); + const SFVEC2F& leftStart = aSeg->GetLeftStar(); + const SFVEC2F& leftEnd = aSeg->GetLeftEnd(); + const SFVEC2F& leftDir = aSeg->GetLeftDir(); - const SFVEC2F rightStart = aSeg->GetRightStar(); - const SFVEC2F rightEnd = aSeg->GetRightEnd(); - const SFVEC2F rightDir = aSeg->GetRightDir(); + const SFVEC2F& rightStart = aSeg->GetRightStar(); + const SFVEC2F& rightEnd = aSeg->GetRightEnd(); + const SFVEC2F& rightDir = aSeg->GetRightDir(); const float radius = aSeg->GetRadius(); - const SFVEC2F start = aSeg->GetStart(); - const SFVEC2F end = aSeg->GetEnd(); + const SFVEC2F& start = aSeg->GetStart(); + const SFVEC2F& end = aSeg->GetEnd(); const float texture_factor = (12.0f / (float)SIZE_OF_CIRCLE_TEXTURE) + 1.0f; const float texture_factorF= ( 6.0f / (float)SIZE_OF_CIRCLE_TEXTURE) + 1.0f; diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/ogl_legacy_utils.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/ogl_legacy_utils.cpp index ce221c3083..3756191b3f 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/ogl_legacy_utils.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/ogl_legacy_utils.cpp @@ -218,8 +218,8 @@ void OGL_Draw_segment( const CROUNDSEGMENT2D &aSegment, { glPushMatrix(); - const SFVEC2F start = aSegment.GetStart(); - const SFVEC2F end_minus_start = aSegment.GetEnd_minus_Start(); + const SFVEC2F& start = aSegment.GetStart(); + const SFVEC2F& end_minus_start = aSegment.GetEnd_minus_Start(); const float radius = aSegment.GetRadius(); const float width = aSegment.GetWidth(); const float length = aSegment.GetLength(); diff --git a/common/gestfich.cpp b/common/gestfich.cpp index e75db2d03a..2a30f6d12c 100644 --- a/common/gestfich.cpp +++ b/common/gestfich.cpp @@ -62,7 +62,7 @@ wxString EDA_FILE_SELECTOR( const wxString& aTitle, { wxString fullfilename; wxString curr_cwd = wxGetCwd(); - wxString defaultname = aFileName; + const wxString& defaultname = aFileName; wxString defaultpath = aPath; wxString dotted_Ext = wxT(".") + aExtension; @@ -209,7 +209,7 @@ int ExecuteFile( wxWindow* frame, const wxString& ExecFile, const wxString& para bool OpenPDF( const wxString& file ) { wxString command; - wxString filename = file; + const wxString& filename = file; Pgm().ReadPdfBrowserInfos(); diff --git a/eeschema/netlist_exporters/netlist_exporter_generic.cpp b/eeschema/netlist_exporters/netlist_exporter_generic.cpp index 6ff492e2fc..ae113f97b6 100644 --- a/eeschema/netlist_exporters/netlist_exporter_generic.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_generic.cpp @@ -546,7 +546,7 @@ XNODE* NETLIST_EXPORTER_GENERIC::makeListOfNets( bool aUseGraph ) auto pin = static_cast( item ); auto refText = pin->GetParentComponent()->GetRef( &sheet ); - auto pinText = pin->GetNumber(); + const auto& pinText = pin->GetNumber(); // Skip power symbols and virtual components if( refText[0] == wxChar( '#' ) ) diff --git a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp index 1707e64e55..18e345f79d 100644 --- a/eeschema/netlist_exporters/netlist_exporter_pspice.cpp +++ b/eeschema/netlist_exporters/netlist_exporter_pspice.cpp @@ -348,7 +348,7 @@ bool NETLIST_EXPORTER_PSPICE::ProcessNetlist( unsigned aCtl ) if( fieldSeq ) { // Get the string containing the sequence of nodes: - const wxString nodeSeqIndexLineStr = fieldSeq->GetText(); + const wxString& nodeSeqIndexLineStr = fieldSeq->GetText(); // Verify field exists and is not empty: if( !nodeSeqIndexLineStr.IsEmpty() ) diff --git a/eeschema/project_rescue.cpp b/eeschema/project_rescue.cpp index bda0b762c6..68287a7fb9 100644 --- a/eeschema/project_rescue.cpp +++ b/eeschema/project_rescue.cpp @@ -367,7 +367,7 @@ void RESCUE_SYMBOL_LIB_TABLE_CANDIDATE::FindRescues( for( SCH_COMPONENT* each_component : *( aRescuer.GetComponents() ) ) { - LIB_ID part_id = each_component->GetLibId(); + const LIB_ID& part_id = each_component->GetLibId(); if( old_part_id != part_id ) { diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 215bf722d5..18bfa47946 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -830,7 +830,7 @@ void EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLib, const wxString* aLibName ) ) { wxString lib = aLibName ? *aLibName : m_lib_path; - wxString pkg = pack_ref; + const wxString& pkg = pack_ref; wxString emsg = wxString::Format( _( " name: \"%s\" duplicated in eagle : \"%s\"" ), diff --git a/pcbnew/load_select_footprint.cpp b/pcbnew/load_select_footprint.cpp index 8f9c30932b..bd249e94e8 100644 --- a/pcbnew/load_select_footprint.cpp +++ b/pcbnew/load_select_footprint.cpp @@ -385,7 +385,7 @@ MODULE* FOOTPRINT_EDIT_FRAME::SelectFootprintFromBoard( BOARD* aPcb ) bool FOOTPRINT_EDIT_FRAME::SaveLibraryAs( const wxString& aLibraryPath ) { - wxString curLibPath = aLibraryPath; + const wxString& curLibPath = aLibraryPath; wxString dstLibPath = CreateNewLibrary(); if( !dstLibPath ) diff --git a/pcbnew/router/pns_index.cpp b/pcbnew/router/pns_index.cpp index 0457696ede..a047c441f1 100644 --- a/pcbnew/router/pns_index.cpp +++ b/pcbnew/router/pns_index.cpp @@ -39,7 +39,7 @@ INDEX::ITEM_SHAPE_INDEX* INDEX::getSubindex( const ITEM* aItem ) { int idx_n = -1; - const LAYER_RANGE l = aItem->Layers(); + const LAYER_RANGE& l = aItem->Layers(); switch( aItem->Kind() ) { diff --git a/pcbnew/router/pns_index.h b/pcbnew/router/pns_index.h index 83970217fb..3fb7b13f67 100644 --- a/pcbnew/router/pns_index.h +++ b/pcbnew/router/pns_index.h @@ -177,7 +177,7 @@ int INDEX::Query( const ITEM* aItem, int aMinDistance, Visitor& aVisitor ) total += querySingle( SI_Multilayer, shape, aMinDistance, aVisitor ); - const LAYER_RANGE layers = aItem->Layers(); + const LAYER_RANGE& layers = aItem->Layers(); if( layers.IsMultilayer() ) { diff --git a/pcbnew/tools/zone_create_helper.cpp b/pcbnew/tools/zone_create_helper.cpp index 1408b329d9..d1b3ecba57 100644 --- a/pcbnew/tools/zone_create_helper.cpp +++ b/pcbnew/tools/zone_create_helper.cpp @@ -291,7 +291,7 @@ void ZONE_CREATE_HELPER::OnComplete( const POLYGON_GEOM_MANAGER& aMgr ) // 45 constraint if( aMgr.GetLeaderMode() == POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 ) { - auto pts = aMgr.GetLeaderLinePoints(); + const auto& pts = aMgr.GetLeaderLinePoints(); for( int i = 1; i < pts.PointCount(); i++ ) outline->Append( pts.CPoint( i ) ); } diff --git a/plugins/3d/oce/loadmodel.cpp b/plugins/3d/oce/loadmodel.cpp index 57755e305f..6bd7d8b529 100644 --- a/plugins/3d/oce/loadmodel.cpp +++ b/plugins/3d/oce/loadmodel.cpp @@ -580,7 +580,7 @@ bool processSolid( const TopoDS_Shape& shape, DATA& data, SGNODE* parent, TopoDS_Iterator it; IFSG_TRANSFORM childNode( parent ); SGNODE* pptr = childNode.GetRawPtr(); - TopLoc_Location loc = shape.Location(); + const TopLoc_Location& loc = shape.Location(); bool ret = false; if( !loc.IsIdentity() ) @@ -634,7 +634,7 @@ bool processComp( const TopoDS_Shape& shape, DATA& data, SGNODE* parent, TopoDS_Iterator it; IFSG_TRANSFORM childNode( parent ); SGNODE* pptr = childNode.GetRawPtr(); - TopLoc_Location loc = shape.Location(); + const TopLoc_Location& loc = shape.Location(); bool ret = false; if( !loc.IsIdentity() )