diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-08-25 17:15:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 17:15:17 +0200 |
commit | c30292ec4b7f6d800b945c5226cbaf1e695df0fd (patch) | |
tree | 05c66e33464a3c6cbdcfb49b074354f16651fd0b | |
parent | 5be4b01d123bebfc355cef1ec83e2b5d041b6ac8 (diff) | |
parent | ec41c7dc9431f851d4b9231f8fb7a1c54054a4cd (diff) | |
download | ATCD-c30292ec4b7f6d800b945c5226cbaf1e695df0fd.tar.gz |
Merge pull request #1220 from jwillemsen/master
Use bool for found_a_port and removed some unnecessary casts
-rw-r--r-- | TAO/tao/IIOP_Acceptor.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 26 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_ORB_Loader.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/Strategies/SCIOP_Acceptor.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/default_resource.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/default_server.cpp | 2 |
6 files changed, 22 insertions, 22 deletions
diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index 3a7f2807b69..3e5dd1f6c97 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -1230,7 +1230,7 @@ TAO_IIOP_Acceptor::parse_options_i (int &argc, -1); if (name == "portspan") { - int range = static_cast <int> (ACE_OS::atoi (value.c_str ())); + int const range = ACE_OS::atoi (value.c_str ()); // @@ What's the lower bound on the range? zero, or one? if (range < 1 || range > ACE_MAX_DEFAULT_PORT) TAOLIB_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index e91407c0d79..7a9a212df75 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -698,7 +698,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBPreferIPV6Interfaces")))) { - int prefer_ipv6_interfaces = ACE_OS::atoi (current_arg); + int const prefer_ipv6_interfaces = ACE_OS::atoi (current_arg); if (prefer_ipv6_interfaces) this->orb_params ()->prefer_ipv6_interfaces (true); else @@ -709,7 +709,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBConnectIPV6Only")))) { - int connect_ipv6_only = ACE_OS::atoi (current_arg); + int const connect_ipv6_only = ACE_OS::atoi (current_arg); if (connect_ipv6_only) this->orb_params ()->connect_ipv6_only (true); else @@ -720,7 +720,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if ((current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBUseIPV6LinkLocal")))) { - int use_ipv6_link_local = ACE_OS::atoi (current_arg); + int const use_ipv6_link_local = ACE_OS::atoi (current_arg); if (use_ipv6_link_local) this->orb_params ()->use_ipv6_link_local (true); else @@ -1105,7 +1105,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardInvocationOnObjectNotExist")))) { - int forward = ACE_OS::atoi (current_arg); + int const forward = ACE_OS::atoi (current_arg); if (forward) this->orb_params_.forward_invocation_on_object_not_exist (true); else @@ -1116,14 +1116,14 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnTransientLimit")))) { - int limit = ACE_OS::atoi (current_arg); + int const limit = ACE_OS::atoi (current_arg); this->orb_params_.forward_on_exception_limit (TAO::FOE_TRANSIENT, limit); arg_shifter.consume_arg (); } else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnCommFailureLimit")))) { - int limit = ACE_OS::atoi (current_arg); + int const limit = ACE_OS::atoi (current_arg); this->orb_params_.forward_on_exception_limit ( TAO::FOE_COMM_FAILURE, limit); arg_shifter.consume_arg (); @@ -1131,7 +1131,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnObjectNotExistLimit")))) { - int limit = ACE_OS::atoi (current_arg); + int const limit = ACE_OS::atoi (current_arg); this->orb_params_.forward_on_exception_limit ( TAO::FOE_OBJECT_NOT_EXIST, limit); arg_shifter.consume_arg (); @@ -1139,7 +1139,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnInvObjrefLimit")))) { - int limit = ACE_OS::atoi (current_arg); + int const limit = ACE_OS::atoi (current_arg); this->orb_params_.forward_on_exception_limit ( TAO::FOE_INV_OBJREF, limit); arg_shifter.consume_arg (); @@ -1147,7 +1147,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnReplyClosedLimit")))) { - int limit = ACE_OS::atoi (current_arg); + int const limit = ACE_OS::atoi (current_arg); this->orb_params_.invocation_retry_params () .forward_on_reply_closed_limit_ = limit; arg_shifter.consume_arg (); @@ -1155,7 +1155,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardDelay")))) { - int msecs = ACE_OS::atoi (current_arg); + int const msecs = ACE_OS::atoi (current_arg); ACE_Time_Value delay(0, 1000*msecs); this->orb_params_.forward_on_exception_delay (delay); arg_shifter.consume_arg (); @@ -1163,7 +1163,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnceOnObjectNotExist")))) { - int forward = ACE_OS::atoi (current_arg); + int const forward = ACE_OS::atoi (current_arg); if (forward) this->orb_params_.forward_once_exception (TAO::FOE_OBJECT_NOT_EXIST); @@ -1172,7 +1172,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnceOnCommFailure")))) { - int forward = ACE_OS::atoi (current_arg); + int const forward = ACE_OS::atoi (current_arg); if (forward) this->orb_params_.forward_once_exception (TAO::FOE_COMM_FAILURE); @@ -1181,7 +1181,7 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBForwardOnceOnTransient")))) { - int forward = ACE_OS::atoi (current_arg); + int const forward = ACE_OS::atoi (current_arg); if (forward) this->orb_params_.forward_once_exception (TAO::FOE_TRANSIENT); diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp index 4ba033315b0..5e2f2cc3ff2 100644 --- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp +++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp @@ -147,7 +147,7 @@ TAO_RT_ORB_Loader::init (int argc, ACE_TCHAR* argv[]) (ACE_TEXT("-RTORBDynamicThreadIdleTimeout")))) { const ACE_TCHAR *name = current_arg; - int timeout = ACE_OS::atoi (name); + int const timeout = ACE_OS::atoi (name); dynamic_thread_time = ACE_Time_Value (0, timeout); lifespan = TAO_RT_ORBInitializer::TAO_RTCORBA_DT_IDLE; arg_shifter.consume_arg (); @@ -156,7 +156,7 @@ TAO_RT_ORB_Loader::init (int argc, ACE_TCHAR* argv[]) (ACE_TEXT("-RTORBDynamicThreadRunTime")))) { const ACE_TCHAR *name = current_arg; - int timeout = ACE_OS::atoi (name); + int const timeout = ACE_OS::atoi (name); dynamic_thread_time = ACE_Time_Value (0, timeout); lifespan = TAO_RT_ORBInitializer::TAO_RTCORBA_DT_FIXED; arg_shifter.consume_arg (); diff --git a/TAO/tao/Strategies/SCIOP_Acceptor.cpp b/TAO/tao/Strategies/SCIOP_Acceptor.cpp index 65e10a506ff..ec0af739457 100644 --- a/TAO/tao/Strategies/SCIOP_Acceptor.cpp +++ b/TAO/tao/Strategies/SCIOP_Acceptor.cpp @@ -525,7 +525,7 @@ TAO_SCIOP_Acceptor::open_i (const ACE_Multihomed_INET_Addr& addr, { ACE_Multihomed_INET_Addr a(addr); - int found_a_port = 0; + bool found_a_port = false; ACE_UINT32 last_port = requested_port + this->port_span_ - 1; if (last_port > ACE_MAX_DEFAULT_PORT) { @@ -547,13 +547,13 @@ TAO_SCIOP_Acceptor::open_i (const ACE_Multihomed_INET_Addr& addr, this->accept_strategy_, this->concurrency_strategy_) != -1) { - found_a_port = 1; + found_a_port = true; break; } } // Now, if we couldn't locate a port, we punt - if (! found_a_port) + if (!found_a_port) { if (TAO_debug_level > 0) TAOLIB_DEBUG ((LM_DEBUG, @@ -1000,7 +1000,7 @@ TAO_SCIOP_Acceptor::parse_options (const char *str) } else if (name == "portspan") { - int range = static_cast<int> (ACE_OS::atoi (value.c_str ())); + int const range = ACE_OS::atoi (value.c_str ()); // @@ What's the lower bound on the range? zero, or one? if (range < 1 || range > ACE_MAX_DEFAULT_PORT) TAOLIB_ERROR_RETURN ((LM_ERROR, diff --git a/TAO/tao/default_resource.cpp b/TAO/tao/default_resource.cpp index 8ea0122bbb4..becfa443f70 100644 --- a/TAO/tao/default_resource.cpp +++ b/TAO/tao/default_resource.cpp @@ -429,7 +429,7 @@ TAO_Default_Resource_Factory::init (int argc, ACE_TCHAR *argv[]) ++curarg; if (curarg < argc) { - int tmp = ACE_OS::atoi (argv[curarg]); + int const tmp = ACE_OS::atoi (argv[curarg]); if (tmp == 0) this->drop_replies_ = false; diff --git a/TAO/tao/default_server.cpp b/TAO/tao/default_server.cpp index f37c5d498c3..b75b2cff94f 100644 --- a/TAO/tao/default_server.cpp +++ b/TAO/tao/default_server.cpp @@ -129,7 +129,7 @@ TAO_Default_Server_Strategy_Factory::parse_args (int argc, ACE_TCHAR* argv[]) else { this->thread_per_connection_use_timeout_ = 1; - int milliseconds = ACE_OS::atoi (name); + int const milliseconds = ACE_OS::atoi (name); this->thread_per_connection_timeout_.set (0, 1000 * milliseconds); } |