diff --git a/common/font/fontconfig.cpp b/common/font/fontconfig.cpp index 46f06bc665..f27f344585 100644 --- a/common/font/fontconfig.cpp +++ b/common/font/fontconfig.cpp @@ -366,7 +366,7 @@ void FONTCONFIG::ListFonts( std::vector& aFonts, const std::string& std::string theFile( reinterpret_cast( file ) ); std::string theStyle( reinterpret_cast( style ) ); - FONTINFO fontInfo( theFile, theStyle, theFamily ); + FONTINFO fontInfo( std::move( theFile ), std::move( theStyle ), theFamily ); if( theFamily.length() > 0 && theFamily.front() == '.' ) continue; diff --git a/common/project/net_settings.cpp b/common/project/net_settings.cpp index 08bb0bf219..22161221cf 100644 --- a/common/project/net_settings.cpp +++ b/common/project/net_settings.cpp @@ -205,7 +205,7 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) : for( const auto& [ netname, color ] : m_NetColorAssignments ) { std::string key( netname.ToUTF8() ); - ret[key] = color; + ret[ std::move( key ) ] = color; } return ret; @@ -220,7 +220,7 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) : for( const auto& pair : aJson.items() ) { wxString key( pair.key().c_str(), wxConvUTF8 ); - m_NetColorAssignments[key] = pair.value().get(); + m_NetColorAssignments[ std::move( key ) ] = pair.value().get(); } }, {} ) ); @@ -233,7 +233,7 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) : for( const auto& [ netname, netclassName ] : m_NetClassLabelAssignments ) { std::string key( netname.ToUTF8() ); - ret[key] = netclassName; + ret[ std::move( key ) ] = netclassName; } return ret; @@ -248,7 +248,7 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) : for( const auto& pair : aJson.items() ) { wxString key( pair.key().c_str(), wxConvUTF8 ); - m_NetClassLabelAssignments[key] = pair.value().get(); + m_NetClassLabelAssignments[ std::move( key ) ] = pair.value().get(); } }, {} ) ); @@ -265,7 +265,7 @@ NET_SETTINGS::NET_SETTINGS( JSON_SETTINGS* aParent, const std::string& aPath ) : { "netclass", netclassName.ToUTF8() } }; - ret.push_back( pattern_json ); + ret.push_back( std::move( pattern_json ) ); } return ret; diff --git a/common/rc_item.cpp b/common/rc_item.cpp index fb0abade0f..637f8fe1d4 100644 --- a/common/rc_item.cpp +++ b/common/rc_item.cpp @@ -274,7 +274,7 @@ void RC_TREE_MODEL::rebuildModel( std::shared_ptr aProvider, BeforeReset(); - m_rcItemsProvider = aProvider; + m_rcItemsProvider = std::move( aProvider ); if( aSeverities != m_severities ) m_severities = aSeverities; diff --git a/common/settings/json_settings.cpp b/common/settings/json_settings.cpp index 67b9f4293a..5bbec1d405 100644 --- a/common/settings/json_settings.cpp +++ b/common/settings/json_settings.cpp @@ -874,7 +874,7 @@ template ResultType JSON_SETTINGS::fetchOrDefault( const nlohmann::json& aJson, const std::string& aKey, ResultType aDefault ) { - ResultType ret = aDefault; + ResultType ret = std::move( aDefault ); try { diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index e397d5301d..a77230eeec 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -807,9 +807,9 @@ bool TOOL_MANAGER::dispatchInternal( TOOL_EVENT& aEvent ) // and transfer the previous view control settings to the new context if( st->cofunc ) { - auto vc = st->vcSettings; + KIGFX::VC_SETTINGS viewControlSettings = st->vcSettings; st->Push(); - st->vcSettings = vc; + st->vcSettings = std::move( viewControlSettings ); } st->cofunc = new COROUTINE( std::move( func_copy ) ); diff --git a/eeschema/eeschema_settings.cpp b/eeschema/eeschema_settings.cpp index 8014d69f2b..5771666064 100644 --- a/eeschema/eeschema_settings.cpp +++ b/eeschema/eeschema_settings.cpp @@ -770,7 +770,7 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) try { - js[key_utf] = value; + js[ std::move( key_utf ) ] = value; } catch(...) { @@ -791,7 +791,7 @@ bool EESCHEMA_SETTINGS::MigrateFromLegacy( wxConfigBase* aCfg ) try { - js[key_utf] = value; + js[ std::move( key_utf ) ] = value; } catch(...) { diff --git a/include/callback_gal.h b/include/callback_gal.h index 86fec65056..02839e12ae 100644 --- a/include/callback_gal.h +++ b/include/callback_gal.h @@ -53,7 +53,7 @@ public: { m_strokeCallback = std::move( aStrokeCallback ); m_triangleCallback = []( const VECTOR2I&, const VECTOR2I&, const VECTOR2I& ) {}; - m_outlineCallback = std::move( aOutlineCallback; + m_outlineCallback = std::move( aOutlineCallback ); m_stroke = true; m_triangulate = false; } diff --git a/include/rc_item.h b/include/rc_item.h index f5ad57720d..3ddaf087e3 100644 --- a/include/rc_item.h +++ b/include/rc_item.h @@ -86,14 +86,14 @@ public: { } - RC_ITEM( std::shared_ptr aItem ) + RC_ITEM( const std::shared_ptr& aItem ) { m_errorCode = aItem->m_errorCode; m_errorMessage = aItem->m_errorMessage; m_errorTitle = aItem->m_errorTitle; m_settingsKey = aItem->m_settingsKey; m_parent = aItem->m_parent; - m_ids = aItem->m_ids; + m_ids = aItem->m_ids; } virtual ~RC_ITEM() { } @@ -195,7 +195,7 @@ class RC_TREE_NODE public: enum NODE_TYPE { MARKER, MAIN_ITEM, AUX_ITEM, AUX_ITEM2, AUX_ITEM3 }; - RC_TREE_NODE( RC_TREE_NODE* aParent, std::shared_ptr aRcItem, NODE_TYPE aType ) : + RC_TREE_NODE( RC_TREE_NODE* aParent, const std::shared_ptr& aRcItem, NODE_TYPE aType ) : m_Type( aType ), m_RcItem( aRcItem ), m_Parent( aParent ) diff --git a/include/settings/parameters.h b/include/settings/parameters.h index 822d567066..b33cb97a63 100644 --- a/include/settings/parameters.h +++ b/include/settings/parameters.h @@ -90,17 +90,17 @@ public: m_max(), m_use_minmax( false ), m_ptr( aPtr ), - m_default( aDefault ) + m_default( std::move( aDefault ) ) { } PARAM( const std::string& aJsonPath, ValueType* aPtr, ValueType aDefault, ValueType aMin, ValueType aMax, bool aReadOnly = false ) : PARAM_BASE( aJsonPath, aReadOnly ), - m_min( aMin ), - m_max( aMax ), + m_min( std::move( aMin ) ), + m_max( std::move( aMax ) ), m_use_minmax( true ), m_ptr( aPtr ), - m_default( aDefault ) + m_default( std::move( aDefault ) ) { } void Load( JSON_SETTINGS* aSettings, bool aResetIfMissing = true ) const override diff --git a/include/tool/conditional_menu.h b/include/tool/conditional_menu.h index 0fa39f4c07..9025898b50 100644 --- a/include/tool/conditional_menu.h +++ b/include/tool/conditional_menu.h @@ -126,7 +126,7 @@ private: bool aCheckmark ) : m_type( ACTION ), m_icon( static_cast( 0 ) ), - m_condition( aCondition ), + m_condition( std::move( aCondition ) ), m_order( aOrder ), m_isCheckmarkEntry( aCheckmark ) { @@ -136,7 +136,7 @@ private: ENTRY( ACTION_MENU* aMenu, SELECTION_CONDITION aCondition, int aOrder ) : m_type( MENU ), m_icon( static_cast( 0 ) ), - m_condition( aCondition ), + m_condition( std::move( aCondition ) ), m_order( aOrder ), m_isCheckmarkEntry( false ) { @@ -147,7 +147,7 @@ private: SELECTION_CONDITION aCondition, int aOrder, bool aCheckmark ) : m_type( WXITEM ), m_icon( aBitmap ), - m_condition( aCondition ), + m_condition( std::move( aCondition ) ), m_order( aOrder ), m_isCheckmarkEntry( aCheckmark ) { @@ -160,7 +160,7 @@ private: m_type( SEPARATOR ), m_icon( static_cast( 0 ) ), m_data(), - m_condition( aCondition ), + m_condition( std::move( aCondition ) ), m_order( aOrder ), m_isCheckmarkEntry( false ) { diff --git a/pcbnew/undo_redo.cpp b/pcbnew/undo_redo.cpp index 7b21f3f446..7998bc0d0e 100644 --- a/pcbnew/undo_redo.cpp +++ b/pcbnew/undo_redo.cpp @@ -471,7 +471,7 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList ) DS_PROXY_UNDO_ITEM alt_item( this ); DS_PROXY_UNDO_ITEM* item = static_cast( eda_item ); item->Restore( this ); - *item = alt_item; + *item = std::move( alt_item ); break; }