From da89a0cbd85364e47d1387a5be0cbb59624ec74d Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 28 Sep 2021 11:06:02 +0200 Subject: Use default/uniform initialization * ACE/ace/Map_Manager.h: * ACE/ace/Map_Manager.inl: * ACE/ace/Map_T.cpp: * ACE/ace/Map_T.h: * ACE/ace/Map_T.inl: * ACE/ace/Monitor_Control_Types.cpp: * ACE/ace/Monitor_Control_Types.h: * ACE/ace/Monitor_Point_Registry.cpp: * ACE/ace/Monitor_Point_Registry.h: * ACE/ace/Node.cpp: --- ACE/ace/Map_Manager.h | 14 +++++++------- ACE/ace/Map_Manager.inl | 16 ---------------- ACE/ace/Map_T.cpp | 22 ---------------------- ACE/ace/Map_T.h | 28 +++++++--------------------- ACE/ace/Map_T.inl | 11 ----------- ACE/ace/Monitor_Control_Types.cpp | 4 ---- ACE/ace/Monitor_Control_Types.h | 4 ++-- ACE/ace/Monitor_Point_Registry.cpp | 11 ----------- ACE/ace/Monitor_Point_Registry.h | 4 ++-- ACE/ace/Node.cpp | 3 --- 10 files changed, 18 insertions(+), 99 deletions(-) (limited to 'ACE/ace') diff --git a/ACE/ace/Map_Manager.h b/ACE/ace/Map_Manager.h index 80e2a3a62c6..99ef7f94021 100644 --- a/ACE/ace/Map_Manager.h +++ b/ACE/ace/Map_Manager.h @@ -38,17 +38,17 @@ class ACE_Map_Entry { public: /// Initialize member variables. - ACE_Map_Entry (); + ACE_Map_Entry () = default; /// We need this destructor to keep some compilers from complaining. /// It's just a no-op, however. - ~ACE_Map_Entry (); + ~ACE_Map_Entry () = default; /// Key used to look up an entry. - EXT_ID ext_id_; + EXT_ID ext_id_ {}; /// The contents of the entry itself. - INT_ID int_id_; + INT_ID int_id_ {}; /// Dump the state of an object. void dump () const; @@ -72,15 +72,15 @@ public: void prev (ACE_UINT32 p); /// Keeps track of the next entry. - ACE_UINT32 next_; + ACE_UINT32 next_ {}; /// Keeps track of the previous entry. - ACE_UINT32 prev_; + ACE_UINT32 prev_ {}; #if defined (ACE_HAS_LAZY_MAP_MANAGER) /// Is this entry free? - bool free_; + bool free_ {true}; #endif /* ACE_HAS_LAZY_MAP_MANAGER */ }; diff --git a/ACE/ace/Map_Manager.inl b/ACE/ace/Map_Manager.inl index 5ef512b49ed..898dbe9f91f 100644 --- a/ACE/ace/Map_Manager.inl +++ b/ACE/ace/Map_Manager.inl @@ -4,22 +4,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template ACE_INLINE -ACE_Map_Entry::ACE_Map_Entry () - : next_ (0), - prev_ (0) -#if defined (ACE_HAS_LAZY_MAP_MANAGER) - , free_ (1) -#endif /* ACE_HAS_LAZY_MAP_MANAGER */ -{ -} - -template ACE_INLINE -ACE_Map_Entry::~ACE_Map_Entry () -{ - // No-op just to keep some compilers happy... -} - template ACE_INLINE ACE_UINT32 ACE_Map_Entry::next () const { diff --git a/ACE/ace/Map_T.cpp b/ACE/ace/Map_T.cpp index 6ebb44e61dd..064682ca78b 100644 --- a/ACE/ace/Map_T.cpp +++ b/ACE/ace/Map_T.cpp @@ -13,27 +13,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -template -ACE_Map::~ACE_Map () -{ -} - -template -ACE_Iterator_Impl::~ACE_Iterator_Impl () -{ -} - -template -ACE_Reverse_Iterator_Impl::~ACE_Reverse_Iterator_Impl () -{ -} - -template -ACE_Map_Impl_Iterator_Adapter::~ACE_Map_Impl_Iterator_Adapter () -{ -} - - template ACE_Iterator_Impl * ACE_Map_Impl_Iterator_Adapter::clone () const { @@ -88,7 +67,6 @@ ACE_Map_Impl_Reverse_Iterator_Adapter::clone () const return temp; } - template int ACE_Map_Impl_Reverse_Iterator_Adapter::compare (const ACE_Reverse_Iterator_Impl &rhs) const { diff --git a/ACE/ace/Map_T.h b/ACE/ace/Map_T.h index 876dda9ce03..bfe52db6a4d 100644 --- a/ACE/ace/Map_T.h +++ b/ACE/ace/Map_T.h @@ -54,9 +54,8 @@ template class ACE_Incremental_Key_Generator { public: - /// Constructor. - ACE_Incremental_Key_Generator (); + ACE_Incremental_Key_Generator () = default; /// Functor method: generates a new key. int operator () (T &t); @@ -65,9 +64,8 @@ public: const T& current_value () const; protected: - /// Current value. - T t_; + T t_ {}; }; /** @@ -81,9 +79,8 @@ template class ACE_Iterator_Impl { public: - /// Destructor. - virtual ~ACE_Iterator_Impl (); + virtual ~ACE_Iterator_Impl () = default; /// Clone. virtual ACE_Iterator_Impl *clone () const = 0; @@ -112,9 +109,8 @@ template class ACE_Reverse_Iterator_Impl { public: - /// Destructor. - virtual ~ACE_Reverse_Iterator_Impl (); + virtual ~ACE_Reverse_Iterator_Impl () = default; /// Clone. virtual ACE_Reverse_Iterator_Impl *clone () const = 0; @@ -143,7 +139,6 @@ template class ACE_Iterator { public: - // = Traits. typedef T value_type; typedef ACE_Iterator_Impl implementation; @@ -183,7 +178,6 @@ public: ACE_Iterator_Impl &impl (); protected: - /// Implementation pointer. ACE_Iterator_Impl *implementation_; }; @@ -199,7 +193,6 @@ template class ACE_Reverse_Iterator { public: - // = Traits. typedef T value_type; typedef ACE_Reverse_Iterator_Impl implementation; @@ -245,7 +238,6 @@ public: ACE_Reverse_Iterator_Impl &impl (); protected: - /// Implementation pointer. ACE_Reverse_Iterator_Impl *implementation_; }; @@ -261,7 +253,6 @@ template class ACE_Map { public: - // = Traits. typedef KEY key_type; @@ -279,7 +270,7 @@ public: reverse_iterator_implementation; /// Close down and release dynamically allocated resources. - virtual ~ACE_Map (); + virtual ~ACE_Map () = default; /// Initialize a map with size @a length. virtual int open (size_t length = ACE_DEFAULT_MAP_SIZE, @@ -423,9 +414,8 @@ public: reverse_iterator rend (); protected: - // = Protected no-op constructor. - ACE_Map (); + ACE_Map () = default; /// Return forward iterator. virtual ACE_Iterator_Impl > *begin_impl () = 0; @@ -452,7 +442,6 @@ template class ACE_Map_Impl_Iterator_Adapter : public ACE_Iterator_Impl { public: - // = Traits. typedef IMPLEMENTATION implementation; @@ -461,7 +450,7 @@ public: ACE_Map_Impl_Iterator_Adapter (const IMPLEMENTATION &impl); /// Destructor. - virtual ~ACE_Map_Impl_Iterator_Adapter (); + virtual ~ACE_Map_Impl_Iterator_Adapter () = default; /// Clone. virtual ACE_Iterator_Impl *clone () const; @@ -482,7 +471,6 @@ public: IMPLEMENTATION &impl (); protected: - /// All implementation details are forwarded to this class. IMPLEMENTATION implementation_; }; @@ -498,7 +486,6 @@ template class ACE_Map_Impl_Reverse_Iterator_Adapter : public ACE_Reverse_Iterator_Impl { public: - // = Traits. typedef IMPLEMENTATION implementation; @@ -528,7 +515,6 @@ public: IMPLEMENTATION &impl (); protected: - /// All implementation details are forwarded to this class. IMPLEMENTATION implementation_; }; diff --git a/ACE/ace/Map_T.inl b/ACE/ace/Map_T.inl index 076819c4d2c..5400cfdde88 100644 --- a/ACE/ace/Map_T.inl +++ b/ACE/ace/Map_T.inl @@ -7,12 +7,6 @@ ACE_Noop_Key_Generator::operator() (T &) return -1; } -template ACE_INLINE -ACE_Incremental_Key_Generator::ACE_Incremental_Key_Generator () - : t_ (0) -{ -} - template ACE_INLINE int ACE_Incremental_Key_Generator::operator() (T &t) { @@ -186,11 +180,6 @@ ACE_Reverse_Iterator::impl () return *this->implementation_; } -template ACE_INLINE -ACE_Map::ACE_Map () -{ -} - template ACE_INLINE ACE_Iterator > ACE_Map::begin () { diff --git a/ACE/ace/Monitor_Control_Types.cpp b/ACE/ace/Monitor_Control_Types.cpp index f5679829841..6b3227e1e45 100644 --- a/ACE/ace/Monitor_Control_Types.cpp +++ b/ACE/ace/Monitor_Control_Types.cpp @@ -26,10 +26,6 @@ namespace ACE //============================================================= - Monitor_Control_Types::Constraint::Constraint () - : control_action (0) - {} - Monitor_Control_Types::Constraint::Constraint (const Constraint& rhs) : expr (rhs.expr), control_action (rhs.control_action) diff --git a/ACE/ace/Monitor_Control_Types.h b/ACE/ace/Monitor_Control_Types.h index 4c7b66f194b..b8ecfda8101 100644 --- a/ACE/ace/Monitor_Control_Types.h +++ b/ACE/ace/Monitor_Control_Types.h @@ -74,7 +74,7 @@ namespace ACE */ struct ACE_Export Constraint { - Constraint (); + Constraint () = default; ~Constraint (); /// Implemented explicitly so reference counting of control @@ -83,7 +83,7 @@ namespace ACE Constraint& operator= (const Constraint& rhs); ACE_CString expr; - Control_Action* control_action; + Control_Action* control_action {}; }; /** diff --git a/ACE/ace/Monitor_Point_Registry.cpp b/ACE/ace/Monitor_Point_Registry.cpp index 05f13aae1d7..b448ab77e89 100644 --- a/ACE/ace/Monitor_Point_Registry.cpp +++ b/ACE/ace/Monitor_Point_Registry.cpp @@ -18,11 +18,6 @@ namespace ACE ACE_Singleton::instance (); } - Monitor_Point_Registry::Monitor_Point_Registry () - : constraint_id_ (0) - { - } - bool Monitor_Point_Registry::add (Monitor_Base* type) { @@ -41,9 +36,6 @@ namespace ACE type->add_ref (); status = this->map_.bind (type->name (), type); - - /// Temporary debugging code. -// ACELIB_DEBUG ((LM_DEBUG, "adding %s\n", type->name ())); } if (status == -1) @@ -74,9 +66,6 @@ namespace ACE ACE_CString name_str (name, 0, false); status = this->map_.unbind (name_str, mp); - - /// Temporary debugging code. -// ACELIB_DEBUG ((LM_DEBUG, "removing %s\n", name_str.c_str ())); } if (status == -1) diff --git a/ACE/ace/Monitor_Point_Registry.h b/ACE/ace/Monitor_Point_Registry.h index e6cf87129f6..921804b8071 100644 --- a/ACE/ace/Monitor_Point_Registry.h +++ b/ACE/ace/Monitor_Point_Registry.h @@ -72,7 +72,7 @@ namespace ACE private: /// Prevent that users can make an instance. - Monitor_Point_Registry (); + Monitor_Point_Registry () = default; /// Underlying container for the registry. typedef ACE_Hash_Map_Manager::ACE_Node (const T &i, ACE_Node *n) : next_ (n), item_ (i) { - // ACE_TRACE ("ACE_Node::ACE_Node"); } template ACE_Node::ACE_Node (ACE_Node *n, int) : next_ (n) { - // ACE_TRACE ("ACE_Node::ACE_Node"); } template @@ -35,7 +33,6 @@ ACE_Node::ACE_Node (const ACE_Node &s) : next_ (s.next_), item_ (s.item_) { - // ACE_TRACE ("ACE_Node::ACE_Node"); } ACE_END_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1