From f4f210cf797d6d2dd4d42b480e646276f339f536 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 9 Nov 2021 16:12:02 +0100 Subject: Add assignment operator to resolve gcc warning * ACE/ace/MEM_Addr.cpp: * ACE/ace/MEM_Addr.h: --- ACE/ace/MEM_Addr.cpp | 11 +++++++++++ ACE/ace/MEM_Addr.h | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ACE/ace/MEM_Addr.cpp b/ACE/ace/MEM_Addr.cpp index 4ee10c5b663..26b365df1df 100644 --- a/ACE/ace/MEM_Addr.cpp +++ b/ACE/ace/MEM_Addr.cpp @@ -54,6 +54,17 @@ ACE_MEM_Addr::ACE_MEM_Addr (u_short port_number) this->initialize_local (port_number); } +ACE_MEM_Addr& +ACE_MEM_Addr::operator= (const ACE_MEM_Addr& sa) +{ + if (this != std::addressof(sa)) + { + this->external_.set (sa.external_); + this->internal_.set (sa.internal_); + } + return *this; +} + int ACE_MEM_Addr::initialize_local (u_short port_number) { diff --git a/ACE/ace/MEM_Addr.h b/ACE/ace/MEM_Addr.h index 017756f0335..ae9e8be008e 100644 --- a/ACE/ace/MEM_Addr.h +++ b/ACE/ace/MEM_Addr.h @@ -35,11 +35,14 @@ class ACE_Export ACE_MEM_Addr : public ACE_Addr { public: /// Default constructor. - ACE_MEM_Addr (void); + ACE_MEM_Addr (); /// Copy constructor. ACE_MEM_Addr (const ACE_MEM_Addr &); + // Assignment operator + ACE_MEM_Addr& operator= (const ACE_MEM_Addr& sa); + /// Creates an ACE_MEM_Addr from a @a port_number ACE_MEM_Addr (u_short port_number); -- cgit v1.2.1 From a54dcc98cde480c8cc9fc1cfcda08f68e2ab4157 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 9 Nov 2021 16:12:16 +0100 Subject: Removed empty line * ACE/ace/Process.cpp: --- ACE/ace/Process.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index d75e5458815..1b6d579595a 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -38,7 +38,6 @@ static void sigchld_nop (int, siginfo_t *, ucontext_t *) } #endif /* ACE_WIN32 */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Process::ACE_Process () -- cgit v1.2.1 From a6797833fd068f5bbf9e2a0126fcddec29a9deaa Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 9 Nov 2021 16:47:11 +0100 Subject: Layout/doxygen changes * ACE/ace/MEM_Addr.cpp: * ACE/ace/UNIX_Addr.inl: --- ACE/ace/MEM_Addr.cpp | 20 ++++++-------------- ACE/ace/UNIX_Addr.inl | 1 - 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ACE/ace/MEM_Addr.cpp b/ACE/ace/MEM_Addr.cpp index 26b365df1df..4e759900abc 100644 --- a/ACE/ace/MEM_Addr.cpp +++ b/ACE/ace/MEM_Addr.cpp @@ -20,8 +20,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_ALLOC_HOOK_DEFINE(ACE_MEM_Addr) -// Transform the current address into string format. - +/// Transform the current address into string format. ACE_MEM_Addr::ACE_MEM_Addr () : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr)) { @@ -41,9 +40,7 @@ ACE_MEM_Addr::ACE_MEM_Addr (const ACE_TCHAR port_number[]) : ACE_Addr (AF_INET, sizeof (ACE_MEM_Addr)) { ACE_TRACE ("ACE_MEM_Addr::ACE_MEM_Addr"); - u_short pn = static_cast (ACE_OS::strtoul (port_number, - 0, - 10)); + u_short const pn = static_cast (ACE_OS::strtoul (port_number, 0, 10)); this->initialize_local (pn); } @@ -102,20 +99,16 @@ ACE_MEM_Addr::addr_to_string (ACE_TCHAR s[], } // Transform the string into the current addressing format. - int ACE_MEM_Addr::string_to_addr (const ACE_TCHAR s[]) { ACE_TRACE ("ACE_MEM_Addr::string_to_addr"); - u_short pn = static_cast (ACE_OS::strtoul (s, - 0, - 10)); + u_short pn = static_cast (ACE_OS::strtoul (s, 0, 10)); return this->set (pn); } -// Return the address. - +/// Return the address. void * ACE_MEM_Addr::get_addr () const { @@ -123,7 +116,7 @@ ACE_MEM_Addr::get_addr () const return this->external_.get_addr (); } -// Set a pointer to the address. +/// Set a pointer to the address. void ACE_MEM_Addr::set_addr (const void *addr, int len) { @@ -141,8 +134,7 @@ ACE_MEM_Addr::get_host_name (ACE_TCHAR hostname[], return this->external_.get_host_name (hostname, len); } -// Return the character representation of the hostname. - +/// Return the character representation of the hostname. const char * ACE_MEM_Addr::get_host_name () const { diff --git a/ACE/ace/UNIX_Addr.inl b/ACE/ace/UNIX_Addr.inl index 125ead75e32..40a57922386 100644 --- a/ACE/ace/UNIX_Addr.inl +++ b/ACE/ace/UNIX_Addr.inl @@ -2,7 +2,6 @@ #include "ace/OS_NS_string.h" - #if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) ACE_BEGIN_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1 From 3681a73b62e4642ce8269babb1bd9eb75ac09604 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 9 Nov 2021 16:53:00 +0100 Subject: Layout changes, use delete, removed redundant void * ACE/ace/Asynch_IO.h: * ACE/ace/Dev_Poll_Reactor.h: * ACE/ace/Event_Handler_Handle_Timeout_Upcall.h: * ACE/ace/Future.h: * ACE/ace/Get_Opt.h: * ACE/ace/Hash_Map_Manager_T.h: * ACE/ace/Local_Tokens.cpp: * ACE/ace/Local_Tokens.h: * ACE/ace/SOCK_Dgram_Mcast.h: * ACE/ace/Select_Reactor_Base.h: --- ACE/ace/Asynch_IO.h | 1 - ACE/ace/Dev_Poll_Reactor.h | 2 +- ACE/ace/Event_Handler_Handle_Timeout_Upcall.h | 1 - ACE/ace/Future.h | 5 ++--- ACE/ace/Get_Opt.h | 2 -- ACE/ace/Hash_Map_Manager_T.h | 1 - ACE/ace/Local_Tokens.cpp | 4 ---- ACE/ace/Local_Tokens.h | 7 +++---- ACE/ace/SOCK_Dgram_Mcast.h | 1 - ACE/ace/Select_Reactor_Base.h | 2 -- 10 files changed, 6 insertions(+), 20 deletions(-) diff --git a/ACE/ace/Asynch_IO.h b/ACE/ace/Asynch_IO.h index 819eed30e7c..6584abfc4e8 100644 --- a/ACE/ace/Asynch_IO.h +++ b/ACE/ace/Asynch_IO.h @@ -1556,7 +1556,6 @@ private: ACE_Asynch_Write_Dgram (const ACE_Asynch_Write_Dgram &) = delete; }; - /** * @class ACE_Handler * diff --git a/ACE/ace/Dev_Poll_Reactor.h b/ACE/ace/Dev_Poll_Reactor.h index 88d30409c2e..c75cbc8cba0 100644 --- a/ACE/ace/Dev_Poll_Reactor.h +++ b/ACE/ace/Dev_Poll_Reactor.h @@ -1126,7 +1126,7 @@ protected: int acquire (ACE_Time_Value *max_wait = 0); private: - Token_Guard (void); + Token_Guard (); private: /// The Reactor token. diff --git a/ACE/ace/Event_Handler_Handle_Timeout_Upcall.h b/ACE/ace/Event_Handler_Handle_Timeout_Upcall.h index 715cacb2c27..02133ad52ea 100644 --- a/ACE/ace/Event_Handler_Handle_Timeout_Upcall.h +++ b/ACE/ace/Event_Handler_Handle_Timeout_Upcall.h @@ -87,7 +87,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /// Flag indicating that reference counting is required for this /// event handler upcall. int requires_reference_counting_; diff --git a/ACE/ace/Future.h b/ACE/ace/Future.h index e928370f1e6..f63695202fa 100644 --- a/ACE/ace/Future.h +++ b/ACE/ace/Future.h @@ -214,10 +214,10 @@ private: mutable ACE_SYNCH_RECURSIVE_CONDITION value_ready_; private: - ACE_Future_Rep (void); + ACE_Future_Rep (); protected: - ~ACE_Future_Rep (void); + ~ACE_Future_Rep (); }; /** @@ -354,7 +354,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /// The ACE_Future_Rep /// Protect operations on the . typedef ACE_Future_Rep FUTURE_REP; diff --git a/ACE/ace/Get_Opt.h b/ACE/ace/Get_Opt.h index 040df2b8cb2..96e06c30b69 100644 --- a/ACE/ace/Get_Opt.h +++ b/ACE/ace/Get_Opt.h @@ -434,7 +434,6 @@ private: ACE_Get_Opt &operator= (ACE_Get_Opt &&) = delete; private: - /// Holds the option string. ACE_TString *optstring_; @@ -481,7 +480,6 @@ private: /// Declare the dynamic allocation hooks. ACE_ALLOC_HOOK_DECLARE; - }; ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Hash_Map_Manager_T.h b/ACE/ace/Hash_Map_Manager_T.h index 70f20f9e9ed..6960498bfe7 100644 --- a/ACE/ace/Hash_Map_Manager_T.h +++ b/ACE/ace/Hash_Map_Manager_T.h @@ -1119,7 +1119,6 @@ template class ACE_Hash_Map_Manager : public ACE_Hash_Map_Manager_Ex, ACE_Equal_To, ACE_LOCK> { public: - /** * Initialize a @c Hash_Map_Manager with default size elements. * @param table_alloc is a pointer to a memory allocator used for diff --git a/ACE/ace/Local_Tokens.cpp b/ACE/ace/Local_Tokens.cpp index 2aedeb0b94c..68cd3d36df3 100644 --- a/ACE/ace/Local_Tokens.cpp +++ b/ACE/ace/Local_Tokens.cpp @@ -160,10 +160,6 @@ ACE_TPQ_Entry::client_id (const ACE_TCHAR *id) ACE_MAXCLIENTIDLEN); } -ACE_TSS_TPQ_Entry::~ACE_TSS_TPQ_Entry (void) -{ -} - void ACE_TSS_TPQ_Entry::dump () const { diff --git a/ACE/ace/Local_Tokens.h b/ACE/ace/Local_Tokens.h index e52695aff37..6b137152143 100644 --- a/ACE/ace/Local_Tokens.h +++ b/ACE/ace/Local_Tokens.h @@ -216,7 +216,7 @@ public: const ACE_TCHAR *client_id); /// Destructor. - virtual ~ACE_TSS_TPQ_Entry (void); + virtual ~ACE_TSS_TPQ_Entry () = default; /// Allows us to pass args to the construction of the TSS object. virtual ACE_TPQ_Entry *make_TSS_TYPE () const; @@ -235,9 +235,8 @@ public: #endif /* ACE_NO_TSS_TOKENS */ private: - /// Private: should not be used - ACE_TSS_TPQ_Entry (const ACE_TSS_TPQ_Entry &); - void operator= (const ACE_TSS_TPQ_Entry &); + ACE_TSS_TPQ_Entry (const ACE_TSS_TPQ_Entry &) = delete; + void operator= (const ACE_TSS_TPQ_Entry &) = delete; // = These are passed to the constructor of ACE_TPQ_Entry in // make_TSS_TYPE diff --git a/ACE/ace/SOCK_Dgram_Mcast.h b/ACE/ace/SOCK_Dgram_Mcast.h index 12a885b7ac1..1fc3ab2430c 100644 --- a/ACE/ace/SOCK_Dgram_Mcast.h +++ b/ACE/ace/SOCK_Dgram_Mcast.h @@ -344,7 +344,6 @@ public: int opts () const; private: - /// Subscribe to a multicast address on one or more network interface(s). /// (No QoS support.) int subscribe_ifs (const ACE_INET_Addr &mcast_addr, diff --git a/ACE/ace/Select_Reactor_Base.h b/ACE/ace/Select_Reactor_Base.h index f076a2bffeb..edac5a28aa9 100644 --- a/ACE/ace/Select_Reactor_Base.h +++ b/ACE/ace/Select_Reactor_Base.h @@ -375,7 +375,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /// Remove the binding of @a handle corresponding to position @a pos /// in accordance with the @a mask. int unbind (ACE_HANDLE handle, @@ -437,7 +436,6 @@ public: ACE_ALLOC_HOOK_DECLARE; private: - /// Reference to the Handler_Repository we are iterating over. ACE_Select_Reactor_Handler_Repository const * const rep_; -- cgit v1.2.1 From 43002d5505231e9e13870d6bec044166dd86480e Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 10 Nov 2021 08:30:10 +0100 Subject: Add default assignment operator to fix gcc warnings * ACE/ace/MEM_Addr.cpp: * ACE/ace/MEM_Addr.h: * ACE/ace/SPIPE_Addr.h: * ACE/ace/UNIX_Addr.h: --- ACE/ace/MEM_Addr.cpp | 11 ----------- ACE/ace/MEM_Addr.h | 4 ++-- ACE/ace/SPIPE_Addr.h | 3 +++ ACE/ace/UNIX_Addr.h | 3 +++ 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/ACE/ace/MEM_Addr.cpp b/ACE/ace/MEM_Addr.cpp index 4e759900abc..1e021a27deb 100644 --- a/ACE/ace/MEM_Addr.cpp +++ b/ACE/ace/MEM_Addr.cpp @@ -51,17 +51,6 @@ ACE_MEM_Addr::ACE_MEM_Addr (u_short port_number) this->initialize_local (port_number); } -ACE_MEM_Addr& -ACE_MEM_Addr::operator= (const ACE_MEM_Addr& sa) -{ - if (this != std::addressof(sa)) - { - this->external_.set (sa.external_); - this->internal_.set (sa.internal_); - } - return *this; -} - int ACE_MEM_Addr::initialize_local (u_short port_number) { diff --git a/ACE/ace/MEM_Addr.h b/ACE/ace/MEM_Addr.h index ae9e8be008e..26485148dfa 100644 --- a/ACE/ace/MEM_Addr.h +++ b/ACE/ace/MEM_Addr.h @@ -40,8 +40,8 @@ public: /// Copy constructor. ACE_MEM_Addr (const ACE_MEM_Addr &); - // Assignment operator - ACE_MEM_Addr& operator= (const ACE_MEM_Addr& sa); + /// Assignment operator + ACE_MEM_Addr& operator= (const ACE_MEM_Addr& sa) = default; /// Creates an ACE_MEM_Addr from a @a port_number ACE_MEM_Addr (u_short port_number); diff --git a/ACE/ace/SPIPE_Addr.h b/ACE/ace/SPIPE_Addr.h index 455acd9acbb..f72e7b77910 100644 --- a/ACE/ace/SPIPE_Addr.h +++ b/ACE/ace/SPIPE_Addr.h @@ -39,6 +39,9 @@ public: /// Copy constructor. ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa); + /// Assignment operator + ACE_SPIPE_Addr& operator= (const ACE_SPIPE_Addr& sa) = default; + /// Create a ACE_SPIPE_Addr from a rendezvous point in the file /// system. ACE_SPIPE_Addr (const ACE_TCHAR *rendezvous_point, gid_t = 0, uid_t = 0); diff --git a/ACE/ace/UNIX_Addr.h b/ACE/ace/UNIX_Addr.h index fed5df7fab6..1400760e6d1 100644 --- a/ACE/ace/UNIX_Addr.h +++ b/ACE/ace/UNIX_Addr.h @@ -43,6 +43,9 @@ public: /// Copy constructor. ACE_UNIX_Addr (const ACE_UNIX_Addr &sa); + /// Assignment operator + ACE_UNIX_Addr& operator= (const ACE_UNIX_Addr& sa) = default; + /// Creates an ACE_UNIX_Addr from a string. ACE_UNIX_Addr (const char rendezvous_point[]); -- cgit v1.2.1