From ae9662c5cd2184b3c86188231fb7e5fc47b4adea Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 18 May 2020 21:29:59 +0100 Subject: [PATCH] Fix some unitialized variables. Fixes https://gitlab.com/kicad/code/kicad/issues/4477 Fixes https://gitlab.com/kicad/code/kicad/issues/4473 --- pcbnew/drc/drc_clearance_test_functions.cpp | 2 +- pcbnew/drc/drc_rule.h | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pcbnew/drc/drc_clearance_test_functions.cpp b/pcbnew/drc/drc_clearance_test_functions.cpp index e0b80ddd1d..348080ad4c 100644 --- a/pcbnew/drc/drc_clearance_test_functions.cpp +++ b/pcbnew/drc/drc_clearance_test_functions.cpp @@ -162,7 +162,7 @@ void DRC::doTrackDrc( BOARD_COMMIT& aCommit, TRACK* aRefSeg, TRACKS::iterator aS { VIA *refvia = static_cast( aRefSeg ); int viaAnnulus = ( refvia->GetWidth() - refvia->GetDrill() ) / 2; - int minAnnulus; + int minAnnulus = 0; for( DRC_SELECTOR* selector : matched ) { diff --git a/pcbnew/drc/drc_rule.h b/pcbnew/drc/drc_rule.h index ca16bc2b98..cbc73d79b1 100644 --- a/pcbnew/drc/drc_rule.h +++ b/pcbnew/drc/drc_rule.h @@ -34,6 +34,14 @@ class BOARD_ITEM; class DRC_RULE { +public: + DRC_RULE() : + m_Clearance( 0 ), + m_AnnulusWidth( 0 ), + m_TrackWidth( 0 ), + m_Hole( 0 ) + { } + public: wxString m_Name; @@ -49,6 +57,11 @@ public: class DRC_SELECTOR { +public: + DRC_SELECTOR() : + m_Priority( 1 ) + { } + public: std::vector m_MatchNetclasses; std::vector m_MatchTypes; @@ -57,8 +70,6 @@ public: int m_Priority; // 0 indicates automatic priority generation DRC_RULE* m_Rule; - -public: };