From 82d310b8d5965411dc2f02bd02be93b3b54909b7 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Sun, 22 Jan 2012 19:42:19 +0000 Subject: Sun Jan 22 19:41:27 UTC 2012 Johnny Willemsen * examples/Reactor/WFMO_Reactor/APC.cpp: * examples/Reactor/WFMO_Reactor/Abandoned.cpp: * examples/Reactor/WFMO_Reactor/Directory_Changes.cpp: * examples/Reactor/WFMO_Reactor/Handle_Close.cpp: * examples/Reactor/WFMO_Reactor/Network_Events.cpp: * examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp: * examples/Reactor/WFMO_Reactor/Registration.cpp: * examples/Reactor/WFMO_Reactor/Registry_Changes.cpp: * examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp: * examples/Reactor/WFMO_Reactor/Talker.cpp: * examples/Reactor/WFMO_Reactor/Window_Messages.cpp: Fixed GCC 4.6.2 release warnings --- ACE/ChangeLog | 15 ++++++++ ACE/examples/Reactor/WFMO_Reactor/APC.cpp | 4 +-- ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp | 7 ++-- .../Reactor/WFMO_Reactor/Directory_Changes.cpp | 2 +- ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp | 35 ++++++++---------- .../Reactor/WFMO_Reactor/Network_Events.cpp | 11 +++--- .../Reactor/WFMO_Reactor/Prerun_State_Changes.cpp | 6 ++-- ACE/examples/Reactor/WFMO_Reactor/Registration.cpp | 6 ++-- .../Reactor/WFMO_Reactor/Registry_Changes.cpp | 2 +- .../Reactor/WFMO_Reactor/Suspended_Removals.cpp | 41 ++++++++++------------ ACE/examples/Reactor/WFMO_Reactor/Talker.cpp | 2 +- .../Reactor/WFMO_Reactor/Window_Messages.cpp | 4 +-- 12 files changed, 67 insertions(+), 68 deletions(-) diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 2da6ef17679..ae706eff947 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,18 @@ +Sun Jan 22 19:41:27 UTC 2012 Johnny Willemsen + + * examples/Reactor/WFMO_Reactor/APC.cpp: + * examples/Reactor/WFMO_Reactor/Abandoned.cpp: + * examples/Reactor/WFMO_Reactor/Directory_Changes.cpp: + * examples/Reactor/WFMO_Reactor/Handle_Close.cpp: + * examples/Reactor/WFMO_Reactor/Network_Events.cpp: + * examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp: + * examples/Reactor/WFMO_Reactor/Registration.cpp: + * examples/Reactor/WFMO_Reactor/Registry_Changes.cpp: + * examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp: + * examples/Reactor/WFMO_Reactor/Talker.cpp: + * examples/Reactor/WFMO_Reactor/Window_Messages.cpp: + Fixed GCC 4.6.2 release warnings + Sun Jan 22 12:35:11 UTC 2012 Johnny Willemsen * bin/make_release.py: diff --git a/ACE/examples/Reactor/WFMO_Reactor/APC.cpp b/ACE/examples/Reactor/WFMO_Reactor/APC.cpp index b45c4036267..0f72e2d4dd3 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/APC.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/APC.cpp @@ -97,14 +97,14 @@ ACE_TMAIN (int, ACE_TCHAR *[]) int result = ACE_Reactor::instance ()->register_handler (&event_handler, event_handler.handle_.handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_Time_Value timeout (2); result = ACE_Reactor::instance ()->schedule_timer (&event_handler, 0, timeout, timeout); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_Reactor::run_alertable_event_loop (); diff --git a/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp b/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp index 4edef8dfc78..3f8e350fdc2 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Abandoned.cpp @@ -99,8 +99,7 @@ Event_Handler::handle_timeout (const ACE_Time_Value &, ACE_Process_Mutex, -1); int result = ACE_Thread_Manager::instance ()->spawn (&worker, this); - ACE_ASSERT (result != -1); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result != -1); } return 0; @@ -115,14 +114,14 @@ ACE_TMAIN (int , ACE_TCHAR *[]) int result = ACE_Reactor::instance ()->register_handler (&event_handler, event_handler.handle_.handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_Time_Value timeout (2); result = ACE_Reactor::instance ()->schedule_timer (&event_handler, 0, timeout, timeout); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_Reactor::run_event_loop (); diff --git a/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp b/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp index 467029cabe7..43407bf36b6 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Directory_Changes.cpp @@ -109,7 +109,7 @@ ACE_TMAIN (int, ACE_TCHAR *[]) Event_Handler handler (reactor); int result = ACE_OS::thr_create ((ACE_THR_FUNC) worker, 0, 0, 0); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); for (result = 0; result != -1; result = reactor.handle_events ()) continue; diff --git a/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp b/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp index 2d0fd1077fb..0187a92a497 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Handle_Close.cpp @@ -49,8 +49,7 @@ write_to_pipe (ACE_Pipe &pipe) ssize_t result = ACE::send (pipe.write_handle (), data, len); - ACE_ASSERT ((size_t)result == len); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT ((size_t)result == len); } // Simple handler class @@ -101,8 +100,7 @@ public: { int result = this->reactor ()->cancel_wakeup (this, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result != -1); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result != -1); } // Write to the pipe; this causes handle_input to get called. @@ -154,8 +152,7 @@ public: // Remove for reading int result = this->reactor ()->remove_handler (this, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result == 0); return 0; } @@ -169,36 +166,34 @@ public: int result = this->reactor ()->mask_ops (this, ACE_Event_Handler::READ_MASK, ACE_Reactor::ADD_MASK); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_Reactor_Mask old_masks = ACE_Event_Handler::WRITE_MASK | ACE_Event_Handler::EXCEPT_MASK; - ACE_ASSERT (old_masks == + ACE_TEST_ASSERT (old_masks == static_cast (result)); - ACE_UNUSED_ARG (old_masks); // Get new masks result = this->reactor ()->mask_ops (this, ACE_Event_Handler::NULL_MASK, ACE_Reactor::GET_MASK); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_Reactor_Mask current_masks = ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK | ACE_Event_Handler::EXCEPT_MASK; - ACE_ASSERT (current_masks == + ACE_TEST_ASSERT (current_masks == static_cast (result)); - ACE_UNUSED_ARG (current_masks); // Remove for writing ACE_Reactor_Mask mask = ACE_Event_Handler::WRITE_MASK | ACE_Event_Handler::DONT_CALL; result = this->reactor ()->remove_handler (this, mask); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Write to the pipe; this causes handle_input to get called. if (!write_to_pipe_in_main) @@ -282,10 +277,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_Pipe pipe1, pipe2; result = pipe1.open (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = pipe2.open (); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Create handlers Handler handler (pipe1); @@ -306,11 +301,11 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) result = reactor->register_handler (&handler, handler_mask); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = reactor->register_handler (&different_handler, different_handler_mask); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); // Write to the pipe; this causes handle_input to get called. if (write_to_pipe_in_main) @@ -322,12 +317,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Note that handle_output will get called automatically since the // pipe is writable! - //FUZZ: disable check_for_lack_ACE_OS // Run for three seconds - ACE_Time_Value time (3); - //FUZZ: enable check_for_lack_ACE_OS + ACE_Time_Value wait_time (3); - reactor->run_reactor_event_loop (time); + reactor->run_reactor_event_loop (wait_time); ACE_DEBUG ((LM_DEBUG, "\nClosing down the application\n\n")); diff --git a/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp b/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp index db7e279178d..5cfa260baac 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Network_Events.cpp @@ -57,8 +57,7 @@ Network_Handler::Network_Handler (ACE_SOCK_Stream &s) this->reactor (ACE_Reactor::instance ()); int result = this->reactor ()->register_handler (this, READ_MASK); - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result == 0); } ACE_HANDLE @@ -136,8 +135,7 @@ Network_Listener::Network_Listener (void) this->reactor (ACE_Reactor::instance ()); int result = this->reactor ()->register_handler (this, ACE_Event_Handler::ACCEPT_MASK); - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result == 0); } Network_Listener::~Network_Listener (void) @@ -170,13 +168,12 @@ Network_Listener::handle_input (ACE_HANDLE handle) 0, // timeout 1, // restart reset_new_handle); // reset new handler - ACE_ASSERT (result == 0); - ACE_UNUSED_ARG (result); + ACE_TEST_ASSERT (result == 0); ACE_DEBUG ((LM_DEBUG, "Remote connection from: ")); remote_address.dump (); - Network_Handler *handler; + Network_Handler *handler = 0; ACE_NEW_RETURN (handler, Network_Handler (stream), -1); return 0; diff --git a/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp b/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp index 828620d89f8..c09dc8caaee 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Prerun_State_Changes.cpp @@ -50,16 +50,16 @@ ACE_TMAIN (int, ACE_TCHAR *[]) int result = ACE_Reactor::instance ()->register_handler (handle, event_handler, ACE_Event_Handler::READ_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = ACE_Reactor::instance ()->register_handler (handle, event_handler, ACE_Event_Handler::WRITE_MASK | ACE_Event_Handler::QOS_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = ACE_Reactor::instance ()->remove_handler (handle, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::DONT_CALL); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); return 0; } diff --git a/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp b/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp index 6bdcb740d1f..ac4c0765254 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Registration.cpp @@ -141,14 +141,14 @@ ACE_TMAIN (int, ACE_TCHAR *[]) { int result = reactor.register_handler (&simple_handler, simple_handler.event1_.handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = reactor.register_handler (&simple_handler, simple_handler.event2_.handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = ACE_OS::thr_create ((ACE_THR_FUNC) worker, 0, 0, 0); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); result = 0; while (!stop_test && result != -1) diff --git a/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp b/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp index ad762a46a3e..21ecc2b3112 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Registry_Changes.cpp @@ -126,7 +126,7 @@ ACE_TMAIN (int, ACE_TCHAR *[]) Event_Handler handler (reactor); int result = ACE_OS::thr_create ((ACE_THR_FUNC) worker, &handler, 0, 0); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); for (result = 0; result != -1; result = reactor.handle_events ()) continue; diff --git a/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp b/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp index 25dd7187dd8..e1cbab4407d 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Suspended_Removals.cpp @@ -44,15 +44,10 @@ public: size_t handles_to_be_resumed, size_t handles_to_be_deleted) { - ACE_UNUSED_ARG (wfmo_reactor); // for release builds where ACE_ASSERT is noop - ACE_UNUSED_ARG (handles_to_be_added); - ACE_UNUSED_ARG (handles_to_be_suspended); - ACE_UNUSED_ARG (handles_to_be_resumed); - ACE_UNUSED_ARG (handles_to_be_deleted); - ACE_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_added_ == handles_to_be_added); - ACE_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_suspended_ == handles_to_be_suspended); - ACE_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_resumed_ == handles_to_be_resumed); - ACE_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_deleted_ == handles_to_be_deleted); + ACE_TEST_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_added_ == handles_to_be_added); + ACE_TEST_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_suspended_ == handles_to_be_suspended); + ACE_TEST_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_resumed_ == handles_to_be_resumed); + ACE_TEST_ASSERT (wfmo_reactor.handler_rep_.handles_to_be_deleted_ == handles_to_be_deleted); } }; @@ -69,7 +64,7 @@ ACE_TMAIN (int, ACE_TCHAR *[]) int result = reactor.register_handler (&handler); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 1, 0, 0, 0); @@ -78,33 +73,33 @@ ACE_TMAIN (int, ACE_TCHAR *[]) reactor.remove_handler (&handler, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::ALL_EVENTS_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 1, 0, 0, 1); result = base_reactor.run_reactor_event_loop (time); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 0); result = reactor.register_handler (&handler); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 1, 0, 0, 0); result = base_reactor.run_reactor_event_loop (time); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 0); result = reactor.suspend_handler (&handler); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 1, 0, 0); @@ -113,40 +108,40 @@ ACE_TMAIN (int, ACE_TCHAR *[]) reactor.remove_handler (&handler, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::ALL_EVENTS_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 1); result = base_reactor.run_reactor_event_loop (time); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 0); result = reactor.register_handler (&handler); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 1, 0, 0, 0); result = reactor.suspend_handler (&handler); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 1, 1, 0, 0); result = base_reactor.run_reactor_event_loop (time); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 0); result = reactor.resume_handler (&handler); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 1, 0); @@ -155,13 +150,13 @@ ACE_TMAIN (int, ACE_TCHAR *[]) reactor.remove_handler (&handler, ACE_Event_Handler::DONT_CALL | ACE_Event_Handler::ALL_EVENTS_MASK); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 1); result = base_reactor.run_reactor_event_loop (time); - ACE_ASSERT (result != -1); + ACE_TEST_ASSERT (result != -1); ACE_WFMO_Reactor_Test::check_for_valid_state (reactor, 0, 0, 0, 0); diff --git a/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp b/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp index 09d863b7fc8..ff6ec9ff0c9 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Talker.cpp @@ -539,7 +539,7 @@ STDIN_Handler::handle_signal (int, siginfo_t *si, ucontext_t *) { if (si != 0) { - ACE_ASSERT (this->thr_handle_ == si->si_handle_); + ACE_TEST_ASSERT (this->thr_handle_ == si->si_handle_); ACE_Reactor::end_event_loop (); } return 0; diff --git a/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp b/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp index d1e46c04307..8c5890c7b3e 100644 --- a/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp +++ b/ACE/examples/Reactor/WFMO_Reactor/Window_Messages.cpp @@ -74,7 +74,7 @@ ACE_TMAIN (int, ACE_TCHAR*[]) int result = ACE_Reactor::instance ()->register_handler (&event_handler, event_handler.handle_.handle ()); - ACE_ASSERT (result == 0); + ACE_TEST_ASSERT (result == 0); ACE_Time_Value timeout (1); result = @@ -84,7 +84,7 @@ ACE_TMAIN (int, ACE_TCHAR*[]) timeout.msec (), // time-out value (TIMERPROC) &timer_callback)); // address of timer procedure - ACE_ASSERT (result != 0); + ACE_TEST_ASSERT (result != 0); ACE_Reactor::run_event_loop (); -- cgit v1.2.1