diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-30 11:36:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-30 11:36:32 +0100 |
commit | a46852de783998ac9c3384fdb55277ef3906cf15 (patch) | |
tree | e3fefdd98ad8f391aee98435345608f85c252c95 | |
parent | 4fca5417b6400f163b718d078cea24efb516b4ca (diff) | |
parent | fb47ee90c59a357e4828c22e2f61aa03cda551a9 (diff) | |
download | ATCD-a46852de783998ac9c3384fdb55277ef3906cf15.tar.gz |
Merge pull request #1364 from jwillemsen/jwi-compilewarnings
Fix warnings in some tests
27 files changed, 75 insertions, 101 deletions
diff --git a/ACE/examples/DLL/Magazine.h b/ACE/examples/DLL/Magazine.h index 85413e98aa4..c21049f38ec 100644 --- a/ACE/examples/DLL/Magazine.h +++ b/ACE/examples/DLL/Magazine.h @@ -26,12 +26,11 @@ class Magazine { public: - /// No-op virtual destructor. - virtual ~Magazine (void) {}; + virtual ~Magazine () {}; /// This method gives the title of the magazine. - virtual void title (void) = 0; + virtual void title () = 0; }; #endif /* MAGAZINE_H */ diff --git a/ACE/examples/DLL/Newsweek.cpp b/ACE/examples/DLL/Newsweek.cpp index e0251b0b906..4de6025b7f0 100644 --- a/ACE/examples/DLL/Newsweek.cpp +++ b/ACE/examples/DLL/Newsweek.cpp @@ -7,8 +7,7 @@ // Implementation of the abstract class method which describes // the magazine. - -void Newsweek::title (void) +void Newsweek::title () { ACE_DEBUG ((LM_DEBUG, "Newsweek: Vol. 44923 Stardate: 12.3054\n")); diff --git a/ACE/examples/DLL/Newsweek.h b/ACE/examples/DLL/Newsweek.h index ddf97a96604..18175311771 100644 --- a/ACE/examples/DLL/Newsweek.h +++ b/ACE/examples/DLL/Newsweek.h @@ -34,9 +34,8 @@ class Newsweek : public Magazine { public: - // This is the abstract class method which describes the magazine. - void title (void); + void title () override; // Overload the new/delete opertors so the object will be // created/deleted using the memory allocator associated with the diff --git a/ACE/examples/DLL/README b/ACE/examples/DLL/README index 0186adfcf95..e22769bf488 100644 --- a/ACE/examples/DLL/README +++ b/ACE/examples/DLL/README @@ -1,5 +1,3 @@ - - DLL Test Example ---------------- diff --git a/ACE/examples/DLL/Today.cpp b/ACE/examples/DLL/Today.cpp index 6427778bd34..522bc6352ec 100644 --- a/ACE/examples/DLL/Today.cpp +++ b/ACE/examples/DLL/Today.cpp @@ -7,9 +7,8 @@ // Implementation of the abstract class method which describes the // magazine. - void -Today::title (void) +Today::title () { ACE_DEBUG ((LM_DEBUG, "Today: XML Special Apr 02\n")); diff --git a/ACE/examples/DLL/Today.h b/ACE/examples/DLL/Today.h index 14fb80459c2..def10393c7f 100644 --- a/ACE/examples/DLL/Today.h +++ b/ACE/examples/DLL/Today.h @@ -34,10 +34,9 @@ class Today : public Magazine { public: - // The virtual abstract class method which returns the title of the // magazine. - void title (void); + void title () override; // Overload the new/delete opertors so the object will be // created/deleted using the memory allocator associated with the diff --git a/ACE/examples/DLL/test_dll.cpp b/ACE/examples/DLL/test_dll.cpp index 74b53aee98e..5eb1276cc80 100644 --- a/ACE/examples/DLL/test_dll.cpp +++ b/ACE/examples/DLL/test_dll.cpp @@ -3,10 +3,8 @@ #include "Magazine.h" #include "ace/DLL.h" -#include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" - - +#include <memory> typedef Magazine* (*Magazine_Creator) (void); @@ -42,7 +40,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } { - auto_ptr <Magazine> magazine (mc ()); + std::unique_ptr<Magazine> magazine (mc ()); magazine->title (); } @@ -76,7 +74,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } { - auto_ptr <Magazine> magazine (mc ()); + std::unique_ptr<Magazine> magazine (mc ()); magazine->title (); } diff --git a/ACE/examples/Smart_Pointers/widget_test.cpp b/ACE/examples/Smart_Pointers/widget_test.cpp index 95b5fa5f721..98bfe7efef9 100644 --- a/ACE/examples/Smart_Pointers/widget_test.cpp +++ b/ACE/examples/Smart_Pointers/widget_test.cpp @@ -7,36 +7,32 @@ */ //============================================================================= -#include "ace/Auto_Ptr.h" -#include "ace/Refcounted_Auto_Ptr.h" -#include "ace/Unbounded_Queue.h" -#include "ace/Synch_Traits.h" -#include "ace/Thread_Mutex.h" -#include "ace/Null_Mutex.h" +#include "ace/OS_main.h" #include "Widget.h" #include "Widget_Factory.h" #include "Widget_Part.h" #include "Widget_Part_Factory.h" +#include <memory> int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { ACE_UNUSED_ARG (argc); ACE_UNUSED_ARG (argv); - auto_ptr<Widget> w1 (Widget_Factory::create_widget ()); + std::unique_ptr<Widget> w1 (Widget_Factory::create_widget ()); w1->add_part (Widget_Part_Factory::create_widget_part (w1.get(), "part1", 1)); w1->add_part (Widget_Part_Factory::create_widget_part (w1.get(), "part2", 2)); w1->add_part (Widget_Part_Factory::create_widget_part (w1.get(), "part3", 3)); w1->list_parts (); - auto_ptr<Widget_Part> p1 (w1->remove_part ()); + std::unique_ptr<Widget_Part> p1 (w1->remove_part ()); p1->print_info (); - auto_ptr<Widget_Part> p2 (w1->remove_part ()); + std::unique_ptr<Widget_Part> p2 (w1->remove_part ()); w1->list_parts (); - auto_ptr<Widget> w2 (Widget_Factory::create_widget ()); + std::unique_ptr<Widget> w2 (Widget_Factory::create_widget ()); w2->add_part (Widget_Part_Factory::create_widget_part (w2.get(), "part4", 4)); Widget_Part *p3 = Widget_Part_Factory::create_widget_part (w2.get(), "part5", 5); w2->add_part (p3); diff --git a/ACE/tests/Compiler_Features_23_Test.cpp b/ACE/tests/Compiler_Features_23_Test.cpp index 39fc0962ab9..711e46fb231 100644 --- a/ACE/tests/Compiler_Features_23_Test.cpp +++ b/ACE/tests/Compiler_Features_23_Test.cpp @@ -38,6 +38,8 @@ run_main (int, ACE_TCHAR *[]) ACE_DEBUG ((LM_INFO, ACE_TEXT ("Compiler Feature 23 Test does compile and run.\n"))); + ACE_UNUSED_ARG(x); + ACE_END_TEST; return 0; diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp index 9e559b2fa09..e4597a137f1 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.cpp @@ -155,7 +155,7 @@ void TAO_FTEC_Group_Manager::add_member ( publisher->setup_info(new_impl->info_list, new_impl->my_position, object_group_ref_version)); - ACE_auto_ptr_reset(group_info, group_info1.release()); + group_info = std::move(group_info1); last_one = true; } diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h index cce2d0abd0a..00207ae4d6e 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Group_Manager.h @@ -18,7 +18,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - TAO_BEGIN_VERSIONED_NAMESPACE_DECL struct TAO_FTEC_Group_Manager_Impl; @@ -39,8 +38,7 @@ public: const FTRT::ManagerInfoList & info_list, CORBA::ULong object_group_ref_version); - void join_group ( - const FTRT::ManagerInfo & info); + void join_group (const FTRT::ManagerInfo & info); void add_member ( const FTRT::ManagerInfo & info, @@ -50,13 +48,10 @@ public: const FTRT::Location & crashed_location, CORBA::ULong object_group_ref_version); - void replica_crashed ( - const FTRT::Location & location); + void replica_crashed (const FTRT::Location & location); private: - virtual void get_state ( - FtRtecEventChannelAdmin::EventChannelState & s - )=0; + virtual void get_state (FtRtecEventChannelAdmin::EventChannelState & s)=0; virtual void connection_closed(); diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h index f2bae73917b..a2715144718 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_ProxyConsumer.h @@ -34,7 +34,6 @@ public: virtual void activate ( RtecEventChannelAdmin::ProxyPushConsumer_ptr &proxy); - // = The RtecEventChannelAdmin::ProxyPushConsumer methods... virtual void connect_push_supplier ( RtecEventComm::PushSupplier_ptr push_supplier, diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h index 0544fe8c8ed..ec5d82947ef 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_SupplierAdmin.h @@ -43,7 +43,6 @@ class TAO_FTEC_SupplierAdmin FtRtecEventChannelAdmin::SupplierAdminState> { public: - static const FtRtecEventChannelAdmin::OperationType OBTAIN_ID; typedef FT_ProxyAdmin<TAO_FTEC_SupplierAdmin, diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp index 8cddd9bcb50..80f63e40ab1 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.cpp @@ -27,8 +27,7 @@ namespace FTRTEC { } int - Fault_Detector_Loader::init (int argc, - ACE_TCHAR* argv[]) + Fault_Detector_Loader::init (int argc, ACE_TCHAR* argv[]) { static int initialized = 0; @@ -54,7 +53,7 @@ namespace FTRTEC { } else { ACE_NEW_RETURN(detector, TCP_Fault_Detector, -1); - ACE_auto_ptr_reset(detector_, detector); + detector_.reset (detector); } return detector_->init(argc, argv); } diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h index ec04504695b..23113d1dd0d 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/Fault_Detector_Loader.h @@ -19,7 +19,7 @@ #include "ace/Service_Object.h" #include "ace/Service_Config.h" -#include "ace/Auto_Ptr.h" +#include <memory> #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -34,16 +34,16 @@ namespace FTRTEC { { public: /// Constructor. - Fault_Detector_Loader (void); + Fault_Detector_Loader (); /// Destructor. - virtual ~Fault_Detector_Loader (void); + virtual ~Fault_Detector_Loader (); virtual int init (int argc, ACE_TCHAR* []); Fault_Detector* detector(); private: - auto_ptr<Fault_Detector> detector_; + std::unique_ptr<Fault_Detector> detector_; }; } diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp index a2280c5c416..4e757109620 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.cpp @@ -144,7 +144,7 @@ GroupInfoPublisherBase::update_info(GroupInfoPublisherBase::Info_ptr& info) } } } - info_ = info; + info_ = std::move(info); } TAO_END_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h index 878e956a536..b4f6b370283 100644 --- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h +++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/GroupInfoPublisher.h @@ -16,7 +16,7 @@ #include "ace/Vector_T.h" #include "ace/Singleton.h" #include "ace/Synch.h" -#include "ace/Auto_Ptr.h" +#include <memory> #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -38,7 +38,7 @@ public: BackupList backups; }; - typedef auto_ptr<Info> Info_ptr; + typedef std::unique_ptr<Info> Info_ptr; friend class ACE_Singleton<GroupInfoPublisherBase, TAO_SYNCH_MUTEX>; void subscribe(TAO_FTEC_Become_Primary_Listener* listener); diff --git a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp index 1609ce1e6f9..f5735cdb6ee 100644 --- a/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Sched/Reconfig_Scheduler_T.cpp @@ -14,7 +14,7 @@ #include "orbsvcs/Log_Macros.h" #include "orbsvcs/Sched/Reconfig_Scheduler_T.h" #include "orbsvcs/Time_Utilities.h" -#include "ace/Auto_Ptr.h" +#include <memory> #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -200,7 +200,7 @@ init (int config_count, // (Re)initialize using the new settings. // Add the passed config infos to the scheduler - auto_ptr<RtecScheduler::Config_Info> new_config_info_ptr; + std::unique_ptr<RtecScheduler::Config_Info> new_config_info_ptr; for (i = 0; i < config_count; ++i) { RtecScheduler::Config_Info* new_config_info; @@ -209,7 +209,7 @@ init (int config_count, CORBA::NO_MEMORY ()); // Make sure the new config info is cleaned up if we exit abruptly. - ACE_auto_ptr_reset (new_config_info_ptr, new_config_info); + new_config_info_ptr.reset (new_config_info); result = config_info_map_.bind (config_info [i].preemption_priority, new_config_info); @@ -241,7 +241,7 @@ init (int config_count, new_config_info->preemption_priority; } - // Release the auto_ptr so it does not clean + // Release the unique_ptr so it does not clean // up the successfully bound config info. new_config_info_ptr.release (); @@ -1529,7 +1529,7 @@ create_i (const char *entry_point, CORBA::NO_MEMORY ()); // Make sure the new scheduling entry is cleaned up if we exit abruptly. - auto_ptr<TAO_RT_Info_Ex> new_rt_info_ptr (new_rt_info); + std::unique_ptr<TAO_RT_Info_Ex> new_rt_info_ptr (new_rt_info); // Set some reasonable default values, and store the passed ones. new_rt_info->entry_point = CORBA::string_dup (entry_point); @@ -1584,7 +1584,7 @@ create_i (const char *entry_point, CORBA::NO_MEMORY ()); // Make sure the new scheduling entry is cleaned up if we exit abruptly. - auto_ptr<TAO_Reconfig_Scheduler_Entry> new_sched_entry_ptr (new_sched_entry); + std::unique_ptr<TAO_Reconfig_Scheduler_Entry> new_sched_entry_ptr (new_sched_entry); // Maintain the size of the entry pointer array. maintain_scheduling_array (entry_ptr_array_, entry_ptr_array_size_, @@ -1685,7 +1685,7 @@ set_i (TAO_RT_Info_Ex *rt_info, // Make sure the new tuple is cleaned up if we exit abruptly. - auto_ptr<TAO_RT_Info_Tuple> tuple_auto_ptr (tuple_ptr); + std::unique_ptr<TAO_RT_Info_Tuple> tuple_auto_ptr (tuple_ptr); // ORBSVCS_DEBUG((LM_DEBUG, "Tuple not found. Inserting new tuple for RT_Info: %d, entry_ptr: 0x%x, tuple_ptr: 0x%x\n", // rt_info->handle, @@ -1708,14 +1708,12 @@ set_i (TAO_RT_Info_Ex *rt_info, ++this->rt_info_tuple_count_; - // All is well: release the auto pointer's hold on the tuple. + // All is well: release the unique pointer's hold on the tuple. tuple_auto_ptr.release (); } } } - - // Internal method to lookup a handle for an RT_Info, and return its // handle, or an error value if it's not present. @@ -2504,7 +2502,7 @@ assign_priorities_i (void) // strategy to decide when a new priority or subpriority is reached. TAO_RSE_Priority_Visitor<RECONFIG_SCHED_STRATEGY, ACE_LOCK> prio_visitor (this->rt_info_count_, this->entry_ptr_array_); - auto_ptr<RtecScheduler::Config_Info> new_config_info_ptr; + std::unique_ptr<RtecScheduler::Config_Info> new_config_info_ptr; for (i = 0; i <= this->rt_info_count_; ++i) { int result; @@ -2527,13 +2525,13 @@ assign_priorities_i (void) } else if (result == 1) { - RtecScheduler::Config_Info* new_config_info; + RtecScheduler::Config_Info* new_config_info {}; ACE_NEW_THROW_EX (new_config_info, RtecScheduler::Config_Info, CORBA::NO_MEMORY ()); // Make sure the new config info is cleaned up if we exit abruptly. - ACE_auto_ptr_reset (new_config_info_ptr, new_config_info); + new_config_info_ptr.reset (new_config_info); // Have the strategy fill in the new config info for that // priority level, using the representative scheduling entry. @@ -2567,7 +2565,7 @@ assign_priorities_i (void) break; } - // Release the auto_ptr so it does not clean + // Release the unique_ptr so it does not clean // up the successfully bound config info. new_config_info_ptr.release (); } diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp index d254b7c1773..b94687511fa 100644 --- a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp +++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.cpp @@ -16,10 +16,10 @@ #include "tao/ORB_Core.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" #include "ace/Sched_Params.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_strings.h" +#include <memory> #if defined (sun) # include <sys/lwp.h> /* for _lwp_self */ @@ -255,7 +255,7 @@ Test_ECG::run (int argc, ACE_TCHAR* argv[]) CosNaming::NamingContext_var naming_context = CosNaming::NamingContext::_narrow (naming_obj.in ()); - auto_ptr<POA_RtecScheduler::Scheduler> scheduler_impl; + std::unique_ptr<POA_RtecScheduler::Scheduler> scheduler_impl; RtecScheduler::Scheduler_var scheduler; switch (this->scheduling_type_) @@ -269,8 +269,8 @@ Test_ECG::run (int argc, ACE_TCHAR* argv[]) case Test_ECG::ss_local: { - auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Config_Scheduler); - scheduler_impl = auto_scheduler_impl; + std::unique_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Config_Scheduler); + scheduler_impl = std::move(auto_scheduler_impl); } if (scheduler_impl.get () == 0) return -1; @@ -287,12 +287,12 @@ Test_ECG::run (int argc, ACE_TCHAR* argv[]) sizeof (runtime_infos_1)/sizeof (runtime_infos_1[0]), runtime_infos_1); - auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl + std::unique_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Runtime_Scheduler (runtime_configs_1_size, runtime_configs_1, runtime_infos_1_size, runtime_infos_1)); - scheduler_impl = auto_scheduler_impl; + scheduler_impl = std::move(auto_scheduler_impl); if (scheduler_impl.get () == 0) return -1; @@ -307,12 +307,12 @@ Test_ECG::run (int argc, ACE_TCHAR* argv[]) sizeof (runtime_infos_2)/sizeof (runtime_infos_2[0]), runtime_infos_2); - auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl + std::unique_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Runtime_Scheduler (runtime_configs_2_size, runtime_configs_2, runtime_infos_2_size, runtime_infos_2)); - scheduler_impl = auto_scheduler_impl; + scheduler_impl = std::move(auto_scheduler_impl); if (scheduler_impl.get () == 0) return -1; @@ -327,12 +327,12 @@ Test_ECG::run (int argc, ACE_TCHAR* argv[]) sizeof (runtime_infos_3)/sizeof (runtime_infos_3[0]), runtime_infos_3); - auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl + std::unique_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Runtime_Scheduler (runtime_configs_3_size, runtime_configs_3, runtime_infos_3_size, runtime_infos_3)); - scheduler_impl = auto_scheduler_impl; + scheduler_impl = std::move(auto_scheduler_impl); if (scheduler_impl.get () == 0) return -1; @@ -344,8 +344,8 @@ Test_ECG::run (int argc, ACE_TCHAR* argv[]) "Unknown name <%C> defaulting to " "config scheduler\n", this->lcl_name_.c_str ())); - auto_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Config_Scheduler); - scheduler_impl = auto_scheduler_impl; + std::unique_ptr<POA_RtecScheduler::Scheduler> auto_scheduler_impl (new ACE_Config_Scheduler); + scheduler_impl = std::move(auto_scheduler_impl); if (scheduler_impl.get () == 0) return -1; diff --git a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h index 9ba503ad3fe..c0e92439226 100644 --- a/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h +++ b/TAO/orbsvcs/tests/EC_Multiple/EC_Multiple.h @@ -27,6 +27,7 @@ #include "orbsvcs/Channel_Clients_T.h" #include "orbsvcs/Event/EC_Gateway_Sched.h" #include "orbsvcs/CosNamingC.h" +#include <atomic> class Test_ECG; @@ -353,11 +354,11 @@ private: // to setup all the consumers. // The suppliers wait on the condition variable. - ACE_Atomic_Op<TAO_SYNCH_MUTEX,int> running_suppliers_; + std::atomic<int> running_suppliers_; // keep track of how many suppliers are still running so we shutdown // at the right moment. - ACE_Atomic_Op<TAO_SYNCH_MUTEX,int> running_consumers_; + std::atomic<int> running_consumers_; // keep track of how many consumers are still running so we shutdown // at the right moment. diff --git a/TAO/orbsvcs/tests/EC_Multiple/README b/TAO/orbsvcs/tests/EC_Multiple/README index 01009d37e0c..2306ce9e100 100644 --- a/TAO/orbsvcs/tests/EC_Multiple/README +++ b/TAO/orbsvcs/tests/EC_Multiple/README @@ -1,6 +1,4 @@ - - - This test ilustrates how to connect multiple ECs; it has many + This test illustrates how to connect multiple ECs; it has many options and can be configured to run a single EC, two ECs connected through a Gateway, short-circuit the EC, use a global, local or precomputed schedule, etc. diff --git a/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp b/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp index 315d6b03e94..c3da2d41833 100644 --- a/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp +++ b/TAO/orbsvcs/tests/EC_Throughput/ECT_Throughput.cpp @@ -13,12 +13,12 @@ #include "tao/debug.h" #include "ace/Get_Opt.h" -#include "ace/Auto_Ptr.h" #include "ace/Sched_Params.h" #include "ace/High_Res_Timer.h" #include "ace/OS_NS_strings.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_unistd.h" +#include <memory> int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) @@ -205,8 +205,6 @@ ECT_Throughput::run (int argc, ACE_TCHAR* argv[]) ACE_Scheduler_Factory::use_config (naming_context.in ()); #endif /* 0 */ - auto_ptr<POA_RtecEventChannelAdmin::EventChannel> ec_impl; - TAO_EC_Event_Channel_Attributes attr (root_poa.in (), root_poa.in ()); @@ -215,8 +213,7 @@ ECT_Throughput::run (int argc, ACE_TCHAR* argv[]) ec->activate (); - auto_ptr<POA_RtecEventChannelAdmin::EventChannel> auto_ec_impl (ec); - ec_impl = auto_ec_impl; + std::unique_ptr<POA_RtecEventChannelAdmin::EventChannel> ec_impl (ec); RtecEventChannelAdmin::EventChannel_var channel = ec_impl->_this (); diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp index 960f03e5911..acfd331e622 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp +++ b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.cpp @@ -1,6 +1,6 @@ #include "EC_Wrapper.h" #include "orbsvcs/Event/EC_Event_Channel.h" -#include "ace/Auto_Ptr.h" +#include <memory> EC_Wrapper::EC_Wrapper (void) : ec_impl_ (0), @@ -53,7 +53,7 @@ EC_Wrapper::init (CORBA::ORB_ptr orb, ACE_NEW_RETURN (impl, TAO_EC_Event_Channel (attr), -1); - auto_ptr<TAO_EC_Event_Channel> impl_release (impl); + std::unique_ptr<TAO_EC_Event_Channel> impl_release (impl); try { @@ -91,7 +91,7 @@ EC_Wrapper::for_suppliers (void) void EC_Wrapper::destroy_ec (void) { - auto_ptr<TAO_EC_Event_Channel> ec_impl_aptr (this->ec_impl_); + std::unique_ptr<TAO_EC_Event_Channel> ec_impl_aptr (this->ec_impl_); this->ec_impl_ = 0; if (ec_impl_aptr.get ()) diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h index 09790573f91..cf73b4bca21 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h +++ b/TAO/orbsvcs/tests/Event/Mcast/Common/EC_Wrapper.h @@ -26,7 +26,6 @@ class ECMcastTests_Export EC_Wrapper: public TAO_EC_Deactivated_Object { public: - /// Create a new EC_Wrapper object. /// (Constructor access is restricted to insure that all /// EC_Wrapper objects are heap-allocated.) @@ -56,13 +55,11 @@ public: //@} protected: - /// Constructor (protected). Clients can create new /// EC_Wrapper objects using the static create() method. EC_Wrapper (void); private: - /// Helper - destroys Event Channel and deactivate from POA, if /// necessary. void destroy_ec (void); diff --git a/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h index bbe81ff8729..455a9149cc9 100644 --- a/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h +++ b/TAO/orbsvcs/tests/Event/Mcast/Common/Gateway_EC.h @@ -20,7 +20,6 @@ class ECMcastTests_Export Gateway_EC { public: - /// Constructor. Gateway_EC (void); @@ -29,7 +28,6 @@ public: int run (int argc, ACE_TCHAR ** argv); private: - /// Helpers. //@{ int parse_args (int argc, ACE_TCHAR *argv[]); diff --git a/TAO/tests/Bug_3531b_Regression/server.cpp b/TAO/tests/Bug_3531b_Regression/server.cpp index 8863849edb7..7b7637e06ca 100644 --- a/TAO/tests/Bug_3531b_Regression/server.cpp +++ b/TAO/tests/Bug_3531b_Regression/server.cpp @@ -10,6 +10,7 @@ #include "ace/Task_T.h" #include "tao/TAO_Export.h" #include "ace/TP_Reactor.h" +#include <memory> #if defined (ACE_HAS_THREADS) @@ -514,7 +515,7 @@ void Test_1 (TAO_ORB_Core* orb_core) TSS_ASSERT (tss, leader_follower, 0, 0, false); - std::auto_ptr<TAO_LF_Event_Loop_Thread_Helper> + std::unique_ptr<TAO_LF_Event_Loop_Thread_Helper> elt (new TAO_LF_Event_Loop_Thread_Helper(leader_follower, lf_strategy, 0)); @@ -535,12 +536,12 @@ void Test_2 (TAO_ORB_Core* orb_core) TSS_ASSERT (tss, leader_follower, 0, 0, false); - std::auto_ptr<TAO_LF_Event_Loop_Thread_Helper> + std::unique_ptr<TAO_LF_Event_Loop_Thread_Helper> elt1 (new TAO_LF_Event_Loop_Thread_Helper(leader_follower, lf_strategy, 0)); TSS_ASSERT (tss, leader_follower, 1, 0, true); - std::auto_ptr<TAO_LF_Event_Loop_Thread_Helper> + std::unique_ptr<TAO_LF_Event_Loop_Thread_Helper> elt2 (new TAO_LF_Event_Loop_Thread_Helper(leader_follower, lf_strategy, 0)); TSS_ASSERT (tss, leader_follower, 2, 0, true); @@ -563,7 +564,7 @@ void Test_3 (TAO_ORB_Core* orb_core) TSS_ASSERT (tss, leader_follower, 0, 0, false); - std::auto_ptr<TAO_LF_Event_Loop_Thread_Helper> + std::unique_ptr<TAO_LF_Event_Loop_Thread_Helper> elt1 (new TAO_LF_Event_Loop_Thread_Helper(leader_follower, lf_strategy, 0)); TSS_ASSERT (tss, leader_follower, 1, 0, true); @@ -571,7 +572,7 @@ void Test_3 (TAO_ORB_Core* orb_core) leader_follower.set_upcall_thread (); TSS_ASSERT (tss, leader_follower, 0, 0, false); - std::auto_ptr<TAO_LF_Event_Loop_Thread_Helper> + std::unique_ptr<TAO_LF_Event_Loop_Thread_Helper> elt2 (new TAO_LF_Event_Loop_Thread_Helper(leader_follower, lf_strategy, 0)); TSS_ASSERT (tss, leader_follower, 1, 0, true); diff --git a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp index 20671f6c34b..222a168df48 100644 --- a/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp +++ b/TAO/tests/Portable_Interceptors/Dynamic/server_interceptor.cpp @@ -49,7 +49,8 @@ Echo_Server_Request_Interceptor::receive_request_service_contexts ( catched_exception = false; try { - CORBA::Boolean tmdi = ri->target_is_a ("FOO"); + CORBA::Boolean const tmdi = ri->target_is_a ("FOO"); + ACE_UNUSED_ARG(tmdi); } catch (const ::CORBA::BAD_INV_ORDER& ex) { @@ -67,7 +68,8 @@ Echo_Server_Request_Interceptor::receive_request_service_contexts ( catched_exception = false; try { - PortableInterceptor::ReplyStatus tmdi = ri->reply_status (); + PortableInterceptor::ReplyStatus const tmdi = ri->reply_status (); + ACE_UNUSED_ARG(tmdi); } catch (const ::CORBA::BAD_INV_ORDER& ex) { @@ -189,7 +191,8 @@ Echo_Server_Request_Interceptor::receive_request ( catched_exception = false; try { - PortableInterceptor::ReplyStatus tmdi = ri->reply_status (); + PortableInterceptor::ReplyStatus const tmdi = ri->reply_status (); + ACE_UNUSED_ARG(tmdi); } catch (const ::CORBA::BAD_INV_ORDER& ex) { |