From 1bfb8257580a2a84da95ca00863f356474eca77a Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 8 Dec 2020 08:51:53 +0100 Subject: Use std::unique_ptr --- ACE/tests/Bug_1890_Regression_Test.cpp | 2 +- ACE/tests/Future_Set_Test.cpp | 2 +- ACE/tests/Future_Test.cpp | 2 +- ACE/tests/Malloc_Test.cpp | 2 +- ACE/tests/Network_Adapters_Test.cpp | 2 +- ACE/tests/Notify_Performance_Test.cpp | 6 +++--- ACE/tests/Priority_Reactor_Test.cpp | 6 +++--- ACE/tests/Proactor_Timer_Test.cpp | 2 +- ACE/tests/Reactor_Notify_Test.cpp | 4 ++-- ACE/tests/Reactor_Performance_Test.cpp | 6 +++--- ACE/tests/Reactor_Remove_Resume_Test.cpp | 6 +++--- ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp | 6 +++--- ACE/tests/Reactor_Timer_Test.cpp | 2 +- ACE/tests/Refcounted_Auto_Ptr_Test.cpp | 4 ++-- 14 files changed, 26 insertions(+), 26 deletions(-) (limited to 'ACE/tests') diff --git a/ACE/tests/Bug_1890_Regression_Test.cpp b/ACE/tests/Bug_1890_Regression_Test.cpp index 492b246937d..09cacb47b1f 100644 --- a/ACE/tests/Bug_1890_Regression_Test.cpp +++ b/ACE/tests/Bug_1890_Regression_Test.cpp @@ -101,7 +101,7 @@ run_main (int, ACE_TCHAR *[]) // regardless of platform. ACE_Select_Reactor *impl_ptr = 0; ACE_NEW_RETURN (impl_ptr, ACE_Select_Reactor, -1); - unique_ptr auto_impl (impl_ptr); + std::unique_ptr auto_impl (impl_ptr); ACE_Reactor reactor (impl_ptr); diff --git a/ACE/tests/Future_Set_Test.cpp b/ACE/tests/Future_Set_Test.cpp index bd5706e3da7..2549e25cd1c 100644 --- a/ACE/tests/Future_Set_Test.cpp +++ b/ACE/tests/Future_Set_Test.cpp @@ -283,7 +283,7 @@ Prime_Scheduler::svc (void) { // Dequeue the next method request (we use an auto pointer in // case an exception is thrown in the ). - unique_ptr mo (this->activation_queue_.dequeue ()); + std::unique_ptr mo (this->activation_queue_.dequeue ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) calling method request\n"))); diff --git a/ACE/tests/Future_Test.cpp b/ACE/tests/Future_Test.cpp index 55f170d0e37..f930ee3dad1 100644 --- a/ACE/tests/Future_Test.cpp +++ b/ACE/tests/Future_Test.cpp @@ -289,7 +289,7 @@ Prime_Scheduler::svc (void) { // Dequeue the next method request (we use an auto pointer in // case an exception is thrown in the ). - unique_ptr mo (this->activation_queue_.dequeue ()); + std::unique_ptr mo (this->activation_queue_.dequeue ()); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) calling method request\n"))); diff --git a/ACE/tests/Malloc_Test.cpp b/ACE/tests/Malloc_Test.cpp index 450f881a727..0b0aed0285a 100644 --- a/ACE/tests/Malloc_Test.cpp +++ b/ACE/tests/Malloc_Test.cpp @@ -87,7 +87,7 @@ static const void *CHILD_BASE_ADDR = static MALLOC * myallocator (const void *base_addr = 0) { - static unique_ptr static_allocator; + static std::unique_ptr static_allocator; if (static_allocator.get () == 0) { diff --git a/ACE/tests/Network_Adapters_Test.cpp b/ACE/tests/Network_Adapters_Test.cpp index efedaba8c77..bb2ddd525fc 100644 --- a/ACE/tests/Network_Adapters_Test.cpp +++ b/ACE/tests/Network_Adapters_Test.cpp @@ -1046,7 +1046,7 @@ run_main (int argc, ACE_TCHAR *argv[]) // to do it right in at least one test. Notice the lack of // ACE_NEW_RETURN, that monstrosity has no business in proper C++ // code ... - unique_ptr tq( + std::unique_ptr tq( new ACE_Timer_Heap_Variable_Time_Source); // ... notice how the policy is in the derived timer queue type. // The abstract timer queue does not have a time policy ... diff --git a/ACE/tests/Notify_Performance_Test.cpp b/ACE/tests/Notify_Performance_Test.cpp index 5d30ca5f166..676fa8f3055 100644 --- a/ACE/tests/Notify_Performance_Test.cpp +++ b/ACE/tests/Notify_Performance_Test.cpp @@ -193,14 +193,14 @@ run_main (int argc, ACE_TCHAR *argv[]) create_reactor (); // Manage memory automagically. - unique_ptr reactor (ACE_Reactor::instance ()); - unique_ptr impl; + std::unique_ptr reactor (ACE_Reactor::instance ()); + std::unique_ptr impl; // If we are using other that the default implementation, we must // clean up. if (opt_select_reactor || opt_wfmo_reactor || opt_dev_poll_reactor) { - unique_ptr auto_impl (ACE_Reactor::instance ()->implementation ()); + std::unique_ptr auto_impl (ACE_Reactor::instance ()->implementation ()); impl = std::move(auto_impl); } diff --git a/ACE/tests/Priority_Reactor_Test.cpp b/ACE/tests/Priority_Reactor_Test.cpp index 493be83e9ff..36915b6c9bc 100644 --- a/ACE/tests/Priority_Reactor_Test.cpp +++ b/ACE/tests/Priority_Reactor_Test.cpp @@ -273,18 +273,18 @@ run_main (int argc, ACE_TCHAR *argv[]) // Note: If opt_priority_reactor is false, the default ACE_Reactor is used // and we don't need to set one up. ACE_Reactor *orig_reactor = 0; - unique_ptr reactor; + std::unique_ptr reactor; if (opt_priority_reactor) { ACE_Select_Reactor *impl_ptr; ACE_NEW_RETURN (impl_ptr, ACE_Priority_Reactor, -1); - unique_ptr auto_impl (impl_ptr); + std::unique_ptr auto_impl (impl_ptr); ACE_Reactor *reactor_ptr; ACE_NEW_RETURN (reactor_ptr, ACE_Reactor (impl_ptr, 1), -1); auto_impl.release (); // ACE_Reactor dtor will take it from here - unique_ptr auto_reactor (reactor_ptr); + std::unique_ptr auto_reactor (reactor_ptr); reactor = std::move(auto_reactor); orig_reactor = ACE_Reactor::instance (reactor_ptr); } diff --git a/ACE/tests/Proactor_Timer_Test.cpp b/ACE/tests/Proactor_Timer_Test.cpp index a1504f02f5c..0897cf6849b 100644 --- a/ACE/tests/Proactor_Timer_Test.cpp +++ b/ACE/tests/Proactor_Timer_Test.cpp @@ -310,7 +310,7 @@ run_main (int argc, ACE_TCHAR *[]) // code ... typedef ACE_Timer_Heap_T Timer_Queue; - unique_ptr tq(new Timer_Queue); + std::unique_ptr tq(new Timer_Queue); // ... notice how the policy is in the derived timer queue type. // The abstract timer queue does not have a time policy ... tq->set_time_policy(&ACE_High_Res_Timer::gettimeofday_hr); diff --git a/ACE/tests/Reactor_Notify_Test.cpp b/ACE/tests/Reactor_Notify_Test.cpp index 41ff9e0b573..360f956f423 100644 --- a/ACE/tests/Reactor_Notify_Test.cpp +++ b/ACE/tests/Reactor_Notify_Test.cpp @@ -364,7 +364,7 @@ run_test (int disable_notify_pipe, -1); // Make sure this stuff gets cleaned up when this function exits. - unique_ptr r (reactor); + std::unique_ptr r (reactor); // Set the Singleton Reactor. ACE_Reactor *orig_reactor = ACE_Reactor::instance (reactor); @@ -465,7 +465,7 @@ run_notify_purge_test (void) Purged_Notify *n2; ACE_NEW_RETURN (n2, Purged_Notify, -1); - unique_ptr ap (n2); + std::unique_ptr ap (n2); // First test: // Notify EXCEPT, and purge ALL diff --git a/ACE/tests/Reactor_Performance_Test.cpp b/ACE/tests/Reactor_Performance_Test.cpp index 6d72c2fad47..e388cf2ebf0 100644 --- a/ACE/tests/Reactor_Performance_Test.cpp +++ b/ACE/tests/Reactor_Performance_Test.cpp @@ -335,14 +335,14 @@ run_main (int argc, ACE_TCHAR *argv[]) create_reactor (); // Manage memory automagically. - unique_ptr reactor (ACE_Reactor::instance ()); - unique_ptr impl; + std::unique_ptr reactor (ACE_Reactor::instance ()); + std::unique_ptr impl; // If we are using other that the default implementation, we must // clean up. if (opt_select_reactor || opt_wfmo_reactor) { - unique_ptr auto_impl (ACE_Reactor::instance ()->implementation ()); + std::unique_ptr auto_impl (ACE_Reactor::instance ()->implementation ()); impl = std::move(auto_impl); } diff --git a/ACE/tests/Reactor_Remove_Resume_Test.cpp b/ACE/tests/Reactor_Remove_Resume_Test.cpp index b36ebe18cd2..67571d56363 100644 --- a/ACE/tests/Reactor_Remove_Resume_Test.cpp +++ b/ACE/tests/Reactor_Remove_Resume_Test.cpp @@ -362,7 +362,7 @@ handle_events (ACE_Reactor & reactor, // ------------------------------------------------------------ -typedef unique_ptr (*reactor_factory_type) (void); +typedef std::unique_ptr (*reactor_factory_type) (void); unique_ptr tp_reactor_factory (void) @@ -370,7 +370,7 @@ tp_reactor_factory (void) ACE_DEBUG ((LM_INFO, ACE_TEXT ("Creating ACE_TP_Reactor.\n"))); - return unique_ptr (new ACE_TP_Reactor); + return std::unique_ptr (new ACE_TP_Reactor); } // ------------------------------------------------------------ @@ -412,7 +412,7 @@ struct Run_Test : public std::unary_function ACE_TEXT ("** Running removal test **\n"))); } - unique_ptr the_factory (factory ()); + std::unique_ptr the_factory (factory ()); ACE_Reactor reactor (the_factory.get ()); // In this test, it's only okay to close the Bogus_Handler diff --git a/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp b/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp index 0295bdd08a8..29b01c1d57c 100644 --- a/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp +++ b/ACE/tests/Reactor_Remove_Resume_Test_Dev_Poll.cpp @@ -366,7 +366,7 @@ handle_events (ACE_Reactor & reactor, // ------------------------------------------------------------ -typedef unique_ptr (*reactor_factory_type) (void); +typedef std::unique_ptr (*reactor_factory_type) (void); unique_ptr dev_poll_reactor_factory (void) @@ -374,7 +374,7 @@ dev_poll_reactor_factory (void) ACE_DEBUG ((LM_INFO, ACE_TEXT ("Creating ACE_Dev_Poll_Reactor.\n"))); - return unique_ptr (new ACE_Dev_Poll_Reactor); + return std::unique_ptr (new ACE_Dev_Poll_Reactor); } // ------------------------------------------------------------ @@ -416,7 +416,7 @@ struct Run_Test : public std::unary_function ACE_TEXT ("** Running removal test **\n"))); } - unique_ptr the_factory (factory ()); + std::unique_ptr the_factory (factory ()); ACE_Reactor reactor (the_factory.get ()); // In this test, it's only okay to close the Bogus_Handler diff --git a/ACE/tests/Reactor_Timer_Test.cpp b/ACE/tests/Reactor_Timer_Test.cpp index 28db2c61a08..8e51fbf4196 100644 --- a/ACE/tests/Reactor_Timer_Test.cpp +++ b/ACE/tests/Reactor_Timer_Test.cpp @@ -255,7 +255,7 @@ run_main (int argc, ACE_TCHAR *[]) // to do it right in at least one test. Notice the lack of // ACE_NEW_RETURN, that monstrosity has no business in proper C++ // code ... - unique_ptr tq( + std::unique_ptr tq( new ACE_Timer_Heap_Variable_Time_Source); // ... notice how the policy is in the derived timer queue type. // The abstract timer queue does not have a time policy ... diff --git a/ACE/tests/Refcounted_Auto_Ptr_Test.cpp b/ACE/tests/Refcounted_Auto_Ptr_Test.cpp index af5b8d89fab..55574c07818 100644 --- a/ACE/tests/Refcounted_Auto_Ptr_Test.cpp +++ b/ACE/tests/Refcounted_Auto_Ptr_Test.cpp @@ -238,7 +238,7 @@ Scheduler::svc (void) ACE_TEXT ("(%t) activation queue shut down\n"))); break; } - unique_ptr mo (mo_p); + std::unique_ptr mo (mo_p); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) calling method request\n"))); @@ -486,7 +486,7 @@ run_main (int, ACE_TCHAR *[]) Scheduler (), -1); - unique_ptr scheduler(scheduler_ptr); + std::unique_ptr scheduler(scheduler_ptr); if (scheduler->open () == -1) ACE_ERROR_RETURN ((LM_ERROR, -- cgit v1.2.1