From 07c4689fb4209e0f06a77f346600e0fd768e3fb4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 8 May 2020 09:39:47 +0200 Subject: [PATCH] Remove declaration "using std::unique_ptr" in a header. Near useless, and it created swig warning --- pcbnew/class_board.h | 2 -- pcbnew/footprint_viewer_frame.cpp | 4 +-- .../import_gfx/graphics_importer_pcbnew.cpp | 26 +++++++++---------- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 4309f6d774..4f0ed3c9ad 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -40,8 +40,6 @@ #include -using std::unique_ptr; - class PCB_BASE_FRAME; class PCB_EDIT_FRAME; class PCBNEW_SETTINGS; diff --git a/pcbnew/footprint_viewer_frame.cpp b/pcbnew/footprint_viewer_frame.cpp index c3f7aa479c..5256b3674f 100644 --- a/pcbnew/footprint_viewer_frame.cpp +++ b/pcbnew/footprint_viewer_frame.cpp @@ -409,7 +409,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList() EDA_COMBINED_MATCHER matcher( term ); int matches, position; - for( const unique_ptr& footprint : fp_info_list->GetList() ) + for( const std::unique_ptr& footprint : fp_info_list->GetList() ) { wxString search = footprint->GetFootprintName() + " " + footprint->GetSearchText(); bool matched = matcher.Find( search.Lower(), matches, position ); @@ -423,7 +423,7 @@ void FOOTPRINT_VIEWER_FRAME::ReCreateFootprintList() } } - for( const unique_ptr& footprint : fp_info_list->GetList() ) + for( const std::unique_ptr& footprint : fp_info_list->GetList() ) { if( !excludes.count( footprint->GetFootprintName() ) ) m_fpList->Append( footprint->GetFootprintName() ); diff --git a/pcbnew/import_gfx/graphics_importer_pcbnew.cpp b/pcbnew/import_gfx/graphics_importer_pcbnew.cpp index f4192c7fcd..947126f979 100644 --- a/pcbnew/import_gfx/graphics_importer_pcbnew.cpp +++ b/pcbnew/import_gfx/graphics_importer_pcbnew.cpp @@ -61,7 +61,7 @@ int GRAPHICS_IMPORTER_PCBNEW::MapLineWidth( double aLineWidth ) void GRAPHICS_IMPORTER_PCBNEW::AddLine( const VECTOR2D& aOrigin, const VECTOR2D& aEnd, double aWidth ) { - unique_ptr line( createDrawing() ); + std::unique_ptr line( createDrawing() ); line->SetShape( S_SEGMENT ); line->SetLayer( GetLayer() ); line->SetWidth( MapLineWidth( aWidth ) ); @@ -77,7 +77,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddLine( const VECTOR2D& aOrigin, const VECTOR2D& void GRAPHICS_IMPORTER_PCBNEW::AddCircle( const VECTOR2D& aCenter, double aRadius, double aWidth ) { - unique_ptr circle( createDrawing() ); + std::unique_ptr circle( createDrawing() ); circle->SetShape( S_CIRCLE ); circle->SetLayer( GetLayer() ); circle->SetWidth( MapLineWidth( aWidth ) ); @@ -94,7 +94,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddCircle( const VECTOR2D& aCenter, double aRadiu void GRAPHICS_IMPORTER_PCBNEW::AddArc( const VECTOR2D& aCenter, const VECTOR2D& aStart, double aAngle, double aWidth ) { - unique_ptr arc( createDrawing() ); + std::unique_ptr arc( createDrawing() ); arc->SetShape( S_ARC ); arc->SetLayer( GetLayer() ); arc->SetWidth( MapLineWidth( aWidth ) ); @@ -117,7 +117,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddPolygon( const std::vector< VECTOR2D >& aVerti for( const VECTOR2D& precisePoint : aVertices ) convertedPoints.emplace_back( MapCoordinate( precisePoint ) ); - unique_ptr polygon( createDrawing() ); + std::unique_ptr polygon( createDrawing() ); polygon->SetShape( S_POLYGON ); polygon->SetLayer( GetLayer() ); polygon->SetPolyPoints( convertedPoints ); @@ -134,7 +134,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddText( const VECTOR2D& aOrigin, const wxString& double aHeight, double aWidth, double aThickness, double aOrientation, EDA_TEXT_HJUSTIFY_T aHJustify, EDA_TEXT_VJUSTIFY_T aVJustify ) { - unique_ptr boardItem; + std::unique_ptr boardItem; EDA_TEXT* textItem; tie( boardItem, textItem ) = createText(); boardItem->SetLayer( GetLayer() ); @@ -157,7 +157,7 @@ void GRAPHICS_IMPORTER_PCBNEW::AddText( const VECTOR2D& aOrigin, const wxString& void GRAPHICS_IMPORTER_PCBNEW::AddSpline( const VECTOR2D& aStart, const VECTOR2D& BezierControl1, const VECTOR2D& BezierControl2, const VECTOR2D& aEnd, double aWidth ) { - unique_ptr spline( createDrawing() ); + std::unique_ptr spline( createDrawing() ); spline->SetShape( S_CURVE ); spline->SetLayer( GetLayer() ); spline->SetWidth( MapLineWidth( aWidth ) ); @@ -174,27 +174,27 @@ void GRAPHICS_IMPORTER_PCBNEW::AddSpline( const VECTOR2D& aStart, const VECTOR2D } -unique_ptr GRAPHICS_IMPORTER_BOARD::createDrawing() +std::unique_ptr GRAPHICS_IMPORTER_BOARD::createDrawing() { return std::make_unique( m_board ); } -std::pair, EDA_TEXT*> GRAPHICS_IMPORTER_BOARD::createText() +std::pair, EDA_TEXT*> GRAPHICS_IMPORTER_BOARD::createText() { TEXTE_PCB* text = new TEXTE_PCB( m_board ); - return make_pair( unique_ptr( text ), static_cast( text ) ); + return make_pair( std::unique_ptr( text ), static_cast( text ) ); } -unique_ptr GRAPHICS_IMPORTER_MODULE::createDrawing() +std::unique_ptr GRAPHICS_IMPORTER_MODULE::createDrawing() { - return unique_ptr( new EDGE_MODULE( m_module ) ); + return std::unique_ptr( new EDGE_MODULE( m_module ) ); } -std::pair, EDA_TEXT*> GRAPHICS_IMPORTER_MODULE::createText() +std::pair, EDA_TEXT*> GRAPHICS_IMPORTER_MODULE::createText() { TEXTE_MODULE* text = new TEXTE_MODULE( m_module ); - return make_pair( unique_ptr( text ), static_cast( text ) ); + return make_pair( std::unique_ptr( text ), static_cast( text ) ); }