summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2014-08-17 18:50:47 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2014-08-17 18:50:47 +0000
commit4abbc21c92c97476d44e513386113e10cc7dd4d0 (patch)
tree81a04d79030da91ce14897df947c9c9815e617ac
parentd196265cdae55e994775bd5eb55e623a8b28c9b8 (diff)
downloadATCD-4abbc21c92c97476d44e513386113e10cc7dd4d0.tar.gz
Sun Aug 17 18:52:48 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp: Removed if statements, the regular and else clause had the exact same code, reported by Coverity * tests/Smart_Proxies/Benchmark/client.cpp: * tests/Smart_Proxies/Benchmark/server.cpp: * tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h: * tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp: * tests/Smart_Proxies/On_Demand/client.cpp: * tests/Smart_Proxies/On_Demand/server.cpp: * tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp: * tests/Smart_Proxies/Policy/client.cpp: * tests/Smart_Proxies/Policy/server.cpp: * tests/Smart_Proxies/Smart_Proxy_Impl.h: * tests/Smart_Proxies/client.cpp: * tests/Smart_Proxies/server.cpp: Fixed Coverity and valgrind reported errors
-rw-r--r--TAO/ChangeLog20
-rw-r--r--TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp45
-rw-r--r--TAO/tests/Smart_Proxies/Benchmark/client.cpp3
-rw-r--r--TAO/tests/Smart_Proxies/Benchmark/server.cpp7
-rw-r--r--TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp9
-rw-r--r--TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h6
-rw-r--r--TAO/tests/Smart_Proxies/On_Demand/client.cpp4
-rw-r--r--TAO/tests/Smart_Proxies/On_Demand/server.cpp7
-rw-r--r--TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp2
-rw-r--r--TAO/tests/Smart_Proxies/Policy/client.cpp5
-rw-r--r--TAO/tests/Smart_Proxies/Policy/server.cpp12
-rw-r--r--TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h1
-rw-r--r--TAO/tests/Smart_Proxies/client.cpp7
-rw-r--r--TAO/tests/Smart_Proxies/server.cpp2
14 files changed, 57 insertions, 73 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 285ff3aa4e3..1a4c6206e87 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,23 @@
+Sun Aug 17 18:52:48 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp:
+ Removed if statements, the regular and else clause had the
+ exact same code, reported by Coverity
+
+ * tests/Smart_Proxies/Benchmark/client.cpp:
+ * tests/Smart_Proxies/Benchmark/server.cpp:
+ * tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h:
+ * tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp:
+ * tests/Smart_Proxies/On_Demand/client.cpp:
+ * tests/Smart_Proxies/On_Demand/server.cpp:
+ * tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp:
+ * tests/Smart_Proxies/Policy/client.cpp:
+ * tests/Smart_Proxies/Policy/server.cpp:
+ * tests/Smart_Proxies/Smart_Proxy_Impl.h:
+ * tests/Smart_Proxies/client.cpp:
+ * tests/Smart_Proxies/server.cpp:
+ Fixed Coverity and valgrind reported errors
+
Thu Aug 7 20:01:02 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
* orbsvcs/tests/ImplRepo/Bug_4152_Regression/run_test.pl:
diff --git a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp
index 479b7c21c39..934a360194b 100644
--- a/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp
+++ b/TAO/orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp
@@ -12,65 +12,36 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
template<class Target, class Object> int
-TAO_ESF_Connected_Command<Target,Object>::execute (void* arg)
+TAO_ESF_Connected_Command<Target,Object>::execute (void* /*arg*/)
{
- if (arg != 0)
- {
- this->target_->connected_i (this->object_);
- }
- else
- {
- this->target_->connected_i (this->object_);
- }
-
+ this->target_->connected_i (this->object_);
return 0;
}
// ****************************************************************
template<class Target, class Object> int
-TAO_ESF_Reconnected_Command<Target,Object>::execute (void* arg)
+TAO_ESF_Reconnected_Command<Target,Object>::execute (void* /*arg*/)
{
- if (arg != 0)
- {
- this->target_->reconnected_i (this->object_);
- }
- else
- {
- this->target_->reconnected_i (this->object_);
- }
+ this->target_->reconnected_i (this->object_);
return 0;
}
// ****************************************************************
template<class Target, class Object> int
-TAO_ESF_Disconnected_Command<Target,Object>::execute (void* arg)
+TAO_ESF_Disconnected_Command<Target,Object>::execute (void* /*arg*/)
{
- if (arg != 0)
- {
- this->target_->disconnected_i (this->object_);
- }
- else
- {
- this->target_->disconnected_i (this->object_);
- }
+ this->target_->disconnected_i (this->object_);
return 0;
}
// ****************************************************************
template<class Target> int
-TAO_ESF_Shutdown_Command<Target>::execute (void* arg)
+TAO_ESF_Shutdown_Command<Target>::execute (void* /*arg*/)
{
- if (arg != 0)
- {
- this->target_->shutdown_i ();
- }
- else
- {
- this->target_->shutdown_i ();
- }
+ this->target_->shutdown_i ();
return 0;
}
diff --git a/TAO/tests/Smart_Proxies/Benchmark/client.cpp b/TAO/tests/Smart_Proxies/Benchmark/client.cpp
index 13e2f32d419..fbc3ea0c10f 100644
--- a/TAO/tests/Smart_Proxies/Benchmark/client.cpp
+++ b/TAO/tests/Smart_Proxies/Benchmark/client.cpp
@@ -67,7 +67,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'i':
- ior = ACE_OS::strdup (get_opts.opt_arg ());
+ ior = get_opts.opt_arg ();
break;
case 'n':
niterations = ACE_OS::atoi (get_opts.opt_arg ());
@@ -232,6 +232,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
server1->shutdown ();
*/
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/Benchmark/server.cpp b/TAO/tests/Smart_Proxies/Benchmark/server.cpp
index e1d7bede99d..ac85e5a3806 100644
--- a/TAO/tests/Smart_Proxies/Benchmark/server.cpp
+++ b/TAO/tests/Smart_Proxies/Benchmark/server.cpp
@@ -72,7 +72,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'o':
- ior_output_file = ACE_OS::strdup (get_opts.opt_arg ());
+ ior_output_file = get_opts.opt_arg ();
break;
case '?':
default:
@@ -147,8 +147,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG,
"event loop finished\n"));
- root_poa->destroy (1,
- 1);
+ root_poa->destroy (true, true);
+
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp
index 65bb3c88526..fc629e39647 100644
--- a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp
+++ b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp
@@ -36,13 +36,10 @@ Smart_Diamond_Top_Proxy::shape ()
char *ans= 0;
try
{
- ans =
- ACE_OS::strdup (
- Diamond::TAO_Diamond_Top_Smart_Proxy_Base::shape (
- )
- );
+ ans = ACE_OS::strdup (
+ Diamond::TAO_Diamond_Top_Smart_Proxy_Base::shape ());
- ACE_DEBUG ((LM_DEBUG, "%s\n", ans));
+ ACE_DEBUG ((LM_DEBUG, "%C\n", ans));
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h
index 6149b7f5dd4..539b46165a7 100644
--- a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h
+++ b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h
@@ -8,8 +8,7 @@
class MY_Stub_Export Smart_Diamond_Top_Factory : public virtual Diamond::TAO_Diamond_Top_Default_Proxy_Factory
{
- public:
-
+public:
Smart_Diamond_Top_Factory (void);
virtual Diamond::Top_ptr create_proxy (Diamond::Top_ptr proxy);
@@ -20,8 +19,7 @@ class MY_Stub_Export Smart_Diamond_Top_Factory : public virtual Diamond::TAO_Dia
class MY_Stub_Export Smart_Diamond_Top_Proxy : public virtual Diamond::TAO_Diamond_Top_Smart_Proxy_Base
{
- public:
-
+public:
Smart_Diamond_Top_Proxy (Diamond::Top_ptr proxy);
virtual char * shape ();
diff --git a/TAO/tests/Smart_Proxies/On_Demand/client.cpp b/TAO/tests/Smart_Proxies/On_Demand/client.cpp
index 13cd632d504..c485746550e 100644
--- a/TAO/tests/Smart_Proxies/On_Demand/client.cpp
+++ b/TAO/tests/Smart_Proxies/On_Demand/client.cpp
@@ -30,7 +30,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'i':
- ior = ACE_OS::strdup (get_opts.opt_arg ());
+ ior = get_opts.opt_arg ();
break;
case '?':
default:
@@ -44,7 +44,6 @@ parse_args (int argc, ACE_TCHAR *argv[])
return 0;
}
-
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
@@ -76,6 +75,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
server->shutdown ();
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/On_Demand/server.cpp b/TAO/tests/Smart_Proxies/On_Demand/server.cpp
index 1da423a2ca8..b73b57a4418 100644
--- a/TAO/tests/Smart_Proxies/On_Demand/server.cpp
+++ b/TAO/tests/Smart_Proxies/On_Demand/server.cpp
@@ -69,7 +69,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'o':
- ior_output_file = ACE_OS::strdup (get_opts.opt_arg ());
+ ior_output_file = get_opts.opt_arg ();
break;
case '?':
default:
@@ -143,8 +143,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
- root_poa->destroy (1,
- 1);
+ root_poa->destroy (true, true);
+
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp
index b71652cae3a..3edc23f2103 100644
--- a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp
+++ b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp
@@ -15,7 +15,7 @@ Smart_Test_Factory::create_proxy (Test_ptr proxy)
ACE_DEBUG ((LM_DEBUG,
"create_smart_proxy\n"));
- if (CORBA::is_nil (proxy) == 0)
+ if (CORBA::is_nil (proxy))
ACE_NEW_RETURN (proxy, Smart_Test_Proxy (proxy), 0);
return proxy;
diff --git a/TAO/tests/Smart_Proxies/Policy/client.cpp b/TAO/tests/Smart_Proxies/Policy/client.cpp
index 18858ee8601..19f8e987186 100644
--- a/TAO/tests/Smart_Proxies/Policy/client.cpp
+++ b/TAO/tests/Smart_Proxies/Policy/client.cpp
@@ -32,10 +32,10 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'i':
- ior1 = ACE_OS::strdup (get_opts.opt_arg ());
+ ior1 = get_opts.opt_arg ();
break;
case 'j':
- ior2 = ACE_OS::strdup (get_opts.opt_arg ());
+ ior2 = get_opts.opt_arg ();
break;
case 'f':
one_shot_factory = ACE_OS::atoi (get_opts.opt_arg ());
@@ -122,6 +122,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
run_test (orb.in (), 1);
run_test (orb.in (), 2);
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/Policy/server.cpp b/TAO/tests/Smart_Proxies/Policy/server.cpp
index 33a19e5aff6..f62fb618bb1 100644
--- a/TAO/tests/Smart_Proxies/Policy/server.cpp
+++ b/TAO/tests/Smart_Proxies/Policy/server.cpp
@@ -69,7 +69,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'o':
- ior_output_file = ACE_OS::strdup (get_opts.opt_arg ());
+ ior_output_file = get_opts.opt_arg ();
break;
case '?':
default:
@@ -87,11 +87,9 @@ parse_args (int argc, ACE_TCHAR *argv[])
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
-
try
{
- CORBA::ORB_var orb = CORBA::ORB_init (argc,
- argv);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
@@ -104,7 +102,6 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
PortableServer::POA_var root_poa =
PortableServer::POA::_narrow (object.in ());
-
// Get the POAManager of the RootPOA.
PortableServer::POAManager_var poa_manager =
root_poa->the_POAManager ();
@@ -145,8 +142,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[])
ACE_DEBUG ((LM_DEBUG,
"event loop finished\n"));
- root_poa->destroy (1,
- 1);
+ root_poa->destroy (true, true);
+
+ orb->destroy ();
}
catch (const CORBA::Exception& ex)
{
diff --git a/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h b/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h
index ed7537777ce..4000212331e 100644
--- a/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h
+++ b/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h
@@ -6,7 +6,6 @@
class Smart_Test_Factory : public virtual TAO_Test_Default_Proxy_Factory
{
public:
-
Smart_Test_Factory (void);
virtual Test_ptr create_proxy (Test_ptr proxy);
diff --git a/TAO/tests/Smart_Proxies/client.cpp b/TAO/tests/Smart_Proxies/client.cpp
index 2000a28b4b2..c863a84e851 100644
--- a/TAO/tests/Smart_Proxies/client.cpp
+++ b/TAO/tests/Smart_Proxies/client.cpp
@@ -31,7 +31,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'i':
- ior = ACE_OS::strdup (get_opts.opt_arg ());
+ ior = get_opts.opt_arg ();
break;
case '?':
default:
@@ -45,16 +45,13 @@ parse_args (int argc, ACE_TCHAR *argv[])
return 0;
}
-
int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
int status = 0;
try
{
- CORBA::ORB_var orb =
- CORBA::ORB_init (argc,
- argv);
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
if (parse_args (argc, argv) != 0)
return 1;
diff --git a/TAO/tests/Smart_Proxies/server.cpp b/TAO/tests/Smart_Proxies/server.cpp
index 45705ad98aa..3a6c5bb26e9 100644
--- a/TAO/tests/Smart_Proxies/server.cpp
+++ b/TAO/tests/Smart_Proxies/server.cpp
@@ -69,7 +69,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
switch (c)
{
case 'o':
- ior_output_file = ACE_OS::strdup (get_opts.opt_arg ());
+ ior_output_file = get_opts.opt_arg ();
break;
case '?':
default: