From 5e5259b59c6377ebb75f95538b92825d036fbd21 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Sat, 11 Mar 2017 19:22:42 -0500 Subject: [PATCH] CMP_TREE_MODEL*: fix uninitialized members Coverity CID 157141 Coverity CID 157136 --- eeschema/cmp_tree_model.cpp | 1 + eeschema/cmp_tree_model.h | 2 +- eeschema/cmp_tree_model_adapter.cpp | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/eeschema/cmp_tree_model.cpp b/eeschema/cmp_tree_model.cpp index 7c85b60063..f8d7ef025f 100644 --- a/eeschema/cmp_tree_model.cpp +++ b/eeschema/cmp_tree_model.cpp @@ -104,6 +104,7 @@ int CMP_TREE_NODE::Compare( CMP_TREE_NODE const& aNode1, CMP_TREE_NODE const& aN CMP_TREE_NODE::CMP_TREE_NODE() : Parent( nullptr ), + Type( INVALID ), IntrinsicRank( 0 ), Score( kLowestDefaultScore ), Alias( nullptr ), diff --git a/eeschema/cmp_tree_model.h b/eeschema/cmp_tree_model.h index 03b06a1020..3ffcc012f0 100644 --- a/eeschema/cmp_tree_model.h +++ b/eeschema/cmp_tree_model.h @@ -76,7 +76,7 @@ class LIB_ALIAS; class CMP_TREE_NODE { public: enum TYPE { - ROOT, LIB, ALIAS, UNIT + ROOT, LIB, ALIAS, UNIT, INVALID }; CMP_TREE_NODE* Parent; ///< Parent node or null diff --git a/eeschema/cmp_tree_model_adapter.cpp b/eeschema/cmp_tree_model_adapter.cpp index d8adb4f27f..21c80d3e78 100644 --- a/eeschema/cmp_tree_model_adapter.cpp +++ b/eeschema/cmp_tree_model_adapter.cpp @@ -82,7 +82,10 @@ CMP_TREE_MODEL_ADAPTER::CMP_TREE_MODEL_ADAPTER( PART_LIBS* aLibs ) :m_filter( CMP_FILTER_NONE ), m_show_units( true ), m_libs( aLibs ), - m_preselect_unit( 0 ) + m_preselect_unit( 0 ), + m_col_part( nullptr ), + m_col_desc( nullptr ), + m_widget( nullptr ) {}