summaryrefslogtreecommitdiff
path: root/ACE/ace
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2021-10-23 18:58:07 +0200
committerGitHub <noreply@github.com>2021-10-23 18:58:07 +0200
commit36a9f816d472c0ba515a6a9ed3f78225994c122c (patch)
tree90884b3696b572b5462288bc8fa264f64c4be43a /ACE/ace
parente5b34643f7fe7a92db1659d4192f80af00abb2b6 (diff)
parent3b9024dd16208f7f37ef545b31d6a7107bda1110 (diff)
downloadATCD-36a9f816d472c0ba515a6a9ed3f78225994c122c.tar.gz
Merge pull request #1701 from jwillemsen/jwi-signalcleanup
Minor cleanup
Diffstat (limited to 'ACE/ace')
-rw-r--r--ACE/ace/Configuration.cpp13
-rw-r--r--ACE/ace/Configuration.h13
-rw-r--r--ACE/ace/POSIX_CB_Proactor.cpp5
-rw-r--r--ACE/ace/POSIX_CB_Proactor.h11
-rw-r--r--ACE/ace/Process.cpp3
-rw-r--r--ACE/ace/Process_Manager.cpp4
-rw-r--r--ACE/ace/Process_Manager.h5
-rw-r--r--ACE/ace/SPIPE_Addr.cpp6
-rw-r--r--ACE/ace/SPIPE_Addr.inl5
-rw-r--r--ACE/ace/Service_Config.cpp4
-rw-r--r--ACE/ace/Sig_Adapter.cpp26
-rw-r--r--ACE/ace/Sig_Adapter.h12
-rw-r--r--ACE/ace/Sig_Handler.cpp26
-rw-r--r--ACE/ace/Sig_Handler.h5
-rw-r--r--ACE/ace/Signal.cpp4
-rw-r--r--ACE/ace/Signal.h6
-rw-r--r--ACE/ace/TP_Reactor.inl1
-rw-r--r--ACE/ace/Test_and_Set.h4
-rw-r--r--ACE/ace/Timer_Queue_Adapters.cpp4
-rw-r--r--ACE/ace/WFMO_Reactor.cpp30
-rw-r--r--ACE/ace/WFMO_Reactor.inl8
21 files changed, 64 insertions, 131 deletions
diff --git a/ACE/ace/Configuration.cpp b/ACE/ace/Configuration.cpp
index 70110b42acc..bb5b9e3432b 100644
--- a/ACE/ace/Configuration.cpp
+++ b/ACE/ace/Configuration.cpp
@@ -114,7 +114,6 @@ ACE_Configuration::expand_path (const ACE_Configuration_Section_Key& key,
}
return 0;
-
}
int
@@ -1098,11 +1097,6 @@ ACE_Configuration_Value_IntId::free (ACE_Allocator *alloc)
// Do nothing in other cases...
}
-ACE_Configuration_ExtId::ACE_Configuration_ExtId ()
- : name_ (0)
-{
-}
-
ACE_Configuration_ExtId::ACE_Configuration_ExtId (const ACE_TCHAR* name)
: name_ (name)
{
@@ -1113,10 +1107,6 @@ ACE_Configuration_ExtId::ACE_Configuration_ExtId (const ACE_Configuration_ExtId&
{
}
-ACE_Configuration_ExtId::~ACE_Configuration_ExtId ()
-{
-}
-
ACE_Configuration_ExtId& ACE_Configuration_ExtId::operator= (const ACE_Configuration_ExtId& rhs)
{
if (this != &rhs)
@@ -1521,8 +1511,7 @@ ACE_Configuration_Heap::open_section (const ACE_Configuration_Section_Key& base,
)
{
ACE_TString simple_section (sub_section, separator - sub_section);
- int ret_val =
- open_simple_section (result, simple_section.c_str (), create, result);
+ int const ret_val = open_simple_section (result, simple_section.c_str (), create, result);
if (ret_val)
return ret_val;
sub_section = separator + 1;
diff --git a/ACE/ace/Configuration.h b/ACE/ace/Configuration.h
index 175e26cf7b6..76ef66f2cd7 100644
--- a/ACE/ace/Configuration.h
+++ b/ACE/ace/Configuration.h
@@ -426,7 +426,7 @@ public:
protected:
/// Destructor - invokes <RegCloseKey>
- virtual ~ACE_Section_Key_Win32 (void);
+ virtual ~ACE_Section_Key_Win32 ();
// Not used
ACE_Section_Key_Win32 (const ACE_Section_Key_Win32& rhs);
@@ -454,7 +454,7 @@ public:
u_long security_access = KEY_ALL_ACCESS);
/// Destructor
- virtual ~ACE_Configuration_Win32Registry (void);
+ virtual ~ACE_Configuration_Win32Registry ();
virtual int open_section (const ACE_Configuration_Section_Key& base,
const ACE_TCHAR* sub_section,
@@ -557,7 +557,7 @@ class ACE_Export ACE_Configuration_ExtId
{
public:
/// Defeault ctor
- ACE_Configuration_ExtId (void);
+ ACE_Configuration_ExtId () = default;
/// Named constructor
explicit ACE_Configuration_ExtId (const ACE_TCHAR* name);
@@ -566,7 +566,7 @@ public:
ACE_Configuration_ExtId (const ACE_Configuration_ExtId& rhs);
/// destructor
- ~ACE_Configuration_ExtId (void);
+ ~ACE_Configuration_ExtId () = default;
/// Assignment operator
ACE_Configuration_ExtId& operator= (const ACE_Configuration_ExtId& rhs);
@@ -586,11 +586,10 @@ public:
u_long hash () const;
// = Data members.
-
- const ACE_TCHAR * name_;
+ const ACE_TCHAR * name_ {};
// Accessors
- const ACE_TCHAR *name (void);
+ const ACE_TCHAR *name ();
};
typedef ACE_Hash_Map_With_Allocator<ACE_Configuration_ExtId, int>
diff --git a/ACE/ace/POSIX_CB_Proactor.cpp b/ACE/ace/POSIX_CB_Proactor.cpp
index 77b2e406268..ef58e76d5ae 100644
--- a/ACE/ace/POSIX_CB_Proactor.cpp
+++ b/ACE/ace/POSIX_CB_Proactor.cpp
@@ -73,7 +73,7 @@ ACE_POSIX_CB_Proactor::notify_completion (int sig_num)
ssize_t
ACE_POSIX_CB_Proactor::allocate_aio_slot (ACE_POSIX_Asynch_Result *result)
{
- ssize_t slot = ACE_POSIX_AIOCB_Proactor::allocate_aio_slot (result);
+ ssize_t const slot = ACE_POSIX_AIOCB_Proactor::allocate_aio_slot (result);
if (slot == -1)
return -1;
@@ -83,8 +83,7 @@ ACE_POSIX_CB_Proactor::allocate_aio_slot (ACE_POSIX_Asynch_Result *result)
// the proactor, but the aiocb as well.
result->aio_sigevent.sigev_notify = SIGEV_THREAD;
# if defined (ACE_HAS_SIG_C_FUNC)
- result->aio_sigevent.sigev_notify_function =
- ACE_POSIX_CB_Proactor_aio_completion;
+ result->aio_sigevent.sigev_notify_function = ACE_POSIX_CB_Proactor_aio_completion;
# else
result->aio_sigevent.sigev_notify_function = aio_completion_func;
# endif /* ACE_HAS_SIG_C_FUNC */
diff --git a/ACE/ace/POSIX_CB_Proactor.h b/ACE/ace/POSIX_CB_Proactor.h
index e38360f5f9f..9aa8221c43b 100644
--- a/ACE/ace/POSIX_CB_Proactor.h
+++ b/ACE/ace/POSIX_CB_Proactor.h
@@ -22,26 +22,22 @@
#include "ace/Synch_Traits.h"
#include "ace/Thread_Semaphore.h"
#include "ace/Null_Semaphore.h"
-
#include "ace/POSIX_Proactor.h"
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/**
* @class ACE_POSIX_CB_Proactor
*
* @brief Implementation of Callback-based Proactor
- * };
*/
class ACE_Export ACE_POSIX_CB_Proactor : public ACE_POSIX_AIOCB_Proactor
{
-
public:
- virtual Proactor_Type get_impl_type (void);
+ virtual Proactor_Type get_impl_type ();
/// Destructor.
- virtual ~ACE_POSIX_CB_Proactor (void);
+ virtual ~ACE_POSIX_CB_Proactor ();
/// Constructor defines max number asynchronous operations that can
/// be started at the same time.
@@ -52,7 +48,6 @@ public:
static void aio_completion_func (sigval cb_data);
protected:
-
/**
* Dispatch a single set of events. If @a wait_time elapses before
* any events occur, return 0. Return 1 on success i.e., when a
@@ -68,7 +63,7 @@ protected:
* completion is dispatched, non-zero (-1) on errors and errno is
* set accordingly.
*/
- virtual int handle_events (void);
+ virtual int handle_events ();
/// Find free slot to store result and aiocb pointer
virtual ssize_t allocate_aio_slot (ACE_POSIX_Asynch_Result *result);
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp
index cc3a25d2636..d75e5458815 100644
--- a/ACE/ace/Process.cpp
+++ b/ACE/ace/Process.cpp
@@ -32,8 +32,7 @@
// to do anything with the signal - it's just needed to interrupt a sleep.
// See wait() for more info.
#if !defined (ACE_WIN32) && !defined(ACE_LACKS_UNIX_SIGNALS)
-static void
-sigchld_nop (int, siginfo_t *, ucontext_t *)
+static void sigchld_nop (int, siginfo_t *, ucontext_t *)
{
return;
}
diff --git a/ACE/ace/Process_Manager.cpp b/ACE/ace/Process_Manager.cpp
index 6990ba40eec..fa2e5cefec5 100644
--- a/ACE/ace/Process_Manager.cpp
+++ b/ACE/ace/Process_Manager.cpp
@@ -333,9 +333,7 @@ ACE_Process_Manager::handle_close (ACE_HANDLE /* handle */,
// On Win32, this routine is called synchronously, and is passed the
// HANDLE of the Process that exited, so we can do all our work here.
int
-ACE_Process_Manager::handle_signal (int,
- siginfo_t *si,
- ucontext_t *)
+ACE_Process_Manager::handle_signal (int, siginfo_t *si, ucontext_t *)
{
#if defined (ACE_WIN32)
ACE_HANDLE proc = si->si_handle_;
diff --git a/ACE/ace/Process_Manager.h b/ACE/ace/Process_Manager.h
index 90fc88d5472..b3491ff090e 100644
--- a/ACE/ace/Process_Manager.h
+++ b/ACE/ace/Process_Manager.h
@@ -389,12 +389,9 @@ protected:
* On Win32, this routine is called synchronously, and is passed the
* HANDLE of the Process that exited, so we can do all our work here
*/
- virtual int handle_signal (int signum,
- siginfo_t * = 0,
- ucontext_t * = 0);
+ virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
private:
-
/**
* @struct Process_Descriptor
*
diff --git a/ACE/ace/SPIPE_Addr.cpp b/ACE/ace/SPIPE_Addr.cpp
index 81240d557eb..e0c6e681cf9 100644
--- a/ACE/ace/SPIPE_Addr.cpp
+++ b/ACE/ace/SPIPE_Addr.cpp
@@ -27,16 +27,13 @@ ACE_SPIPE_Addr::set_addr (const void *addr, int len)
}
// Return the address.
-
void *
ACE_SPIPE_Addr::get_addr () const
{
return (void *) &this->SPIPE_addr_;
}
-
// Do nothing constructor.
-
ACE_SPIPE_Addr::ACE_SPIPE_Addr ()
: ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_)
{
@@ -55,7 +52,6 @@ ACE_SPIPE_Addr::addr_to_string (ACE_TCHAR *s, size_t len) const
}
// Transform the string into the current addressing format.
-
int
ACE_SPIPE_Addr::string_to_addr (const ACE_TCHAR *addr)
{
@@ -79,7 +75,6 @@ ACE_SPIPE_Addr::set (const ACE_SPIPE_Addr &sa)
}
// Copy constructor.
-
ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_SPIPE_Addr &sa)
: ACE_Addr (AF_SPIPE, sizeof this->SPIPE_addr_)
{
@@ -147,7 +142,6 @@ ACE_SPIPE_Addr::set (const ACE_TCHAR *addr,
}
// Create a ACE_Addr from a ACE_SPIPE pathname.
-
ACE_SPIPE_Addr::ACE_SPIPE_Addr (const ACE_TCHAR *addr,
gid_t gid,
uid_t uid)
diff --git a/ACE/ace/SPIPE_Addr.inl b/ACE/ace/SPIPE_Addr.inl
index be00866dc80..53041a4a090 100644
--- a/ACE/ace/SPIPE_Addr.inl
+++ b/ACE/ace/SPIPE_Addr.inl
@@ -8,15 +8,14 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE bool
ACE_SPIPE_Addr::operator == (const ACE_SPIPE_Addr &sap) const
{
- return ACE_OS::strcmp (this->SPIPE_addr_.rendezvous_,
- sap.SPIPE_addr_.rendezvous_) == 0;
+ return ACE_OS::strcmp (this->SPIPE_addr_.rendezvous_, sap.SPIPE_addr_.rendezvous_) == 0;
}
// Compare two addresses for inequality.
ACE_INLINE bool
ACE_SPIPE_Addr::operator != (const ACE_SPIPE_Addr &sap) const
{
- return !((*this) == sap); // This is lazy, of course... ;-)
+ return !((*this) == sap);
}
// Return the path name used for the rendezvous point.
diff --git a/ACE/ace/Service_Config.cpp b/ACE/ace/Service_Config.cpp
index 54b48c37a1a..f88ef610fe4 100644
--- a/ACE/ace/Service_Config.cpp
+++ b/ACE/ace/Service_Config.cpp
@@ -513,9 +513,7 @@ ACE_Service_Config::create_service_type_impl (const ACE_TCHAR *name,
// Signal handling API to trigger dynamic reconfiguration.
void
-ACE_Service_Config::handle_signal (int sig,
- siginfo_t *,
- ucontext_t *)
+ACE_Service_Config::handle_signal (int sig, siginfo_t *, ucontext_t *)
{
#if defined (ACE_NDEBUG)
ACE_UNUSED_ARG (sig);
diff --git a/ACE/ace/Sig_Adapter.cpp b/ACE/ace/Sig_Adapter.cpp
index 2010f8a3e0a..c6722b21a7c 100644
--- a/ACE/ace/Sig_Adapter.cpp
+++ b/ACE/ace/Sig_Adapter.cpp
@@ -4,49 +4,36 @@ ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Action &sa, int sigkey)
: sigkey_ (sigkey),
type_ (SIG_ACTION),
sa_ (sa),
- eh_ (0),
- sig_func_ (0)
+ sig_func_ (nullptr)
{
- // ACE_TRACE ("ACE_Sig_Adapter::ACE_Sig_Adapter");
}
-ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Event_Handler *eh,
- int sigkey)
+ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Event_Handler *eh, int sigkey)
: sigkey_ (sigkey),
type_ (ACE_HANDLER),
eh_ (eh),
- sig_func_ (0)
+ sig_func_ (nullptr)
{
- // ACE_TRACE ("ACE_Sig_Adapter::ACE_Sig_Adapter");
}
-ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Handler_Ex sig_func,
- int sigkey)
+ACE_Sig_Adapter::ACE_Sig_Adapter (ACE_Sig_Handler_Ex sig_func, int sigkey)
: sigkey_ (sigkey),
type_ (C_FUNCTION),
- eh_ (0),
sig_func_ (sig_func)
{
- // ACE_TRACE ("ACE_Sig_Adapter::ACE_Sig_Adapter");
-}
-
-ACE_Sig_Adapter::~ACE_Sig_Adapter ()
-{
}
ACE_ALLOC_HOOK_DEFINE(ACE_Sig_Adapter)
int
-ACE_Sig_Adapter::sigkey ()
+ACE_Sig_Adapter::sigkey () const
{
ACE_TRACE ("ACE_Sig_Adapter::sigkey");
return this->sigkey_;
}
int
-ACE_Sig_Adapter::handle_signal (int signum,
- siginfo_t *siginfo,
- ucontext_t *ucontext)
+ACE_Sig_Adapter::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *ucontext)
{
ACE_TRACE ("ACE_Sig_Adapter::handle_signal");
@@ -56,7 +43,6 @@ ACE_Sig_Adapter::handle_signal (int signum,
{
// We have to dispatch a handler that was registered by a
// third-party library.
-
ACE_Sig_Action old_disp;
// Make sure this handler executes in the context it was
diff --git a/ACE/ace/Sig_Adapter.h b/ACE/ace/Sig_Adapter.h
index bb0f791a07c..0142f2e6795 100644
--- a/ACE/ace/Sig_Adapter.h
+++ b/ACE/ace/Sig_Adapter.h
@@ -36,20 +36,20 @@ public:
ACE_Sig_Adapter (ACE_Sig_Action &, int sigkey);
ACE_Sig_Adapter (ACE_Event_Handler *, int sigkey);
ACE_Sig_Adapter (ACE_Sig_Handler_Ex, int sigkey = 0);
- ~ACE_Sig_Adapter (void);
+ ~ACE_Sig_Adapter () override = default;
/// Returns this signal key that's used to remove this from the
/// ACE_Reactor's internal table.
- int sigkey (void);
+ int sigkey () const;
- /// Called by the <Reactor> to dispatch the signal handler.
- virtual int handle_signal (int, siginfo_t *, ucontext_t *);
+ /// Called by the ACE_Reactor to dispatch the signal handler.
+ int handle_signal (int, siginfo_t *, ucontext_t *) override;
ACE_ALLOC_HOOK_DECLARE;
private:
/// Key for this signal handler (used to remove it).
- int sigkey_;
+ int const sigkey_;
/// Is this an external handler or an ACE handler?
enum
@@ -68,7 +68,7 @@ private:
ACE_Sig_Action sa_;
/// This is an ACE hander.
- ACE_Event_Handler *eh_;
+ ACE_Event_Handler *eh_ {};
/// This is a normal C function.
ACE_Sig_Handler_Ex sig_func_;
diff --git a/ACE/ace/Sig_Handler.cpp b/ACE/ace/Sig_Handler.cpp
index 9b6e4a8e272..3fb63c52ffc 100644
--- a/ACE/ace/Sig_Handler.cpp
+++ b/ACE/ace/Sig_Handler.cpp
@@ -146,12 +146,12 @@ ACE_Sig_Handler::register_handler_i (int signum,
ACE_Sig_Action sa; // Define a "null" action.
ACE_Event_Handler *sh = ACE_Sig_Handler::handler_i (signum, new_sh);
- // Return a pointer to the old <ACE_Sig_Handler> if the user
+ // Return a pointer to the old ACE_Event_Handler if the user
// asks for this.
if (old_sh != 0)
*old_sh = sh;
- // Make sure that <new_disp> points to a valid location if the
+ // Make sure that @a new_disp points to a valid location if the
// user doesn't care...
if (new_disp == 0)
new_disp = &sa;
@@ -236,9 +236,7 @@ ACE_Sig_Handler::remove_handler (int signum,
/// Master dispatcher function that gets called by a signal handler and
/// dispatches one handler...
void
-ACE_Sig_Handler::dispatch (int signum,
- siginfo_t *siginfo,
- ucontext_t *ucontext)
+ACE_Sig_Handler::dispatch (int signum, siginfo_t *siginfo, ucontext_t *ucontext)
{
ACE_TRACE ("ACE_Sig_Handler::dispatch");
@@ -346,8 +344,8 @@ ACE_Sig_Handlers::register_handler (int signum,
if (ACE_Sig_Handler::in_range (signum))
{
- ACE_Sig_Adapter *ace_sig_adapter = 0; // Our signal handler.
- ACE_Sig_Adapter *extern_sh = 0; // An external signal handler.
+ ACE_Sig_Adapter *ace_sig_adapter = nullptr; // Our signal handler.
+ ACE_Sig_Adapter *extern_sh = nullptr; // An external signal handler.
ACE_Sig_Action sa;
// Get current signal disposition.
@@ -355,7 +353,6 @@ ACE_Sig_Handlers::register_handler (int signum,
// Check whether we are already in control of the signal
// handling disposition...
-
if (!(sa.handler () == ace_signal_handlers_dispatcher
|| sa.handler () == ACE_SignalHandler (SIG_IGN)
|| sa.handler () == ACE_SignalHandler (SIG_DFL)))
@@ -364,7 +361,6 @@ ACE_Sig_Handlers::register_handler (int signum,
// Upto here we never disabled RESTART_MODE. Thus,
// RESTART_MODE can only be changed by 3rd party libraries.
-
if (ACE_BIT_DISABLED (sa.flags (), SA_RESTART)
&& ACE_Sig_Handlers::third_party_sig_handler_)
// Toggling is disallowed since we might break 3rd party
@@ -397,7 +393,7 @@ ACE_Sig_Handlers::register_handler (int signum,
// Add the ACE signal handler to the set of handlers for this
// signal (make sure it goes before the external one if there is
// one of these).
- int result = ACE_Sig_Handlers_Set::instance (signum)->insert (ace_sig_adapter);
+ int const result = ACE_Sig_Handlers_Set::instance (signum)->insert (ace_sig_adapter);
if (result == -1)
{
@@ -516,9 +512,7 @@ ACE_Sig_Handlers::remove_handler (int signum,
/// Master dispatcher function that gets called by a signal handler and
/// dispatches *all* the handlers...
void
-ACE_Sig_Handlers::dispatch (int signum,
- siginfo_t *siginfo,
- ucontext_t *ucontext)
+ACE_Sig_Handlers::dispatch (int signum, siginfo_t *siginfo, ucontext_t *ucontext)
{
ACE_TRACE ("ACE_Sig_Handlers::dispatch");
// The following is #ifdef'd out because it's entirely non-portable
@@ -580,7 +574,7 @@ ACE_Sig_Handlers::handler (int signum, ACE_Event_Handler *new_sh)
ACE_SIG_HANDLERS_SET *handler_set =
ACE_Sig_Handlers_Set::instance (signum);
ACE_SIG_HANDLERS_ITERATOR handler_iterator (*handler_set);
- ACE_Event_Handler **eh = 0;
+ ACE_Event_Handler **eh = nullptr;
// Find the first handler...
handler_iterator.next (eh);
@@ -591,12 +585,12 @@ ACE_Sig_Handlers::handler (int signum, ACE_Event_Handler *new_sh)
// ... and then insert the new signal handler into the beginning of
// the set (note, this is a bit too tied up in the implementation of
// ACE_Unbounded_Set...).
- ACE_Sig_Adapter *temp = 0;
+ ACE_Sig_Adapter *temp = nullptr;
ACE_NEW_RETURN (temp,
ACE_Sig_Adapter (new_sh,
++ACE_Sig_Handlers::sigkey_),
- 0);
+ nullptr);
handler_set->insert (temp);
return *eh;
}
diff --git a/ACE/ace/Sig_Handler.h b/ACE/ace/Sig_Handler.h
index 3a9e08be45b..337f6a63521 100644
--- a/ACE/ace/Sig_Handler.h
+++ b/ACE/ace/Sig_Handler.h
@@ -94,8 +94,7 @@ public:
* <handle_signal> method of the appropriate pre-registered
* ACE_Event_Handler.
*/
- static void dispatch (int, siginfo_t *,
- ucontext_t *);
+ static void dispatch (int, siginfo_t *, ucontext_t *);
/// Dump the state of an object.
void dump () const;
@@ -149,7 +148,7 @@ private:
/**
* @class ACE_Sig_Handlers
*
- * @brief This is an alternative signal handling dispatcher for ACE. It
+ * @brief This is an alternative signal handling dispatcher for ACE. It
* allows a list of signal handlers to be registered for each
* signal. It also makes SA_RESTART the default mode.
*
diff --git a/ACE/ace/Signal.cpp b/ACE/ace/Signal.cpp
index 74c60bb2f5c..90f09bbd13c 100644
--- a/ACE/ace/Signal.cpp
+++ b/ACE/ace/Signal.cpp
@@ -93,7 +93,7 @@ ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
- if (sig_mask == 0)
+ if (sig_mask == nullptr)
ACE_OS::sigemptyset (&this->sa_.sa_mask);
else
this->sa_.sa_mask = *sig_mask; // Structure assignment...
@@ -121,7 +121,7 @@ ACE_Sig_Action::ACE_Sig_Action (ACE_SignalHandler sig_handler,
// ACE_TRACE ("ACE_Sig_Action::ACE_Sig_Action");
this->sa_.sa_flags = sig_flags;
- if (sig_mask == 0)
+ if (sig_mask == nullptr)
ACE_OS::sigemptyset (&this->sa_.sa_mask);
else
this->sa_.sa_mask = *sig_mask; // Structure assignment...
diff --git a/ACE/ace/Signal.h b/ACE/ace/Signal.h
index c4299437c51..d16268539fa 100644
--- a/ACE/ace/Signal.h
+++ b/ACE/ace/Signal.h
@@ -164,7 +164,7 @@ public:
/// Register @c this as the current disposition and store old
/// disposition into @a oaction if it is non-NULL.
int register_action (int signum,
- ACE_Sig_Action *oaction = 0);
+ ACE_Sig_Action *oaction = nullptr);
/// Assign the value of @a oaction to @c this and make it become the
/// new signal disposition.
@@ -223,7 +223,7 @@ public:
/// This is kind of conditional Guard, needed when guard should be
/// activated only when a specific condition met. When condition ==
/// true (default), Guard is activated
- ACE_Sig_Guard (ACE_Sig_Set *mask = 0, bool condition = true);
+ ACE_Sig_Guard (ACE_Sig_Set *mask = nullptr, bool condition = true);
/// Restore blocked signals.
~ACE_Sig_Guard ();
@@ -239,7 +239,7 @@ private:
ACE_Sig_Set omask_;
/// Guard Condition
- bool condition_;
+ bool const condition_;
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/TP_Reactor.inl b/ACE/ace/TP_Reactor.inl
index fc712b13c68..1660925ee3c 100644
--- a/ACE/ace/TP_Reactor.inl
+++ b/ACE/ace/TP_Reactor.inl
@@ -52,7 +52,6 @@ ACE_EH_Dispatch_Info::dispatch () const
ACE_INLINE
ACE_TP_Token_Guard::ACE_TP_Token_Guard (ACE_Select_Reactor_Token &token)
-
: token_ (token),
owner_ (false)
{
diff --git a/ACE/ace/Test_and_Set.h b/ACE/ace/Test_and_Set.h
index d7351dd1cc3..69a32502bbe 100644
--- a/ACE/ace/Test_and_Set.h
+++ b/ACE/ace/Test_and_Set.h
@@ -45,9 +45,7 @@ public:
/// Called when object is signaled by OS (either via UNIX signals or
/// when a Win32 object becomes signaled).
- virtual int handle_signal (int signum,
- siginfo_t * = 0,
- ucontext_t * = 0);
+ virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0);
private:
/// Keeps track of our state.
diff --git a/ACE/ace/Timer_Queue_Adapters.cpp b/ACE/ace/Timer_Queue_Adapters.cpp
index 7f12d825813..d440e4ca2bc 100644
--- a/ACE/ace/Timer_Queue_Adapters.cpp
+++ b/ACE/ace/Timer_Queue_Adapters.cpp
@@ -120,9 +120,7 @@ ACE_Async_Timer_Queue_Adapter<TQ, TYPE>::ACE_Async_Timer_Queue_Adapter (ACE_Sig_
// occurs.
template <class TQ, class TYPE> int
-ACE_Async_Timer_Queue_Adapter<TQ, TYPE>::handle_signal (int signum,
- siginfo_t *,
- ucontext_t *)
+ACE_Async_Timer_Queue_Adapter<TQ, TYPE>::handle_signal (int signum, siginfo_t *, ucontext_t *)
{
switch (signum)
{
diff --git a/ACE/ace/WFMO_Reactor.cpp b/ACE/ace/WFMO_Reactor.cpp
index dc61a2a642b..c08b0e744de 100644
--- a/ACE/ace/WFMO_Reactor.cpp
+++ b/ACE/ace/WFMO_Reactor.cpp
@@ -1621,14 +1621,13 @@ ACE_WFMO_Reactor_Handler_Repository::handler (ACE_HANDLE handle,
ACE_Event_Handler **user_event_handler)
{
long existing_masks = 0;
- int found = 0;
+ bool found = false;
ACE_Event_Handler_var safe_event_handler =
- this->handler (handle,
- existing_masks);
+ this->handler (handle, existing_masks);
if (safe_event_handler.handler ())
- found = 1;
+ found = true;
if (!found)
return -1;
@@ -1639,37 +1638,36 @@ ACE_WFMO_Reactor_Handler_Repository::handler (ACE_HANDLE handle,
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::READ_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_READ) &&
!ACE_BIT_ENABLED (existing_masks, FD_CLOSE))
- found = 0;
+ found = false;
if (found &&
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::WRITE_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_WRITE))
- found = 0;
+ found = false;
if (found &&
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::EXCEPT_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_OOB))
- found = 0;
+ found = false;
if (found &&
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::ACCEPT_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_ACCEPT))
- found = 0;
+ found = false;
if (found &&
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::CONNECT_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_CONNECT))
- found = 0;
+ found = false;
if (found &&
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::QOS_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_QOS))
- found = 0;
-
+ found = false;
if (found &&
ACE_BIT_ENABLED (user_masks, ACE_Event_Handler::GROUP_QOS_MASK))
if (!ACE_BIT_ENABLED (existing_masks, FD_GROUP_QOS))
- found = 0;
+ found = false;
if (found &&
user_event_handler)
@@ -1898,12 +1896,12 @@ ACE_WFMO_Reactor::calculate_timeout (ACE_Time_Value *max_wait_time)
return time->msec ();
}
-
int
-ACE_WFMO_Reactor::expire_timers (void)
+ACE_WFMO_Reactor::expire_timers ()
{
// If "owner" thread
if (ACE_Thread::self () == this->owner_)
+
// expire all pending timers.
return this->timer_queue_->expire ();
@@ -2420,9 +2418,7 @@ ACE_WFMO_Reactor_Notify::get_handle () const
// Handle all pending notifications.
int
-ACE_WFMO_Reactor_Notify::handle_signal (int signum,
- siginfo_t *siginfo,
- ucontext_t *)
+ACE_WFMO_Reactor_Notify::handle_signal (int signum, siginfo_t *siginfo, ucontext_t *)
{
ACE_UNUSED_ARG (signum);
diff --git a/ACE/ace/WFMO_Reactor.inl b/ACE/ace/WFMO_Reactor.inl
index 0cd239a2bbf..5d1993b77a2 100644
--- a/ACE/ace/WFMO_Reactor.inl
+++ b/ACE/ace/WFMO_Reactor.inl
@@ -10,9 +10,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
/************************************************************/
ACE_INLINE int
-ACE_Wakeup_All_Threads_Handler::handle_signal (int /* signum */,
- siginfo_t * /* siginfo */,
- ucontext_t *)
+ACE_Wakeup_All_Threads_Handler::handle_signal (int /* signum */, siginfo_t * /* siginfo */, ucontext_t *)
{
// This will get called when <WFMO_Reactor->wakeup_all_threads_> event
// is signaled. There is nothing to be done here.
@@ -1153,9 +1151,7 @@ ACE_WFMO_Reactor::handler (ACE_HANDLE handle,
{
ACE_GUARD_RETURN (ACE_Process_Mutex, ace_mon, this->lock_, -1);
- return this->handler_rep_.handler (handle,
- mask,
- event_handler);
+ return this->handler_rep_.handler (handle, mask, event_handler);
}
ACE_INLINE bool