From 6bd3b0afa426070f321e7da06eb5f346bfba859c Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Tue, 27 Oct 2020 00:25:08 +0000 Subject: [PATCH] Various Coverity fixes --- 3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp | 1 + cvpcb/cvpcb_settings.cpp | 12 +++++++----- eeschema/sch_connection.cpp | 2 ++ .../cadstar/cadstar_sch_archive_loader.cpp | 2 +- .../sch_plugins/cadstar/cadstar_sch_archive_loader.h | 2 +- qa/qa_utils/mocks.cpp | 3 ++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp index 05cb90656f..780617a731 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/ray.cpp @@ -44,6 +44,7 @@ void RAY::Init( const SFVEC3F& o, const SFVEC3F& d ) m_Dir = d; m_InvDir = 1.0f / d; + rayID = 0; // Not used, just set to 0 //rayID = gs_next_rayID; //gs_next_rayID++; diff --git a/cvpcb/cvpcb_settings.cpp b/cvpcb/cvpcb_settings.cpp index 1e04658244..7d549f82db 100644 --- a/cvpcb/cvpcb_settings.cpp +++ b/cvpcb/cvpcb_settings.cpp @@ -29,11 +29,13 @@ ///! Update the schema version whenever a migration is required const int cvpcbSchemaVersion = 0; -CVPCB_SETTINGS::CVPCB_SETTINGS() - : APP_SETTINGS_BASE( "cvpcb", cvpcbSchemaVersion ), - m_FootprintViewerAutoZoom( false ), - m_FootprintViewerZoom( 1.0 ), - m_FilterFootprint( 0 ) +CVPCB_SETTINGS::CVPCB_SETTINGS() : + APP_SETTINGS_BASE( "cvpcb", cvpcbSchemaVersion ), + m_FootprintViewerAutoZoom( false ), + m_FootprintViewerZoom( 1.0 ), + m_FilterFootprint( 0 ), + m_LibrariesWidth( 0 ), + m_FootprintsWidth( 0 ) { // We always snap and don't let the user configure it m_FootprintViewerMagneticSettings.pads = MAGNETIC_OPTIONS::CAPTURE_ALWAYS; diff --git a/eeschema/sch_connection.cpp b/eeschema/sch_connection.cpp index 7a51ab3794..510bde3d02 100644 --- a/eeschema/sch_connection.cpp +++ b/eeschema/sch_connection.cpp @@ -62,6 +62,7 @@ SCH_CONNECTION::SCH_CONNECTION( SCH_ITEM* aParent, SCH_SHEET_PATH aPath ) : m_sheet( aPath ), m_parent( aParent ), + m_driver( nullptr ), m_graph( nullptr ) { Reset(); @@ -71,6 +72,7 @@ SCH_CONNECTION::SCH_CONNECTION( SCH_ITEM* aParent, SCH_SHEET_PATH aPath ) : SCH_CONNECTION::SCH_CONNECTION( CONNECTION_GRAPH* aGraph ) : m_sheet( SCH_SHEET_PATH() ), m_parent( nullptr ), + m_driver( nullptr ), m_graph( aGraph ) { Reset(); diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index 23bb0d1297..0118634b91 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -44,7 +44,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::Load( ::SCHEMATIC* aSchematic, ::SCH_SHEET* aRootSheet, - SCH_PLUGIN::SCH_PLUGIN_RELEASER* aSchPlugin, wxFileName aLibraryFileName ) + SCH_PLUGIN::SCH_PLUGIN_RELEASER* aSchPlugin, const wxFileName& aLibraryFileName ) { Parse(); diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h index a04d7e19c2..4af878f51b 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.h @@ -70,7 +70,7 @@ public: * @param aRootSheet Root sheet to add the design onto */ void Load( ::SCHEMATIC* aSchematic, ::SCH_SHEET* aRootSheet, - SCH_PLUGIN::SCH_PLUGIN_RELEASER* aSchPlugin, wxFileName aLibraryFileName ); + SCH_PLUGIN::SCH_PLUGIN_RELEASER* aSchPlugin, const wxFileName& aLibraryFileName ); private: diff --git a/qa/qa_utils/mocks.cpp b/qa/qa_utils/mocks.cpp index 263b6fd28e..4de2669cfb 100644 --- a/qa/qa_utils/mocks.cpp +++ b/qa/qa_utils/mocks.cpp @@ -317,7 +317,8 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxSt m_mainToolBar( nullptr ), m_canvas( nullptr ), m_currentCamera( m_trackBallCamera ), - m_trackBallCamera( RANGE_SCALE_3D ) + m_trackBallCamera( RANGE_SCALE_3D ), + m_disable_ray_tracing( true ) { }