From 94bd1c60256af415d5aec2078493a5d7d9811ccf Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 12 May 2023 17:57:03 +0200 Subject: [PATCH] Fix a few Coverity warnings. --- 3d-viewer/3d_navlib/nl_3d_viewer_plugin.cpp | 2 ++ 3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp | 5 ++++- eeschema/connection_graph.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/3d-viewer/3d_navlib/nl_3d_viewer_plugin.cpp b/3d-viewer/3d_navlib/nl_3d_viewer_plugin.cpp index b178df0513..aa0228b03b 100644 --- a/3d-viewer/3d_navlib/nl_3d_viewer_plugin.cpp +++ b/3d-viewer/3d_navlib/nl_3d_viewer_plugin.cpp @@ -27,6 +27,8 @@ NL_3D_VIEWER_PLUGIN::NL_3D_VIEWER_PLUGIN( EDA_3D_CANVAS* aViewport ) { if( ADVANCED_CFG::GetCfg().m_Use3DConnexionDriver ) m_impl = new NL_3D_VIEWER_PLUGIN_IMPL( aViewport ); + else + m_impl = nullptr; } diff --git a/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp b/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp index 559b0253b8..51816af0c3 100644 --- a/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp +++ b/3d-viewer/3d_navlib/nl_3d_viewer_plugin_impl.cpp @@ -73,7 +73,10 @@ bool equals( glm::mat const& aFirst, glm::mat const& aSe NL_3D_VIEWER_PLUGIN_IMPL::NL_3D_VIEWER_PLUGIN_IMPL( EDA_3D_CANVAS* aCanvas ) : - NAV_3D( false, false ), m_canvas( aCanvas ), m_capIsMoving( false ) + NAV_3D( false, false ), + m_canvas( aCanvas ), + m_capIsMoving( false ), + m_newWidth( 0.0 ) { m_camera = dynamic_cast( m_canvas->GetCamera() ); diff --git a/eeschema/connection_graph.cpp b/eeschema/connection_graph.cpp index c785ecd8fe..656f2ef2f7 100644 --- a/eeschema/connection_graph.cpp +++ b/eeschema/connection_graph.cpp @@ -763,7 +763,7 @@ void CONNECTION_GRAPH::removeSubgraphs( std::set& aSubgrap m_subgraphs.erase( it ); } - for( auto el : m_sheet_to_subgraphs_map ) + for( auto& el : m_sheet_to_subgraphs_map ) { auto it = std::lower_bound( el.second.begin(), el.second.end(), sg );