From a53f3899d4a30cfbb099040b8cdd6465679f3ab0 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 16 Sep 2020 11:27:46 +0100 Subject: [PATCH] Initialize variables properly --- common/settings/common_settings.cpp | 1 + common/widgets/paged_dialog.cpp | 4 +++- include/lib_table_base.h | 8 +++++--- pcbnew/drc/drc_test_provider_misc.cpp | 3 ++- pcbnew/tools/point_editor.cpp | 3 ++- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/common/settings/common_settings.cpp b/common/settings/common_settings.cpp index 27c33c4bc5..f81c4ce6c3 100644 --- a/common/settings/common_settings.cpp +++ b/common/settings/common_settings.cpp @@ -41,6 +41,7 @@ COMMON_SETTINGS::COMMON_SETTINGS() : m_Env(), m_Input(), m_Graphics(), + m_Session(), m_System() { // This only effect the first time KiCad is run. The user's setting will be used for all diff --git a/common/widgets/paged_dialog.cpp b/common/widgets/paged_dialog.cpp index e7b40e1666..9f2f75fc41 100644 --- a/common/widgets/paged_dialog.cpp +++ b/common/widgets/paged_dialog.cpp @@ -41,11 +41,13 @@ PAGED_DIALOG::PAGED_DIALOG( wxWindow* aParent, const wxString& aTitle, bool aUse DIALOG_SHIM( aParent, wxID_ANY, aTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ), m_title( aTitle ), + m_dirty( false ), m_errorCtrl( nullptr ), m_errorRow( 0 ), m_errorCol( 0 ), m_auxiliaryButton( nullptr ), - m_resetButton( nullptr ) + m_resetButton( nullptr ), + m_cancelButton( nullptr ) { auto mainSizer = new wxBoxSizer( wxVERTICAL ); SetSizer( mainSizer ); diff --git a/include/lib_table_base.h b/include/lib_table_base.h index d1fce8bda5..6914845fb0 100644 --- a/include/lib_table_base.h +++ b/include/lib_table_base.h @@ -65,7 +65,9 @@ LIB_TABLE_ROW* new_clone( const LIB_TABLE_ROW& aRow ); class LIB_TABLE_ROW : boost::noncopyable { public: - LIB_TABLE_ROW() + LIB_TABLE_ROW() : + enabled( true ), + m_loaded( false ) { } @@ -220,8 +222,8 @@ private: wxString options; wxString description; - bool enabled = true; ///< Whether the LIB_TABLE_ROW is enabled - bool m_loaded; ///< Whether the LIB_TABLE_ROW is loaded + bool enabled = true; ///< Whether the LIB_TABLE_ROW is enabled + bool m_loaded = false; ///< Whether the LIB_TABLE_ROW is loaded std::unique_ptr< PROPERTIES > properties; }; diff --git a/pcbnew/drc/drc_test_provider_misc.cpp b/pcbnew/drc/drc_test_provider_misc.cpp index 62d7eb811f..7bce913af7 100644 --- a/pcbnew/drc/drc_test_provider_misc.cpp +++ b/pcbnew/drc/drc_test_provider_misc.cpp @@ -44,7 +44,8 @@ class DRC_TEST_PROVIDER_MISC : public DRC_TEST_PROVIDER { public: - DRC_TEST_PROVIDER_MISC() + DRC_TEST_PROVIDER_MISC() : + m_board( nullptr ) { m_isRuleDriven = false; } diff --git a/pcbnew/tools/point_editor.cpp b/pcbnew/tools/point_editor.cpp index ea8c561d48..629fcf4e5f 100644 --- a/pcbnew/tools/point_editor.cpp +++ b/pcbnew/tools/point_editor.cpp @@ -306,7 +306,8 @@ POINT_EDITOR::POINT_EDITOR() : m_editedPoint( NULL ), m_original( VECTOR2I( 0, 0 ) ), m_altConstrainer( VECTOR2I( 0, 0 ) ), - m_refill( false ) + m_refill( false ), + m_altEditMethod( false ) { }