diff --git a/src/class_diagram/model/class_parent.h b/src/class_diagram/model/class_parent.h index 62b39029..d1afd485 100644 --- a/src/class_diagram/model/class_parent.h +++ b/src/class_diagram/model/class_parent.h @@ -41,9 +41,9 @@ public: common::model::access_t access() const; private: - clanguml::common::id_t id_; + clanguml::common::id_t id_{}; std::string name_; bool is_virtual_{false}; - common::model::access_t access_; + common::model::access_t access_{common::model::access_t::kPublic}; }; } // namespace clanguml::class_diagram::model diff --git a/src/common/model/diagram_element.cc b/src/common/model/diagram_element.cc index 8571ffeb..20f23a85 100644 --- a/src/common/model/diagram_element.cc +++ b/src/common/model/diagram_element.cc @@ -26,12 +26,7 @@ namespace clanguml::common::model { std::atomic_uint64_t diagram_element::m_nextId = 1; -diagram_element::diagram_element() - : id_{0} - , nested_{false} - , complete_{false} -{ -} +diagram_element::diagram_element() { } diagram_element::id_t diagram_element::id() const { return id_; } diff --git a/src/common/model/diagram_element.h b/src/common/model/diagram_element.h index 91806fe2..2553f87c 100644 --- a/src/common/model/diagram_element.h +++ b/src/common/model/diagram_element.h @@ -77,11 +77,11 @@ public: void complete(bool completed); private: - id_t id_; + id_t id_{0}; std::string name_; std::vector relationships_; - bool nested_; - bool complete_; + bool nested_{false}; + bool complete_{false}; static std::atomic_uint64_t m_nextId; }; diff --git a/src/common/model/source_location.h b/src/common/model/source_location.h index 89525c66..3bdae624 100644 --- a/src/common/model/source_location.h +++ b/src/common/model/source_location.h @@ -47,6 +47,6 @@ public: private: std::string file_; unsigned int line_{0}; - unsigned int hash_; + unsigned int hash_{0}; }; } // namespace clanguml::common::model \ No newline at end of file diff --git a/src/common/types.h b/src/common/types.h index 4cabddea..b0176495 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -31,10 +31,7 @@ template class optional_ref { public: using optional_type = T; - optional_ref() - : value_{nullptr} - { - } + optional_ref() { } optional_ref(T *value) { value_ = value; } @@ -112,7 +109,7 @@ public: T *get() const { return value_; } private: - T *value_; + T *value_{nullptr}; }; template diff --git a/src/config/config.h b/src/config/config.h index 8d34197a..72271190 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -79,7 +79,7 @@ struct filter { enum class hint_t { up, down, left, right }; struct layout_hint { - hint_t hint; + hint_t hint{hint_t::up}; std::string entity; }; @@ -166,7 +166,7 @@ struct diagram : public inheritable_diagram_options { struct source_location { enum class location_t { usr, marker, fileline, function }; - location_t location_type; + location_t location_type{location_t::function}; std::string location; }; diff --git a/src/sequence_diagram/model/participant.h b/src/sequence_diagram/model/participant.h index 630ffc09..e5b518a7 100644 --- a/src/sequence_diagram/model/participant.h +++ b/src/sequence_diagram/model/participant.h @@ -206,7 +206,7 @@ struct method : public function { std::string to_string() const override; private: - diagram_element::id_t class_id_; + diagram_element::id_t class_id_{}; std::string method_name_; std::string class_full_name_; }; diff --git a/src/sequence_diagram/visitor/call_expression_context.cc b/src/sequence_diagram/visitor/call_expression_context.cc index b82b4851..fbbb4e51 100644 --- a/src/sequence_diagram/visitor/call_expression_context.cc +++ b/src/sequence_diagram/visitor/call_expression_context.cc @@ -20,16 +20,7 @@ namespace clanguml::sequence_diagram::visitor { -call_expression_context::call_expression_context() - : current_class_decl_{nullptr} - , current_class_template_decl_{nullptr} - , current_class_template_specialization_decl_{nullptr} - , current_method_decl_{nullptr} - , current_function_decl_{nullptr} - , current_function_template_decl_{nullptr} - , current_caller_id_{0} -{ -} +call_expression_context::call_expression_context() { } void call_expression_context::reset() { diff --git a/src/sequence_diagram/visitor/call_expression_context.h b/src/sequence_diagram/visitor/call_expression_context.h index e124770e..6777b189 100644 --- a/src/sequence_diagram/visitor/call_expression_context.h +++ b/src/sequence_diagram/visitor/call_expression_context.h @@ -99,16 +99,16 @@ struct call_expression_context { bool is_expr_in_current_control_statement_condition( const clang::Stmt *stmt) const; - clang::CXXRecordDecl *current_class_decl_; - clang::ClassTemplateDecl *current_class_template_decl_; + clang::CXXRecordDecl *current_class_decl_{nullptr}; + clang::ClassTemplateDecl *current_class_template_decl_{nullptr}; clang::ClassTemplateSpecializationDecl - *current_class_template_specialization_decl_; - clang::CXXMethodDecl *current_method_decl_; - clang::FunctionDecl *current_function_decl_; - clang::FunctionTemplateDecl *current_function_template_decl_; + *current_class_template_specialization_decl_{nullptr}; + clang::CXXMethodDecl *current_method_decl_{nullptr}; + clang::FunctionDecl *current_function_decl_{nullptr}; + clang::FunctionTemplateDecl *current_function_template_decl_{nullptr}; private: - std::int64_t current_caller_id_; + std::int64_t current_caller_id_{0}; std::stack current_lambda_caller_id_; std::stack call_expr_stack_;