diff options
Diffstat (limited to 'ACE/examples/ASX')
9 files changed, 39 insertions, 52 deletions
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 e7dadb5d68c..cb448367e61 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Consumer_Router.cpp @@ -138,22 +138,22 @@ 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 (); + const ACE_TCHAR *module_name = this->name (); if (this->context ()->acceptor ().get_local_addr (addr) == -1) return -1; ACE_OS::sprintf (buf, FMTSTR, - mod_name, + module_name, addr.get_port_number (), ACE_TEXT ("tcp"), ACE_TEXT ("# consumer router"), this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer")); - if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) + if (*strp == 0 && (*strp = ACE_OS::strdup (module_name)) == 0) return -1; else - ACE_OS::strncpy (*strp, mod_name, length); + ACE_OS::strncpy (*strp, module_name, length); - return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (module_name)); } diff --git a/ACE/examples/ASX/Event_Server/Event_Server/Options.cpp b/ACE/examples/ASX/Event_Server/Event_Server/Options.cpp index 8683f48d153..16ce65aa5fd 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Options.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Options.cpp @@ -168,32 +168,26 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) "\t[-H high water mark]\n" "\t[-i number of test iterations]\n" "\t[-L low water mark]\n" - "\t[-M] message size \n" + "\t[-M] message size\n" "\t[-n] (THR_NEW_LWP)\n" "\t[-q max queue size]\n" "\t[-s supplier port]\n" "\t[-t number of threads]\n" - "\t[-v] (verbose) \n", + "\t[-v] (verbose)\n", ACE_TEXT_ALWAYS_CHAR (argv[0])); ACE_OS::exit (1); /* NOTREACHED */ break; } - // This is a major hack to get the size_t format spec to be a narrow - // char, same as the other strings for printf() here. It only works - // because this is the end of the source file. It makes the - // ACE_SIZE_T_FORMAT_SPECIFIER not use ACE_TEXT, effectively. -#undef ACE_TEXT -#define ACE_TEXT(A) A if (this->verbose ()) ACE_OS::printf ("%8d = initial concurrency hint\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = total iterations\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = thread count\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = low water mark\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = high water mark\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = message_size\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = initial queue length\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = total iterations\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = thread count\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = low water mark\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = high water mark\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = message_size\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = initial queue length\n" "%8d = THR_BOUND\n" "%8d = THR_NEW_LWP\n", ACE_Thread::getconcurrency (), 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 f3ac967e554..9fced9b8059 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Peer_Router.cpp @@ -406,7 +406,7 @@ Peer_Handler::svc (void) ACE_TEXT ("unbind failed")), -1); LM_DEBUG ((LOG_DEBUG, - ACE_TEXT ("(%t) shutting down \n"))); + ACE_TEXT ("(%t) shutting down\n"))); // We do not need to be deregistered by reactor // as we were not registered at all. 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 de00bba7346..0e0f45e386f 100644 --- a/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/Event_Server/Event_Server/Supplier_Router.cpp @@ -144,23 +144,23 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; ACE_INET_Addr addr; - const ACE_TCHAR *mod_name = this->name (); + const ACE_TCHAR *module_name = this->name (); if (this->context ()->acceptor ().get_local_addr (addr) == -1) return -1; ACE_OS::sprintf (buf, FMTSTR, - mod_name, + module_name, addr.get_port_number (), ACE_TEXT ("tcp"), ACE_TEXT ("# supplier router"), this->is_reader () ? ACE_TEXT ("reader") : ACE_TEXT ("writer")); - if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) + if (*strp == 0 && (*strp = ACE_OS::strdup (module_name)) == 0) return -1; else - ACE_OS::strncpy (*strp, mod_name, length); + ACE_OS::strncpy (*strp, module_name, length); - return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (module_name)); } diff --git a/ACE/examples/ASX/Event_Server/Transceiver/transceiver.cpp b/ACE/examples/ASX/Event_Server/Transceiver/transceiver.cpp index 37bbaad7d3d..56327d405bd 100644 --- a/ACE/examples/ASX/Event_Server/Transceiver/transceiver.cpp +++ b/ACE/examples/ASX/Event_Server/Transceiver/transceiver.cpp @@ -47,7 +47,7 @@ Event_Transceiver::parse_args (int argc, ACE_TCHAR *argv[]) break; default: ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("usage: %n [-CS] [-h host_name] [-p portnum] \n")), + ACE_TEXT ("usage: %n [-CS] [-h host_name] [-p portnum]\n")), -1); /* NOTREACHED */ break; diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp index 5b1faec011a..4b0b25ed8fb 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Consumer_Router.cpp @@ -113,7 +113,7 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; ACE_UPIPE_Addr addr; - const ACE_TCHAR *mod_name = this->name (); + const ACE_TCHAR *module_name = this->name (); ACE_UPIPE_Acceptor &sa = (ACE_UPIPE_Acceptor &) *this->acceptor_; if (sa.get_local_addr (addr) == -1) @@ -126,15 +126,15 @@ Consumer_Router::info (ACE_TCHAR **strp, size_t length) const #endif ACE_OS::sprintf (buf, FMTSTR, - mod_name, ACE_TEXT ("upipe"), + module_name, ACE_TEXT ("upipe"), ACE_TEXT ("# consumer router\n")); - if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) + if (*strp == 0 && (*strp = ACE_OS::strdup (module_name)) == 0) return -1; else - ACE_OS::strncpy (*strp, mod_name, length); + ACE_OS::strncpy (*strp, module_name, length); - return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (module_name)); } #endif /* ACE_HAS_THREADS */ diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Options.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Options.cpp index 033132610aa..0f7cccb2365 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Options.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Options.cpp @@ -165,34 +165,27 @@ Options::parse_args (int argc, ACE_TCHAR *argv[]) "\t[-H high water mark]\n" "\t[-i number of test iterations]\n" "\t[-L low water mark]\n" - "\t[-M] message size \n" + "\t[-M] message size\n" "\t[-n] (THR_NEW_LWP)\n" "\t[-q max queue size]\n" "\t[-S supplier file]\n" "\t[-s supplier port]\n" "\t[-t number of threads]\n" - "\t[-v] (verbose) \n", + "\t[-v] (verbose)\n", ACE_TEXT_ALWAYS_CHAR (argv[0])); ACE_OS::exit (1); /* NOTREACHED */ break; } - // HACK! This needs to be done to avoid the mismatch from ACE_TEXT - // in ACE_SIZE_T_FORMAT_SPECIFIER to narrow-char on wide-char builds. - // It only works because it's at the end of the file. -# if defined (ACE_TEXT) -# undef ACE_TEXT -# endif -# define ACE_TEXT(X) X if (this->verbose ()) ACE_OS::printf ("%8d = initial concurrency hint\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = total iterations\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = thread count\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = low water mark\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = high water mark\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = message_size\n" - ACE_SIZE_T_FORMAT_SPECIFIER " = initial queue length\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = total iterations\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = thread count\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = low water mark\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = high water mark\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = message_size\n" + ACE_SIZE_T_FORMAT_SPECIFIER_ASCII " = initial queue length\n" "%8d = THR_BOUND\n" "%8d = THR_NEW_LWP\n", ACE_OS::thr_getconcurrency (), diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp index b1f3755d9bd..65eb65a5609 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Peer_Router.cpp @@ -84,7 +84,7 @@ Peer_Handler<ROUTER, KEY>::svc (void) 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"))); + 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 } diff --git a/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp b/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp index 823253d8c06..50ddc87998a 100644 --- a/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp +++ b/ACE/examples/ASX/UPIPE_Event_Server/Supplier_Router.cpp @@ -112,7 +112,7 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const { ACE_TCHAR buf[BUFSIZ]; ACE_UPIPE_Addr addr; - const ACE_TCHAR *mod_name = this->name (); + const ACE_TCHAR *module_name = this->name (); ACE_UPIPE_Acceptor &sa = (ACE_UPIPE_Acceptor &) *this->acceptor_; if (sa.get_local_addr (addr) == -1) @@ -125,15 +125,15 @@ Supplier_Router::info (ACE_TCHAR **strp, size_t length) const #endif ACE_OS::sprintf (buf, FMTSTR, - mod_name, ACE_TEXT ("upipe"), + module_name, ACE_TEXT ("upipe"), ACE_TEXT ("# supplier router\n")); - if (*strp == 0 && (*strp = ACE_OS::strdup (mod_name)) == 0) + if (*strp == 0 && (*strp = ACE_OS::strdup (module_name)) == 0) return -1; else - ACE_OS::strncpy (*strp, mod_name, length); + ACE_OS::strncpy (*strp, module_name, length); - return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (mod_name)); + return ACE_Utils::truncate_cast<int> (ACE_OS::strlen (module_name)); } #endif /* ACE_HAS_THREADS */ |