diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2001-11-28 08:28:54 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2001-11-28 08:28:54 +0000 |
commit | f7d16eba91da39d71c4245de658def689bdd560c (patch) | |
tree | 2b71134b1aa98ccc5b68cc10d3c160d68c3233dd | |
parent | e0fe0c0872f194056687ea9fc989e6893da01381 (diff) | |
download | ATCD-f7d16eba91da39d71c4245de658def689bdd560c.tar.gz |
ChangeLogTag: Wed Nov 28 09:18:08 2001 Johnny Willemsen <jwillemsen@remedy.nl>
52 files changed, 340 insertions, 340 deletions
diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp index c1d1ba99187..673cdd8caeb 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.cpp @@ -23,7 +23,7 @@ Options::Options (void) port_ (ACE_DEFAULT_SERVER_PORT), sleep_time_ (0, 0), // By default, don't sleep between calls. threads_ (10), - quit_string_ ("q"), + quit_string_ (ACE_TEXT("q")), message_len_ (0), message_buf_ (0), io_source_ (ACE_INVALID_HANDLE), // Defaults to using the generator. @@ -111,9 +111,9 @@ Options::read (void *buf, size_t len, size_t &iteration) } int -Options::parse_args (int argc, char *argv[]) +Options::parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt getopt (argc, argv, "2h:i:m:p:q:st:T:", 1); + ACE_Get_Opt getopt (argc, argv, ACE_TEXT("2h:i:m:p:q:st:T:"), 1); for (int c; (c = getopt ()) != -1; ) switch (c) @@ -160,13 +160,13 @@ Options::port (void) const return this->port_; } -const char * +const ACE_TCHAR * Options::host (void) const { return this->host_; } -const char * +const ACE_TCHAR * Options::quit_string (void) const { return this->quit_string_; @@ -402,7 +402,7 @@ run_client (void) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { // Initialize the logger. ACE_LOG_MSG->open (argv[0]); diff --git a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h index 8b3a9ee4562..266de7f32ea 100644 --- a/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h +++ b/examples/IPC_SAP/SOCK_SAP/CPP-inclient.h @@ -21,7 +21,7 @@ public: ~Options (void); // Destructor. - int parse_args (int argc, char *argv[]); + int parse_args (int argc, ACE_TCHAR *argv[]); // Parse the command-line arguments. const ACE_Time_Value &sleep_time (void) const; @@ -31,13 +31,13 @@ public: u_short port (void) const; // Port of the server. - const char *host (void) const; + const ACE_TCHAR *host (void) const; // Host of the server. size_t threads (void) const; // Number of threads. - const char *quit_string (void) const; + const ACE_TCHAR *quit_string (void) const; // String that shuts down the client/server. ssize_t read (void *buf, size_t len, size_t &iterations); @@ -69,7 +69,7 @@ private: static void *oneway_client_test (void *); // Performs the oneway test. - const char *host_; + const ACE_TCHAR *host_; // Host of the server. u_short port_; @@ -81,7 +81,7 @@ private: size_t threads_; // Number of threads. - const char *quit_string_; + const ACE_TCHAR *quit_string_; // String that shuts down the client/server. size_t message_len_; diff --git a/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp b/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp index 25683b88618..778dc5bef7c 100644 --- a/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/NPClient.cpp @@ -15,11 +15,11 @@ ACE_RCSID(SPIPE_SAP, NPClient, "$Id$") const int DEFAULT_SIZE = 8; const int DEFAULT_COUNT = 10000; -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; + int size = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_SIZE; + int iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_COUNT; char *buf; ACE_NEW_RETURN (buf, diff --git a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp b/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp index f13cfa0fef9..247f38fff78 100644 --- a/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/NPServer.cpp @@ -13,7 +13,7 @@ ACE_RCSID(SPIPE_SAP, NPServer, "$Id$") #endif int -main (int /* argc */, char * /* argv */ []) +main (int /* argc */, ACE_TCHAR * /* argv */ []) { ACE_SPIPE_Acceptor acceptor; ACE_SPIPE_Stream new_stream; @@ -34,7 +34,7 @@ main (int /* argc */, char * /* argv */ []) { ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); - + // Accept a client connection. if (acceptor.accept (new_stream, 0) == -1) ACE_ERROR_RETURN ((LM_ERROR, diff --git a/examples/IPC_SAP/SPIPE_SAP/client.cpp b/examples/IPC_SAP/SPIPE_SAP/client.cpp index 3549bfa3ce1..47dcd42ccc7 100644 --- a/examples/IPC_SAP/SPIPE_SAP/client.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/client.cpp @@ -11,7 +11,7 @@ ACE_RCSID(SPIPE_SAP, client, "$Id$") #include "shared.h" int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { if (argc < 2) ACE_ERROR_RETURN ((LM_ERROR, "usage: %s string [rendezvous]\n", argv[0]), 1); @@ -37,7 +37,7 @@ main (int argc, char *argv[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp b/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp index 506f46efee1..ba03cce374a 100644 --- a/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/consumer_msg.cpp @@ -11,7 +11,7 @@ ACE_RCSID(SPIPE_SAP, consumer_msg, "$Id$") #include "shared.h" int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_SPIPE_Acceptor peer_acceptor; ACE_SPIPE_Stream new_stream; @@ -47,7 +47,7 @@ main (int argc, char *argv[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp b/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp index a06d94a7229..ffd1da3e8fd 100644 --- a/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/consumer_read.cpp @@ -11,7 +11,7 @@ ACE_RCSID(SPIPE_SAP, consumer_read, "$Id$") #include "shared.h" int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_SPIPE_Acceptor peer_acceptor; ACE_SPIPE_Stream new_stream; @@ -44,7 +44,7 @@ main (int argc, char *argv[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp b/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp index da0adacd691..7e0055ad9c6 100644 --- a/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/producer_msg.cpp @@ -14,10 +14,10 @@ const int DEFAULT_SIZE = 4 * 1024; const int DEFAULT_COUNT = 100; int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; + int size = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_SIZE; + int iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_COUNT; char *buf; ACE_NEW_RETURN (buf, char[size], -1); @@ -52,7 +52,7 @@ main (int argc, char *argv[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp b/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp index 20aca877ada..45caa4324bf 100644 --- a/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/producer_read.cpp @@ -13,13 +13,13 @@ ACE_RCSID(SPIPE_SAP, producer_read, "$Id$") const int DEFAULT_SIZE = 8 * 1024; const int DEFAULT_COUNT = 100; -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { - int size = argc > 1 ? atoi (argv[1]) : DEFAULT_SIZE; - int iterations = argc > 2 ? atoi (argv[2]) : DEFAULT_COUNT; + int size = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_SIZE; + int iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_COUNT; char *buf = new char[size]; - + if (argc > 3) rendezvous = argv[3]; @@ -44,7 +44,7 @@ main (int argc, char *argv[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "this feature is not supported"), -1); } diff --git a/examples/IPC_SAP/SPIPE_SAP/server.cpp b/examples/IPC_SAP/SPIPE_SAP/server.cpp index e05e27ea07c..7cb8f6c3009 100644 --- a/examples/IPC_SAP/SPIPE_SAP/server.cpp +++ b/examples/IPC_SAP/SPIPE_SAP/server.cpp @@ -14,7 +14,7 @@ ACE_RCSID(SPIPE_SAP, server, "$Id$") const int MAX_HANDLES = 200; int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_SPIPE_Acceptor peer_acceptor; ACE_SPIPE_Stream new_stream; @@ -112,7 +112,7 @@ main (int argc, char *argv[]) } #else #include <stdio.h> -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { ACE_OS::fprintf (stderr, "This feature is not supported\n"); return 0; diff --git a/examples/IPC_SAP/SPIPE_SAP/shared.h b/examples/IPC_SAP/SPIPE_SAP/shared.h index 3d49ce9dc04..368ee0a7615 100644 --- a/examples/IPC_SAP/SPIPE_SAP/shared.h +++ b/examples/IPC_SAP/SPIPE_SAP/shared.h @@ -7,4 +7,4 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -static const char *rendezvous = ACE_DEFAULT_RENDEZVOUS; +static const ACE_TCHAR *rendezvous = ACE_DEFAULT_RENDEZVOUS; diff --git a/examples/Misc/test_XtReactor1.cpp b/examples/Misc/test_XtReactor1.cpp index d2d94036285..7475684fcbd 100644 --- a/examples/Misc/test_XtReactor1.cpp +++ b/examples/Misc/test_XtReactor1.cpp @@ -55,7 +55,7 @@ public: return 0; } - void put (char c) + void put (char c) { if (msg_.length () == 0) reactor_->register_handler (this, @@ -63,7 +63,7 @@ public: if (msg_.wr_ptr () < msg_.end ()) { - *msg_.wr_ptr () = c; + *msg_.wr_ptr () = c; msg_.wr_ptr (1); } else @@ -79,7 +79,7 @@ private: class Stdin : public ACE_Event_Handler { public: - Stdin (Stdout *out) + Stdin (Stdout *out) : out_ (out) {} ACE_HANDLE get_handle () const { return ACE_STDIN; } @@ -106,15 +106,15 @@ private: Stdout *out_; }; -static void +static void ActivateCB (Widget, XtPointer, XtPointer) { ACE_DEBUG ((LM_DEBUG, "Button pushed!\n")); } -int -main (int argc, char**argv) +int +main (int argc, ACE_TCHAR**argv) { // The worlds most useless user interface Widget top_level = XtVaAppInitialize (NULL, @@ -148,8 +148,8 @@ main (int argc, char**argv) ACE_Event_Handler::READ_MASK); // Print a message every 10 seconds. - if (reactor.schedule_timer (stdin_, 0, - ACE_Time_Value (10), + if (reactor.schedule_timer (stdin_, 0, + ACE_Time_Value (10), ACE_Time_Value (10)) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", @@ -165,8 +165,8 @@ main (int argc, char**argv) return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "XT not configured for this platform\n"), diff --git a/examples/Misc/test_XtReactor2.cpp b/examples/Misc/test_XtReactor2.cpp index 568c21f398d..50cef2e7cb2 100644 --- a/examples/Misc/test_XtReactor2.cpp +++ b/examples/Misc/test_XtReactor2.cpp @@ -38,15 +38,15 @@ public: } }; -static void +static void ActivateCB (Widget w, XtPointer, XtPointer) { ACE_DEBUG ((LM_DEBUG, "Button pushed!\n")); } -int -main (int argc, char**argv) +int +main (int argc, ACE_TCHAR**argv) { // The worlds most useless user interface Widget top_level = XtVaAppInitialize (NULL, @@ -80,13 +80,13 @@ main (int argc, char**argv) ACE_Event_Handler::READ_MASK); // Print a message every 10 seconds - if (reactor.schedule_timer (stdin_, 0, - ACE_Time_Value (10), + if (reactor.schedule_timer (stdin_, 0, + ACE_Time_Value (10), ACE_Time_Value (10)) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "schedule_timer"), -1); - + // Show the top_level widget XtRealizeWidget (top_level); @@ -94,8 +94,8 @@ main (int argc, char**argv) XtAppMainLoop (XtWidgetToApplicationContext (top_level)); } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "XT not configured for this platform\n"), diff --git a/examples/Misc/test_dump.cpp b/examples/Misc/test_dump.cpp index aa54fff047d..ffd683b14b6 100644 --- a/examples/Misc/test_dump.cpp +++ b/examples/Misc/test_dump.cpp @@ -12,7 +12,7 @@ ACE_RCSID(Misc, test_dump, "$Id$") int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { SOCK outer_sock; // Note that the SOCK superclass is *not* printed. diff --git a/examples/Misc/test_get_opt.cpp b/examples/Misc/test_get_opt.cpp index cf305556640..756acb64ea7 100644 --- a/examples/Misc/test_get_opt.cpp +++ b/examples/Misc/test_get_opt.cpp @@ -8,9 +8,9 @@ ACE_RCSID(Misc, test_get_opt, "$Id$") int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "ab:cd:ef:gh:"); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("ab:cd:ef:gh:")); int c; while ((c = get_opt ()) != EOF) @@ -46,7 +46,7 @@ main (int argc, char *argv[]) } for (int i = get_opt.optind; i < argc; i++) - ACE_DEBUG ((LM_DEBUG, "optind = %d, argv[optind] = %s\n", + ACE_DEBUG ((LM_DEBUG, "optind = %d, argv[optind] = %s\n", i, argv[i])); return 0; diff --git a/examples/Misc/test_profile_timer.cpp b/examples/Misc/test_profile_timer.cpp index a948199315d..2ae794ead88 100644 --- a/examples/Misc/test_profile_timer.cpp +++ b/examples/Misc/test_profile_timer.cpp @@ -8,7 +8,7 @@ ACE_RCSID(Misc, test_profile_timer, "$Id$") static const int DEFAULT_ITERATIONS = 100000000; int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_Profile_Timer timer; int iterations = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_ITERATIONS; @@ -28,7 +28,7 @@ main (int argc, char *argv[]) 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)); - ACE_DEBUG ((LM_DEBUG, "time per call = %f usecs\n", + ACE_DEBUG ((LM_DEBUG, "time per call = %f usecs\n", (et.real_time / double (iterations)) * 1000000)); return 0; } diff --git a/examples/Misc/test_read_buffer.cpp b/examples/Misc/test_read_buffer.cpp index 0b6b61c2aa1..095364130f7 100644 --- a/examples/Misc/test_read_buffer.cpp +++ b/examples/Misc/test_read_buffer.cpp @@ -5,8 +5,8 @@ ACE_RCSID(Misc, test_read_buffer, "$Id$") -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { ACE_HANDLE handle = argc > 1 ? ACE_OS::open (argv[1], O_RDONLY) : 0; int term = argc > 2 ? ACE_OS::atoi (argv[2]) : EOF; @@ -14,7 +14,7 @@ main (int argc, char *argv[]) int replace = argc > 4 ? ACE_OS::atoi (argv[4]) : '\0'; ACE_Read_Buffer rb (handle); - + char *buf; while ((buf = rb.read (term, search, replace)) != 0) diff --git a/examples/Misc/test_set.cpp b/examples/Misc/test_set.cpp index 70e0e730f77..c128b4755e7 100644 --- a/examples/Misc/test_set.cpp +++ b/examples/Misc/test_set.cpp @@ -2,8 +2,8 @@ #include "ace/Containers.h" -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_Unbounded_Set<int> s1; diff --git a/examples/Misc/test_sstring.cpp b/examples/Misc/test_sstring.cpp index 9fe6da8555e..8fbdfeb9add 100644 --- a/examples/Misc/test_sstring.cpp +++ b/examples/Misc/test_sstring.cpp @@ -5,8 +5,8 @@ ACE_RCSID(Misc, test_sstring, "$Id$") -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_CString s1 ("hello"); ACE_CString s2 ("world"); @@ -14,7 +14,7 @@ main (int, char *[]) ACE_WString s4 ("hello"); ACE_WString s5 ("world"); ACE_WString s6 ("el"); - + ACE_ASSERT (s1 != s2); ACE_ASSERT (s1.strstr (s2) == -1); ACE_ASSERT (s1.strstr (s2) == -1); diff --git a/examples/Misc/test_trace.cpp b/examples/Misc/test_trace.cpp index 4a97bcd8872..2473f5aebf3 100644 --- a/examples/Misc/test_trace.cpp +++ b/examples/Misc/test_trace.cpp @@ -50,9 +50,9 @@ private: int My_Task::recursive (size_t depth) { - ACE_Trace _ ("int recursive (size_t depth)", + ACE_Trace _ (ACE_TEXT("int recursive (size_t depth)"), __LINE__, - __FILE__); + ACE_TEXT(__FILE__)); if (depth > 0) return recursive (depth - 1); @@ -70,18 +70,18 @@ exithook (void) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { - const size_t MAX_DEPTH = argc == 1 ? 10 : atoi (argv[1]); + const size_t MAX_DEPTH = argc == 1 ? 10 : ACE_OS::atoi (argv[1]); ACE_OS::atexit (exithook); if (argc > 2) ACE_Trace::set_nesting_indent (ACE_OS::atoi (argv[2])); - ACE_Trace _ ("int main (int argc, char *argv[])", + ACE_Trace _ (ACE_TEXT("int main (int argc, ACE_TCHAR *argv[])"), __LINE__, - __FILE__); + ACE_TEXT(__FILE__)); // The following won't work on MVS OpenEdition... ACE_Sig_Action sig1 ((ACE_SignalHandler) ACE_Trace::start_tracing, diff --git a/examples/Naming/test_multiple_contexts.cpp b/examples/Naming/test_multiple_contexts.cpp index a8a028a3c41..c1916eef154 100644 --- a/examples/Naming/test_multiple_contexts.cpp +++ b/examples/Naming/test_multiple_contexts.cpp @@ -5,7 +5,7 @@ ACE_RCSID(Naming, test_multiple_contexts, "$Id$") -int main (int, char *[]) +int main (int, ACE_TCHAR *[]) { static u_long ACE_DEFAULT_BASE_ADDR_1 = (1 * 64 * 1024 * 1024); static u_long ACE_DEFAULT_BASE_ADDR_2 = (2 * 64 * 1024 * 1024); @@ -28,38 +28,38 @@ int main (int, char *[]) ACE_Name_Options *name_options1 = ns_ptr1->name_options (); - char address_arg1[BUFSIZ]; - char address_arg2[BUFSIZ]; + ACE_TCHAR address_arg1[BUFSIZ]; + ACE_TCHAR address_arg2[BUFSIZ]; ACE_OS::sprintf (address_arg1, - "-b%ld", + ACE_TEXT("-b%ld"), ACE_DEFAULT_BASE_ADDR_1); - const char *m_argv[] = + const ACE_TCHAR *m_argv[] = { - "MyName1", - "-cNODE_LOCAL", + ACE_TEXT("MyName1"), + ACE_TEXT("-cNODE_LOCAL"), address_arg1, NULL }; int m_argc = - sizeof (m_argv) / sizeof (char *) -1; + sizeof (m_argv) / sizeof (ACE_TCHAR *) -1; ACE_OS::sprintf (address_arg2, - "-b%ld", + ACE_TEXT("-b%ld"), ACE_DEFAULT_BASE_ADDR_2); - const char *n_argv[] = + const ACE_TCHAR *n_argv[] = { - "MyName2", - "-cNODE_LOCAL", + ACE_TEXT("MyName2"), + ACE_TEXT("-cNODE_LOCAL"), address_arg2, NULL }; int n_argc = - sizeof (n_argv) / sizeof (char *) -1; + sizeof (n_argv) / sizeof (ACE_TCHAR *) -1; name_options->parse_args (m_argc, - (char **) m_argv); + (ACE_TCHAR **) m_argv); i = ns_ptr->open (ACE_Naming_Context::NODE_LOCAL); ACE_DEBUG ((LM_DEBUG, @@ -70,7 +70,7 @@ int main (int, char *[]) return -1; name_options1->parse_args (n_argc, - (char **) n_argv); + (ACE_TCHAR **) n_argv); i = ns_ptr1->open (ACE_Naming_Context::NODE_LOCAL); diff --git a/examples/RMCast/Send_File/Receiver.cpp b/examples/RMCast/Send_File/Receiver.cpp index 432befb9a03..6cfc82c02fd 100644 --- a/examples/RMCast/Send_File/Receiver.cpp +++ b/examples/RMCast/Send_File/Receiver.cpp @@ -17,7 +17,7 @@ public: int status (void) const; /// Initialize the module - int init (const char *filename); + int init (const ACE_TCHAR *filename); int close (void); int data (ACE_RMCast::Data &data); @@ -33,7 +33,7 @@ private: }; int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { if (argc != 3) { @@ -43,7 +43,7 @@ main (int argc, char *argv[]) 1); } - const char *filename = argv[1]; + const ACE_TCHAR *filename = argv[1]; File_Module file_module; if (file_module.init (filename) == -1) @@ -108,7 +108,7 @@ File_Module::status (void) const } int -File_Module::init (const char * filename) +File_Module::init (const ACE_TCHAR * filename) { ACE_HANDLE handle = ACE_OS::open (filename, O_WRONLY|O_BINARY|O_CREAT, diff --git a/examples/RMCast/Send_File/Sender.cpp b/examples/RMCast/Send_File/Sender.cpp index 592b2cf0179..a3aaf4bdd08 100644 --- a/examples/RMCast/Send_File/Sender.cpp +++ b/examples/RMCast/Send_File/Sender.cpp @@ -9,7 +9,7 @@ ACE_RCSID(tests, RMCast_Examples_Sender, "$Id$") int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { if (argc != 3) { @@ -19,7 +19,7 @@ main (int argc, char *argv[]) 1); } - const char *filename = argv[1]; + const ACE_TCHAR *filename = argv[1]; if (ACE_OS::access (filename, R_OK) != 0) { ACE_ERROR_RETURN ((LM_ERROR, diff --git a/examples/Reactor/Dgram/CODgram.cpp b/examples/Reactor/Dgram/CODgram.cpp index 6da3f683402..66b90cea1a9 100644 --- a/examples/Reactor/Dgram/CODgram.cpp +++ b/examples/Reactor/Dgram/CODgram.cpp @@ -2,10 +2,10 @@ // Exercise the <ACE_SOCK_CODgram> wrapper along with the // <ACE_Reactor>. This test simply ping-pongs datagrams back and -// forth between the peer1 and peer2 processes. This test can +// forth between the peer1 and peer2 processes. This test can // be run in two ways: // -// 1. Stand-alone -- e.g., +// 1. Stand-alone -- e.g., // // % ./CODgram // @@ -19,7 +19,7 @@ // // # Peer1 // % ./CODgram 10003 tango.cs.wustl.edu 10002 peer2 -// +// // which will run peer1 and peer2 in different processes // on the same or different machines. Note that you MUST // give the name "peer1" as the final argument to one and @@ -120,9 +120,9 @@ Dgram_Endpoint::handle_timeout (const ACE_Time_Value &, static int run_test (u_short localport, - const char *remotehost, + const ACE_TCHAR *remotehost, u_short remoteport, - const char *peer) + const ACE_TCHAR *peer) { ACE_INET_Addr remote_addr (remoteport, remotehost); @@ -143,7 +143,7 @@ run_test (u_short localport, size_t len = ACE_OS::strlen (buf); // "peer1" is the "initiator." - if (ACE_OS::strncmp (peer, "peer1", 5) == 0) + if (ACE_OS::strncmp (peer, ACE_TEXT("peer1"), 5) == 0) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) sending data\n")); @@ -187,18 +187,18 @@ run_test (u_short localport, } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { // Estabish call backs and socket names. port1 = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - const char *remotehost = argc > 2 ? argv[2] : ACE_DEFAULT_SERVER_HOST; + const ACE_TCHAR *remotehost = argc > 2 ? argv[2] : ACE_DEFAULT_SERVER_HOST; const u_short port2 = argc > 3 ? ACE_OS::atoi (argv[3]) : port1 + 1; // Providing the fourth command line argument indicates we don't // want to spawn a new process. On Win32, we use this to exec the // new program. - if (argc > 4) + if (argc > 4) run_test (port1, remotehost, port2, @@ -221,7 +221,7 @@ main (int argc, char *argv[]) // This has no effect on NT and will spawn a process that exec // the above run_test function. - options.creation_flags (ACE_Process_Options::NO_EXEC); + options.creation_flags (ACE_Process_Options::NO_EXEC); ACE_Process new_process; @@ -234,14 +234,14 @@ main (int argc, char *argv[]) run_test (port1, remotehost, port2, - "peer1"); + ACE_TEXT("peer1")); break; default: run_test (port2, remotehost, port1, - "peer2"); + ACE_TEXT("peer2")); new_process.wait (); break; } diff --git a/examples/Reactor/Dgram/Dgram.cpp b/examples/Reactor/Dgram/Dgram.cpp index 3d4d06fcbb1..83be96377d1 100644 --- a/examples/Reactor/Dgram/Dgram.cpp +++ b/examples/Reactor/Dgram/Dgram.cpp @@ -4,7 +4,7 @@ // This test simply ping-pongs datagrams back and forth between the // peer1 and peer2 processes. This test can be run in two ways: // -// 1. Stand-alone -- e.g., +// 1. Stand-alone -- e.g., // // % ./Dgram // @@ -18,7 +18,7 @@ // // # Peer1 // % ./Dgram 10003 tango.cs.wustl.edu 10002 peer2 -// +// // which will run peer1 and peer2 in different processes // on the same or different machines. Note that you MUST // give the name "peer1" as the final argument to one and @@ -124,16 +124,16 @@ Dgram_Endpoint::handle_timeout (const ACE_Time_Value &, static int run_test (u_short localport, - const char *remotehost, + const ACE_TCHAR *remotehost, u_short remoteport, - const char *peer) + const ACE_TCHAR *peer) { ACE_INET_Addr remote_addr (remoteport, remotehost); ACE_INET_Addr local_addr (localport); Dgram_Endpoint *endpoint; - + ACE_NEW_RETURN (endpoint, Dgram_Endpoint (local_addr), -1); @@ -150,7 +150,7 @@ run_test (u_short localport, ACE_OS::strcpy (buf, "Data to transmit"); size_t len = ACE_OS::strlen (buf); - if (ACE_OS::strncmp (peer, "peer1", 5) == 0) + if (ACE_OS::strncmp (peer, ACE_TEXT("peer1"), 5) == 0) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) sending data\n")); @@ -196,18 +196,18 @@ run_test (u_short localport, } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { // Estabish call backs and socket names. port1 = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_SERVER_PORT; - const char *remotehost = argc > 2 ? argv[2] : ACE_DEFAULT_SERVER_HOST; + const ACE_TCHAR *remotehost = argc > 2 ? argv[2] : ACE_DEFAULT_SERVER_HOST; const u_short port2 = argc > 3 ? ACE_OS::atoi (argv[3]) : port1 + 1; // Providing the fourth command line argument indicate we don't want // to spawn a new process. On Win32, we use this to exec the new // program. - if (argc > 4) + if (argc > 4) run_test (port1, remotehost, port2, argv[4]); else { @@ -227,7 +227,7 @@ main (int argc, char *argv[]) // This has no effect on NT and will spawn a process that exec // the above run_test function. - options.creation_flags (ACE_Process_Options::NO_EXEC); + options.creation_flags (ACE_Process_Options::NO_EXEC); ACE_Process new_process; switch (new_process.spawn (options)) @@ -236,17 +236,17 @@ main (int argc, char *argv[]) return -1; case 0: - run_test (port1, + run_test (port1, remotehost, port2, - "peer1"); + ACE_TEXT("peer1")); break; default: run_test (port2, - remotehost, + remotehost, port1, - "peer2"); + ACE_TEXT("peer2")); new_process.wait (); break; } diff --git a/examples/Reactor/Ntalker/ntalker.cpp b/examples/Reactor/Ntalker/ntalker.cpp index 26b2566c467..6b0038289de 100644 --- a/examples/Reactor/Ntalker/ntalker.cpp +++ b/examples/Reactor/Ntalker/ntalker.cpp @@ -17,7 +17,7 @@ ACE_RCSID(Ntalker, ntalker, "$Id$") // Network interface to subscribe to. This is hardware specific. use // netstat(1M) to find whether your interface is le0 or ie0 -static const char *INTERFACE = 0; +static const ACE_TCHAR *INTERFACE = 0; static const char *MCAST_ADDR = ACE_DEFAULT_MULTICAST_ADDR; static const u_short UDP_PORT = ACE_DEFAULT_MULTICAST_PORT; @@ -27,9 +27,9 @@ class Handler : public ACE_Event_Handler // Handle both multicast and stdin events. public: // = Initialization and termination methods. - Handler (u_short udp_port, + Handler (u_short udp_port, const char *ip_addr, - const char *interface, + const ACE_TCHAR *interface, ACE_Reactor &); // Constructor. @@ -118,7 +118,7 @@ Handler::handle_close (ACE_HANDLE h, ACE_Reactor_Mask) { ACE_DEBUG ((LM_DEBUG, "STDIN_Events handle removed from reactor.\n")); - if (ACE_Reactor::instance ()->remove_handler + if (ACE_Reactor::instance ()->remove_handler (this, ACE_Event_Handler::READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", @@ -139,18 +139,18 @@ Handler::~Handler (void) "unsubscribe fails")); } -Handler::Handler (u_short udp_port, +Handler::Handler (u_short udp_port, const char *ip_addr, - const char *interface, + const ACE_TCHAR *interface, ACE_Reactor &reactor) { // Create multicast address to listen on. ACE_INET_Addr sockmc_addr (udp_port, ip_addr); - + // subscribe to multicast group. - if (this->mcast_.subscribe (sockmc_addr, 1, interface) == -1) + if (this->mcast_.subscribe (sockmc_addr, 1, interface) == -1) ACE_ERROR ((LM_ERROR, "%p\n", "can't subscribe to multicast group")); @@ -163,7 +163,7 @@ Handler::Handler (u_short udp_port, else if (reactor.register_handler (this->mcast_.get_handle (), this, ACE_Event_Handler::READ_MASK) == -1) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "%p\n", "can't register with Reactor\n")); // Register the STDIN handler. @@ -176,9 +176,9 @@ Handler::Handler (u_short udp_port, } static void -parse_args (int argc, char *argv[]) +parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "i:u"); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("i:u")); int c; @@ -198,12 +198,12 @@ parse_args (int argc, char *argv[]) } } -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { parse_args (argc, argv); - Handler handler (UDP_PORT, + Handler handler (UDP_PORT, MCAST_ADDR, INTERFACE, *ACE_Reactor::instance ()); @@ -216,12 +216,12 @@ main (int argc, char *argv[]) return 0; } #else -int -main (int, char *argv[]) +int +main (int, ACE_TCHAR *argv[]) { ACE_ERROR_RETURN ((LM_ERROR, "error: %s must be run on a platform that support IP multicast\n", - argv[0]), + argv[0]), 0); } #endif /* ACE_HAS_IP_MULTICAST */ diff --git a/examples/Registry/test_registry_iterator.cpp b/examples/Registry/test_registry_iterator.cpp index 1931b82b167..2ddecccc240 100644 --- a/examples/Registry/test_registry_iterator.cpp +++ b/examples/Registry/test_registry_iterator.cpp @@ -26,7 +26,7 @@ static void print_context (ACE_Registry::Naming_Context &parent, static void indent (u_long indentation); int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { int result; ACE_Registry::Naming_Context naming_context; @@ -37,7 +37,7 @@ main (int argc, char *argv[]) // HKEY_CLASSES_ROOT, // HKEY_USERS, // HKEY_CURRENT_USER, - argc == 2 ? ACE_TEXT_CHAR_TO_TCHAR (argv[1]) : 0); + argc == 2 ? argv[1] : 0); if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Predefined_Naming_Contexts::connect failed"), -1); diff --git a/examples/Registry/test_registry_update.cpp b/examples/Registry/test_registry_update.cpp index a755bb25e01..49728e097c5 100644 --- a/examples/Registry/test_registry_update.cpp +++ b/examples/Registry/test_registry_update.cpp @@ -9,7 +9,7 @@ // This application uses the ACE_Registry class to create and update // entries in the LOCAL_MACHINE and CURRENT_USER predefined registries // to store the counters. -// +// // Note that this application will not work with remote registries // if used with the CURRENT_USER predefined registry. @@ -30,7 +30,7 @@ static int update_counter (HKEY predefined, static void setup_names (); int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { int result; u_long current_counter = 0; @@ -51,41 +51,41 @@ main (int, char *[]) if (result == 0) cout << "Machine counter: " << current_counter << endl; } - + if (result != 0) ACE_DEBUG ((LM_DEBUG, "test failed\n")); else ACE_DEBUG ((LM_DEBUG, "test succeeded\n")); return 0; -} +} -static int +static int update_counter (HKEY predefined, u_long ¤t_counter) { int result; ACE_Registry::Naming_Context parent_context; ACE_Registry::Naming_Context application_context; - + // Connect to predefined entry result = ACE_Predefined_Naming_Contexts::connect (parent_context, 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, + result = parent_context.resolve_context (application_context_name, application_context); - + if (result != 0) // Failed to find: create a new context result = parent_context.bind_new_context (application_context_name, application_context); - + if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Registry::Naming_Contexts::bind/resolve_context failed"), -1); - + // Counter u_long counter = 0; // Represent counter as an ACE_Registry::Object @@ -93,9 +93,9 @@ update_counter (HKEY predefined, sizeof counter, REG_DWORD); // Find counter - result = application_context.resolve (counter_name, + result = application_context.resolve (counter_name, object); - + if (result != 0) // Failed to find: create new binding for object { @@ -110,13 +110,13 @@ update_counter (HKEY predefined, counter++; // Update result = application_context.rebind (counter_name, - object); + object); } if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Registry::Naming_Contexts::bind/resolve failed"), -1); + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Registry::Naming_Contexts::bind/resolve failed"), -1); else - current_counter = counter; + current_counter = counter; return 0; } @@ -132,7 +132,7 @@ setup_names () ::application_context_name [1].id_ = ACE_TEXT ("AcmeSoft"); ::application_context_name [2].id_ = ACE_TEXT ("AcmeApplication"); ::application_context_name [3].id_ = ACE_TEXT ("1.0"); - + ::counter_name.reserve (1); ::counter_name [0].id_ = ACE_TEXT ("Instance Counter"); */ @@ -143,7 +143,7 @@ setup_names () component.id_ = ACE_TEXT ("AcmeSoft"), ::application_context_name.insert (component); component.id_ = ACE_TEXT ("AcmeApplication"), ::application_context_name.insert (component); component.id_ = ACE_TEXT ("1.0"), ::application_context_name.insert (component); - + component.id_ = ACE_TEXT ("Instance Counter"), ::counter_name.insert (component); } diff --git a/examples/Threads/auto_event.cpp b/examples/Threads/auto_event.cpp index 463eecd29fd..43a1d26ae53 100644 --- a/examples/Threads/auto_event.cpp +++ b/examples/Threads/auto_event.cpp @@ -74,13 +74,13 @@ writer (void *arg) } int -main (int argc, char **argv) +main (int argc, ACE_TCHAR **argv) { // Shared data: set by writer, read by reader. int data; // Work time for writer. - work_time = argc == 2 ? atoi (argv[1]) : 5; + work_time = argc == 2 ? ACE_OS::atoi (argv[1]) : 5; // threads manager ACE_Thread_Manager& tm = *ACE_Thread_Manager::instance (); @@ -111,7 +111,7 @@ template class ACE_Singleton<ACE_Auto_Event, ACE_Thread_Mutex>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/barrier1.cpp b/examples/Threads/barrier1.cpp index 2a387359e9e..03e109c36b9 100644 --- a/examples/Threads/barrier1.cpp +++ b/examples/Threads/barrier1.cpp @@ -16,7 +16,7 @@ struct Tester_Args // These arguments are passed into each test thread. { Tester_Args (ACE_Barrier &tb, int i) - : tester_barrier_ (tb), + : tester_barrier_ (tb), n_iterations_ (i) {} ACE_Barrier &tester_barrier_; @@ -33,7 +33,7 @@ struct Tester_Args static void * tester (Tester_Args *args) { - for (int iterations = 1; + for (int iterations = 1; iterations <= args->n_iterations_; iterations++) { @@ -49,8 +49,8 @@ tester (Tester_Args *args) // Default number of threads to spawn. static const int DEFAULT_ITERATIONS = 5; -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { ACE_Service_Config daemon (argv[0]); @@ -58,11 +58,11 @@ main (int argc, char *argv[]) int n_iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_ITERATIONS; ACE_Barrier tester_barrier (n_threads); - + Tester_Args args (tester_barrier, n_iterations); - if (ACE_Thread_Manager::instance ()->spawn_n - (int(n_threads), ACE_THR_FUNC (tester), + if (ACE_Thread_Manager::instance ()->spawn_n + (int(n_threads), ACE_THR_FUNC (tester), (void *) &args, THR_NEW_LWP | THR_DETACHED) == -1) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn_n"), 1); @@ -73,8 +73,8 @@ main (int argc, char *argv[]) return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/barrier2.cpp b/examples/Threads/barrier2.cpp index c621190ad0b..ee2e094b83b 100644 --- a/examples/Threads/barrier2.cpp +++ b/examples/Threads/barrier2.cpp @@ -49,11 +49,11 @@ private: // = Not needed for this test. virtual int open (void *) { return 0; } - virtual int close (u_long) + virtual int close (u_long) { ACE_DEBUG ((LM_DEBUG, "(%t) in close of worker\n")); - return 0; + return 0; } int nt_; @@ -258,7 +258,7 @@ Worker_Task<BARRIER>::input (ACE_Message_Block *mb) "put")); #if defined (delay_put) // this sleep helps to shutdown correctly -> was an error! - ACE_OS::sleep (1); + ACE_OS::sleep (1); #endif /* delay_put */ } return -1; @@ -278,7 +278,7 @@ Worker_Task<BARRIER>::input (ACE_Message_Block *mb) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { int n_threads = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_THREADS; @@ -309,7 +309,7 @@ template class Worker_Task<ACE_Null_Barrier>; #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/cancel.cpp b/examples/Threads/cancel.cpp index d19457e0915..3754069cbef 100644 --- a/examples/Threads/cancel.cpp +++ b/examples/Threads/cancel.cpp @@ -15,7 +15,7 @@ worker (int iterations) { for (int i = 0; i < iterations; i++) { - if ((i % 10) == 0 + if ((i % 10) == 0 && (ACE_Thread_Manager::instance ()->testcancel (ACE_Thread::self ()) != 0)) { ACE_DEBUG ((LM_DEBUG, "(%t) has been cancelled before iteration!\n", i)); @@ -30,7 +30,7 @@ static const int DEFAULT_THREADS = ACE_DEFAULT_THREADS; static const int DEFAULT_ITERATIONS = 100000; int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_Service_Config daemon; @@ -66,8 +66,8 @@ main (int argc, char *argv[]) return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "threads not supported on this platform\n"), -1); } diff --git a/examples/Threads/future1.cpp b/examples/Threads/future1.cpp index a3d589653a8..3ede3c3043e 100644 --- a/examples/Threads/future1.cpp +++ b/examples/Threads/future1.cpp @@ -287,7 +287,7 @@ Scheduler::work (u_long newparam, static size_t n_loops = 100; int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { Scheduler *andres, *peter, *helmut, *matias; @@ -422,7 +422,7 @@ template class ACE_Unbounded_Set_Iterator<ACE_Future_Observer<u_long> *>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/future2.cpp b/examples/Threads/future2.cpp index d5d1b510496..3cb49c7692a 100644 --- a/examples/Threads/future2.cpp +++ b/examples/Threads/future2.cpp @@ -498,7 +498,7 @@ test_timeout (int n_iterations) } int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { int n_iterations = determine_iterations (); @@ -544,7 +544,7 @@ template class ACE_Unbounded_Set_Iterator<ACE_Future_Observer<u_long> *>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/manual_event.cpp b/examples/Threads/manual_event.cpp index 455b2cc0328..ec273da90cc 100644 --- a/examples/Threads/manual_event.cpp +++ b/examples/Threads/manual_event.cpp @@ -78,9 +78,9 @@ worker (void *arg) } int -main (int argc, char **argv) +main (int argc, ACE_TCHAR **argv) { - int n_threads = argc == 2 ? atoi (argv[1]) : 5; + int n_threads = argc == 2 ? ACE_OS::atoi (argv[1]) : 5; ACE_Thread_Manager &tm = *ACE_Thread_Manager::instance (); @@ -108,7 +108,7 @@ template class ACE_Atomic_Op<ACE_Thread_Mutex, int>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/process_manager.cpp b/examples/Threads/process_manager.cpp index f251f81be50..4a772b86142 100644 --- a/examples/Threads/process_manager.cpp +++ b/examples/Threads/process_manager.cpp @@ -33,7 +33,7 @@ ACE_RCSID(Threads, process_manager, "$Id$") -class ExitHandler : public ACE_Event_Handler +class ExitHandler : public ACE_Event_Handler { public: ExitHandler (const char *name); @@ -107,7 +107,7 @@ worker (size_t iterations) for (size_t i = 0; i <= iterations; i++) - if (i && (i % 100) == 0) + if (i && (i % 100) == 0) { ACE_DEBUG ((LM_DEBUG, "(%P|%t@%T) worker spinning furiously... (%u)\n", @@ -125,11 +125,11 @@ static int exit_code = 0; // Parse the command-line arguments and set options. static void -parse_args (int argc, char *argv[]) +parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "i:e:cu"); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("i:e:cu")); - int c; + int c; while ((c = get_opt ()) != -1) switch (c) @@ -156,7 +156,7 @@ parse_args (int argc, char *argv[]) // process. static pid_t -respawn_self (const char *myname, +respawn_self (const ACE_TCHAR *myname, int iter, int exit_code) { @@ -169,7 +169,7 @@ respawn_self (const char *myname, } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_Service_Config daemon; @@ -188,7 +188,7 @@ main (int argc, char *argv[]) "(%P|%t@%T) Process_Manager test. Expect output from" "2 or 3 processes...\n")); - ACE_Process_Manager::instance ()->register_handler + ACE_Process_Manager::instance ()->register_handler (new ExitHandler ("default")); pid_t pid1 = respawn_self (argv[0], @@ -201,7 +201,7 @@ main (int argc, char *argv[]) #if !defined (ACE_WIN32) pid_t pid3 = ACE_OS::fork (); - if (!pid3) + if (!pid3) { worker (n_iterations); return 999; @@ -228,7 +228,7 @@ main (int argc, char *argv[]) "(%P|%t@%T) Test parent: %d processes left\n", result)); - if (result > 0) + if (result > 0) { ACE_DEBUG ((LM_DEBUG, "(%P|%t@%T) Test parent waiting (synchronously, " @@ -256,14 +256,14 @@ main (int argc, char *argv[]) #if !defined (ACE_WIN32) pid3 = ACE_OS::fork (); - if (!pid3) + if (!pid3) { worker (n_iterations); return 888; } #endif /* ACE_WIN32 */ - ExitHandler *main_thread_work; + ExitHandler *main_thread_work = 0; ACE_NEW_RETURN (main_thread_work, ExitHandler ("main thread worker"), 1); diff --git a/examples/Threads/process_mutex.cpp b/examples/Threads/process_mutex.cpp index a8a2f27c5c6..ef6bdd19adb 100644 --- a/examples/Threads/process_mutex.cpp +++ b/examples/Threads/process_mutex.cpp @@ -21,9 +21,9 @@ handler (int) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { - const char *name = argc > 1 ? argv[1] : "hello"; + const ACE_TCHAR *name = argc > 1 ? argv[1] : ACE_TEXT("hello"); int iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : 100; ACE_Process_Mutex pm (name); @@ -64,7 +64,7 @@ main (int argc, char *argv[]) } #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "ACE doesn't support support threads on this platform (yet)\n"), diff --git a/examples/Threads/process_semaphore.cpp b/examples/Threads/process_semaphore.cpp index 6a175175477..4a7002de074 100644 --- a/examples/Threads/process_semaphore.cpp +++ b/examples/Threads/process_semaphore.cpp @@ -19,9 +19,9 @@ handler (int) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { - const char *name = argc == 1 ? "hello" : argv[1]; + const ACE_TCHAR *name = argc == 1 ? ACE_TEXT("hello") : argv[1]; int iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : 100; ACE_Process_Semaphore pm (1, name); diff --git a/examples/Threads/reader_writer.cpp b/examples/Threads/reader_writer.cpp index 55ffd25395e..a39d1f19d34 100644 --- a/examples/Threads/reader_writer.cpp +++ b/examples/Threads/reader_writer.cpp @@ -47,9 +47,9 @@ print_usage_and_die (void) // Parse the command-line arguments and set options. static void -parse_args (int argc, char *argv[]) +parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "r:w:n:l:"); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("r:w:n:l:")); int c; @@ -154,7 +154,7 @@ writer (void *) // Spawn off threads. -int main (int argc, char *argv[]) +int main (int argc, ACE_TCHAR *argv[]) { ACE_LOG_MSG->open (argv[0]); parse_args (argc, argv); @@ -189,7 +189,7 @@ template class ACE_Write_Guard<ACE_RW_Mutex>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/recursive_mutex.cpp b/examples/Threads/recursive_mutex.cpp index 2a37bfaa13a..ef019fdc3fb 100644 --- a/examples/Threads/recursive_mutex.cpp +++ b/examples/Threads/recursive_mutex.cpp @@ -17,10 +17,10 @@ static size_t n_iterations = 1000; static size_t n_threads = 4; // Explain usage and exit. -static void +static void print_usage_and_die (void) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "usage: %n [-t n_threads] [-n iteration_count]\n")); ACE_OS::exit (1); } @@ -28,11 +28,11 @@ print_usage_and_die (void) // Parse the command-line arguments and set options. static void -parse_args (int argc, char *argv[]) +parse_args (int argc, ACE_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "n:t:"); + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("n:t:")); - int c; + int c; while ((c = get_opt ()) != -1) switch (c) @@ -50,12 +50,12 @@ parse_args (int argc, char *argv[]) } static void -recursive_worker (size_t nesting_level, +recursive_worker (size_t nesting_level, ACE_Recursive_Thread_Mutex *rm) { if (nesting_level < n_iterations) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "(%P|%t) = trying to acquire, nesting = %d, thread id = %u\n", rm->get_nesting_level (), rm->get_thread_id ())); { @@ -77,7 +77,7 @@ recursive_worker (size_t nesting_level, static void * worker (void *arg) { - ACE_Recursive_Thread_Mutex *rm + ACE_Recursive_Thread_Mutex *rm = (ACE_Recursive_Thread_Mutex *) arg; recursive_worker (0, rm); @@ -85,26 +85,26 @@ worker (void *arg) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_Service_Config daemon (argv[0]); parse_args (argc, argv); ACE_Recursive_Thread_Mutex rm; - ACE_Thread_Manager::instance ()->spawn_n (n_threads, - ACE_THR_FUNC (worker), + ACE_Thread_Manager::instance ()->spawn_n (n_threads, + ACE_THR_FUNC (worker), (void *) &rm); ACE_Thread_Manager::instance ()->wait (); return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { - ACE_ERROR_RETURN ((LM_ERROR, - "ACE doesn't support support process mutexes on this platform (yet)\n"), + ACE_ERROR_RETURN ((LM_ERROR, + "ACE doesn't support support process mutexes on this platform (yet)\n"), -1); } #endif /* ACE_WIN32 */ diff --git a/examples/Threads/task_five.cpp b/examples/Threads/task_five.cpp index 3d302805d62..e9c7a55994e 100644 --- a/examples/Threads/task_five.cpp +++ b/examples/Threads/task_five.cpp @@ -160,7 +160,7 @@ work (ACE_Thread_Manager *thr_mgr, } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { size_t stack_size = argc > 1 ? ACE_OS::atoi (argv[1]) : default_stack_size; const int n_tasks = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_TASKS; diff --git a/examples/Threads/task_four.cpp b/examples/Threads/task_four.cpp index 42ad56d9c06..687e6d99469 100644 --- a/examples/Threads/task_four.cpp +++ b/examples/Threads/task_four.cpp @@ -10,7 +10,7 @@ // // There are two main ACE_Tasks in this sample: // -// Invoker_Task - is run from main (). It's purpose is to run a number of +// Invoker_Task - is run from main (). It's purpose is to run a number of // ACE_Tasks of type Worker_Task. The number can be specified // on the command line. // After starting the tasks, the Invoker_Task groups all the tasks @@ -64,7 +64,7 @@ class Worker_Task : public ACE_Task<ACE_MT_SYNCH> public: Worker_Task (ACE_Thread_Manager *thr_mgr, size_t n_threads, - size_t n_iterations); + size_t n_iterations); virtual int svc (void); // Does a small work... virtual int open (void * = NULL); @@ -92,17 +92,17 @@ Worker_Task::close (u_long) return 0; } -Worker_Task::Worker_Task (ACE_Thread_Manager *thr_mgr, +Worker_Task::Worker_Task (ACE_Thread_Manager *thr_mgr, size_t n_threads, size_t n_iterations) : ACE_Task<ACE_MT_SYNCH> (thr_mgr), index_ (Worker_Task::workers_count_++), - n_threads_ (n_threads), + n_threads_ (n_threads), n_iterations_ (n_iterations) { } - -int + +int Worker_Task::open (void *) { // Create the pool of worker threads. @@ -114,14 +114,14 @@ Worker_Task::open (void *) this); } -int +int Worker_Task::svc (void) { ACE_DEBUG ((LM_DEBUG, " (%t) in worker %d\n", index_)); - for (size_t iterations = 1; + for (size_t iterations = 1; iterations <= this->n_iterations_; iterations++) { @@ -138,13 +138,13 @@ Worker_Task::svc (void) return 0; } -Invoker_Task::Invoker_Task (ACE_Thread_Manager *thr_mgr, +Invoker_Task::Invoker_Task (ACE_Thread_Manager *thr_mgr, size_t n_tasks, size_t n_threads, - size_t n_iterations) + size_t n_iterations) : ACE_Task<ACE_MT_SYNCH> (thr_mgr), - n_tasks_ (n_tasks), - n_threads_ (n_threads), + n_tasks_ (n_tasks), + n_threads_ (n_threads), n_iterations_ (n_iterations) { // Create a single worker thread. @@ -158,26 +158,26 @@ Invoker_Task::Invoker_Task (ACE_Thread_Manager *thr_mgr, "%p\n", "activate failed")); } - + // Iterate <n_iterations> time printing off a message and "waiting" // for all other threads to complete this iteration. -int -Invoker_Task::svc (void) -{ +int +Invoker_Task::svc (void) +{ // Note that the ACE_Task::svc_run () method automatically adds us // to the Thread_Manager when the thread begins. ACE_Thread_Manager *thr_mgr = ACE_Thread_Manager::instance (); Worker_Task **worker_task; - + ACE_NEW_RETURN (worker_task, Worker_Task *[n_tasks_], -1); size_t task; - for (task = 0; + for (task = 0; task < this->n_tasks_; task++) { @@ -185,10 +185,10 @@ Invoker_Task::svc (void) " (%t) in task %d\n", task + 1)); - ACE_NEW_RETURN (worker_task[task], + ACE_NEW_RETURN (worker_task[task], Worker_Task (thr_mgr, n_threads_, - n_iterations_), + n_iterations_), -1); if (worker_task[task]->open () == -1) @@ -199,10 +199,10 @@ Invoker_Task::svc (void) } // Set all tasks to be one group - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, " (%t) setting tasks group id\n")); - for (task = 0; + for (task = 0; task < this->n_tasks_; task++) if (thr_mgr->set_grp (worker_task[task], @@ -229,7 +229,7 @@ Invoker_Task::svc (void) // Wait for 3 more second and then resume every thread in the group. ACE_OS::sleep (ACE_Time_Value (2)); - + ACE_DEBUG ((LM_DEBUG, " (%t) resuming group\n")); @@ -250,8 +250,8 @@ Invoker_Task::svc (void) static const size_t DEFAULT_TASKS = 4; static const size_t DEFAULT_ITERATIONS = 5; -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { size_t n_tasks = argc > 1 ? ACE_OS::atoi (argv[1]) : DEFAULT_TASKS; size_t n_threads = argc > 2 ? ACE_OS::atoi (argv[2]) : ACE_DEFAULT_THREADS; @@ -261,10 +261,10 @@ main (int argc, char *argv[]) // have special manager for the Invoker_Task. ACE_Thread_Manager invoker_manager; - Invoker_Task invoker (&invoker_manager, - n_tasks, + Invoker_Task invoker (&invoker_manager, + n_tasks, n_threads, - n_iterations); + n_iterations); // Wait for 1 second and then suspend the invoker task ACE_OS::sleep (1); @@ -295,8 +295,8 @@ main (int argc, char *argv[]) return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); diff --git a/examples/Threads/task_one.cpp b/examples/Threads/task_one.cpp index 14016f795dc..85f258f8824 100644 --- a/examples/Threads/task_one.cpp +++ b/examples/Threads/task_one.cpp @@ -18,9 +18,9 @@ class Barrier_Task : public ACE_Task<ACE_MT_SYNCH> { public: Barrier_Task (ACE_Thread_Manager *thr_mgr, - int n_threads, + int n_threads, int n_iterations); - + virtual int svc (void); // Iterate <n_iterations> time printing off a message and "waiting" // for all other threads to complete this iteration. @@ -34,28 +34,28 @@ private: // Number of iterations to run. }; -Barrier_Task::Barrier_Task (ACE_Thread_Manager *thr_mgr, - int n_threads, +Barrier_Task::Barrier_Task (ACE_Thread_Manager *thr_mgr, + int n_threads, int n_iterations) - : ACE_Task<ACE_MT_SYNCH> (thr_mgr), - barrier_ (n_threads), - n_iterations_ (n_iterations) + : ACE_Task<ACE_MT_SYNCH> (thr_mgr), + barrier_ (n_threads), + n_iterations_ (n_iterations) { // Create worker threads. if (this->activate (THR_NEW_LWP, n_threads) == -1) ACE_ERROR ((LM_ERROR, "%p\n", "activate failed")); } - + // Iterate <n_iterations> time printing off a message and "waiting" // for all other threads to complete this iteration. -int -Barrier_Task::svc (void) -{ +int +Barrier_Task::svc (void) +{ // Note that the ACE_Task::svc_run() method automatically adds us to // the Thread_Manager when the thread begins. - for (int iterations = 1; + for (int iterations = 1; iterations <= this->n_iterations_; iterations++) { @@ -74,14 +74,14 @@ Barrier_Task::svc (void) // Default number of threads to spawn. static const int DEFAULT_ITERATIONS = 5; -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { int n_threads = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_THREADS; int n_iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : DEFAULT_ITERATIONS; - Barrier_Task barrier_task (ACE_Thread_Manager::instance (), - n_threads, + Barrier_Task barrier_task (ACE_Thread_Manager::instance (), + n_threads, n_iterations); // Wait for all the threads to reach their exit point. @@ -91,7 +91,7 @@ main (int argc, char *argv[]) return 0; } #else -int +int main (int, char *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); diff --git a/examples/Threads/task_three.cpp b/examples/Threads/task_three.cpp index 0bda095f67c..7c2791b5964 100644 --- a/examples/Threads/task_three.cpp +++ b/examples/Threads/task_three.cpp @@ -54,8 +54,8 @@ Test_Task::Test_Task (void) this->handled_ = 0; Test_Task::current_count_++; - ACE_DEBUG ((LM_DEBUG, - "Test_Task constructed, current_count_ = %d\n", + ACE_DEBUG ((LM_DEBUG, + "Test_Task constructed, current_count_ = %d\n", Test_Task::current_count_)); } @@ -68,21 +68,21 @@ Test_Task::~Test_Task (void) Test_Task::current_count_)); } -int +int Test_Task::open (void *args) { r_ = ACE_reinterpret_cast (ACE_Reactor *, args); return ACE_Task<ACE_MT_SYNCH>::activate (THR_NEW_LWP); } -int +int Test_Task::close (u_long) { ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, lock_, -1); Test_Task::current_count_--; ACE_DEBUG ((LM_DEBUG, - "Test_Task::close () current_count_ = %d.\n", + "Test_Task::close () current_count_ = %d.\n", Test_Task::current_count_)); return 0; } @@ -117,7 +117,7 @@ Test_Task::svc (void) return 0; } -int +int Test_Task::handle_input (ACE_HANDLE) { this->handled_++; @@ -126,7 +126,7 @@ Test_Task::handle_input (ACE_HANDLE) { ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, lock_, -1); Test_Task::done_cnt_++; - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, " (%t) Test_Task: handle_input! done_cnt_ = %d.\n", Test_Task::done_cnt_)); } @@ -165,14 +165,14 @@ dispatch (void *arg) ACE_NOTREACHED (return 0); } -extern "C" void +extern "C" void handler (int) { done = 1; } -int -main (int argc, char **) +int +main (int argc, ACE_TCHAR **) { if (argc > 1) { @@ -232,7 +232,7 @@ main (int argc, char **) *out_stream << flush; out_stream->close (); } - + // Bail out here so that we don't call the destructors for the tasks.. ACE_OS::exit (0); /* NOTREACHED */ @@ -241,10 +241,10 @@ main (int argc, char **) } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; } diff --git a/examples/Threads/task_two.cpp b/examples/Threads/task_two.cpp index 29c0840a28f..1a66a31b2f9 100644 --- a/examples/Threads/task_two.cpp +++ b/examples/Threads/task_two.cpp @@ -84,7 +84,7 @@ Task_Test::svc (void) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { n_threads = argc > 1 ? ACE_OS::atoi (argv[1]) : default_threads; int n_iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : default_iterations; @@ -145,7 +145,7 @@ template class ACE_Atomic_Op<ACE_Thread_Mutex, int>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/thread_manager.cpp b/examples/Threads/thread_manager.cpp index 704cf88753b..6d8a465d40e 100644 --- a/examples/Threads/thread_manager.cpp +++ b/examples/Threads/thread_manager.cpp @@ -25,14 +25,14 @@ worker (int iterations) { if ((i % 1000) == 0) { - ACE_DEBUG ((LM_DEBUG, - "(%t) checking cancellation before iteration %d!\n", + 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", + ACE_DEBUG ((LM_DEBUG, + "(%t) has been cancelled before iteration %d!\n", i)); break; } @@ -47,7 +47,7 @@ static const int DEFAULT_THREADS = ACE_DEFAULT_THREADS; static const int DEFAULT_ITERATIONS = 100000; int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { ACE_Service_Config daemon; @@ -97,8 +97,8 @@ main (int argc, char *argv[]) return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "threads not supported on this platform\n"), -1); } diff --git a/examples/Threads/thread_pool.cpp b/examples/Threads/thread_pool.cpp index 166a0e3d1cc..3e25b0071b1 100644 --- a/examples/Threads/thread_pool.cpp +++ b/examples/Threads/thread_pool.cpp @@ -51,16 +51,16 @@ private: // Close hook. }; -int -Thread_Pool::close (u_long) -{ +int +Thread_Pool::close (u_long) +{ ACE_DEBUG ((LM_DEBUG, "(%t) worker thread closing down\n")); return 0; } -Thread_Pool::Thread_Pool (ACE_Thread_Manager *thr_mgr, - int n_threads) +Thread_Pool::Thread_Pool (ACE_Thread_Manager *thr_mgr, + int n_threads) : ACE_Task<ACE_MT_SYNCH> (thr_mgr) { // Create the pool of worker threads. @@ -74,22 +74,22 @@ Thread_Pool::Thread_Pool (ACE_Thread_Manager *thr_mgr, Thread_Pool::~Thread_Pool (void) { } - + // Simply enqueue the Message_Block into the end of the queue. int Thread_Pool::put (ACE_Message_Block *mb, ACE_Time_Value *tv) -{ - return this->putq (mb, tv); +{ + return this->putq (mb, tv); } // Iterate <n_iterations> time printing off a message and "waiting" // for all other threads to complete this iteration. -int -Thread_Pool::svc (void) -{ +int +Thread_Pool::svc (void) +{ // Note that the <ACE_Task::svc_run> method automatically adds us to // the Thread_Manager when the thread begins. @@ -99,7 +99,7 @@ Thread_Pool::svc (void) // message with a length == 0, which signals us to quit. for (;; count++) - { + { ACE_Message_Block *mb; ACE_DEBUG ((LM_DEBUG, @@ -108,7 +108,7 @@ Thread_Pool::svc (void) if (this->getq (mb) == -1) { - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, "(%t) in iteration %d, got result -1, exiting\n", count)); break; @@ -117,7 +117,7 @@ Thread_Pool::svc (void) int length = mb->length (); if (length > 0) - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "(%t) in iteration %d, length = %d, text = \"%*s\"\n", count, length, @@ -129,7 +129,7 @@ Thread_Pool::svc (void) if (length == 0) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "(%t) in iteration %d, got NULL message, exiting\n", count)); break; @@ -157,7 +157,7 @@ producer (Thread_Pool &thread_pool) if (manual) { - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "(%t) enter a new message for the task pool...")); n = ACE_OS::read (ACE_STDIN, mb->rd_ptr (), @@ -202,8 +202,8 @@ producer (Thread_Pool &thread_pool) // Send a shutdown message to the waiting threads and exit. for (int i = thread_pool.thr_count (); i > 0; i--) { - ACE_DEBUG ((LM_DEBUG, - "(%t) EOF, enqueueing NULL block for thread = %d\n", + ACE_DEBUG ((LM_DEBUG, + "(%t) EOF, enqueueing NULL block for thread = %d\n", i)); // Enqueue a NULL message to flag each consumer to @@ -225,25 +225,25 @@ producer (Thread_Pool &thread_pool) } } -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { int n_threads = argc > 1 ? ACE_OS::atoi (argv[1]) : ACE_DEFAULT_THREADS; n_iterations = argc > 2 ? ACE_OS::atoi (argv[2]) : n_iterations; manual = argc > 3 ? 1 : 0; - + ACE_DEBUG ((LM_DEBUG, - "(%t) argc = %d, threads = %d\n", + "(%t) argc = %d, threads = %d\n", argc, n_threads)); // Create the worker tasks. - Thread_Pool thread_pool (ACE_Thread_Manager::instance (), + Thread_Pool thread_pool (ACE_Thread_Manager::instance (), n_threads); // Create work for the worker tasks to process in their own threads. producer (thread_pool); - + ACE_DEBUG ((LM_DEBUG, "(%t) waiting for threads to exit in Thread_Pool destructor...\n")); // Wait for all the threads to reach their exit point. @@ -256,8 +256,8 @@ main (int argc, char *argv[]) return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); diff --git a/examples/Threads/thread_specific.cpp b/examples/Threads/thread_specific.cpp index bf21d0a9e41..be94adb98ee 100644 --- a/examples/Threads/thread_specific.cpp +++ b/examples/Threads/thread_specific.cpp @@ -185,7 +185,7 @@ handler (int signum) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { // The Service_Config must be the first object defined in main... ACE_Service_Config daemon (argv[0]); @@ -224,7 +224,7 @@ template class ACE_TSS<Errno>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "ACE doesn't support support threads on this platform (yet)\n"), diff --git a/examples/Threads/token.cpp b/examples/Threads/token.cpp index 47bcc795dd7..79ca3fdeaea 100644 --- a/examples/Threads/token.cpp +++ b/examples/Threads/token.cpp @@ -30,7 +30,7 @@ My_Task::My_Task (int n) this->thr_mgr ()->wait (); } -void +void My_Task::sleep_hook (void *) { ACE_DEBUG ((LM_ERROR, "(%u) blocking, My_Task::sleep_hook () called\n", @@ -39,7 +39,7 @@ My_Task::sleep_hook (void *) // Test out the behavior of the ACE_Token class. -int +int My_Task::svc (void) { for (size_t i = 0; i < 100; i++) @@ -60,16 +60,16 @@ My_Task::svc (void) return 0; } -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { - My_Task tasks (argc > 1 ? atoi (argv[1]) : 4); + My_Task tasks (argc > 1 ? ACE_OS::atoi (argv[1]) : 4); return 0; } #else -int -main (int, char *[]) +int +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "your platform doesn't support threads\n"), -1); } diff --git a/examples/Threads/tss1.cpp b/examples/Threads/tss1.cpp index 524c81a0ffd..65ef76dfdad 100644 --- a/examples/Threads/tss1.cpp +++ b/examples/Threads/tss1.cpp @@ -117,7 +117,7 @@ template class Tester<ACE_MT_SYNCH>; #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { Tester<ACE_MT_SYNCH> tester; @@ -156,7 +156,7 @@ main (int, char *[]) } #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR_RETURN ((LM_ERROR, "ACE doesn't support support threads on this platform (yet)\n"), diff --git a/examples/Threads/tss2.cpp b/examples/Threads/tss2.cpp index 59a4dfca1bc..ef67ce1b7fb 100644 --- a/examples/Threads/tss2.cpp +++ b/examples/Threads/tss2.cpp @@ -114,9 +114,9 @@ Test_Task::open (void *arg) } int -main (int argc, char *argv[]) +main (int argc, ACE_TCHAR *argv[]) { - num_tasks = argc > 1 ? atoi (argv[1]) : MAX_TASKS; + num_tasks = argc > 1 ? ACE_OS::atoi (argv[1]) : MAX_TASKS; Test_Task **task_arr; @@ -192,7 +192,7 @@ template class ACE_TSS_Singleton<TSS_Data, ACE_SYNCH_MUTEX>; #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_ERROR ((LM_ERROR, "threads not supported on this platform\n")); return 0; diff --git a/examples/Threads/wfmo.cpp b/examples/Threads/wfmo.cpp index 008a3c101f8..18e7a2f6d9b 100644 --- a/examples/Threads/wfmo.cpp +++ b/examples/Threads/wfmo.cpp @@ -48,7 +48,7 @@ WFMO_Test::svc (void) { while(1) { - int result = ::WaitForMultipleObjects (2, this->sema_handles_, + int result = ::WaitForMultipleObjects (2, this->sema_handles_, FALSE, INFINITE); if (result == WAIT_OBJECT_0) { @@ -82,8 +82,8 @@ WFMO_Test::svc (void) return 0; } -int -main (int argc, char *argv[]) +int +main (int argc, ACE_TCHAR *argv[]) { int thread_count = THREAD_COUNT; @@ -111,9 +111,9 @@ main (int argc, char *argv[]) ACE_OS::sleep (1); // Add one for the other thread that was signaled. - ACE_DEBUG ((LM_DEBUG, + ACE_DEBUG ((LM_DEBUG, "semaphore_count_ = %d (should have been %d).\n", - wfmo_test.semaphore_count_, + wfmo_test.semaphore_count_, 2)); // Two semaphores should have been released. } @@ -123,7 +123,7 @@ main (int argc, char *argv[]) } #else int -main (int, char *[]) +main (int, ACE_TCHAR *[]) { ACE_DEBUG ((LM_DEBUG, "this test only runs on Win32\n")); } |