diff options
author | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2008-06-16 16:57:12 +0000 |
---|---|---|
committer | Abdullah Sowayan <sowayan@users.noreply.github.com> | 2008-06-16 16:57:12 +0000 |
commit | 7ea3ed1ac16c01d9c52ed005113d059dc24d07af (patch) | |
tree | dfd4a24631aa25ed30db07a2a5adb23df086b1d9 /ACE | |
parent | d34535e5f988ba2387ef762cb8477dc585109acc (diff) | |
download | ATCD-7ea3ed1ac16c01d9c52ed005113d059dc24d07af.tar.gz |
Mon Jun 16 16:54:25 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com>
Diffstat (limited to 'ACE')
82 files changed, 1029 insertions, 954 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index d986033b00e..fbf97226b5f 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,89 @@ +Mon Jun 16 16:54:25 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com> + + * examples/APG/Logging/Callback-2.h: + * examples/APG/Logging/Callback-3.h: + * examples/APG/Logging/Use_Logger.cpp: + * examples/APG/Threads/Message_Queue.cpp: + * examples/APG/Timers/CB.h: + * examples/APG/Timers/PCB.cpp: + * examples/ASX/CCM_App/SC_Server.cpp: + * examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp: + * examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp: + * examples/ASX/Event_Server/Event_Server/Peer_Router.cpp: + * examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp: + * examples/ASX/Message_Queue/bounded_buffer.cpp: + * examples/ASX/Message_Queue/priority_buffer.cpp: + * examples/ASX/UPIPE_Event_Server/Peer_Router.cpp: + * examples/Bounded_Packet_Relay/BPR_Drivers.cpp: + * examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp: + * examples/Bounded_Packet_Relay/bpr_thread.cpp: + * examples/C++NPv2/display_logfile.cpp: + * examples/Connection/misc/Connection_Handler.h: + * examples/IPC_SAP/ATM_SAP/CPP-client.cpp: + * examples/IPC_SAP/ATM_SAP/CPP-server.cpp: + * examples/IPC_SAP/DEV_SAP/writer/writer.cpp: + * examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp: + * examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp: + * examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp: + * examples/IPC_SAP/FILE_SAP/client.cpp: + * examples/IPC_SAP/SOCK_SAP/C-inclient.cpp: + * examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp: + * examples/IPC_SAP/SPIPE_SAP/NPServer.cpp: + * examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp: + * examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp: + * examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp: + * examples/IPC_SAP/TLI_SAP/CPP-client.cpp: + * examples/IPC_SAP/TLI_SAP/CPP-server.cpp: + * examples/IPC_SAP/TLI_SAP/db-client.cpp: + * examples/IPC_SAP/TLI_SAP/ftp-client.cpp: + * examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.h: + * examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.cpp: + * examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.h: + * examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.cpp: + * examples/Logger/Acceptor-server/server_loggerd.h: + * examples/Logger/Acceptor-server/server_loggerd.cpp: + * examples/Logger/simple-server/Logging_Handler.cpp: + * examples/Logger/simple-server/server_loggerd.cpp: + * examples/Mem_Map/IO-tests/test_io.cpp: + * examples/Misc/test_get_opt.cpp: + * examples/Misc/test_profile_timer.cpp: + * examples/OS/Process/imore.cpp: + * examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp: + * examples/Reactor/FIFO/client.cpp: + * examples/Reactor/FIFO/server.cpp: + * examples/Reactor/Misc/notification.cpp: + * examples/Reactor/Misc/test_signals_1.cpp: + * examples/Reactor/Misc/test_signals_2.cpp: + * examples/Reactor/Ntalker/ntalker.cpp: + * examples/Reactor/Proactor/test_cancel.h: + * examples/Reactor/Proactor/test_cancel.cpp: + * examples/Reactor/Proactor/test_multiple_loops.cpp: + * examples/Reactor/Proactor/test_proactor3.cpp: + * examples/Reactor/Proactor/test_timeout.cpp: + * examples/Reactor/Proactor/test_timeout_st.cpp: + * examples/Registry/test_registry_update.cpp: + * examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp: + * examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp: + * examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp: + * examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp: + * examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.inl: + * examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp: + * examples/Service_Configurator/Misc/Timer_Service.cpp: + * examples/Shared_Memory/test_SV.cpp: + * examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp: + * examples/Threads/recursive_mutex.cpp: + * examples/Threads/task_one.cpp: + * examples/Threads/thread_manager.cpp: + * examples/Threads/token.cpp: + + Untabify. + Mon Jun 16 16:04:40 2008 Steve Huston <shuston@riverace.com> * bin/PerlACE/TestTarget.pm: When getting the exe subdir for a @@ -8,21 +94,21 @@ Mon Jun 16 15:45:45 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu> * ace/Monitor_Control/Null_Network_Interface_Monitor.cpp: * ace/Monitor_Control/Null_Network_Interface_Monitor.h: - + New files, defining a base class for tne network interface OS monitors when the monitor framework itself is enabled but no platform-specific OS monitor flags are defined, whether because the platform itself does not support native system-level monitoring, or because the Linux, Windows or Solaris OS monitor flags has been turned off for some reason. - + * ace/Monitor_Control/Monitor_Control.mpc: * ace/Monitor_Control/Bytes_Sent_Monitor.h: * ace/Monitor_Control/Packets_Sent_Monitor.h: * ace/Monitor_Control/Linux_Network_Interface_Monitor.h: * ace/Monitor_Control/Bytes_Received_Monitor.h: * ace/Monitor_Control/Packets_Received_Monitor.h: - + Incorporated the new no-op network interface monitor base class into the existing network interface monitor classes. If this new base class is used, the monitor's value will always be 0, @@ -31,11 +117,11 @@ Mon Jun 16 15:45:45 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu> Mon Jun 16 12:12:16 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu> * ace/config-sunos5.5.h: - + Reverted addition of ACE_HAS_KSTAT flag in - + Fri Jun 13 14:00:00 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu> - + Thanks to Johnny Willemsen <jwillemsen@remedy.nl>, we now know that the correct way to do this is to set kstat=1 in platform_macros.GNU. diff --git a/ACE/examples/APG/Logging/Callback-2.h b/ACE/examples/APG/Logging/Callback-2.h index 906b2e43286..f5f2389bd0d 100644 --- a/ACE/examples/APG/Logging/Callback-2.h +++ b/ACE/examples/APG/Logging/Callback-2.h @@ -23,7 +23,7 @@ public: ACE_Log_Record::priority_name (prio); cerr << "\tType: " << ACE_TEXT_ALWAYS_CHAR (prio_name) - << endl; + << endl; cerr << "\tLength: " << log_record.length () << endl; diff --git a/ACE/examples/APG/Logging/Callback-3.h b/ACE/examples/APG/Logging/Callback-3.h index 22824fad382..27f136a3a00 100644 --- a/ACE/examples/APG/Logging/Callback-3.h +++ b/ACE/examples/APG/Logging/Callback-3.h @@ -23,43 +23,41 @@ public: ACE_INET_Addr addr (LOGGER_PORT, ACE_DEFAULT_SERVER_HOST); if (connector.connect (*(this->logger_), addr) == -1) - { - delete this->logger_; - this->logger_ = 0; - } + { + delete this->logger_; + this->logger_ = 0; + } } virtual ~Callback () { if (this->logger_) - { - this->logger_->close (); - } + { + this->logger_->close (); + } delete this->logger_; } void log (ACE_Log_Record &log_record) { if (!this->logger_) - { + { # if defined (ACE_LACKS_IOSTREAM_TOTALLY) - log_record.print - (ACE_TEXT (""), ACE_Log_Msg::VERBOSE, stderr); + log_record.print (ACE_TEXT (""), ACE_Log_Msg::VERBOSE, stderr); # else - log_record.print - (ACE_TEXT (""), ACE_Log_Msg::VERBOSE, cerr); + log_record.print(ACE_TEXT (""), ACE_Log_Msg::VERBOSE, cerr); # endif /* ACE_LACKS_IOSTREAM_TOTALLY */ - return; - } + return; + } size_t len = log_record.length(); log_record.encode (); if (this->logger_->send_n ((char *) &log_record, len) == -1) - { - delete this->logger_; - this->logger_ = 0; - } + { + delete this->logger_; + this->logger_ = 0; + } } private: diff --git a/ACE/examples/APG/Logging/Use_Logger.cpp b/ACE/examples/APG/Logging/Use_Logger.cpp index 5fb672c1ab4..4ccafd97835 100644 --- a/ACE/examples/APG/Logging/Use_Logger.cpp +++ b/ACE/examples/APG/Logging/Use_Logger.cpp @@ -4,8 +4,8 @@ int ACE_TMAIN (int, ACE_TCHAR *argv[]) { - ACE_LOG_MSG->open (argv[0], - ACE_Log_Msg::LOGGER, + ACE_LOG_MSG->open (argv[0], + ACE_Log_Msg::LOGGER, ACE_DEFAULT_LOGGER_KEY); ACE_TRACE ("main"); diff --git a/ACE/examples/APG/Threads/Message_Queue.cpp b/ACE/examples/APG/Threads/Message_Queue.cpp index 3544d6bcefa..8c3ffcb60f4 100644 --- a/ACE/examples/APG/Threads/Message_Queue.cpp +++ b/ACE/examples/APG/Threads/Message_Queue.cpp @@ -15,7 +15,7 @@ HA_CommandHandler::svc (void) { ACE_Message_Block *mb; if (this->getq (mb) == -1) - break; + break; if (mb->msg_type () == ACE_Message_Block::MB_HANGUP) { mb->release (); diff --git a/ACE/examples/APG/Timers/CB.h b/ACE/examples/APG/Timers/CB.h index 716ad4e4f50..72722387994 100644 --- a/ACE/examples/APG/Timers/CB.h +++ b/ACE/examples/APG/Timers/CB.h @@ -21,8 +21,8 @@ public: long getID (void); // Handle the timeout. - virtual int handle_timeout(const ACE_Time_Value &tv, - const void *arg = 0); + virtual int handle_timeout(const ACE_Time_Value &tv, + const void *arg = 0); virtual int handle_close (ACE_HANDLE handle, ACE_Reactor_Mask close_mask); diff --git a/ACE/examples/APG/Timers/PCB.cpp b/ACE/examples/APG/Timers/PCB.cpp index d3401c65116..62d678d50ba 100644 --- a/ACE/examples/APG/Timers/PCB.cpp +++ b/ACE/examples/APG/Timers/PCB.cpp @@ -34,10 +34,10 @@ int PCB::handleEvent (const void *arg) // New interval is 10 ms. ACE_Time_Value interval (0L, 1000L); if (PTimer::instance ()->reset_interval (timerID_, interval) != -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("reset_interval")), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("reset_interval")), + -1); } if (count_++ == 10) diff --git a/ACE/examples/ASX/CCM_App/SC_Server.cpp b/ACE/examples/ASX/CCM_App/SC_Server.cpp index b93e49005bf..4a1256cf7f4 100644 --- a/ACE/examples/ASX/CCM_App/SC_Server.cpp +++ b/ACE/examples/ASX/CCM_App/SC_Server.cpp @@ -17,7 +17,7 @@ class Event_Handler : public ACE_Event_Handler public: virtual int handle_input (ACE_HANDLE handle); virtual int handle_close (ACE_HANDLE, - ACE_Reactor_Mask); + ACE_Reactor_Mask); }; int @@ -57,8 +57,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_Sig_Adapter shutdown_handler ((ACE_Sig_Handler_Ex) ACE_Reactor::end_event_loop); if (ACE_Event_Handler::register_stdin_handler (&handler, - ACE_Reactor::instance (), - ACE_Thread_Manager::instance ()) == -1) + ACE_Reactor::instance (), + ACE_Thread_Manager::instance ()) == -1) ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("register_stdin_handler"))); diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp index d5215ffcd26..9c5a1f9ca6e 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp @@ -14,7 +14,7 @@ Consumer_Router::Consumer_Router (Peer_Router_Context *prc) this->context ()->duplicate (); } -// Initialize the Router. +// Initialize the Router. int Consumer_Router::open (void *) @@ -38,14 +38,14 @@ Consumer_Router::open (void *) // Nothing to do since this side is primarily used to transmit to // Consumers, rather than receive. - return 0; + return 0; } int Consumer_Router::close (u_long) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) closing Consumer_Router %s\n"), - this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer"))); + this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer"))); if (this->is_writer ()) // Inform the thread to shut down. @@ -59,41 +59,41 @@ Consumer_Router::close (u_long) // Handle incoming messages in a separate thread. -int +int Consumer_Router::svc (void) { assert (this->is_writer ()); - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) starting svc in Consumer_Router\n"))); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) starting svc in Consumer_Router\n"))); for (ACE_Message_Block *mb = 0; this->getq (mb) >= 0; ) { - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) warning: Consumer_Router is ") + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) warning: Consumer_Router is ") ACE_TEXT ("forwarding a message to Supplier_Router\n"))); // Pass this message down to the next Module's writer Task. if (this->put_next (mb) == -1) - ACE_ERROR_RETURN - ((LM_ERROR, + ACE_ERROR_RETURN + ((LM_ERROR, ACE_TEXT ("(%t) send_peers failed in Consumer_Router\n")), -1); } - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) stopping svc in Consumer_Router\n"))); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) stopping svc in Consumer_Router\n"))); return 0; // Note the implicit ACE_OS::thr_exit() via destructor. } -// Send a <Message_Block> to the supplier(s). +// Send a <Message_Block> to the supplier(s). -int -Consumer_Router::put (ACE_Message_Block *mb, - ACE_Time_Value *) +int +Consumer_Router::put (ACE_Message_Block *mb, + ACE_Time_Value *) { // Perform the necessary control operations before passing the // message down the stream. @@ -110,15 +110,14 @@ Consumer_Router::put (ACE_Message_Block *mb, else if (this->is_reader ()) { if (this->context ()->send_peers (mb) == -1) - ACE_ERROR_RETURN + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%t) send_peers failed in Consumer_Router\n")), -1); - else - return 0; + else + return 0; } else // if (this->is_writer ()) - // Queue up the message to processed by <Consumer_Router::svc> // Since we don't expect to be getting many of these messages, we // queue them up and run them in a separate thread to avoid taxing @@ -139,16 +138,16 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const ACE_TCHAR buf[BUFSIZ]; ACE_INET_Addr addr; const ACE_TCHAR *mod_name = this->name (); - + if (this->context ()->acceptor ().get_local_addr (addr) == -1) return -1; - + ACE_OS::sprintf (buf, FMTSTR, - mod_name, + mod_name, addr.get_port_number (), ACE_TEXT ("tcp"), - ACE_TEXT ("# consumer router"), + ACE_TEXT ("# consumer router"), this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer")); if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) return -1; diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp index a064da6459a..eeb7060833f 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Event_Analyzer.cpp @@ -28,7 +28,7 @@ Event_Analyzer::control (ACE_Message_Block *mb) switch (cmd = ioc->cmd ()) { - case ACE_IO_Cntl_Msg::SET_LWM: + case ACE_IO_Cntl_Msg::SET_LWM: case ACE_IO_Cntl_Msg::SET_HWM: this->water_marks (cmd, *(size_t *) mb->cont ()->rd_ptr ()); break; @@ -38,13 +38,13 @@ Event_Analyzer::control (ACE_Message_Block *mb) return 0; } -int +int Event_Analyzer::put (ACE_Message_Block *mb, ACE_Time_Value *) { if (Options::instance ()->debug ()) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) passing through Event_Analyser::put() (%s)\n"), - this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer"))); + this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer"))); if (mb->msg_type () == ACE_Message_Block::MB_IOCTL) this->control (mb); @@ -53,25 +53,25 @@ Event_Analyzer::put (ACE_Message_Block *mb, ACE_Time_Value *) return this->put_next (mb); } -int +int Event_Analyzer::init (int, ACE_TCHAR *[]) { // No-op for now. return 0; } -int +int Event_Analyzer::fini (void) { // No-op for now. return 0; } -int +int Event_Analyzer::info (ACE_TCHAR **strp, size_t length) const { const ACE_TCHAR *mod_name = this->name (); - + if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) return -1; else diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp index cb82eec16df..f3ac967e554 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp @@ -37,9 +37,9 @@ Peer_Router_Context::send_peers (ACE_Message_Block *mb) map_iter.advance ()) { if (Options::instance ()->debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) sending to peer via handle %d\n"), - ss->ext_id_)); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) sending to peer via handle %d\n"), + ss->ext_id_)); iterations++; @@ -64,7 +64,7 @@ Peer_Router_Context::unbind_peer (ROUTING_KEY key) int Peer_Router_Context::bind_peer (ROUTING_KEY key, - Peer_Handler *peer_handler) + Peer_Handler *peer_handler) { return this->peer_map_.bind (key, peer_handler); } @@ -105,16 +105,16 @@ Peer_Router_Context::Peer_Router_Context (u_short port) ACE_INET_Addr addr; if (this->acceptor ().get_local_addr (addr) != -1) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) initializing %C on port = %d, handle = %d, this = %u\n"), - addr.get_port_number () == Options::instance ()->supplier_port () - ? "Supplier_Handler" : "Consumer_Handler", - addr.get_port_number (), - this->acceptor().get_handle (), - this)); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) initializing %C on port = %d, handle = %d, this = %u\n"), + addr.get_port_number () == Options::instance ()->supplier_port () + ? "Supplier_Handler" : "Consumer_Handler", + addr.get_port_number (), + this->acceptor().get_handle (), + this)); else - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("%p\n"), + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("%p\n"), ACE_TEXT ("get_local_addr"))); } } @@ -123,7 +123,7 @@ Peer_Router_Context::~Peer_Router_Context (void) { // Free up the handle and close down the listening socket. ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) closing down Peer_Router_Context\n"))); + ACE_TEXT ("(%t) closing down Peer_Router_Context\n"))); // Close down the Acceptor and take ourselves out of the Reactor. this->handle_close (); @@ -138,14 +138,13 @@ Peer_Router_Context::~Peer_Router_Context (void) map_iter.advance ()) { if (Options::instance ()->debug ()) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) closing down peer on handle %d\n"), - ss->ext_id_)); - - if (ACE_Reactor::instance ()->remove_handler - (ss->ext_id_, - ACE_Event_Handler::READ_MASK) == -1) - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) closing down peer on handle %d\n"), + ss->ext_id_)); + + if (ACE_Reactor::instance ()->remove_handler(ss->ext_id_, + ACE_Event_Handler::READ_MASK) == -1) + ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%t) p\n"), ACE_TEXT ("remove_handle"))); } @@ -235,7 +234,7 @@ Peer_Handler::open (void *) ACE_TEXT ("activation of thread failed")), -1); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) Peer_Handler::open registering with Reactor for handle_input\n"))); + ACE_TEXT ("(%t) Peer_Handler::open registering with Reactor for handle_input\n"))); #else // Register with the Reactor to receive messages from our Peer. @@ -272,7 +271,7 @@ Peer_Handler::handle_input (ACE_HANDLE h) ACE_NEW_RETURN (db, ACE_Message_Block (BUFSIZ), -1); ACE_Message_Block *hb = new ACE_Message_Block (sizeof (ROUTING_KEY), - ACE_Message_Block::MB_PROTO, db); + ACE_Message_Block::MB_PROTO, db); // Check for memory failures. if (hb == 0) { @@ -292,7 +291,7 @@ Peer_Handler::handle_input (ACE_HANDLE h) else if (n == 0) // Client has closed down the connection. { if (this->peer_router_context_->unbind_peer (this->get_handle ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p"), ACE_TEXT ("unbind failed")), -1); @@ -395,38 +394,38 @@ Peer_Handler::svc (void) ssize_t n = this->peer_.recv (db->rd_ptr (), db->size ()); if (n == -1) - LM_ERROR_RETURN ((LOG_ERROR, + LM_ERROR_RETURN ((LOG_ERROR, ACE_TEXT ("%p"), ACE_TEXT ("recv failed")), -1); else if (n == 0) // Client has closed down the connection. - { - if (this->peer_router_context_->peer_router ()->unbind_peer (this->get_handle ()) == -1) - LM_ERROR_RETURN ((LOG_ERROR, + { + if (this->peer_router_context_->peer_router ()->unbind_peer (this->get_handle ()) == -1) + LM_ERROR_RETURN ((LOG_ERROR, ACE_TEXT ("%p"), ACE_TEXT ("unbind failed")), -1); - LM_DEBUG ((LOG_DEBUG, + LM_DEBUG ((LOG_DEBUG, ACE_TEXT ("(%t) shutting down \n"))); // We do not need to be deregistered by reactor - // as we were not registered at all. - return -1; - } + // as we were not registered at all. + return -1; + } else - { + { // Transform incoming buffer into a Message. - db->wr_ptr (n); - *(long *) hb->rd_ptr () = this->get_handle (); // Structure assignment. - hb->wr_ptr (sizeof (long)); + db->wr_ptr (n); + *(long *) hb->rd_ptr () = this->get_handle (); // Structure assignment. + hb->wr_ptr (sizeof (long)); // Pass the message to the stream. - if (this->peer_router_context_->peer_router ()->reply (hb) == -1) + if (this->peer_router_context_->peer_router ()->reply (hb) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("(%t) %p\n"), ACE_TEXT ("Peer_Handler.svc : peer_router->reply failed")), -1); - } + } } return 0; } diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp index 72c43ee6312..cbca9cbe037 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp @@ -10,7 +10,7 @@ ACE_RCSID(Event_Server, Supplier_Router, "$Id$") // Handle outgoing messages in a separate thread. -int +int Supplier_Router::svc (void) { assert (this->is_writer ()); @@ -21,8 +21,8 @@ Supplier_Router::svc (void) this->getq (mb) >= 0; ) { - ACE_DEBUG ((LM_DEBUG, - "(%t) warning: Supplier_Router is " + ACE_DEBUG ((LM_DEBUG, + "(%t) warning: Supplier_Router is " "forwarding a message via send_peers\n")); // Broadcast the message to the Suppliers, even though this is @@ -30,9 +30,9 @@ Supplier_Router::svc (void) // to Consumers)! if (this->context ()->send_peers (mb) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%t) send_peers failed in Supplier_Router\n"), - -1); + ACE_ERROR_RETURN ((LM_ERROR, + "(%t) send_peers failed in Supplier_Router\n"), + -1); } ACE_DEBUG ((LM_DEBUG, @@ -64,7 +64,7 @@ Supplier_Router::open (void *) else // if (this->is_writer () { // Increment the reference count. - this->context ()->duplicate (); + this->context ()->duplicate (); // Make this an active object to handle the error cases in a // separate thread. @@ -72,14 +72,14 @@ Supplier_Router::open (void *) } } -// Close down the router. +// Close down the router. int Supplier_Router::close (u_long) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "(%t) closing Supplier_Router %s\n", - this->is_reader () ? "reader" : "writer")); + this->is_reader () ? "reader" : "writer")); if (this->is_writer ()) // Inform the thread to shut down. @@ -93,9 +93,9 @@ Supplier_Router::close (u_long) // Send an <ACE_Message_Block> to the supplier(s). -int -Supplier_Router::put (ACE_Message_Block *mb, - ACE_Time_Value *) +int +Supplier_Router::put (ACE_Message_Block *mb, + ACE_Time_Value *) { // Perform the necessary control operations before passing // the message up the stream. @@ -138,7 +138,7 @@ Supplier_Router::put (ACE_Message_Block *mb, # define FMTSTR ACE_TEXT ("%ls\t %d/%ls %ls (%ls)\n") #endif /* ACE_WIN32 || !ACE_USES_WCHAR */ -int +int Supplier_Router::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; @@ -147,13 +147,13 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const if (this->context ()->acceptor ().get_local_addr (addr) == -1) return -1; - + ACE_OS::sprintf (buf, FMTSTR, - mod_name, + mod_name, addr.get_port_number (), ACE_TEXT ("tcp"), - ACE_TEXT ("# supplier router"), + ACE_TEXT ("# supplier router"), this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer")); if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) diff --git a/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp b/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp index 2cdc50f2116..d549d755916 100644 --- a/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp +++ b/ACE/examples/ASX/Message_Queue/bounded_buffer.cpp @@ -41,19 +41,18 @@ producer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) ACE_ERROR ((LM_ERROR, "(%t) %p\n", "put_next")); - break; + break; } - // Send the message to the other thread. else - { - mb->msg_priority (n); - mb->wr_ptr (n); - if (msg_queue->enqueue_tail (mb) == -1) - ACE_ERROR ((LM_ERROR, + { + mb->msg_priority (n); + mb->wr_ptr (n); + if (msg_queue->enqueue_tail (mb) == -1) + ACE_ERROR ((LM_ERROR, "(%t) %p\n", "put_next")); - } + } } return 0; @@ -80,17 +79,17 @@ static void *consumer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) result = msg_queue->dequeue_head (mb, &timeout); if (result == -1) - break; + break; int length = mb->length (); if (length > 0) - ACE_OS::write (ACE_STDOUT, mb->rd_ptr (), length); + ACE_OS::write (ACE_STDOUT, mb->rd_ptr (), length); mb->release (); if (length == 0) - break; + break; } if (result == -1 && errno == EWOULDBLOCK) diff --git a/ACE/examples/ASX/Message_Queue/priority_buffer.cpp b/ACE/examples/ASX/Message_Queue/priority_buffer.cpp index db60a33bcae..517025919d2 100644 --- a/ACE/examples/ASX/Message_Queue/priority_buffer.cpp +++ b/ACE/examples/ASX/Message_Queue/priority_buffer.cpp @@ -81,7 +81,7 @@ producer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) // Send a 0-sized shutdown message to the other thread and // exit. - ACE_NEW_RETURN (mb, ACE_Message_Block ((size_t) 0), 0); + ACE_NEW_RETURN (mb, ACE_Message_Block ((size_t) 0), 0); if (msg_queue->enqueue_tail (mb) == -1) ACE_ERROR ((LM_ERROR, "(%t) %p\n", "put_next")); @@ -93,16 +93,17 @@ producer (ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue) { // Allocate a new message, but have it "borrow" its memory // from the buffer. - ACE_NEW_RETURN (mb, ACE_Message_Block (rb.size (), - ACE_Message_Block::MB_DATA, - 0, - buffer), - 0); + ACE_NEW_RETURN (mb, + ACE_Message_Block (rb.size (), + ACE_Message_Block::MB_DATA, + 0, + buffer), + 0); mb->msg_priority (rb.size ()); mb->wr_ptr (rb.size ()); ACE_DEBUG ((LM_DEBUG, - "enqueueing message of size %d\n", + "enqueueing message of size %d\n", mb->msg_priority ())); // Enqueue in priority order. diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp index 757eecedc33..8c353c6247f 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp @@ -15,7 +15,7 @@ ACE_RCSID(UPIPE_Event_Server, Peer_Router, "$Id$") #if defined (ACE_HAS_THREADS) // Define some short-hand macros to deal with long templates -// names... +// names... #define PH PEER_HANDLER #define PA PEER_ACCEPTOR @@ -30,35 +30,35 @@ Acceptor_Factory<PH, PK>::init (int argc, ACE_TCHAR *argv[]) ACE_UPIPE_Addr addr; for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'f': - addr.set (get_opt.opt_arg ()); - break; - case 'd': - break; - default: - break; - } - + switch (c) + { + case 'f': + addr.set (get_opt.opt_arg ()); + break; + case 'd': + break; + default: + break; + } + if (this->open (addr, ACE_Reactor::instance ()) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); return 0; } -template <class PH, class PK> +template <class PH, class PK> Acceptor_Factory<PH, PK>::Acceptor_Factory (Peer_Router<PH, PK> *pr) - : pr_ (pr) + : pr_ (pr) { } template <class PH, class PK> Peer_Router<PH, PK> * Acceptor_Factory<PH, PK>::router (void) -{ - return this->pr_; +{ + return this->pr_; } -template <class ROUTER, class KEY> +template <class ROUTER, class KEY> Peer_Handler<ROUTER, KEY>::Peer_Handler (ACE_Thread_Manager *tm) : ACE_Svc_Handler<ACE_UPIPE_STREAM, ACE_MT_SYNCH> (tm) { @@ -75,33 +75,32 @@ Peer_Handler<ROUTER, KEY>::svc (void) { db = new ACE_Message_Block (BUFSIZ); hb = new ACE_Message_Block (sizeof (KEY), ACE_Message_Block::MB_PROTO, db); - + if ((n = this->peer ().recv (db->rd_ptr (), db->size ())) == -1) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("recv failed")), -1); + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), + ACE_TEXT ("recv failed")), -1); else if (n == 0) // Client has closed down the connection. - { - - if (this->router_task_->unbind_peer (this->get_handle ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), + { + if (this->router_task_->unbind_peer (this->get_handle ()) == -1) + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("unbind failed")), -1); ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) shutting down \n"))); - return -1; // We do not need to be deregistered by reactor - // as we were not registered at all - } + return -1; // We do not need to be deregistered by reactor + // as we were not registered at all + } else // Transform incoming buffer into a Message and pass downstream. - { - db->wr_ptr (n); - *(ACE_HANDLE *) hb->rd_ptr () = this->get_handle (); // structure assignment. - hb->wr_ptr (sizeof (long)); - if (this->router_task_->reply (hb) == -1) - { + { + db->wr_ptr (n); + *(ACE_HANDLE *) hb->rd_ptr () = this->get_handle (); // structure assignment. + hb->wr_ptr (sizeof (long)); + if (this->router_task_->reply (hb) == -1) + { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Peer_Handler.svc : router_task->reply failed\n"))); - return -1; - } - + return -1; + } + // return this->router_task_->reply (hb) == -1 ? -1 : 0; - } + } } ACE_NOTREACHED(return 0); } @@ -159,11 +158,11 @@ Peer_Handler<ROUTER, KEY>::handle_input (ACE_HANDLE h) int n; if ((n = this->peer ().recv (db->rd_ptr (), db->size ())) == -1) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("recv failed")), -1); + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("recv failed")), -1); else if (n == 0) // Client has closed down the connection. { if (this->router_task_->unbind_peer (this->get_handle ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("unbind failed")), -1); ACE_DEBUG ((LM_DEBUG, "(%t) shutting down %d\n", h)); return -1; // Instruct the ACE_Reactor to deregister us by returning -1. @@ -175,7 +174,7 @@ Peer_Handler<ROUTER, KEY>::handle_input (ACE_HANDLE h) hb->wr_ptr (sizeof (long)); return this->router_task_->reply (hb) == -1 ? -1 : 0; } -#endif +#endif } template <class PH, class PK> @@ -196,7 +195,7 @@ Peer_Router<PH, PK>::send_peers (ACE_Message_Block *mb) map_iter.advance ()) { if (options.debug ()) - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) sending to peer via sd %d\n"), + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) sending to peer via sd %d\n"), ss->ext_id_)); iterations++; @@ -250,7 +249,7 @@ Peer_Router<PH, PK>::bind_peer (PK key, Peer_Handler<Peer_Router<PH, PK>, PK> *p return this->peer_map_.bind (key, peer_handler); } -template <class PH, class PK> int +template <class PH, class PK> int Peer_Router<PH, PK>::init (int argc, ACE_TCHAR *argv[]) { this->acceptor_ = new Acceptor_Factory <PH, PK> (this); @@ -262,13 +261,13 @@ Peer_Router<PH, PK>::init (int argc, ACE_TCHAR *argv[]) { ACE_UPIPE_Addr addr; ACE_UPIPE_Acceptor &pa = this->acceptor_->acceptor (); - + if (pa.get_local_addr (addr) != -1) - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%t) initializing %s, file = %s, fd = %d, this = %@\n"), - this->name (), addr.get_path_name (), pa.get_handle (), this)); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) initializing %s, file = %s, fd = %d, this = %@\n"), + this->name (), addr.get_path_name (), pa.get_handle (), this)); else - ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("get_local_addr")), -1); } return 0; diff --git a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp index fb646962004..dde26ed3ef9 100644 --- a/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp +++ b/ACE/examples/Bounded_Packet_Relay/BPR_Drivers.cpp @@ -35,7 +35,7 @@ Input_Device_Wrapper_Base::Input_Device_Wrapper_Base (ACE_Thread_Manager *input_ send_input_msg_cmd_ (0), input_period_ (ACE_ONE_SECOND_IN_USECS), is_active_ (0), - send_count_ (0) + send_count_ (0) { } diff --git a/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp b/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp index a2f179a5348..f8ca093528b 100644 --- a/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp +++ b/ACE/examples/Bounded_Packet_Relay/Thread_Bounded_Packet_Relay.cpp @@ -143,9 +143,8 @@ Text_Output_Device_Wrapper::write_output_message (void *message) if (logging_ & Text_Output_Device_Wrapper::PRINT_MSGS_RCVD) ACE_DEBUG ((LM_DEBUG, "output message %d:\n[%s]\n", - packet_count_, - static_cast<ACE_Message_Block *> (message)-> - rd_ptr ())); + packet_count_, + static_cast<ACE_Message_Block *> (message)->rd_ptr ())); delete static_cast<ACE_Message_Block *> (message); return 0; @@ -531,7 +530,7 @@ Send_Handler::~Send_Handler (void) int Send_Handler::handle_timeout (const ACE_Time_Value &, - const void *) + const void *) { switch (relay_.send_input ()) { @@ -691,8 +690,8 @@ Thread_Bounded_Packet_Relay_Driver::display_menu (void) " Please enter your choice: "; ACE_DEBUG ((LM_DEBUG, - menu, - this->packet_count (), + menu, + this->packet_count (), this->arrival_period (), this->send_period (), this->duration_limit (), diff --git a/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp b/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp index 0a564ecd2a5..132c681c975 100644 --- a/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp +++ b/ACE/examples/Bounded_Packet_Relay/bpr_thread.cpp @@ -41,10 +41,10 @@ ACE_RCSID (Bounded_Packet_Relay, "$Id$") typedef Bounded_Packet_Relay_Driver<Thread_Timer_Queue> - THREAD_BOUNDED_PACKET_RELAY_DRIVER; + THREAD_BOUNDED_PACKET_RELAY_DRIVER; typedef ACE_Command_Callback<Bounded_Packet_Relay,Bounded_Packet_Relay::ACTION> - INPUT_CALLBACK; + INPUT_CALLBACK; // A snippet from Andrew Marvell (Oliver Cromwell's poet laureate) static const char input_text [] = diff --git a/ACE/examples/C++NPv2/display_logfile.cpp b/ACE/examples/C++NPv2/display_logfile.cpp index d92d07b60f9..3be2681dce0 100644 --- a/ACE/examples/C++NPv2/display_logfile.cpp +++ b/ACE/examples/C++NPv2/display_logfile.cpp @@ -26,10 +26,10 @@ public: Logrec_Module (const ACE_TCHAR *name) { this->open (name, - &task_, // Initialize writer-side task. - 0, // Ignore reader-side task. - 0, - ACE_Module<ACE_SYNCH>::M_DELETE_READER); + &task_, // Initialize writer-side task. + 0, // Ignore reader-side task. + 0, + ACE_Module<ACE_SYNCH>::M_DELETE_READER); } private: TASK task_; diff --git a/ACE/examples/Connection/misc/Connection_Handler.h b/ACE/examples/Connection/misc/Connection_Handler.h index 2e22ac8dc11..37b7c33fcd1 100644 --- a/ACE/examples/Connection/misc/Connection_Handler.h +++ b/ACE/examples/Connection/misc/Connection_Handler.h @@ -22,19 +22,19 @@ public: protected: virtual int handle_close (ACE_HANDLE, - ACE_Reactor_Mask); + ACE_Reactor_Mask); // Signal the Active Object to stop when called. virtual int handle_input (ACE_HANDLE); // Handle input from the client. virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); + const void *arg); // Handle timeouts. virtual int handle_signal (int signum, - siginfo_t *, - ucontext_t *); + siginfo_t *, + ucontext_t *); // Handle timeouts. sig_atomic_t finished_; diff --git a/ACE/examples/IPC_SAP/ATM_SAP/CPP-client.cpp b/ACE/examples/IPC_SAP/ATM_SAP/CPP-client.cpp index e4f10eb27b0..91c682e4fbe 100644 --- a/ACE/examples/IPC_SAP/ATM_SAP/CPP-client.cpp +++ b/ACE/examples/IPC_SAP/ATM_SAP/CPP-client.cpp @@ -38,7 +38,8 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) int num_leaves = argc / 2 - 2; ACE_OS::printf( "ATM_Client: Connecting to ...\n" ); - for ( int i = 0; i < num_leaves; i++ ) { + for ( int i = 0; i < num_leaves; i++ ) + { hosts[ i ].set( argv[ i*2 + 4 ], ( argv[ i*2 + 5 ] != 0 ) ? ACE_OS::atoi( argv[ i*2 + 5 ]) : ACE_ATM_Addr::DEFAULT_SELECTOR ); @@ -84,7 +85,8 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) rate, ACE_ATM_QoS::OPT_FLAGS_CPID); - if ( num_leaves == 1 ) { + if ( num_leaves == 1 ) + { // Point-to-point connection // Not sure why but reuse_addr set to true/1 causes problems for // FORE/XTI/ATM - this is now handled in ACE_ATM_Connector::connect() @@ -97,12 +99,13 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) (ACE_Time_Value *) &ACE_Time_Value::zero, local_addr, 0, - 0 ) == -1) { + 0 ) == -1) + { if (errno != EWOULDBLOCK) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "ATM_Client: connection failed"), - 1); + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "ATM_Client: connection failed"), + 1); ACE_DEBUG ((LM_DEBUG, "ATM_Client: starting timed connection\n")); @@ -115,14 +118,14 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (con.complete (atm_stream, &hosts[ 0 ], &tv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "ATM_Client: connection failed"), - 1); + ACE_ERROR_RETURN ((LM_ERROR, + "%p\n", + "ATM_Client: connection failed"), + 1); else - ACE_DEBUG ((LM_DEBUG, - "ATM_Client: connected to %s\n", - hosts[ 0 ].addr_to_string())); + ACE_DEBUG ((LM_DEBUG, + "ATM_Client: connected to %s\n", + hosts[ 0 ].addr_to_string())); } } else { // Point-to-multipoint connection @@ -196,7 +199,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, - "your platform isn't configured to support ATM\n"), + "your platform isn't configured to support ATM\n"), 1); } #endif /* ACE_HAS_ATM */ diff --git a/ACE/examples/IPC_SAP/ATM_SAP/CPP-server.cpp b/ACE/examples/IPC_SAP/ATM_SAP/CPP-server.cpp index 8cf6e9c9c92..81082fea0ef 100644 --- a/ACE/examples/IPC_SAP/ATM_SAP/CPP-server.cpp +++ b/ACE/examples/IPC_SAP/ATM_SAP/CPP-server.cpp @@ -65,19 +65,21 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) double real_time; double actual_rate; - for (;;) { + for (;;) + { // Create a new ACE_ATM_Stream endpoint (note automatic restart // if errno == EINTR). ACE_OS::printf( "ATM_Server: expecting clients\n" ); if (peer_acceptor.accept (new_stream, &addr, - &timeout) == -1) { - ACE_ERROR ((LM_ERROR, + &timeout) == -1) + { + ACE_ERROR ((LM_ERROR, "%p\n", "accept")); - continue; - } + continue; + } ACE_OS::printf( "ATM_Server: got a connection\n" ); @@ -102,13 +104,15 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) int recvd = 0; - for ( ;; ) { + for ( ;; ) + { total = 0; timer.start_incr(); for (int r_bytes; - (r_bytes = new_stream.recv (buf, sizeof buf, 0)) > 0; ) { -// ACE_OS::printf( "ATM_Server: received %dB\n", r_bytes ); + (r_bytes = new_stream.recv (buf, sizeof buf, 0)) > 0; ) + { +// ACE_OS::printf( "ATM_Server: received %dB\n", r_bytes ); // if (ACE_OS::write (ACE_STDOUT, // buf, @@ -120,8 +124,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if ( total > 10000000 ) break; - - } + } timer.stop_incr(); timer.elapsed_time_incr( tv ); @@ -136,9 +139,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) actual_rate < 0 ? 0 : actual_rate )); } - // Close new endpoint (listening endpoint stays open). + // Close new endpoint (listening endpoint stays open). if (new_stream.close () == -1) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "%p\n", "close")); } diff --git a/ACE/examples/IPC_SAP/DEV_SAP/writer/writer.cpp b/ACE/examples/IPC_SAP/DEV_SAP/writer/writer.cpp index a61b8ca2b8d..965bd40f500 100644 --- a/ACE/examples/IPC_SAP/DEV_SAP/writer/writer.cpp +++ b/ACE/examples/IPC_SAP/DEV_SAP/writer/writer.cpp @@ -60,12 +60,12 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) 1); if (bytes_written != 1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("send")), 1); if (writeto == 'q') - break; + break; } if (write_dev.close () == -1) diff --git a/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp b/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp index fc96ec71dbb..de1ace338ff 100644 --- a/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp +++ b/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-Msg-server.cpp @@ -26,10 +26,10 @@ ACE_TMAIN (int, ACE_TCHAR *[]) while ((n = server.recv (&band, &msg, (ACE_Str_Buf *) 0, &flags)) >= 0) { if (msg.len == 0) - break; + break; else - ACE_DEBUG ((LM_DEBUG, "%4d (%4d): %*s", - msg.len, band, msg.len, msg.buf)); + ACE_DEBUG ((LM_DEBUG, "%4d (%4d): %*s", + msg.len, band, msg.len, msg.buf)); flags = MSG_ANY; band = 0; } diff --git a/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp b/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp index 8c80809f380..d359e6297e7 100644 --- a/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp +++ b/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-client.cpp @@ -19,7 +19,7 @@ ACE_TMAIN (int, ACE_TCHAR *[]) ssize_t n = ACE_OS::strlen (buf); if (client.send (buf, n) != n) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); } if (client.close () == -1) diff --git a/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp b/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp index d6911908658..b23def7de34 100644 --- a/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp +++ b/ACE/examples/IPC_SAP/FIFO_SAP/FIFO-test.cpp @@ -41,7 +41,7 @@ do_child (ACE_FIFO_Recv &fifo_reader) static int do_parent (const ACE_TCHAR fifo_name[], - ACE_TCHAR input_filename[]) + ACE_TCHAR input_filename[]) { ACE_FIFO_Send fifo_sender (fifo_name, O_WRONLY | O_CREAT); ssize_t len; diff --git a/ACE/examples/IPC_SAP/FILE_SAP/client.cpp b/ACE/examples/IPC_SAP/FILE_SAP/client.cpp index 7c2402f0b3e..f90f4fb3d95 100644 --- a/ACE/examples/IPC_SAP/FILE_SAP/client.cpp +++ b/ACE/examples/IPC_SAP/FILE_SAP/client.cpp @@ -26,9 +26,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (con.connect (cli_file, ACE_FILE_Addr (argv[1]), - 0, + 0, ACE_Addr::sap_any, 0, - O_RDWR|O_APPEND|O_CREAT, + O_RDWR|O_APPEND|O_CREAT, ACE_DEFAULT_FILE_PERMS) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n to %s", diff --git a/ACE/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp b/ACE/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp index 1781f6ab8b8..9db1e0f2d8f 100644 --- a/ACE/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp +++ b/ACE/examples/IPC_SAP/SOCK_SAP/C-inclient.cpp @@ -60,7 +60,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Establish connection with remote server. if (ACE_OS::connect (s_handle, - reinterpret_cast<sockaddr *> (&saddr), + reinterpret_cast<sockaddr *> (&saddr), sizeof saddr) == -1) ACE_OS::perror (ACE_TEXT("connect")), ACE_OS::exit (1); diff --git a/ACE/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp b/ACE/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp index 9f3fdec22b9..b9075c683bf 100644 --- a/ACE/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp +++ b/ACE/examples/IPC_SAP/SOCK_SAP/CPP-unclient.cpp @@ -66,6 +66,6 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, - "this platform does not support UNIX-domain sockets\n"), -1); + "this platform does not support UNIX-domain sockets\n"), -1); } #endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ diff --git a/ACE/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp b/ACE/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp index 4055a2cc02d..2c5a4dfd7c5 100644 --- a/ACE/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp +++ b/ACE/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp @@ -37,7 +37,7 @@ ACE_TMAIN (int /* argc */, ACE_TCHAR * /* argv */ []) // Accept a client connection. if (acceptor.accept (new_stream, 0) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("accept")), 1); @@ -46,21 +46,21 @@ ACE_TMAIN (int /* argc */, ACE_TCHAR * /* argv */ []) ACE_TEXT ("Accepted connection\n"))); while ((n = new_stream.recv (buf, sizeof buf)) > 0) - { + { ACE_OS::fprintf (stderr, "%s\n", buf); - ACE_OS::write (ACE_STDOUT, + ACE_OS::write (ACE_STDOUT, buf, n); - } + } if (n == -1) - { - ACE_DEBUG ((LM_DEBUG, + { + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("End of connection. Closing handle\n"))); - new_stream.close (); - } + new_stream.close (); + } } ACE_NOTREACHED(return 0); diff --git a/ACE/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp b/ACE/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp index 619a44f1e71..051190c1f0d 100644 --- a/ACE/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp +++ b/ACE/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp @@ -45,9 +45,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) for (i = 0; i < iterations; i++) if (cli_stream.send ((ACE_Str_Buf *) 0, - &buffer, - 1, - MSG_BAND) == -1) + &buffer, + 1, + MSG_BAND) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send"), 1); if (cli_stream.close () == -1) diff --git a/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp b/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp index 35dda19f05e..bfd464b2c1f 100644 --- a/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp +++ b/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-client.cpp @@ -106,7 +106,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) &optbuf) == -1) { if (errno != EWOULDBLOCK) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connection failed"), 1); @@ -121,14 +121,14 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (con.complete (cli_stream, &remote_addr, &tv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "connection failed"), 1); else - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "connected to %s\n", - remote_addr.addr_to_string ())); + remote_addr.addr_to_string ())); } // Send data to server (correctly handles "incomplete writes"). @@ -156,7 +156,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, - "your platform isn't configured to support XTI/ATM\n"), + "your platform isn't configured to support XTI/ATM\n"), 1); } #endif /* ACE_HAS_TLI */ diff --git a/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp b/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp index 5f45d465b49..b3ac025d945 100644 --- a/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp +++ b/ACE/examples/IPC_SAP/TLI_SAP/CPP-ATM-server.cpp @@ -70,14 +70,14 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Create a new ACE_TLI_Stream endpoint (note automatic restart // if errno == EINTR). if (peer_acceptor.accept (new_stream, - &addr, + &addr, &timeout) == -1) - { - ACE_ERROR ((LM_ERROR, + { + ACE_ERROR ((LM_ERROR, "%p\n", "accept")); - continue; - } + continue; + } ACE_DEBUG ((LM_DEBUG, "client %s connected\n", @@ -86,17 +86,17 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Read data from client (terminate on error). for (int r_bytes; - (r_bytes = new_stream.recv (buf, sizeof buf, 0)) > 0; ) + (r_bytes = new_stream.recv (buf, sizeof buf, 0)) > 0; ) if (ACE_OS::write (ACE_STDOUT, buf, r_bytes) != r_bytes) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "%p\n", "ACE::send_n")); - // Close new endpoint (listening endpoint stays open). + // Close new endpoint (listening endpoint stays open). if (new_stream.close () == -1) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "%p\n", "close")); diff --git a/ACE/examples/IPC_SAP/TLI_SAP/CPP-client.cpp b/ACE/examples/IPC_SAP/TLI_SAP/CPP-client.cpp index 550356bba2e..9cd5ba35453 100644 --- a/ACE/examples/IPC_SAP/TLI_SAP/CPP-client.cpp +++ b/ACE/examples/IPC_SAP/TLI_SAP/CPP-client.cpp @@ -39,7 +39,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) 1) == -1) { if (errno != EWOULDBLOCK) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("connection failed")), 1); @@ -53,14 +53,14 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (con.complete (cli_stream, &remote_addr, &tv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("connection failed")), 1); else - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("connected to %s\n"), - remote_addr.get_host_name ())); + remote_addr.get_host_name ())); } // Send data to server (correctly handles "incomplete writes"). @@ -88,7 +88,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("your platform isn't configured to support TLI\n")), + ACE_TEXT ("your platform isn't configured to support TLI\n")), 1); } #endif /* ACE_HAS_TLI */ diff --git a/ACE/examples/IPC_SAP/TLI_SAP/CPP-server.cpp b/ACE/examples/IPC_SAP/TLI_SAP/CPP-server.cpp index a85070ccb9e..d1b1e4d4a88 100644 --- a/ACE/examples/IPC_SAP/TLI_SAP/CPP-server.cpp +++ b/ACE/examples/IPC_SAP/TLI_SAP/CPP-server.cpp @@ -45,14 +45,14 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Create a new ACE_TLI_Stream endpoint (note automatic restart // if errno == EINTR). if (peer_acceptor.accept (new_stream, - &addr, + &addr, &timeout) == -1) - { - ACE_ERROR ((LM_ERROR, - "%p\n", - "accept")); - continue; - } + { + ACE_ERROR ((LM_ERROR, + "%p\n", + "accept")); + continue; + } ACE_DEBUG ((LM_DEBUG, "client %s connected\n", @@ -60,18 +60,17 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) // Read data from client (terminate on error). - for (int r_bytes; - (r_bytes = new_stream.recv (buf, sizeof buf)) > 0; ) + for (int r_bytes; (r_bytes = new_stream.recv (buf, sizeof buf)) > 0; ) if (ACE_OS::write (ACE_STDOUT, buf, r_bytes) != r_bytes) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "%p\n", "ACE::send_n")); - // Close new endpoint (listening endpoint stays open). + // Close new endpoint (listening endpoint stays open). if (new_stream.close () == -1) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "%p\n", "close")); diff --git a/ACE/examples/IPC_SAP/TLI_SAP/db-client.cpp b/ACE/examples/IPC_SAP/TLI_SAP/db-client.cpp index 6136d0ae4c5..c59f958e810 100644 --- a/ACE/examples/IPC_SAP/TLI_SAP/db-client.cpp +++ b/ACE/examples/IPC_SAP/TLI_SAP/db-client.cpp @@ -16,7 +16,7 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) if (argc < 2) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("Usage: %s employee_id [server-host port-number]\n"), - argv[0]), + argv[0]), -1); const ACE_TCHAR *emp_num = argv[1]; diff --git a/ACE/examples/IPC_SAP/TLI_SAP/ftp-client.cpp b/ACE/examples/IPC_SAP/TLI_SAP/ftp-client.cpp index c783e0aba55..28cbf612005 100644 --- a/ACE/examples/IPC_SAP/TLI_SAP/ftp-client.cpp +++ b/ACE/examples/IPC_SAP/TLI_SAP/ftp-client.cpp @@ -15,10 +15,10 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { if (argc < 2) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Usage: %s filename ") - ACE_TEXT ("[server-host port-number]\n"), - argv[0]), - 1); + ACE_TEXT ("Usage: %s filename ") + ACE_TEXT ("[server-host port-number]\n"), + argv[0]), + 1); const ACE_TCHAR *filename = argv[1]; const ACE_TCHAR *host_name = argc < 3 ? ACE_DEFAULT_SERVER_HOST : argv[2]; diff --git a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.cpp b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.cpp index 5aa9c95f0d4..c2e7c946481 100644 --- a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.cpp +++ b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.cpp @@ -21,11 +21,11 @@ static char THIS_FILE[] = __FILE__; // CLog_Msg_MFCApp BEGIN_MESSAGE_MAP(CLog_Msg_MFCApp, CWinApp) - //{{AFX_MSG_MAP(CLog_Msg_MFCApp) - // NOTE - the ClassWizard will add and remove mapping macros here. - // DO NOT EDIT what you see in these blocks of generated code! - //}}AFX_MSG - ON_COMMAND(ID_HELP, CWinApp::OnHelp) + //{{AFX_MSG_MAP(CLog_Msg_MFCApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + ON_COMMAND(ID_HELP, CWinApp::OnHelp) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -33,8 +33,8 @@ END_MESSAGE_MAP() CLog_Msg_MFCApp::CLog_Msg_MFCApp() { - // TODO: add construction code here, - // Place all significant initialization in InitInstance + // TODO: add construction code here, + // Place all significant initialization in InitInstance } ///////////////////////////////////////////////////////////////////////////// diff --git a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.h b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.h index 66940811ba1..27bba46f159 100644 --- a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.h +++ b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFC.h @@ -13,7 +13,7 @@ #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ - #error include 'stdafx.h' before including this file for PCH + #error include 'stdafx.h' before including this file for PCH #endif #include "resource.h" // main symbols @@ -29,22 +29,22 @@ class CLog_Msg_MFCApp : public CWinApp { public: - CLog_Msg_MFCApp(); + CLog_Msg_MFCApp(); // Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CLog_Msg_MFCApp) - public: - virtual BOOL InitInstance(); - //}}AFX_VIRTUAL + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CLog_Msg_MFCApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL // Implementation - //{{AFX_MSG(CLog_Msg_MFCApp) - // NOTE - the ClassWizard will add and remove member functions here. - // DO NOT EDIT what you see in these blocks of generated code ! - //}}AFX_MSG - DECLARE_MESSAGE_MAP() + //{{AFX_MSG(CLog_Msg_MFCApp) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() // MFC Log class for ACE_Log_Msg. To be used by ACE_DEBUG MFC_Log m_mfc_logger; diff --git a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.cpp b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.cpp index 60227d94456..9bd5af88869 100644 --- a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.cpp +++ b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.cpp @@ -21,74 +21,74 @@ static char THIS_FILE[] = __FILE__; class CAboutDlg : public CDialog { public: - CAboutDlg(); + CAboutDlg(); // Dialog Data - //{{AFX_DATA(CAboutDlg) - enum { IDD = IDD_ABOUTBOX }; - //}}AFX_DATA + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + //}}AFX_DATA - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CAboutDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL // Implementation protected: - //{{AFX_MSG(CAboutDlg) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() + //{{AFX_MSG(CAboutDlg) + //}}AFX_MSG + DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { - //{{AFX_DATA_INIT(CAboutDlg) - //}}AFX_DATA_INIT + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CAboutDlg) - //}}AFX_DATA_MAP + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CAboutDlg) + //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) - //{{AFX_MSG_MAP(CAboutDlg) - // No message handlers - //}}AFX_MSG_MAP + //{{AFX_MSG_MAP(CAboutDlg) + // No message handlers + //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CLog_Msg_MFCDlg dialog CLog_Msg_MFCDlg::CLog_Msg_MFCDlg(CWnd* pParent /*=0*/) - : CDialog(CLog_Msg_MFCDlg::IDD, pParent) + : CDialog(CLog_Msg_MFCDlg::IDD, pParent) { - //{{AFX_DATA_INIT(CLog_Msg_MFCDlg) - // NOTE: the ClassWizard will add member initialization here - //}}AFX_DATA_INIT - // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 - m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + //{{AFX_DATA_INIT(CLog_Msg_MFCDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CLog_Msg_MFCDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); - //{{AFX_DATA_MAP(CLog_Msg_MFCDlg) - // NOTE: the ClassWizard will add DDX and DDV calls here - //}}AFX_DATA_MAP + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CLog_Msg_MFCDlg) + // NOTE: the ClassWizard will add DDX and DDV calls here + //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CLog_Msg_MFCDlg, CDialog) - //{{AFX_MSG_MAP(CLog_Msg_MFCDlg) - ON_WM_SYSCOMMAND() - ON_WM_PAINT() - ON_WM_QUERYDRAGICON() - ON_BN_CLICKED(IDC_BUTTON1, OnDebugButtonClicked) - ON_WM_CLOSE() - //}}AFX_MSG_MAP + //{{AFX_MSG_MAP(CLog_Msg_MFCDlg) + ON_WM_SYSCOMMAND() + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(IDC_BUTTON1, OnDebugButtonClicked) + ON_WM_CLOSE() + //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// @@ -96,90 +96,90 @@ END_MESSAGE_MAP() BOOL CLog_Msg_MFCDlg::OnInitDialog() { - CDialog::OnInitDialog(); + CDialog::OnInitDialog(); - // Add "About..." menu item to system menu. + // Add "About..." menu item to system menu. - // IDM_ABOUTBOX must be in the system command range. - ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); - ASSERT(IDM_ABOUTBOX < 0xF000); + // IDM_ABOUTBOX must be in the system command range. + ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); + ASSERT(IDM_ABOUTBOX < 0xF000); #if !defined (_WIN32_WCE) - CMenu* pSysMenu = GetSystemMenu(FALSE); - if (pSysMenu != 0) - { - CString strAboutMenu; - strAboutMenu.LoadString(IDS_ABOUTBOX); - if (!strAboutMenu.IsEmpty()) - { - pSysMenu->AppendMenu(MF_SEPARATOR); - pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); - } - } + CMenu* pSysMenu = GetSystemMenu(FALSE); + if (pSysMenu != 0) + { + CString strAboutMenu; + strAboutMenu.LoadString(IDS_ABOUTBOX); + if (!strAboutMenu.IsEmpty()) + { + pSysMenu->AppendMenu(MF_SEPARATOR); + pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); + } + } #endif /* !_WIN32_WCE */ - // Set the icon for this dialog. The framework does this automatically - // when the application's main window is not a dialog - SetIcon(m_hIcon, TRUE); // Set big icon - SetIcon(m_hIcon, FALSE); // Set small icon - - // TODO: Add extra initialization here - - return TRUE; // return TRUE unless you set the focus to a control + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE);// Set small icon + + // TODO: Add extra initialization here + + return TRUE; // return TRUE unless you set the focus to a control } void CLog_Msg_MFCDlg::OnSysCommand(UINT nID, LPARAM lParam) { - if ((nID & 0xFFF0) == IDM_ABOUTBOX) - { - CAboutDlg dlgAbout; - dlgAbout.DoModal(); - } - else - { - CDialog::OnSysCommand(nID, lParam); - } + if ((nID & 0xFFF0) == IDM_ABOUTBOX) + { + CAboutDlg dlgAbout; + dlgAbout.DoModal(); + } + else + { + CDialog::OnSysCommand(nID, lParam); + } } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. -void CLog_Msg_MFCDlg::OnPaint() +void CLog_Msg_MFCDlg::OnPaint() { - if (IsIconic()) - { - CPaintDC dc(this); // device context for painting - - // Center icon in client rectangle - int cxIcon = GetSystemMetrics(SM_CXICON); - int cyIcon = GetSystemMetrics(SM_CYICON); - CRect rect; - GetClientRect(&rect); - int x = (rect.Width() - cxIcon + 1) / 2; - int y = (rect.Height() - cyIcon + 1) / 2; - - // Draw the icon - dc.DrawIcon(x, y, m_hIcon); - } - else - { - CDialog::OnPaint(); - } + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialog::OnPaint(); + } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CLog_Msg_MFCDlg::OnQueryDragIcon() { - return (HCURSOR) m_hIcon; + return (HCURSOR) m_hIcon; } -void CLog_Msg_MFCDlg::OnDebugButtonClicked() +void CLog_Msg_MFCDlg::OnDebugButtonClicked() { ACE_DEBUG(( LM_DEBUG, "Debug message sent!\n" )); - + } #endif /* ACE_WIN32 */ diff --git a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.h b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.h index bbbbaca12b0..9da01bafa85 100644 --- a/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.h +++ b/ACE/examples/Log_Msg/Log_Msg_MFC/Log_Msg_MFCDlg.h @@ -19,36 +19,35 @@ class CLog_Msg_MFCDlg : public CDialog { -// Construction public: - CLog_Msg_MFCDlg(CWnd* pParent = 0); // standard constructor - -// Dialog Data - //{{AFX_DATA(CLog_Msg_MFCDlg) - enum { IDD = IDD_LOG_MSG_MFC_DIALOG }; - // NOTE: the ClassWizard will add data members here - //}}AFX_DATA - - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CLog_Msg_MFCDlg) - protected: - virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - //}}AFX_VIRTUAL - -// Implementation + // Construction + CLog_Msg_MFCDlg(CWnd* pParent = 0); // standard constructor + + // Dialog Data + //{{AFX_DATA(CLog_Msg_MFCDlg) + enum { IDD = IDD_LOG_MSG_MFC_DIALOG }; + // NOTE: the ClassWizard will add data members here + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CLog_Msg_MFCDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + + // Implementation protected: - HICON m_hIcon; - - // Generated message map functions - //{{AFX_MSG(CLog_Msg_MFCDlg) - virtual BOOL OnInitDialog(); - afx_msg void OnSysCommand(UINT nID, LPARAM lParam); - afx_msg void OnPaint(); - afx_msg HCURSOR OnQueryDragIcon(); - afx_msg void OnDebugButtonClicked(); - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - + HICON m_hIcon; + + // Generated message map functions + //{{AFX_MSG(CLog_Msg_MFCDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnSysCommand(UINT nID, LPARAM lParam); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg void OnDebugButtonClicked(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() }; //{{AFX_INSERT_LOCATION}} diff --git a/ACE/examples/Logger/Acceptor-server/server_loggerd.cpp b/ACE/examples/Logger/Acceptor-server/server_loggerd.cpp index dc9d8d689a4..f1fbc51da4d 100644 --- a/ACE/examples/Logger/Acceptor-server/server_loggerd.cpp +++ b/ACE/examples/Logger/Acceptor-server/server_loggerd.cpp @@ -122,9 +122,9 @@ Logging_Handler::handle_input (ACE_HANDLE) ACE_CDR::Boolean byte_order; ACE_CDR::ULong length; - ssize_t count = ACE::recv_n (this->peer ().get_handle (), - header->wr_ptr (), - 8); + ssize_t count = ACE::recv_n (this->peer ().get_handle (), + header->wr_ptr (), + 8); switch (count) { // Handle shutdown and error cases. @@ -157,7 +157,7 @@ Logging_Handler::handle_input (ACE_HANDLE) // Extract the length header_cdr >> length; - + ACE_NEW_RETURN (payload_p, ACE_Message_Block (length), -1); diff --git a/ACE/examples/Logger/Acceptor-server/server_loggerd.h b/ACE/examples/Logger/Acceptor-server/server_loggerd.h index 33d5f0042ee..971b0b1f74e 100644 --- a/ACE/examples/Logger/Acceptor-server/server_loggerd.h +++ b/ACE/examples/Logger/Acceptor-server/server_loggerd.h @@ -44,7 +44,7 @@ protected: // = Demultiplexing hooks. virtual int handle_input (ACE_HANDLE); virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg); + const void *arg); private: char peer_name_[MAXHOSTNAMELEN + 1]; diff --git a/ACE/examples/Logger/simple-server/Logging_Handler.cpp b/ACE/examples/Logger/simple-server/Logging_Handler.cpp index aacad00c3f1..55286fff69f 100644 --- a/ACE/examples/Logger/simple-server/Logging_Handler.cpp +++ b/ACE/examples/Logger/simple-server/Logging_Handler.cpp @@ -74,9 +74,9 @@ Logging_Handler::handle_input (ACE_HANDLE) ACE_CDR::Boolean byte_order; ACE_CDR::ULong length; - ssize_t count = ACE::recv_n (this->peer ().get_handle (), - header->wr_ptr (), - 8); + ssize_t count = ACE::recv_n (this->peer ().get_handle (), + header->wr_ptr (), + 8); switch (count) { // Handle shutdown and error cases. @@ -109,7 +109,7 @@ Logging_Handler::handle_input (ACE_HANDLE) // Extract the length header_cdr >> length; - + ACE_NEW_RETURN (payload_p, ACE_Message_Block (length), -1); diff --git a/ACE/examples/Logger/simple-server/server_loggerd.cpp b/ACE/examples/Logger/simple-server/server_loggerd.cpp index f323a2f3826..d5296addaad 100644 --- a/ACE/examples/Logger/simple-server/server_loggerd.cpp +++ b/ACE/examples/Logger/simple-server/server_loggerd.cpp @@ -44,37 +44,36 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("p:")); for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'p': - addr.set (ACE_OS::atoi (get_opt.opt_arg ())); - break; - default: - break; - } + switch (c) + { + case 'p': + addr.set (ACE_OS::atoi (get_opt.opt_arg ())); + break; + default: + break; + } if (peer_acceptor->open (addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); - else if (REACTOR::instance ()->register_handler - (peer_acceptor, - ACE_Event_Handler::ACCEPT_MASK) == -1) + else if (REACTOR::instance ()->register_handler (peer_acceptor, + ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("registering service with ACE_Reactor\n")), - -1); + ACE_TEXT ("registering service with ACE_Reactor\n")), + -1); // Run forever, performing the logging service. ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) starting up server logging daemon\n"))); + ACE_TEXT ("(%P|%t) starting up server logging daemon\n"))); while (!finished) REACTOR::instance ()->handle_events (); ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) shutting down server logging daemon\n"))); + ACE_TEXT ("(%P|%t) shutting down server logging daemon\n"))); return 0; } diff --git a/ACE/examples/Mem_Map/IO-tests/test_io.cpp b/ACE/examples/Mem_Map/IO-tests/test_io.cpp index dde13f60dc3..20dd3da70d1 100644 --- a/ACE/examples/Mem_Map/IO-tests/test_io.cpp +++ b/ACE/examples/Mem_Map/IO-tests/test_io.cpp @@ -136,9 +136,9 @@ run_tests (int iterations, FILE *input_fp, FILE *output_fp) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("--------------------\n") - ACE_TEXT ("starting %C for %d iterations(s):\n"), - test_vector[i]->name (), - iterations)); + ACE_TEXT ("starting %C for %d iterations(s):\n"), + test_vector[i]->name (), + iterations)); test_vector[i]->run_test (iterations, input_fp, @@ -149,9 +149,9 @@ run_tests (int iterations, FILE *input_fp, FILE *output_fp) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("wallclock time = %f, user time = %f, system time = %f\n"), - et.real_time, - et.user_time, - et.system_time)); + et.real_time, + et.user_time, + et.system_time)); delete test_vector[i]; } diff --git a/ACE/examples/Misc/test_get_opt.cpp b/ACE/examples/Misc/test_get_opt.cpp index 3fd0a16ac80..720a0a26bd5 100644 --- a/ACE/examples/Misc/test_get_opt.cpp +++ b/ACE/examples/Misc/test_get_opt.cpp @@ -18,37 +18,37 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) switch (c) { case 'a': - ACE_DEBUG ((LM_DEBUG, "got a\n")); - break; + ACE_DEBUG ((LM_DEBUG, "got a\n")); + break; case 'b': - ACE_DEBUG ((LM_DEBUG, "got b with arg %s\n", get_opt.opt_arg ())); - break; + ACE_DEBUG ((LM_DEBUG, "got b with arg %s\n", get_opt.opt_arg ())); + break; case 'c': - ACE_DEBUG ((LM_DEBUG, "got c\n")); - break; + ACE_DEBUG ((LM_DEBUG, "got c\n")); + break; case 'd': - ACE_DEBUG ((LM_DEBUG, "got d with arg %s\n", get_opt.opt_arg ())); - break; + ACE_DEBUG ((LM_DEBUG, "got d with arg %s\n", get_opt.opt_arg ())); + break; case 'e': - ACE_DEBUG ((LM_DEBUG, "got e\n")); - break; + ACE_DEBUG ((LM_DEBUG, "got e\n")); + break; case 'f': - ACE_DEBUG ((LM_DEBUG, "got f with arg %s\n", get_opt.opt_arg ())); - break; + ACE_DEBUG ((LM_DEBUG, "got f with arg %s\n", get_opt.opt_arg ())); + break; case 'g': - ACE_DEBUG ((LM_DEBUG, "got g\n")); - break; + ACE_DEBUG ((LM_DEBUG, "got g\n")); + break; case 'h': - ACE_DEBUG ((LM_DEBUG, "got h with arg %s\n", get_opt.opt_arg ())); - break; + ACE_DEBUG ((LM_DEBUG, "got h with arg %s\n", get_opt.opt_arg ())); + break; default: - ACE_DEBUG ((LM_DEBUG, "got %c, which is unrecognized!\n", c)); - break; + ACE_DEBUG ((LM_DEBUG, "got %c, which is unrecognized!\n", c)); + break; } for (int i = get_opt.opt_ind (); i < argc; i++) ACE_DEBUG ((LM_DEBUG, "optind = %d, argv[optind] = %s\n", - i, argv[i])); + i, argv[i])); return 0; } diff --git a/ACE/examples/Misc/test_profile_timer.cpp b/ACE/examples/Misc/test_profile_timer.cpp index adb6f599f83..a028956ede3 100644 --- a/ACE/examples/Misc/test_profile_timer.cpp +++ b/ACE/examples/Misc/test_profile_timer.cpp @@ -29,10 +29,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "iterations = %d\n", iterations)); ACE_DEBUG ((LM_DEBUG, "real time = %f secs, user time = %f secs, system time = %f secs\n", - et.real_time, et.user_time, et.system_time)); + et.real_time, et.user_time, et.system_time)); ACE_DEBUG ((LM_DEBUG, "time per call = %f usecs\n", - (et.real_time / double (iterations)) * 1000000)); + (et.real_time / double (iterations)) * 1000000)); return 0; } diff --git a/ACE/examples/OS/Process/imore.cpp b/ACE/examples/OS/Process/imore.cpp index 12913d3993c..fd875218ca0 100644 --- a/ACE/examples/OS/Process/imore.cpp +++ b/ACE/examples/OS/Process/imore.cpp @@ -53,8 +53,8 @@ static void usage (void) { ACE_ERROR ((LM_ERROR, "Usage: imore [-n|-u] <filename>\n" - "\t-n Use named pipe.\n" - "\t-u Use unnamed pipe.\n")); + "\t-n Use named pipe.\n" + "\t-u Use unnamed pipe.\n")); } static int @@ -69,17 +69,17 @@ parse_args (int argc, ACE_TCHAR **argv) { case 'n': // We want to use named pipe. #if !defined (ACE_WIN32) - use_named_pipe = 1; + use_named_pipe = 1; #else - ACE_ERROR_RETURN ((LM_ERROR, "Named pipes not supported on Win32\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "Named pipes not supported on Win32\n"), -1); #endif /* !ACE_WIN32 */ - break; + break; case 'u': // Use unnamed pipe. - use_named_pipe = 0; - break; + use_named_pipe = 0; + break; default: // What are you talking about? - usage (); - return -1; + usage (); + return -1; } } @@ -179,15 +179,15 @@ print_file (ACE_HANDLE infd) while ((len = ACE_OS::read (infd, buffer, BUFSIZ)) > 0) { if ((ACE_OS::write (ACE_STDOUT, buffer, len) != len)) - if (errno == EPIPE) - { - // I tried to "produce" EPIPE warning to test - // the program but never seen one. (odd.) - // ACE_ERROR ((LM_ERROR, "\n\nEPIPE\n")); - break; - } - else - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "write"), -1); + if (errno == EPIPE) + { + // I tried to "produce" EPIPE warning to test + // the program but never seen one. (odd.) + // ACE_ERROR ((LM_ERROR, "\n\nEPIPE\n")); + break; + } + else + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "write"), -1); } return 0; } diff --git a/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp b/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp index 33176ba4da3..220cfb3e53c 100644 --- a/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp +++ b/ACE/examples/QOS/Change_Receiver_FlowSpec/Receiver_QoS_Event_Handler.cpp @@ -133,84 +133,77 @@ Receiver_QoS_Event_Handler::handle_qos (ACE_HANDLE fd) ace_get_qos.receiving_flowspec ()->minimum_policed_size (), ace_get_qos.sending_flowspec ()->minimum_policed_size ())); - + // // create a dynamic flow spec on each callback to test QoS retransmits // ACE_CString flow_id ("flow_id"); - + Fill_ACE_QoS flow_spec_list; ACE_DEBUG ((LM_DEBUG, - "\nA new flow spec! in QoS handler.")); - + "\nA new flow spec! in QoS handler.")); + static int token_rate = 9400; ++token_rate; static int peak_bw = 18500; ++peak_bw; switch (flow_spec_list.map ().bind (flow_id, - new ACE_Flow_Spec (token_rate, - 708, - peak_bw, - 0, - 0, - ACE_SERVICETYPE_CONTROLLEDLOAD, - 368, - 368, - 25, - 1))) + new ACE_Flow_Spec (token_rate, + 708, + peak_bw, + 0, + 0, + ACE_SERVICETYPE_CONTROLLEDLOAD, + 368, + 368, + 25, + 1))) { - case 1 : + case 1 : ACE_ERROR_RETURN ((LM_ERROR, - "Unable to bind the new flow spec\n" - "The Flow Spec name already exists\n"), - -1); + "Unable to bind the new flow spec\n" + "The Flow Spec name already exists\n"), + -1); break; case -1 : ACE_ERROR_RETURN ((LM_ERROR, - "Unable to bind the new flow spec\n"), - -1); + "Unable to bind the new flow spec\n"), + -1); break; } - + // // set up the new qos // ACE_QoS another_qos_receiver; if (flow_spec_list.fill_simplex_receiver_qos (another_qos_receiver, - flow_id) !=0) + flow_id) !=0) ACE_ERROR_RETURN ((LM_ERROR, - "Unable to fill handler-simplex receiver qos\n"), - -1); + "Unable to fill handler-simplex receiver qos\n"), + -1); else ACE_DEBUG ((LM_DEBUG, "Successfully built a new flowspec in handle_qos!\n")); - + // // change the qos for the current session // ACE_QoS_Manager qos_manager = this->dgram_mcast_qos_.qos_manager (); - + ACE_DEBUG ((LM_DEBUG, - "QoS Manager was built in handle_qos!\n")); - + "QoS Manager was built in handle_qos!\n")); + // Set the QoS for the session. Replaces the ioctl () call that // was being made previously. if (this->qos_session_->qos (&this->dgram_mcast_qos_, - &qos_manager, - another_qos_receiver) == -1) + &qos_manager, + another_qos_receiver) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "Unable to set QoS\n"), - -1); + "Unable to set QoS\n"), + -1); else ACE_DEBUG ((LM_DEBUG, - "Setting QOS succeeds.\n")); - -return 0; + "Setting QOS succeeds.\n")); + return 0; } - - - - - - diff --git a/ACE/examples/Reactor/FIFO/client.cpp b/ACE/examples/Reactor/FIFO/client.cpp index daa8d3304ad..27e7ab45f37 100644 --- a/ACE/examples/Reactor/FIFO/client.cpp +++ b/ACE/examples/Reactor/FIFO/client.cpp @@ -13,8 +13,8 @@ ACE_TMAIN (int, ACE_TCHAR *[]) ACE_Str_Buf msg (buf, sizeof buf); ACE_FIFO_Send_Msg fifo_sender (ACE_DEFAULT_RENDEZVOUS, - O_WRONLY | O_CREAT, - ACE_DEFAULT_FILE_PERMS); + O_WRONLY | O_CREAT, + ACE_DEFAULT_FILE_PERMS); if (fifo_sender.send (msg) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send error for fifo"), -1); diff --git a/ACE/examples/Reactor/FIFO/server.cpp b/ACE/examples/Reactor/FIFO/server.cpp index b6e91dd5046..3897aa3566e 100644 --- a/ACE/examples/Reactor/FIFO/server.cpp +++ b/ACE/examples/Reactor/FIFO/server.cpp @@ -68,10 +68,10 @@ FIFO_Recv_Handler::handle_input (ACE_HANDLE) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("msg.len = %d, n = %d\n"), msg.len, n)); if (msg.len > 0) - { - // Do some work in here... - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("msg.buf = %C\n"), msg.buf)); - } + { + // Do some work in here... + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("msg.buf = %C\n"), msg.buf)); + } return 0; } } diff --git a/ACE/examples/Reactor/Misc/notification.cpp b/ACE/examples/Reactor/Misc/notification.cpp index cf790ff6b03..c304b254dd0 100644 --- a/ACE/examples/Reactor/Misc/notification.cpp +++ b/ACE/examples/Reactor/Misc/notification.cpp @@ -53,7 +53,7 @@ public: // Print data from main thread. virtual int handle_timeout (const ACE_Time_Value &, - const void *); + const void *); // Handle timeout events in the main thread. virtual int handle_input (ACE_HANDLE); @@ -112,7 +112,7 @@ Thread_Handler::~Thread_Handler (void) Thread_Handler::Thread_Handler ( long delay, long interval, - size_t n_threads, + size_t n_threads, size_t max_iterations) : iterations_ (max_iterations) { @@ -126,8 +126,8 @@ Thread_Handler::Thread_Handler ( this->id_ = 0; if (ACE_Event_Handler::register_stdin_handler (this, - ACE_Reactor::instance (), - ACE_Thread_Manager::instance ()) == -1) + ACE_Reactor::instance (), + ACE_Thread_Manager::instance ()) == -1) ACE_ERROR ((LM_ERROR, "%p\n", "register_stdin_handler")); @@ -183,15 +183,15 @@ Thread_Handler::notify (ACE_Time_Value *timeout) timeout) == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", - "notification::notify:exception"), + "notification::notify:exception"), -1); else if (ACE_Reactor::instance ()->notify - (this, + (this, ACE_Event_Handler::WRITE_MASK, timeout) == -1) ACE_ERROR_RETURN ((LM_ERROR, "(%t) %p\n", - "notification::notify:write"), + "notification::notify:write"), -1); return 0; } @@ -209,21 +209,21 @@ Thread_Handler::handle_input (ACE_HANDLE handle) { ACE_DEBUG ((LM_DEBUG, "input to (%t) %*s", - n, + n, buf)); ACE_DEBUG ((LM_DEBUG, "%d more input to kill\n", - this->iterations_)); + this->iterations_)); // Only wait up to 10 milliseconds to notify the Reactor. ACE_Time_Value timeout (0, 10 * 1000); if (this->notify (&timeout) == -1) - ACE_ERROR ((LM_DEBUG, + ACE_ERROR ((LM_DEBUG, "(%t), %p\n", - "notification::handle_input:notify")); + "notification::handle_input:notify")); return 0; } else @@ -252,7 +252,7 @@ Thread_Handler::svc (void) ACE_Time_Value timeout (0, 10 * 1000); if (this->notify (&timeout) == -1) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "(%t) %p\n", "notify")); } @@ -284,8 +284,8 @@ Thread_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *) case SIGQUIT: #endif ACE_ERROR ((LM_ERROR, - "(%t) ******************** shutting down %n on signal %S\n", - signum)); + "(%t) ******************** shutting down %n on signal %S\n", + signum)); this->shutdown_ = 1; ACE_Reactor::end_event_loop(); } @@ -297,7 +297,7 @@ Thread_Handler::handle_timeout (const ACE_Time_Value &time, const void *) { ACE_DEBUG ((LM_DEBUG, "(%t) received timeout at (%u, %u), iterations = %d\n", - time.sec (), + time.sec (), time.usec (), this->iterations_)); @@ -314,8 +314,8 @@ int Thread_Handler::handle_exception (ACE_HANDLE) { ACE_DEBUG ((LM_DEBUG, - "(%t) exception to id %d, iteration = %d\n", - this->id_, + "(%t) exception to id %d, iteration = %d\n", + this->id_, this->iterations_)); return 0; } @@ -326,8 +326,8 @@ int Thread_Handler::handle_output (ACE_HANDLE) { ACE_DEBUG ((LM_DEBUG, - "(%t) output to id %d, iteration = %d\n", - this->id_, + "(%t) output to id %d, iteration = %d\n", + this->id_, // This decrement must come last since // <handle_exception> is called before <handle_output>! this->iterations_--)); @@ -382,6 +382,6 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, - "threads must be supported to run this application\n"), -1); + "threads must be supported to run this application\n"), -1); } #endif /* ACE_HAS_THREADS */ diff --git a/ACE/examples/Reactor/Misc/test_signals_1.cpp b/ACE/examples/Reactor/Misc/test_signals_1.cpp index 392abe26310..aef83ae9428 100644 --- a/ACE/examples/Reactor/Misc/test_signals_1.cpp +++ b/ACE/examples/Reactor/Misc/test_signals_1.cpp @@ -27,8 +27,8 @@ class My_Handler : public ACE_Event_Handler { public: virtual int handle_signal (int sig, - siginfo_t *, - ucontext_t *) + siginfo_t *, + ucontext_t *) { // @@ Note that this code is not portable to all OS platforms // since it uses print statements within signal handler context. @@ -45,7 +45,7 @@ public: } virtual int handle_timeout (const ACE_Time_Value &, - const void *arg) + const void *arg) { ACE_DEBUG ((LM_DEBUG, "%s\n", @@ -94,7 +94,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_UNUSED_ARG (sig); ACE_DEBUG ((LM_DEBUG, - "starting event loop that runs until you've typed ^C a total of 10 times or ^\\ once.\n")); + "starting event loop that runs until you've typed ^C a total of 10 times or ^\\ once.\n")); // This call executes the reactor events until we're finished. int result = ACE_Reactor::run_event_loop (); diff --git a/ACE/examples/Reactor/Misc/test_signals_2.cpp b/ACE/examples/Reactor/Misc/test_signals_2.cpp index 856e06adf91..ebfc89fc7ee 100644 --- a/ACE/examples/Reactor/Misc/test_signals_2.cpp +++ b/ACE/examples/Reactor/Misc/test_signals_2.cpp @@ -3,98 +3,98 @@ // Test the ability of the Reactor/Signal_Handler to register multiple // handler per-signal. -/* This test works as follows: - - 1. To test the "original" semantics of ACE (i.e., only one - ACE_Event_Handler can be registered per signal), you don't - need to do anything special. Existing programs work the - same since giving the Reactor's constructor a 0 value - (which is the default argument, BTW) instructs it to behave - as before. When a 0 is given, the ACE_Reactor's - constructor/open method creates an instance of - ACE_Sig_Handler and assigns this to an internal pointer. - This pointer is then used to dispatch all signal-related - methods within the Reactor. The default ACE_Sig_Handler - only allows *one* ACE_Event_Handler to be registered - per-signal. - - To run this version of the test do the following: - - % ./test-signal - ./test_signals - waiting for SIGINT or SIGQUIT - ^C - signal Interrupt occurred in Sig_Handler_2 (fruity, 0, 0) with count = 1 - waiting for SIGINT or SIGQUIT - ^\ - signal Quit occurred in Sig_Handler_2 (fruity, 0, 0) with count = 2 - shutting down SIGQUIT in Sig_Handler_2 (fruity, 0, 0) - waiting for SIGINT or SIGQUIT - ^C - signal Interrupt occurred in Sig_Handler_2 (fruity, 0, 0) with count = 3 - waiting for SIGINT or SIGQUIT - ^\Quit (core dumped) +/* This test works as follows: + + 1. To test the "original" semantics of ACE (i.e., only one + ACE_Event_Handler can be registered per signal), you don't + need to do anything special. Existing programs work the + same since giving the Reactor's constructor a 0 value + (which is the default argument, BTW) instructs it to behave + as before. When a 0 is given, the ACE_Reactor's + constructor/open method creates an instance of + ACE_Sig_Handler and assigns this to an internal pointer. + This pointer is then used to dispatch all signal-related + methods within the Reactor. The default ACE_Sig_Handler + only allows *one* ACE_Event_Handler to be registered + per-signal. + + To run this version of the test do the following: + + % ./test-signal + ./test_signals + waiting for SIGINT or SIGQUIT + ^C + signal Interrupt occurred in Sig_Handler_2 (fruity, 0, 0) with count = 1 + waiting for SIGINT or SIGQUIT + ^\ + signal Quit occurred in Sig_Handler_2 (fruity, 0, 0) with count = 2 + shutting down SIGQUIT in Sig_Handler_2 (fruity, 0, 0) + waiting for SIGINT or SIGQUIT + ^C + signal Interrupt occurred in Sig_Handler_2 (fruity, 0, 0) with count = 3 + waiting for SIGINT or SIGQUIT + ^\Quit (core dumped) Note that in this test only one handler (the last one -- - "Sig_Handler_2 (fruity)") is actually registered. BTW, the - core dump is the expected behavior since the default - disposition is restored when there are no more handlers - (see the code below). - - 2. To test the "multiple handlers per-signal semantics", you - need to pass the constructor/open method of the ACE_Reactor - a pointer to a an instance of ACE_Sig_Handlers (note the - plural "s"). ACE_Sig_Handlers is a class that derives from - ACE_Sig_Handler. The difference between these two classes - is that (1) ACE_Sig_Handlers::register_signal allows - multiple ACE_Event_Handlers to be registered per-signal and - (2) it enables SA_RESTART by default. This class also - implements Detlef Becker's algorithm for integrating ACE - signal handling with 3rd party libraries. - - To run this version of the test do the following: - - % ./test_signals 1 - - waiting for SIGINT or SIGQUIT - ^C - signal Interrupt occurred in external handler! - signal Interrupt occurred in Sig_Handler_1 (howdy, 3, 1) with count = 1 - shutting down SIGINT in Sig_Handler_1 (howdy, 3, 1) - signal Interrupt occurred in Sig_Handler_1 (doody, 5, 4) with count = 1 - shutting down SIGINT in Sig_Handler_1 (doody, 5, 4) - signal Interrupt occurred in Sig_Handler_2 (tutty, 7, 6) with count = 1 - signal Interrupt occurred in Sig_Handler_2 (fruity, 9, 8) with count = 1 - waiting for SIGINT or SIGQUIT - ^\ - signal Quit occurred in Sig_Handler_1 (howdy, 3, 1) with count = 2 - shutting down SIGQUIT in Sig_Handler_1 (howdy, 3, 1) - signal Quit occurred in Sig_Handler_1 (doody, 5, 4) with count = 2 - shutting down SIGQUIT in Sig_Handler_1 (doody, 5, 4) - signal Quit occurred in Sig_Handler_2 (tutty, 7, 6) with count = 2 - shutting down SIGQUIT in Sig_Handler_2 (tutty, 7, 6) - signal Quit occurred in Sig_Handler_2 (fruity, 9, 8) with count = 2 - shutting down SIGQUIT in Sig_Handler_2 (fruity, 9, 8) - waiting for SIGINT or SIGQUIT - ^C - signal Interrupt occurred in external handler! - signal Interrupt occurred in Sig_Handler_2 (tutty, 7, 6) with count = 3 - signal Interrupt occurred in Sig_Handler_2 (fruity, 9, 8) with count = 3 - waiting for SIGINT or SIGQUIT - ^\Quit (core dumped) - - When this test begins all four handlers are registered and - dispatched when a SIGINT or SIGQUIT occurs. After the - first SIGINT, the handle_signal method of the Sig_Handler_1 - objects unregister themselves. At that point there are 4 - SIGQUIT handlers left, but only 2 of our SIGINT handlers - left (and the 1 external handler). After the first - SIGQUIT, there are no SIGQUIT handlers left since they all - deregister themselves (which restores the "SIG_DFL" - disposition). On the second SIGINT there are only 3 - handlers left (2 of ours and 1 external). Finally, on the - second SIGQUIT we exit and dump core since that's what - happens with the default disposition for SIGQUIT. */ + "Sig_Handler_2 (fruity)") is actually registered. BTW, the + core dump is the expected behavior since the default + disposition is restored when there are no more handlers + (see the code below). + + 2. To test the "multiple handlers per-signal semantics", you + need to pass the constructor/open method of the ACE_Reactor + a pointer to a an instance of ACE_Sig_Handlers (note the + plural "s"). ACE_Sig_Handlers is a class that derives from + ACE_Sig_Handler. The difference between these two classes + is that (1) ACE_Sig_Handlers::register_signal allows + multiple ACE_Event_Handlers to be registered per-signal and + (2) it enables SA_RESTART by default. This class also + implements Detlef Becker's algorithm for integrating ACE + signal handling with 3rd party libraries. + + To run this version of the test do the following: + + % ./test_signals 1 + + waiting for SIGINT or SIGQUIT + ^C + signal Interrupt occurred in external handler! + signal Interrupt occurred in Sig_Handler_1 (howdy, 3, 1) with count = 1 + shutting down SIGINT in Sig_Handler_1 (howdy, 3, 1) + signal Interrupt occurred in Sig_Handler_1 (doody, 5, 4) with count = 1 + shutting down SIGINT in Sig_Handler_1 (doody, 5, 4) + signal Interrupt occurred in Sig_Handler_2 (tutty, 7, 6) with count = 1 + signal Interrupt occurred in Sig_Handler_2 (fruity, 9, 8) with count = 1 + waiting for SIGINT or SIGQUIT + ^\ + signal Quit occurred in Sig_Handler_1 (howdy, 3, 1) with count = 2 + shutting down SIGQUIT in Sig_Handler_1 (howdy, 3, 1) + signal Quit occurred in Sig_Handler_1 (doody, 5, 4) with count = 2 + shutting down SIGQUIT in Sig_Handler_1 (doody, 5, 4) + signal Quit occurred in Sig_Handler_2 (tutty, 7, 6) with count = 2 + shutting down SIGQUIT in Sig_Handler_2 (tutty, 7, 6) + signal Quit occurred in Sig_Handler_2 (fruity, 9, 8) with count = 2 + shutting down SIGQUIT in Sig_Handler_2 (fruity, 9, 8) + waiting for SIGINT or SIGQUIT + ^C + signal Interrupt occurred in external handler! + signal Interrupt occurred in Sig_Handler_2 (tutty, 7, 6) with count = 3 + signal Interrupt occurred in Sig_Handler_2 (fruity, 9, 8) with count = 3 + waiting for SIGINT or SIGQUIT + ^\Quit (core dumped) + + When this test begins all four handlers are registered and + dispatched when a SIGINT or SIGQUIT occurs. After the + first SIGINT, the handle_signal method of the Sig_Handler_1 + objects unregister themselves. At that point there are 4 + SIGQUIT handlers left, but only 2 of our SIGINT handlers + left (and the 1 external handler). After the first + SIGQUIT, there are no SIGQUIT handlers left since they all + deregister themselves (which restores the "SIG_DFL" + disposition). On the second SIGINT there are only 3 + handlers left (2 of ours and 1 external). Finally, on the + second SIGQUIT we exit and dump core since that's what + happens with the default disposition for SIGQUIT. */ #include "ace/Reactor.h" @@ -133,8 +133,8 @@ public: { this->count_++; ACE_DEBUG ((LM_DEBUG, - "\nsignal %S occurred in Sig_Handler_1 (%s, %d, %d) with count = %d", - signum, + "\nsignal %S occurred in Sig_Handler_1 (%s, %d, %d) with count = %d", + signum, this->msg_, this->int_sigkey_, this->quit_sigkey_, @@ -142,15 +142,15 @@ public: if (this->count_ != 1 && signum == SIGQUIT) { - if (this->reactor_.remove_handler (SIGQUIT, + if (this->reactor_.remove_handler (SIGQUIT, 0, 0, - this->quit_sigkey_) == -1) - ACE_ERROR ((LM_ERROR, + this->quit_sigkey_) == -1) + ACE_ERROR ((LM_ERROR, "\n%p", "remove_handler")); - else - ACE_DEBUG ((LM_DEBUG, + else + ACE_DEBUG ((LM_DEBUG, "\nshutting down SIGQUIT in Sig_Handler_1 (%s, %d, %d)", this->msg_, this->int_sigkey_, @@ -158,15 +158,15 @@ public: } else if (this->count_ != 2 && signum == SIGINT) { - if (this->reactor_.remove_handler (SIGINT, + if (this->reactor_.remove_handler (SIGINT, 0, 0, - this->int_sigkey_) == -1) - ACE_ERROR ((LM_ERROR, + this->int_sigkey_) == -1) + ACE_ERROR ((LM_ERROR, "\n%p", "remove_handler")); - else - ACE_DEBUG ((LM_DEBUG, + else + ACE_DEBUG ((LM_DEBUG, "\nshutting down SIGINT in Sig_Handler_1 (%s, %d, %d)", this->msg_, this->int_sigkey_, @@ -197,25 +197,24 @@ public: { this->count_++; ACE_DEBUG ((LM_DEBUG, - "\nsignal %S occurred in Sig_Handler_2 (%s, %d, %d) with count = %d", - signum, + "\nsignal %S occurred in Sig_Handler_2 (%s, %d, %d) with count = %d", + signum, this->msg_, this->int_sigkey_, this->quit_sigkey_, this->count_)); if (this->count_ != 0 && signum == SIGQUIT) { - if (this->reactor_.remove_handler (SIGQUIT, 0, 0, - this->quit_sigkey_) == -1) - ACE_ERROR ((LM_ERROR, + if (this->reactor_.remove_handler (SIGQUIT, 0, 0, this->quit_sigkey_) == -1) + ACE_ERROR ((LM_ERROR, "\n%p", "remove_handler")); - else - ACE_DEBUG ((LM_DEBUG, - "\nshutting down SIGQUIT in Sig_Handler_2 (%s, %d, %d)", - this->msg_, - this->int_sigkey_, - this->quit_sigkey_)); + else + ACE_DEBUG ((LM_DEBUG, + "\nshutting down SIGQUIT in Sig_Handler_2 (%s, %d, %d)", + this->msg_, + this->int_sigkey_, + this->quit_sigkey_)); } return 0; } diff --git a/ACE/examples/Reactor/Ntalker/ntalker.cpp b/ACE/examples/Reactor/Ntalker/ntalker.cpp index e73b3ae8b60..5bf538b06eb 100644 --- a/ACE/examples/Reactor/Ntalker/ntalker.cpp +++ b/ACE/examples/Reactor/Ntalker/ntalker.cpp @@ -29,9 +29,9 @@ class Handler : public ACE_Event_Handler public: // = Initialization and termination methods. Handler (u_short udp_port, - const char *ip_addr, - const ACE_TCHAR *a_interface, - ACE_Reactor & ); + const char *ip_addr, + const ACE_TCHAR *a_interface, + ACE_Reactor & ); // Constructor. ~Handler (void); @@ -67,14 +67,14 @@ Handler::handle_input (ACE_HANDLE h) ssize_t result = ACE_OS::read (h, buf, BUFSIZ); if (result > 0) - { - if (this->mcast_.send (buf, result) != result) + { + if (this->mcast_.send (buf, result) != result) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "send error"), -1); - return 0; - } + return 0; + } else if (result == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", @@ -96,17 +96,17 @@ Handler::handle_input (ACE_HANDLE h) remote_addr); if (result != -1) - { + { ACE_DEBUG ((LM_DEBUG, "received datagram from host %s on port %d bytes = %d\n", remote_addr.get_host_name (), remote_addr.get_port_number (), result)); - ACE_OS::write (ACE_STDERR, buf, result); + ACE_OS::write (ACE_STDERR, buf, result); ACE_DEBUG ((LM_DEBUG, "\n")); - return 0; - } + return 0; + } ACE_ERROR_RETURN ((LM_ERROR, "%p\n", @@ -144,9 +144,9 @@ Handler::~Handler (void) } Handler::Handler (u_short udp_port, - const char *ip_addr, + const char *ip_addr, const ACE_TCHAR *a_interface, - ACE_Reactor &reactor) + ACE_Reactor &reactor) { // Create multicast address to listen on. @@ -190,15 +190,15 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - INTERFACE = get_opt.opt_arg (); - break; + INTERFACE = get_opt.opt_arg (); + break; case 'u': - // Usage fallthrough. + // Usage fallthrough. default: ACE_DEBUG ((LM_DEBUG, "%s -i interface\n", argv[0])); - ACE_OS::exit (1); + ACE_OS::exit (1); } } diff --git a/ACE/examples/Reactor/Proactor/test_cancel.cpp b/ACE/examples/Reactor/Proactor/test_cancel.cpp index 49c0c0a6490..160ade46a30 100644 --- a/ACE/examples/Reactor/Proactor/test_cancel.cpp +++ b/ACE/examples/Reactor/Proactor/test_cancel.cpp @@ -80,7 +80,7 @@ Receiver::~Receiver (void) void Receiver::open (ACE_HANDLE handle, - ACE_Message_Block &) + ACE_Message_Block &) { // New connection, initiate stuff @@ -192,16 +192,16 @@ parse_args (int argc, ACE_TCHAR *argv[]) { case 'p': port = ACE_OS::atoi (get_opt.opt_arg ()); - break; + break; case 's': - read_size = ACE_OS::atoi (get_opt.opt_arg ()); - break; + read_size = ACE_OS::atoi (get_opt.opt_arg ()); + break; default: - ACE_ERROR ((LM_ERROR, "%p.\n", - "usage :\n" - "-p <port>\n" - "-s <read_size>\n")); - return -1; + ACE_ERROR ((LM_ERROR, "%p.\n", + "usage :\n" + "-p <port>\n" + "-s <read_size>\n")); + return -1; } return 0; diff --git a/ACE/examples/Reactor/Proactor/test_cancel.h b/ACE/examples/Reactor/Proactor/test_cancel.h index 45c4bfbc85b..67f67ffc0da 100644 --- a/ACE/examples/Reactor/Proactor/test_cancel.h +++ b/ACE/examples/Reactor/Proactor/test_cancel.h @@ -24,7 +24,7 @@ public: ~Receiver (void); virtual void open (ACE_HANDLE handle, - ACE_Message_Block &message_block); + ACE_Message_Block &message_block); // This is called after the new connection has been accepted. protected: diff --git a/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp b/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp index 09b62efd97f..61301aaf50b 100644 --- a/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp +++ b/ACE/examples/Reactor/Proactor/test_multiple_loops.cpp @@ -45,21 +45,21 @@ public: { // Print out when timeouts occur. ACE_DEBUG ((LM_DEBUG, "(%t) %d timeout occurred for %s @ %d.\n", - ++count_, - (char *) arg, - tv.sec ())); + ++count_, + (char *) arg, + tv.sec ())); // Since there is only one thread that can do the timeouts in // Reactor, lets keep the handle_timeout short for that // thread. if (ACE_OS::strcmp ((char *) arg, "Proactor") == 0) - // Sleep for a while - ACE_OS::sleep (1); + // Sleep for a while + ACE_OS::sleep (1); } // This method is declared in ACE_Event_Handler. virtual int handle_timeout (const ACE_Time_Value &tv, - const void *arg) + const void *arg) { this->handle_time_out (tv, arg); return 0; @@ -105,17 +105,17 @@ ACE_TMAIN (int, ACE_TCHAR *[]) // Register a 2 second timer. ACE_Time_Value foo_tv (2); if (proactor.schedule_timer (handler, - (void *) "Proactor", - ACE_Time_Value::zero, - foo_tv) == -1) + (void *) "Proactor", + ACE_Time_Value::zero, + foo_tv) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_timer"), -1); // Register a 3 second timer. ACE_Time_Value bar_tv (3); if (ACE_Reactor::instance ()->schedule_timer (&handler, - (void *) "Reactor", - ACE_Time_Value::zero, - bar_tv) == -1) + (void *) "Reactor", + ACE_Time_Value::zero, + bar_tv) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_timer"), -1); Worker worker; diff --git a/ACE/examples/Reactor/Proactor/test_proactor3.cpp b/ACE/examples/Reactor/Proactor/test_proactor3.cpp index 9b92723e29a..ef068335bb8 100644 --- a/ACE/examples/Reactor/Proactor/test_proactor3.cpp +++ b/ACE/examples/Reactor/Proactor/test_proactor3.cpp @@ -706,7 +706,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) break; case 'o': // max number of aio for proactor max_aio_operations = ACE_OS::atoi (get_opt.opt_arg ()); - break; + break; case 't': // Proactor Type if (set_proactor_type (get_opt.opt_arg ())) break; @@ -728,7 +728,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) "\n-u show this message" "\n")); - return -1; + return -1; } return 0; diff --git a/ACE/examples/Reactor/Proactor/test_timeout.cpp b/ACE/examples/Reactor/Proactor/test_timeout.cpp index f89d5dcc98a..258756ef772 100644 --- a/ACE/examples/Reactor/Proactor/test_timeout.cpp +++ b/ACE/examples/Reactor/Proactor/test_timeout.cpp @@ -45,13 +45,13 @@ public: } virtual void handle_time_out (const ACE_Time_Value &tv, - const void *arg) + const void *arg) { // Print out when timeouts occur. ACE_DEBUG ((LM_DEBUG, "(%t) %d timeout occurred for %s @ %d.\n", - ++count_, - (char *) arg, - (tv - this->start_time_).sec ())); + ++count_, + (char *) arg, + (tv - this->start_time_).sec ())); // Sleep for a while ACE_OS::sleep (4); diff --git a/ACE/examples/Reactor/Proactor/test_timeout_st.cpp b/ACE/examples/Reactor/Proactor/test_timeout_st.cpp index c7a984b9eb2..045f3607375 100644 --- a/ACE/examples/Reactor/Proactor/test_timeout_st.cpp +++ b/ACE/examples/Reactor/Proactor/test_timeout_st.cpp @@ -41,13 +41,13 @@ public: } virtual void handle_time_out (const ACE_Time_Value &tv, - const void *arg) + const void *arg) { // Print out when timeouts occur. ACE_DEBUG ((LM_DEBUG, "(%t) %d timeout occurred for %s @ %d.\n", - ++count_, - (char *) arg, - (tv - this->start_time_).sec ())); + ++count_, + (char *) arg, + (tv - this->start_time_).sec ())); } private: diff --git a/ACE/examples/Registry/test_registry_update.cpp b/ACE/examples/Registry/test_registry_update.cpp index 78cd0aabd8c..8aec0bd412d 100644 --- a/ACE/examples/Registry/test_registry_update.cpp +++ b/ACE/examples/Registry/test_registry_update.cpp @@ -32,7 +32,7 @@ static ACE_Registry::Name counter_name; // Protypes static int update_counter (HKEY predefined, - u_long ¤t_counter); + u_long ¤t_counter); static void setup_names (); int @@ -46,16 +46,16 @@ ACE_TMAIN (int, ACE_TCHAR *[]) // Update counter per user result = ::update_counter (HKEY_CURRENT_USER, - current_counter); + current_counter); if (result == 0) { cout << "User counter: " << current_counter << endl; // Update counter per machine result = ::update_counter (HKEY_LOCAL_MACHINE, - current_counter); + current_counter); if (result == 0) - cout << "Machine counter: " << current_counter << endl; + cout << "Machine counter: " << current_counter << endl; } if (result != 0) @@ -68,7 +68,7 @@ ACE_TMAIN (int, ACE_TCHAR *[]) static int update_counter (HKEY predefined, - u_long ¤t_counter) + u_long ¤t_counter) { int result; ACE_Registry::Naming_Context parent_context; @@ -76,18 +76,18 @@ update_counter (HKEY predefined, // Connect to predefined entry result = ACE_Predefined_Naming_Contexts::connect (parent_context, - predefined); + predefined); if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Predefined_Naming_Contexts::connect failed"), -1); // Find application context name result = parent_context.resolve_context (application_context_name, - application_context); + application_context); if (result != 0) // Failed to find: create a new context result = parent_context.bind_new_context (application_context_name, - application_context); + application_context); if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Registry::Naming_Contexts::bind/resolve_context failed"), -1); @@ -96,18 +96,18 @@ update_counter (HKEY predefined, u_long counter = 0; // Represent counter as an ACE_Registry::Object ACE_Registry::Object object ((void *) &counter, - sizeof counter, - REG_DWORD); + sizeof counter, + REG_DWORD); // Find counter result = application_context.resolve (counter_name, - object); + object); if (result != 0) // Failed to find: create new binding for object { counter = 1; result = application_context.bind (counter_name, - object); + object); } else // Counter was found @@ -116,7 +116,7 @@ update_counter (HKEY predefined, counter++; // Update result = application_context.rebind (counter_name, - object); + object); } if (result != 0) diff --git a/ACE/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp b/ACE/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp index 4cbb964cd74..4895d326b8d 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/client/broadcast_client_test.cpp @@ -37,11 +37,11 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'p': - broadcast_port_number = ACE_OS::atoi (get_opt.opt_arg ()); - break; + broadcast_port_number = ACE_OS::atoi (get_opt.opt_arg ()); + break; default: - print_usage_and_die (); - break; + print_usage_and_die (); + break; } } diff --git a/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp b/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp index 3f8ed3db866..2a125a4a5f4 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/client/local_dgram_client_test.cpp @@ -32,7 +32,7 @@ print_usage_and_die (void) ACE_ERROR ((LM_ERROR, ACE_TEXT ("usage: %s [-r rendezvous_dgram] ") ACE_TEXT ("[-c rendezvous_codgram] [-f file]\n"), - program_name)); + program_name)); ACE_OS::exit (1); } diff --git a/ACE/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp b/ACE/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp index 7193440b440..694406647fd 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/client/local_pipe_client_test.cpp @@ -29,7 +29,7 @@ print_usage_and_die (void) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("usage: %s [-r rendezvous] [-f file]\n"), - program_name)); + program_name)); ACE_OS::exit (1); } @@ -86,21 +86,21 @@ do_client_processing (ACE_LSOCK_Stream &sc) if (ACE_OS::write (fd_write[1], buf, n) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("write")), -1); if ((n = ACE_OS::read (fd_read[0], buf, sizeof buf)) == -1) - ACE_ERROR_RETURN ((LM_ERROR, + ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("read")), -1); if (ACE_OS::write (ACE_STDOUT, buf, n) == -1) - return -1; + return -1; } if (ACE_OS::close (fd_read[0]) == -1 diff --git a/ACE/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp b/ACE/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp index 390b14e19b8..3b27f3db67a 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/client/local_stream_client_test.cpp @@ -41,14 +41,14 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'f': - file_name = get_opt.opt_arg (); - break; + file_name = get_opt.opt_arg (); + break; case 'r': - rendezvous = get_opt.opt_arg (); - break; + rendezvous = get_opt.opt_arg (); + break; default: - print_usage_and_die (); - break; + print_usage_and_die (); + break; } } diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.inl index a77d75e1fa8..5eff78a4bea 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_CODgram.inl @@ -22,7 +22,7 @@ Handle_L_CODgram::open (const ACE_UNIX_Addr &suad, int async) return 0; } -ACE_INLINE int +ACE_INLINE int Handle_L_CODgram::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; @@ -30,7 +30,7 @@ Handle_L_CODgram::info (ACE_TCHAR **strp, size_t length) const if (ACE_LSOCK_CODgram::get_local_addr (sa) == -1) return -1; - + ACE_OS::strcpy (buf, ACE_TEXT_CHAR_TO_TCHAR (sa.get_path_name ())); ACE_OS::strcat (buf, ACE_TEXT (" # tests local connected datagram\n")); @@ -49,42 +49,41 @@ Handle_L_CODgram::init (int argc, ACE_TCHAR *argv[]) const ACE_TCHAR *r = Handle_L_CODgram::DEFAULT_RENDEZVOUS; for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'r': - r = get_opt.opt_arg (); - break; - default: - break; - } + switch (c) + { + case 'r': + r = get_opt.opt_arg (); + break; + default: + break; + } ACE_OS::strncpy (this->rendezvous, r, MAXPATHLEN); ACE_OS::unlink (this->rendezvous); sucd.set (this->rendezvous); if (this->open (sucd) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); - else if (ACE_Reactor::instance ()->register_handler - (this, ACE_Event_Handler::ACCEPT_MASK) == -1) + else if (ACE_Reactor::instance ()->register_handler (this, ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("registering service with ACE_Reactor")), + ACE_TEXT ("registering service with ACE_Reactor")), -1); return 0; } -ACE_INLINE int -Handle_L_CODgram::fini(void) +ACE_INLINE int +Handle_L_CODgram::fini(void) { - return ACE_Reactor::instance ()->remove_handler + return ACE_Reactor::instance ()->remove_handler (this, ACE_Event_Handler::ACCEPT_MASK); } ACE_INLINE ACE_HANDLE Handle_L_CODgram::get_handle (void) const -{ +{ return ACE_LSOCK_CODgram::get_handle (); } -ACE_INLINE int +ACE_INLINE int Handle_L_CODgram::handle_input (ACE_HANDLE) { ACE_HANDLE handle = ACE_INVALID_HANDLE; @@ -102,7 +101,7 @@ Handle_L_CODgram::handle_input (ACE_HANDLE) ssize_t n = ACE_OS::read (handle, buf, sizeof buf); if (n <= 0) - break; + break; ACE_OS::write (ACE_STDOUT, buf, n); } diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.inl index 3b2ab29331f..110a6e1cb3b 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Dgram.inl @@ -18,11 +18,11 @@ Handle_L_Dgram::open (const ACE_UNIX_Addr &suad, int async) return -1; else if (async && this->ACE_LSOCK_Dgram::enable (ACE_SIGIO) == -1) return -1; - else + else return 0; } -ACE_INLINE int +ACE_INLINE int Handle_L_Dgram::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; @@ -49,22 +49,22 @@ Handle_L_Dgram::init (int argc, ACE_TCHAR *argv[]) const ACE_TCHAR *r = Handle_L_Dgram::DEFAULT_RENDEZVOUS; for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'r': - r = get_opt.opt_arg (); - break; - default: - break; - } - + switch (c) + { + case 'r': + r = get_opt.opt_arg (); + break; + default: + break; + } + ACE_OS::strncpy (this->rendezvous, r, MAXPATHLEN); ACE_OS::unlink (this->rendezvous); sudg.set (this->rendezvous); if (this->open (sudg) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); else if (ACE_Reactor::instance ()->register_handler (this, - ACE_Event_Handler::ACCEPT_MASK) == -1) + ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("registering service with ACE_Reactor")), @@ -72,19 +72,19 @@ Handle_L_Dgram::init (int argc, ACE_TCHAR *argv[]) return 0; } -ACE_INLINE int -Handle_L_Dgram::fini (void) +ACE_INLINE int +Handle_L_Dgram::fini (void) { return ACE_Reactor::instance ()->remove_handler (this, ACE_Event_Handler::ACCEPT_MASK); } -ACE_INLINE int +ACE_INLINE int Handle_L_Dgram::get_handle (void) const -{ +{ return this->ACE_LSOCK_Dgram::get_handle (); } -ACE_INLINE int +ACE_INLINE int Handle_L_Dgram::handle_input (int) { ACE_UNIX_Addr sa; diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.inl index f6cd0cda734..d1559ad0359 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_FIFO.inl @@ -46,20 +46,19 @@ Handle_L_FIFO::init (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("r:"), 0); for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'r': - rendezvous_fifo = get_opt.opt_arg (); - break; - default: - break; - } + switch (c) + { + case 'r': + rendezvous_fifo = get_opt.opt_arg (); + break; + default: + break; + } ACE_OS::unlink (rendezvous_fifo); if (this->open (rendezvous_fifo) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); - else if (ACE_Reactor::instance ()->register_handler - (this, ACE_Event_Handler::READ_MASK) == -1) + else if (ACE_Reactor::instance ()->register_handler (this, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("registering service with ACE_Reactor")), -1); diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.inl index ce978aa85ea..6ab9f96128d 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Pipe.inl @@ -54,24 +54,23 @@ Handle_L_Pipe::init (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("r:"), 0); for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'r': - r = get_opt.opt_arg (); - break; - default: - break; - } + switch (c) + { + case 'r': + r = get_opt.opt_arg (); + break; + default: + break; + } ACE_OS::strncpy (this->rendezvous, r, MAXPATHLEN); ACE_OS::unlink (this->rendezvous); sup.set (this->rendezvous); if (this->open (sup) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); - else if (ACE_Reactor::instance ()->register_handler - (this, ACE_Event_Handler::ACCEPT_MASK) == -1) + else if (ACE_Reactor::instance ()->register_handler (this, ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("registering service with ACE_Reactor")), -1); + ACE_TEXT ("registering service with ACE_Reactor")), -1); return 0; } diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.inl index 910938d8648..50c0456893f 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_SPIPE.inl @@ -71,9 +71,9 @@ Handle_L_SPIPE::init (int argc, ACE_TCHAR *argv[]) else if (ACE_Reactor::instance ()->register_handler (this, ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("registering service with ACE_Reactor")), - -1); + ACE_TEXT ("%p\n"), + ACE_TEXT ("registering service with ACE_Reactor")), + -1); return 0; } @@ -108,8 +108,8 @@ Handle_L_SPIPE::handle_input (int) new_spipe.get_remote_addr (sa); ACE_DEBUG ((LM_INFO, - ACE_TEXT ("accepted request from %s (gid = %d, uid = %d)\n"), - sa.get_path_name (), sa.group_id (), sa.user_id ())); + ACE_TEXT ("accepted request from %s (gid = %d, uid = %d)\n"), + sa.get_path_name (), sa.group_id (), sa.user_id ())); } while (new_spipe.recv ((ACE_Str_Buf *) 0, &msg, &flags) >= 0) diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl index 80b21852293..03b87ef905c 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_L_Stream.inl @@ -20,8 +20,8 @@ Handle_L_Stream::Handle_L_Stream (void) } ACE_INLINE int -Handle_L_Stream::open (const ACE_UNIX_Addr &suas, - int async) +Handle_L_Stream::open (const ACE_UNIX_Addr &suas, + int async) { if (this->ACE_LSOCK_Acceptor::open (suas) == -1) return -1; @@ -31,7 +31,7 @@ Handle_L_Stream::open (const ACE_UNIX_Addr &suas, return 0; } -ACE_INLINE int +ACE_INLINE int Handle_L_Stream::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; @@ -39,7 +39,7 @@ Handle_L_Stream::info (ACE_TCHAR **strp, size_t length) const if (this->get_local_addr (sa) == -1) return -1; - + ACE_OS::strcpy (buf, ACE_TEXT_CHAR_TO_TCHAR (sa.get_path_name ())); ACE_OS::strcat (buf, ACE_TEXT (" # tests local ACE_Stream\n")); @@ -58,30 +58,29 @@ Handle_L_Stream::init (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("r:"), 0); for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'r': - r = get_opt.opt_arg (); - break; - default: - break; - } - + switch (c) + { + case 'r': + r = get_opt.opt_arg (); + break; + default: + break; + } + ACE_OS::strncpy (this->rendezvous, r, MAXPATHLEN); ACE_OS::unlink (this->rendezvous); sus.set (this->rendezvous); if (this->open (sus) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); - else if (ACE_Reactor::instance ()->register_handler - (this, ACE_Event_Handler::ACCEPT_MASK) == -1) + else if (ACE_Reactor::instance ()->register_handler (this, ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), - ACE_TEXT ("registering service with ACE_Reactor")), -1); + ACE_TEXT ("registering service with ACE_Reactor")), -1); return 0; } -ACE_INLINE int -Handle_L_Stream::fini (void) +ACE_INLINE int +Handle_L_Stream::fini (void) { return ACE_Reactor::instance ()->remove_handler (this, ACE_Event_Handler::ACCEPT_MASK); @@ -89,11 +88,11 @@ Handle_L_Stream::fini (void) ACE_INLINE ACE_HANDLE Handle_L_Stream::get_handle (void) const -{ +{ return ACE_LSOCK_Acceptor::get_handle (); } -ACE_INLINE int +ACE_INLINE int Handle_L_Stream::handle_input (ACE_HANDLE) { ACE_LSOCK_Stream new_local_stream; @@ -106,9 +105,9 @@ Handle_L_Stream::handle_input (ACE_HANDLE) else if (new_local_stream.recv_handle (handle) == -1) return -1; else - ACE_DEBUG ((LM_INFO, - ACE_TEXT ("received file descriptor %d on ACE_Stream %s\n"), - handle, sa.get_path_name ())); + ACE_DEBUG ((LM_INFO, + ACE_TEXT ("received file descriptor %d on ACE_Stream %s\n"), + handle, sa.get_path_name ())); ACE_OS::puts ("----------------------------------------"); @@ -117,7 +116,7 @@ Handle_L_Stream::handle_input (ACE_HANDLE) ssize_t n = ACE_OS::read (handle, buf, sizeof buf); if (n <= 0) - break; + break; ACE_OS::write (ACE_STDOUT, buf, n); } @@ -128,10 +127,10 @@ Handle_L_Stream::handle_input (ACE_HANDLE) ACE_TCHAR *cs = ACE_OS::ctime (&t); if (new_local_stream.send (4, - Handle_L_Stream::login_name, - ACE_OS::strlen (Handle_L_Stream::login_name), - ACE_TEXT_ALWAYS_CHAR (cs), - ACE_OS::strlen (cs)) == -1) + Handle_L_Stream::login_name, + ACE_OS::strlen (Handle_L_Stream::login_name), + ACE_TEXT_ALWAYS_CHAR (cs), + ACE_OS::strlen (cs)) == -1) return -1; else if (ACE_OS::close (handle) == -1) return -1; diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.inl b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.inl index 88212a988f0..68a6bb9a967 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.inl +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_R_Dgram.inl @@ -22,7 +22,7 @@ Handle_R_Dgram::open (const ACE_INET_Addr &r, int async) return 0; } -ACE_INLINE int +ACE_INLINE int Handle_R_Dgram::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; @@ -30,7 +30,7 @@ Handle_R_Dgram::info (ACE_TCHAR **strp, size_t length) const if (this->get_local_addr (sa) == -1) return -1; - + ACE_OS::sprintf (buf, ACE_TEXT ("%d/"), sa.get_port_number ()); ACE_OS::strcat (buf, ACE_TEXT ("udp # tests remote dgram\n")); @@ -48,26 +48,25 @@ Handle_R_Dgram::init (int argc, ACE_TCHAR *argv[]) ACE_Get_Opt get_opt (argc, argv, ACE_TEXT ("p:"), 0); for (int c; (c = get_opt ()) != -1; ) - switch (c) - { - case 'p': - sidg.set (ACE_OS::atoi (get_opt.opt_arg ())); - break; - default: - break; - } - + switch (c) + { + case 'p': + sidg.set (ACE_OS::atoi (get_opt.opt_arg ())); + break; + default: + break; + } + if (this->open (sidg) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); - else if (ACE_Reactor::instance ()->register_handler - (this, ACE_Event_Handler::ACCEPT_MASK) == -1) + else if (ACE_Reactor::instance ()->register_handler (this, ACE_Event_Handler::ACCEPT_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("registering service with ACE_Reactor")), -1); return 0; } -ACE_INLINE int -Handle_R_Dgram::fini (void) +ACE_INLINE int +Handle_R_Dgram::fini (void) { return ACE_Reactor::instance ()->remove_handler (this, ACE_Event_Handler::ACCEPT_MASK); @@ -75,11 +74,11 @@ Handle_R_Dgram::fini (void) ACE_INLINE ACE_HANDLE Handle_R_Dgram::get_handle (void) const -{ - return ACE_SOCK_Dgram::get_handle (); +{ + return ACE_SOCK_Dgram::get_handle (); } -ACE_INLINE int +ACE_INLINE int Handle_R_Dgram::handle_input (ACE_HANDLE) { ACE_INET_Addr sa; diff --git a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp index fb53c0f8d70..3598b6f87f6 100644 --- a/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp +++ b/ACE/examples/Service_Configurator/IPC-tests/server/Handle_Thr_Stream.cpp @@ -67,28 +67,28 @@ Handle_Thr_Acceptor<SVH, PR_AC_2>::init (int argc, ACE_TCHAR *argv[]) switch (c) { case 'p': - local_addr.set (ACE_OS::atoi (get_opt.opt_arg ())); - break; + local_addr.set (ACE_OS::atoi (get_opt.opt_arg ())); + break; case 't': - n_threads = ACE_OS::atoi (get_opt.opt_arg ()); - break; + n_threads = ACE_OS::atoi (get_opt.opt_arg ()); + break; default: - break; + break; } // Initialize the threading strategy. if (this->thr_strategy_.open (&this->thr_mgr_, - this->thr_flags_, - n_threads) == -1) + this->thr_flags_, + n_threads) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); // Initialize the Acceptor base class, passing in the desired // concurrency strategy. else if (this->open (local_addr, - ACE_Reactor::instance (), - 0, - 0, - &this->thr_strategy_) == -1) + ACE_Reactor::instance (), + 0, + 0, + &this->thr_strategy_) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("open")), -1); else return 0; @@ -124,14 +124,16 @@ CLI_Stream<PR_ST_2>::open (void *) { ACE_INET_Addr sa; - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) client handle = %d\n"), - this->peer ().get_handle ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) client handle = %d\n"), + this->peer ().get_handle ())); if (this->peer ().get_remote_addr (sa) == -1) return -1; - ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%t) accepted at port %d\n"), - sa.get_port_number ())); + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%t) accepted at port %d\n"), + sa.get_port_number ())); return 0; } @@ -152,9 +154,10 @@ CLI_Stream<PR_ST_2>::svc (void) time_t t = ACE_OS::time (0L); ACE_OS::cuserid (login_name); - ACE_OS::sprintf (buf, "user %s %s", - login_name, - ACE_TEXT_ALWAYS_CHAR (ACE_OS::ctime ((const time_t *) &t))); + ACE_OS::sprintf (buf, + "user %s %s", + login_name, + ACE_TEXT_ALWAYS_CHAR (ACE_OS::ctime ((const time_t *) &t))); if (this->peer ().send_n (buf, ACE_OS::strlen (buf) + 1) == -1) return -1; diff --git a/ACE/examples/Service_Configurator/Misc/Timer_Service.cpp b/ACE/examples/Service_Configurator/Misc/Timer_Service.cpp index d7bcdd15989..583552c6de4 100644 --- a/ACE/examples/Service_Configurator/Misc/Timer_Service.cpp +++ b/ACE/examples/Service_Configurator/Misc/Timer_Service.cpp @@ -16,8 +16,8 @@ int Timer_Service_1::init (int argc, ACE_TCHAR *argv[]) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("in Timer_Service::init, argv[0] = %s, argc == %d\n"), - argv[0], argc)); + ACE_TEXT ("in Timer_Service::init, argv[0] = %s, argc == %d\n"), + argv[0], argc)); // Printout the <argv> values for sanity's sake. for (int i = 0; i < argc; i++) @@ -76,13 +76,13 @@ Timer_Service_1::handle_timeout (const ACE_Time_Value &tv, const void *) { ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%x) in %s::handle_timeout sec = %d, usec = %d") - ACE_TEXT (" cur_timeouts = %d, max_timeouts = %d\n"), + ACE_TEXT ("(%x) in %s::handle_timeout sec = %d, usec = %d") + ACE_TEXT (" cur_timeouts = %d, max_timeouts = %d\n"), this, this->name_, - tv.sec (), + tv.sec (), tv.usec (), - this->cur_timeouts_, + this->cur_timeouts_, this->max_timeouts_)); this->cur_timeouts_++; @@ -121,10 +121,10 @@ Timer_Service_3::Timer_Service_3 (void) // Define the object that describes the service. ACE_STATIC_SVC_DEFINE (Timer_Service_1, - ACE_TEXT ("Timer_Service_1"), + ACE_TEXT ("Timer_Service_1"), ACE_SVC_OBJ_T, &ACE_SVC_NAME (Timer_Service_1), - ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, 0) // The following are "Factories" used by the <ACE_Service_Config> and diff --git a/ACE/examples/Shared_Memory/test_SV.cpp b/ACE/examples/Shared_Memory/test_SV.cpp index 26ab56a7115..f606eea5b70 100644 --- a/ACE/examples/Shared_Memory/test_SV.cpp +++ b/ACE/examples/Shared_Memory/test_SV.cpp @@ -25,8 +25,9 @@ client (void) static void server (void) { - ACE_Shared_Memory_SV shm_server (SHM_KEY, SHMSZ, - ACE_Shared_Memory_SV::ACE_CREATE); + ACE_Shared_Memory_SV shm_server (SHM_KEY, + SHMSZ, + ACE_Shared_Memory_SV::ACE_CREATE); char *shm = (char *) shm_server.malloc (); char *s = shm; diff --git a/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp b/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp index d48939845d5..23fc877663c 100644 --- a/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp +++ b/ACE/examples/System_V_IPC/SV_Message_Queues/TMQ_Client.cpp @@ -24,9 +24,9 @@ ACE_TMAIN (int, ACE_TCHAR *[]) "did you get this?"); ACE_Typed_SV_Message<Message_Data> send_msg (msg_data, - SRV_ID, - msg_data.length ()), - recv_msg (pid); + SRV_ID, + msg_data.length ()), + recv_msg (pid); if (msgque.send (send_msg) < 0) ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"), diff --git a/ACE/examples/Threads/recursive_mutex.cpp b/ACE/examples/Threads/recursive_mutex.cpp index 3c915682d90..6ffc7670776 100644 --- a/ACE/examples/Threads/recursive_mutex.cpp +++ b/ACE/examples/Threads/recursive_mutex.cpp @@ -24,7 +24,7 @@ static void print_usage_and_die (void) { ACE_DEBUG ((LM_DEBUG, - "usage: %n [-t n_threads] [-n iteration_count]\n")); + "usage: %n [-t n_threads] [-n iteration_count]\n")); ACE_OS::exit (1); } @@ -41,39 +41,39 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'n': - n_iterations = ACE_OS::atoi (get_opt.opt_arg ()); - break; + n_iterations = ACE_OS::atoi (get_opt.opt_arg ()); + break; case 't': - n_threads = ACE_OS::atoi (get_opt.opt_arg ()); - break; + n_threads = ACE_OS::atoi (get_opt.opt_arg ()); + break; default: - print_usage_and_die (); - break; + print_usage_and_die (); + break; } } static void recursive_worker (size_t nesting_level, - ACE_Recursive_Thread_Mutex *rm) + ACE_Recursive_Thread_Mutex *rm) { if (nesting_level < n_iterations) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) = trying to acquire, nesting = %d, thread id = %u\n", - rm->get_nesting_level (), rm->get_thread_id ())); + "(%P|%t) = trying to acquire, nesting = %d, thread id = %u\n", + rm->get_nesting_level (), rm->get_thread_id ())); { - // This illustrates the use of the ACE_Guard<LOCK> with an - // ACE_Recursive_Thread_Mutex. - ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, *rm); - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) = acquired, nesting = %d, thread id = %u\n", - rm->get_nesting_level (), rm->get_thread_id ())); - - recursive_worker (nesting_level + 1, rm); + // This illustrates the use of the ACE_Guard<LOCK> with an + // ACE_Recursive_Thread_Mutex. + ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, *rm); + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) = acquired, nesting = %d, thread id = %u\n", + rm->get_nesting_level (), rm->get_thread_id ())); + + recursive_worker (nesting_level + 1, rm); } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) = released, nesting = %d, thread id = %u\n", - rm->get_nesting_level (), rm->get_thread_id ())); + "(%P|%t) = released, nesting = %d, thread id = %u\n", + rm->get_nesting_level (), rm->get_thread_id ())); } } @@ -96,8 +96,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_Recursive_Thread_Mutex rm; ACE_Thread_Manager::instance ()->spawn_n (n_threads, - ACE_THR_FUNC (worker), - (void *) &rm); + ACE_THR_FUNC (worker), + (void *) &rm); ACE_Thread_Manager::instance ()->wait (); return 0; @@ -107,7 +107,7 @@ int ACE_TMAIN (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, - "ACE doesn't support support process mutexes on this platform (yet)\n"), - -1); + "ACE doesn't support support process mutexes on this platform (yet)\n"), + -1); } #endif /* ACE_WIN32 */ diff --git a/ACE/examples/Threads/task_one.cpp b/ACE/examples/Threads/task_one.cpp index c2c23306152..c106d9c6ba9 100644 --- a/ACE/examples/Threads/task_one.cpp +++ b/ACE/examples/Threads/task_one.cpp @@ -20,8 +20,8 @@ class Barrier_Task : public ACE_Task<ACE_MT_SYNCH> { public: Barrier_Task (ACE_Thread_Manager *thr_mgr, - int n_threads, - int n_iterations); + int n_threads, + int n_iterations); virtual int svc (void); // Iterate <n_iterations> time printing off a message and "waiting" @@ -37,8 +37,8 @@ private: }; Barrier_Task::Barrier_Task (ACE_Thread_Manager *thr_mgr, - int n_threads, - int n_iterations) + int n_threads, + int n_iterations) : ACE_Task<ACE_MT_SYNCH> (thr_mgr), barrier_ (n_threads), n_iterations_ (n_iterations) @@ -83,8 +83,8 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) int n_iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_ITERATIONS; Barrier_Task barrier_task (ACE_Thread_Manager::instance (), - n_threads, - n_iterations); + n_threads, + n_iterations); // Wait for all the threads to reach their exit point. ACE_Thread_Manager::instance ()->wait (); diff --git a/ACE/examples/Threads/thread_manager.cpp b/ACE/examples/Threads/thread_manager.cpp index b2bee7db4c6..7b3fb230fd3 100644 --- a/ACE/examples/Threads/thread_manager.cpp +++ b/ACE/examples/Threads/thread_manager.cpp @@ -27,19 +27,19 @@ worker (intptr_t iterations) for (intptr_t i = 0; i < iterations; i++) { if ((i % 1000) == 0) - { - ACE_DEBUG ((LM_DEBUG, - "(%t) checking cancellation before iteration %d!\n", - i)); - - if (ACE_Thread_Manager::instance ()->testcancel (ACE_Thread::self ()) != 0) - { - ACE_DEBUG ((LM_DEBUG, - "(%t) has been cancelled before iteration %d!\n", - i)); - break; - } - } + { + ACE_DEBUG ((LM_DEBUG, + "(%t) checking cancellation before iteration %d!\n", + i)); + + if (ACE_Thread_Manager::instance ()->testcancel (ACE_Thread::self ()) != 0) + { + ACE_DEBUG ((LM_DEBUG, + "(%t) has been cancelled before iteration %d!\n", + i)); + break; + } + } } // Destructor removes thread from Thread_Manager. @@ -66,9 +66,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_Thread_Manager *thr_mgr = ACE_Thread_Manager::instance (); - int grp_id = thr_mgr->spawn_n (n_threads, ACE_THR_FUNC (worker), - reinterpret_cast<void *> (n_iterations), - THR_NEW_LWP | THR_DETACHED); + int grp_id = thr_mgr->spawn_n (n_threads, + ACE_THR_FUNC (worker), + reinterpret_cast<void *> (n_iterations), + THR_NEW_LWP | THR_DETACHED); // Wait for 1 second and then suspend every thread in the group. ACE_OS::sleep (1); diff --git a/ACE/examples/Threads/token.cpp b/ACE/examples/Threads/token.cpp index bbda579369b..c3513724cdc 100644 --- a/ACE/examples/Threads/token.cpp +++ b/ACE/examples/Threads/token.cpp @@ -36,7 +36,7 @@ void My_Task::sleep_hook (void *) { ACE_DEBUG ((LM_ERROR, "(%u) blocking, My_Task::sleep_hook () called\n", - ACE_Thread::self())) ; + ACE_Thread::self())) ; } // Test out the behavior of the ACE_Token class. @@ -50,14 +50,14 @@ My_Task::svc (void) ACE_Time_Value timeout (ACE_OS::time (0), 1000); if (this->token_.acquire (&My_Task::sleep_hook, 0, &timeout) == 1) - { - this->token_.acquire (); - this->token_.renew (); - this->token_.release (); - this->token_.release (); - } + { + this->token_.acquire (); + this->token_.renew (); + this->token_.release (); + this->token_.release (); + } else - ACE_Thread::yield (); + ACE_Thread::yield (); } return 0; } |