summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2022-11-01 11:25:13 +0100
committerJohnny Willemsen <jwillemsen@remedy.nl>2022-11-01 11:25:13 +0100
commitfca859fece1cf48bc3ecbba171286a09b660f879 (patch)
treef33e68d0ddabfc1d2cad418681cf1f34a1f41173
parent71e2d9ced469264cf3709beca848ac16deec8200 (diff)
downloadATCD-fca859fece1cf48bc3ecbba171286a09b660f879.tar.gz
Use const/override/default and some layout changes
* ACE/ace/Process.cpp: * ACE/ace/Process.h: * TAO/tao/ORB_Core.cpp:
-rw-r--r--ACE/ace/Process.cpp23
-rw-r--r--ACE/ace/Process.h5
-rw-r--r--TAO/tao/ORB_Core.cpp7
3 files changed, 12 insertions, 23 deletions
diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp
index eb1f5f6a31b..3a52b8bb9a4 100644
--- a/ACE/ace/Process.cpp
+++ b/ACE/ace/Process.cpp
@@ -928,8 +928,8 @@ ACE_Process_Options::inherit_environment ()
for (WCHAR *iter = existing_wide_env; *iter; ++iter)
{
ACE_Wide_To_Ascii wta (iter);
- size_t len = ACE_OS::strlen (wta.char_rep ());
- size_t idx = temp_narrow_env.size ();
+ size_t const len = ACE_OS::strlen (wta.char_rep ());
+ size_t const idx = temp_narrow_env.size ();
temp_narrow_env.resize (idx + len + 1, 0);
ACE_OS::strncpy (&temp_narrow_env[idx], wta.char_rep (), len);
iter += len;
@@ -945,7 +945,7 @@ ACE_Process_Options::inherit_environment ()
while (existing_environment[slot] != '\0')
{
- size_t len = ACE_OS::strlen (existing_environment + slot);
+ size_t const len = ACE_OS::strlen (existing_environment + slot);
// Add the string to our env buffer.
if (this->setenv_i (existing_environment + slot, len) == -1)
@@ -984,8 +984,7 @@ ACE_Process_Options::setenv (ACE_TCHAR *envp[])
int i = 0;
while (envp[i])
{
- if (this->setenv_i (envp[i],
- ACE_OS::strlen (envp[i])) == -1)
+ if (this->setenv_i (envp[i], ACE_OS::strlen (envp[i])) == -1)
return -1;
i++;
}
@@ -1009,8 +1008,7 @@ ACE_Process_Options::setenv (const ACE_TCHAR *format, ...)
va_start (argp, format);
// Add the rest of the varargs.
- int status = ACE_OS::vsnprintf (stack_buf, DEFAULT_COMMAND_LINE_BUF_LEN,
- format, argp);
+ int status = ACE_OS::vsnprintf (stack_buf, DEFAULT_COMMAND_LINE_BUF_LEN, format, argp);
// End varargs.
va_end (argp);
@@ -1018,8 +1016,7 @@ ACE_Process_Options::setenv (const ACE_TCHAR *format, ...)
return -1;
// Append the string to are environment buffer.
- if (this->setenv_i (stack_buf,
- ACE_OS::strlen (stack_buf)) == -1)
+ if (this->setenv_i (stack_buf, ACE_OS::strlen (stack_buf)) == -1)
return -1;
#if defined (ACE_WIN32)
@@ -1136,8 +1133,7 @@ ACE_Process_Options::setenv_i (ACE_TCHAR *assignment,
len * sizeof (ACE_TCHAR));
// Update the argv array.
- environment_argv_[environment_argv_index_++] =
- environment_buf_ + environment_buf_index_;
+ environment_argv_[environment_argv_index_++] = environment_buf_ + environment_buf_index_;
environment_argv_[environment_argv_index_] = 0;
// Update our index.
@@ -1171,7 +1167,6 @@ ACE_Process_Options::set_handles (ACE_HANDLE std_in,
// processes that were launched from services. In this case we need to make
// sure not to return -1 from setting std_in so that we can process std_out
// and std_err.
-
if (std_in)
{
if (!::DuplicateHandle (::GetCurrentProcess (),
@@ -1448,10 +1443,6 @@ ACE_Process_Options::passed_handles (ACE_Handle_Set &set) const
return 1;
}
-ACE_Managed_Process::~ACE_Managed_Process ()
-{
-}
-
ACE_ALLOC_HOOK_DEFINE(ACE_Managed_Process)
void
diff --git a/ACE/ace/Process.h b/ACE/ace/Process.h
index 21b3f065e7a..7e00b3dc975 100644
--- a/ACE/ace/Process.h
+++ b/ACE/ace/Process.h
@@ -687,13 +687,12 @@ class ACE_Export ACE_Managed_Process : public ACE_Process
{
public:
/// Cleanup by deleting @c this.
- virtual void unmanage ();
+ void unmanage () override;
ACE_ALLOC_HOOK_DECLARE;
protected:
- /// Make sure that we're allocated dynamically!
- virtual ~ACE_Managed_Process ();
+ ~ACE_Managed_Process () override = default;
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 3596704e008..7da08d0f8cb 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -3242,7 +3242,7 @@ TAO_ORB_Core::connection_timeout_hook (Timeout_Hook hook)
#define TOCSRi TAO_ORB_Core_Static_Resources::instance ()
- // A consern was raised that since this function is called by two
+ // A concern was raised that since this function is called by two
// different initializers there may be a race condition that might
// require a lock. We are not using a lock at this time because of
// two callers, one happens only during service directive processing
@@ -3250,14 +3250,13 @@ TAO_ORB_Core::connection_timeout_hook (Timeout_Hook hook)
// happens when the OC_Endpoint_Selector_Factory is loaded, the
// latter is part of the messaging library. The messaging library
// calls this function as part of pre_init processing, and this call
- // happes for every ORB instance. This was the case before these The
+ // happens for every ORB instance. This was the case before these The
// latter call occurs when the messaging library is loaded. The
// redundant calls occurred then as well. Second, it isn't clear how
// a lock in this static method would react in the face of windows
// dlls, shared memory segments, etc. Therefore we are continuing to
// keep this code lockless as it always was, assuming no
- // simultanious overwrite will occur.
-
+ // simultaneous overwrite will occur.
if (TOCSRi->connection_timeout_hook_ == nullptr)
{
if (TAO_debug_level > 2)