diff options
98 files changed, 1326 insertions, 1146 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 794e7db5401..0c6921c5b74 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -591,8 +591,8 @@ ACE::strrepl (char *s, char search, char replace) } #if !defined (ACE_HAS_WINCE) -char * -ACE::strenvdup (const char *str) +ASYS_TCHAR * +ACE::strenvdup (const ASYS_TCHAR *str) { ACE_TRACE ("ACE::strenvdup"); @@ -629,9 +629,15 @@ ACE::ldfind (const ASYS_TCHAR filename[], #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && \ !defined (ACE_HAS_PHARLAP) ASYS_TCHAR expanded_filename[MAXPATHLEN]; +#if !defined (ACE_HAS_MOSTLY_UNICODE_APIS) if (::ExpandEnvironmentStringsA (filename, expanded_filename, sizeof expanded_filename)) +#else + if (::ExpandEnvironmentStringsW (filename, + expanded_filename, + sizeof expanded_filename)) +#endif /* ACE_HAS_MOSTLY_UNICODE_APIS */ filename = expanded_filename; #endif /* ACE_WIN32 && !ACE_HAS_WINCE && !ACE_HAS_PHARLAP */ @@ -681,11 +687,7 @@ ACE::ldfind (const ASYS_TCHAR filename[], ASYS_TCHAR *s = ACE_OS::strrchr (searchfilename, '.'); const ASYS_TCHAR *dll_suffix = -#if !defined (ACE_HAS_MOSTLY_UNICODE_APIS) - ACE_DLL_SUFFIX; -#else - _TEXT (ACE_DLL_SUFFIX); -#endif /* ACE_HAS_MOSTLY_UNICODE_APIS */ + ASYS_TEXT (ACE_DLL_SUFFIX); if (s != 0) { diff --git a/ace/ACE.h b/ace/ACE.h index 665afe8ffcf..33a575723e2 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -440,7 +440,7 @@ public: // = String functions #if !defined (ACE_HAS_WINCE) - static char *strenvdup (const char *str); + static ASYS_TCHAR *strenvdup (const ASYS_TCHAR *str); // Return a dynamically allocated duplicate of <str>, substituting // the environment variable if <str[0] == '$'>. Note that the // pointer is allocated with <ACE_OS::malloc> and must be freed by diff --git a/ace/DLL.cpp b/ace/DLL.cpp index 7d84ff9705f..4e4e81858df 100644 --- a/ace/DLL.cpp +++ b/ace/DLL.cpp @@ -76,7 +76,8 @@ ACE_DLL::open (const char *dll_filename, return result; // The ACE_SHLIB_HANDLE object is obtained. - this->handle_ = ACE_OS::dlopen (dll_pathname, open_mode); + this->handle_ = ACE_OS::dlopen (ASYS_ONLY_MULTIBYTE_STRING (dll_pathname), + open_mode); if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, @@ -117,7 +118,7 @@ ACE_DLL::close (void) // This method is used on error in an library operation. -char * +ASYS_TCHAR * ACE_DLL::error (void) { return ACE_OS::dlerror (); diff --git a/ace/DLL.h b/ace/DLL.h index d2f0594de3e..361214fd551 100644 --- a/ace/DLL.h +++ b/ace/DLL.h @@ -77,7 +77,7 @@ public: // If <symbol_name> is in the symbol table of the DLL a pointer to // the <symbol_name> is returned. Otherwise, returns 0. - char *error (void); + ASYS_TCHAR *error (void); // Returns a pointer to a string explaining why <symbol> or <open> // failed. diff --git a/ace/Env_Value_T.h b/ace/Env_Value_T.h index 3921321985f..726d1c7b4bb 100644 --- a/ace/Env_Value_T.h +++ b/ace/Env_Value_T.h @@ -42,7 +42,7 @@ public: // variable name or a default value. Before being useful it must // <open()>ed. - ACE_Env_Value (const char *varname, + ACE_Env_Value (const ASYS_TCHAR *varname, const T &vardefault); // Constructor that calls <open>. @@ -52,11 +52,11 @@ public: operator T (void); // Returns the value as type T. - void open (const char *varname, const T &defval); + void open (const ASYS_TCHAR *varname, const T &defval); // The constructor, read <varname> from the enviroment, using // <vardefault> as its value if it is not defined. - const char *varname (void) const; + const ASYS_TCHAR *varname (void) const; // Returns the name of the variable being tracked. private: @@ -66,11 +66,11 @@ private: void fetch_value (void); - const char *varname_; + const ASYS_TCHAR *varname_; T value_; }; -template <class T> void ACE_Convert (const char *s, T &t); +template <class T> void ACE_Convert (const ASYS_TCHAR *s, T &t); // Function to convert a string <s> into type <T>. #if defined (__ACE_INLINE__) @@ -89,62 +89,62 @@ template <class T> void ACE_Convert (const char *s, T &t); // conversion will be necessary. template <class T> inline void -ACE_Convert (const char *s, T &t) +ACE_Convert (const ASYS_TCHAR *s, T &t) { t = T (s); } inline void -ACE_Convert (const char *s, char *&v) +ACE_Convert (const ASYS_TCHAR *s, ASYS_TCHAR *&v) { - v = (char *) s; + v = (ASYS_TCHAR *) s; } inline void -ACE_Convert (const char *s, const char *&v) +ACE_Convert (const ASYS_TCHAR *s, const ASYS_TCHAR *&v) { - v = (const char *) s; + v = (const ASYS_TCHAR *) s; } inline void -ACE_Convert (const char *s, short &si) +ACE_Convert (const ASYS_TCHAR *s, short &si) { si = ACE_static_cast (short, ACE_OS::strtol (s, 0, 10)); } inline void -ACE_Convert (const char *s, u_short &us) +ACE_Convert (const ASYS_TCHAR *s, u_short &us) { us = ACE_static_cast (u_short, ACE_OS::strtol (s, 0, 10)); } inline void -ACE_Convert (const char *s, u_int &i) +ACE_Convert (const ASYS_TCHAR *s, u_int &i) { i = ACE_static_cast (u_int, ACE_OS::strtol (s, 0, 10)); } inline void -ACE_Convert (const char *s, long &l) +ACE_Convert (const ASYS_TCHAR *s, long &l) { l = ACE_OS::strtol (s, 0, 10); } inline void -ACE_Convert (const char *s, int &i) +ACE_Convert (const ASYS_TCHAR *s, int &i) { i = ACE_static_cast (int, ACE_OS::strtol (s, 0, 10)); } inline void -ACE_Convert (const char *s, u_long &ul) +ACE_Convert (const ASYS_TCHAR *s, u_long &ul) { ul = ACE_OS::strtoul (s, 0, 10); } inline void -ACE_Convert (const char *s, double &d) +ACE_Convert (const ASYS_TCHAR *s, double &d) { d = ACE_OS::strtod (s, 0); } diff --git a/ace/Env_Value_T.i b/ace/Env_Value_T.i index b01f9920110..25598c8dad5 100644 --- a/ace/Env_Value_T.i +++ b/ace/Env_Value_T.i @@ -13,7 +13,7 @@ ACE_Env_Value<T>::ACE_Env_Value (void) } template <class T> ACE_INLINE -ACE_Env_Value<T>::ACE_Env_Value (const char *varname, +ACE_Env_Value<T>::ACE_Env_Value (const ASYS_TCHAR *varname, const T &defval) : varname_ (varname), value_(defval) @@ -22,7 +22,7 @@ ACE_Env_Value<T>::ACE_Env_Value (const char *varname, } template <class T> ACE_INLINE void -ACE_Env_Value<T>::open (const char *varname, +ACE_Env_Value<T>::open (const ASYS_TCHAR *varname, const T &defval) { varname_ = varname; @@ -33,13 +33,13 @@ ACE_Env_Value<T>::open (const char *varname, template <class T> ACE_INLINE void ACE_Env_Value<T>::fetch_value (void) { - const char *env = ACE_OS::getenv (varname_); + const ASYS_TCHAR *env = ACE_OS::getenv (varname_); if (env != 0) ACE_Convert (env, value_); } -template <class T> ACE_INLINE const char* +template <class T> ACE_INLINE const ASYS_TCHAR* ACE_Env_Value<T>::varname (void) const { return varname_; diff --git a/ace/FIFO.cpp b/ace/FIFO.cpp index 7301dae0df9..6bca0a8d62e 100644 --- a/ace/FIFO.cpp +++ b/ace/FIFO.cpp @@ -25,7 +25,7 @@ ACE_FIFO::dump (void) const } int -ACE_FIFO::open (const char *r, int flags, int perms, +ACE_FIFO::open (const ASYS_TCHAR *r, int flags, int perms, LPSECURITY_ATTRIBUTES sa) { ACE_TRACE ("ACE_FIFO::open"); @@ -46,7 +46,7 @@ ACE_FIFO::open (const char *r, int flags, int perms, return this->get_handle () == ACE_INVALID_HANDLE ? -1 : 0; } -ACE_FIFO::ACE_FIFO (const char *fifo_name, +ACE_FIFO::ACE_FIFO (const ASYS_TCHAR *fifo_name, int flags, int perms, LPSECURITY_ATTRIBUTES sa) diff --git a/ace/FIFO.h b/ace/FIFO.h index 1e5b20392a0..a671a1a50f6 100644 --- a/ace/FIFO.h +++ b/ace/FIFO.h @@ -34,7 +34,7 @@ class ACE_Export ACE_FIFO : public ACE_IPC_SAP // IPC mechanism that will be portable to both UNIX and Win32, // take a look at the <ACE_SPIPE_*> classes. public: - int open (const char *rendezvous, int flags, int perms, + int open (const ASYS_TCHAR *rendezvous, int flags, int perms, LPSECURITY_ATTRIBUTES sa = 0); // Open up the named pipe on the <rendezvous> in accordance with the // flags. @@ -46,7 +46,7 @@ public: // Close down the ACE_FIFO and remove the rendezvous point from the // file system. - int get_local_addr (const char *&rendezvous) const; + int get_local_addr (const ASYS_TCHAR *&rendezvous) const; // Return the local address of this endpoint. void dump (void) const; @@ -60,13 +60,13 @@ protected: ACE_FIFO (void); // Default constructor. - ACE_FIFO (const char *rendezvous, int flags, int perms, + ACE_FIFO (const ASYS_TCHAR *rendezvous, int flags, int perms, LPSECURITY_ATTRIBUTES sa = 0); // Open up the named pipe on the <rendezvous> in accordance with the // flags. private: - char rendezvous_[MAXPATHLEN + 1]; + ASYS_TCHAR rendezvous_[MAXPATHLEN + 1]; // Rendezvous point in the file system. }; diff --git a/ace/FIFO.i b/ace/FIFO.i index d5aa8fb1943..52f3555495a 100644 --- a/ace/FIFO.i +++ b/ace/FIFO.i @@ -3,8 +3,8 @@ // FIFO.i -ACE_INLINE int -ACE_FIFO::get_local_addr (const char *&r) const +ACE_INLINE int +ACE_FIFO::get_local_addr (const ASYS_TCHAR *&r) const { ACE_TRACE ("ACE_FIFO::get_local_addr"); r = this->rendezvous_; @@ -18,4 +18,3 @@ ACE_FIFO::remove (void) int result = this->close (); return ACE_OS::unlink (this->rendezvous_) == -1 || result == -1 ? -1 : 0; } - diff --git a/ace/FIFO_Recv.cpp b/ace/FIFO_Recv.cpp index ad9e57d09e4..bbdb3bb6672 100644 --- a/ace/FIFO_Recv.cpp +++ b/ace/FIFO_Recv.cpp @@ -41,7 +41,7 @@ ACE_FIFO_Recv::close (void) // aren't any writers at the moment! int -ACE_FIFO_Recv::open (const char *fifo_name, +ACE_FIFO_Recv::open (const ASYS_TCHAR *fifo_name, int flags, int perms, int persistent, @@ -66,7 +66,7 @@ ACE_FIFO_Recv::ACE_FIFO_Recv (void) ACE_TRACE ("ACE_FIFO_Recv::ACE_FIFO_Recv"); } -ACE_FIFO_Recv::ACE_FIFO_Recv (const char *fifo_name, +ACE_FIFO_Recv::ACE_FIFO_Recv (const ASYS_TCHAR *fifo_name, int flags, int perms, int persistent, @@ -82,4 +82,3 @@ ACE_FIFO_Recv::ACE_FIFO_Recv (const char *fifo_name, sa) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_FIFO_Recv"))); } - diff --git a/ace/FIFO_Recv.h b/ace/FIFO_Recv.h index c1f9d0aad9c..f5de468e91f 100644 --- a/ace/FIFO_Recv.h +++ b/ace/FIFO_Recv.h @@ -33,14 +33,14 @@ public: ACE_FIFO_Recv (void); // Default constructor. - ACE_FIFO_Recv (const char *rendezvous, + ACE_FIFO_Recv (const ASYS_TCHAR *rendezvous, int flags = O_CREAT | O_RDONLY, int perms = ACE_DEFAULT_FILE_PERMS, int persistent = 1, LPSECURITY_ATTRIBUTES sa = 0); // Open up a bytestream named pipe for reading. - int open (const char *rendezvous, + int open (const ASYS_TCHAR *rendezvous, int flags = O_CREAT | O_RDONLY, int perms = ACE_DEFAULT_FILE_PERMS, int persistent = 1, diff --git a/ace/FIFO_Recv_Msg.cpp b/ace/FIFO_Recv_Msg.cpp index d9131331e44..c4c9e2cf529 100644 --- a/ace/FIFO_Recv_Msg.cpp +++ b/ace/FIFO_Recv_Msg.cpp @@ -25,8 +25,8 @@ ACE_FIFO_Recv_Msg::dump (void) const // reading." This ensures that the FIFO never gets EOF, even if there // aren't any writers at the moment! -int -ACE_FIFO_Recv_Msg::open (const char *fifo_name, +int +ACE_FIFO_Recv_Msg::open (const ASYS_TCHAR *fifo_name, int flags, int perms, int persistent, @@ -46,7 +46,7 @@ ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (void) ACE_TRACE ("ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg"); } -ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (const char *fifo_name, +ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (const ASYS_TCHAR *fifo_name, int flags, int perms, int persistent, @@ -56,7 +56,7 @@ ACE_FIFO_Recv_Msg::ACE_FIFO_Recv_Msg (const char *fifo_name, if (this->ACE_FIFO_Recv_Msg::open (fifo_name, flags, - perms, + perms, persistent, sa) == -1) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_FIFO_Recv_Msg"))); diff --git a/ace/FIFO_Recv_Msg.h b/ace/FIFO_Recv_Msg.h index 7f5cabcfb2d..57a0697b5a2 100644 --- a/ace/FIFO_Recv_Msg.h +++ b/ace/FIFO_Recv_Msg.h @@ -32,14 +32,14 @@ public: ACE_FIFO_Recv_Msg (void); // Default constructor. - ACE_FIFO_Recv_Msg (const char *rendezvous, + ACE_FIFO_Recv_Msg (const ASYS_TCHAR *rendezvous, int flags = O_CREAT | O_RDONLY, int perms = ACE_DEFAULT_FILE_PERMS, int persistent = 1, LPSECURITY_ATTRIBUTES sa = 0); // Open up a record-oriented named pipe for reading. - int open (const char *rendezvous, + int open (const ASYS_TCHAR *rendezvous, int flags = O_CREAT | O_RDONLY, int perms = ACE_DEFAULT_FILE_PERMS, int persistent = 1, diff --git a/ace/FIFO_Send.cpp b/ace/FIFO_Send.cpp index b0b9ae74e57..5906f6c8e69 100644 --- a/ace/FIFO_Send.cpp +++ b/ace/FIFO_Send.cpp @@ -27,17 +27,29 @@ ACE_FIFO_Send::ACE_FIFO_Send (void) } int -ACE_FIFO_Send::open (const char *rendezvous_name, int flags, int perms, +ACE_FIFO_Send::open (const ASYS_TCHAR *rendezvous_name, + int flags, + int perms, LPSECURITY_ATTRIBUTES sa) { ACE_TRACE ("ACE_FIFO_Send::open"); - return ACE_FIFO::open (rendezvous_name, flags | O_WRONLY, perms, sa); + return ACE_FIFO::open (rendezvous_name, + flags | O_WRONLY, + perms, + sa); } -ACE_FIFO_Send::ACE_FIFO_Send (const char *fifo_name, int flags, int perms, +ACE_FIFO_Send::ACE_FIFO_Send (const ASYS_TCHAR *fifo_name, + int flags, + int perms, LPSECURITY_ATTRIBUTES sa) { ACE_TRACE ("ACE_FIFO_Send::ACE_FIFO_Send"); - if (this->ACE_FIFO_Send::open (fifo_name, flags, perms, sa) == -1) - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_FIFO_Send::ACE_FIFO_Send"))); + if (this->ACE_FIFO_Send::open (fifo_name, + flags, + perms, + sa) == -1) + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_FIFO_Send::ACE_FIFO_Send"))); } diff --git a/ace/FIFO_Send.h b/ace/FIFO_Send.h index 65a36178071..1a402f71746 100644 --- a/ace/FIFO_Send.h +++ b/ace/FIFO_Send.h @@ -32,13 +32,13 @@ public: ACE_FIFO_Send (void); // Default constructor. - ACE_FIFO_Send (const char *rendezvous, + ACE_FIFO_Send (const ASYS_TCHAR *rendezvous, int flags = O_WRONLY, int perms = ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa = 0); // Open up a bytestream named pipe for writing. - int open (const char *rendezvous, + int open (const ASYS_TCHAR *rendezvous, int flags = O_WRONLY, int perms = ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa = 0); @@ -62,4 +62,3 @@ public: #endif #endif /* ACE_FIFO_SEND_H */ - diff --git a/ace/FIFO_Send_Msg.cpp b/ace/FIFO_Send_Msg.cpp index e88c1243688..7691a16026c 100644 --- a/ace/FIFO_Send_Msg.cpp +++ b/ace/FIFO_Send_Msg.cpp @@ -26,9 +26,9 @@ ACE_FIFO_Send_Msg::send (const ACE_Str_Buf &send_msg) { // ACE_TRACE ("ACE_FIFO_Send_Msg::send"); #if defined (ACE_HAS_STREAM_PIPES) - return ACE_OS::putmsg (this->get_handle (), - (strbuf *) 0, - (strbuf *) &send_msg, + return ACE_OS::putmsg (this->get_handle (), + (strbuf *) 0, + (strbuf *) &send_msg, 0); #else iovec iov[2]; @@ -49,8 +49,8 @@ ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (void) } int -ACE_FIFO_Send_Msg::open (const char *fifo_name, - int flags, +ACE_FIFO_Send_Msg::open (const ASYS_TCHAR *fifo_name, + int flags, int perms, LPSECURITY_ATTRIBUTES sa) { @@ -58,8 +58,8 @@ ACE_FIFO_Send_Msg::open (const char *fifo_name, return ACE_FIFO_Send::open (fifo_name, flags | O_WRONLY, perms, sa); } -ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (const char *fifo_name, - int flags, +ACE_FIFO_Send_Msg::ACE_FIFO_Send_Msg (const ASYS_TCHAR *fifo_name, + int flags, int perms, LPSECURITY_ATTRIBUTES sa) { diff --git a/ace/FIFO_Send_Msg.h b/ace/FIFO_Send_Msg.h index 20dc659b880..78b2f82ac4a 100644 --- a/ace/FIFO_Send_Msg.h +++ b/ace/FIFO_Send_Msg.h @@ -33,13 +33,13 @@ public: ACE_FIFO_Send_Msg (void); // Default constructor. - ACE_FIFO_Send_Msg (const char *rendezvous, + ACE_FIFO_Send_Msg (const ASYS_TCHAR *rendezvous, int flags = O_WRONLY, int perms = ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa = 0); // Open up a record-oriented named pipe for writing. - int open (const char *rendezvous, + int open (const ASYS_TCHAR *rendezvous, int flags = O_WRONLY, int perms = ACE_DEFAULT_FILE_PERMS, LPSECURITY_ATTRIBUTES sa = 0); @@ -76,4 +76,3 @@ public: #endif #endif /* ACE_FIFO_SEND_MSG_H */ - diff --git a/ace/FILE_Connector.i b/ace/FILE_Connector.i index a05db9b8e3d..608ce4a9bdc 100644 --- a/ace/FILE_Connector.i +++ b/ace/FILE_Connector.i @@ -3,10 +3,10 @@ // FILE_Connector.i -// Creates a Local ACE_FILE. +// Creates a Local ACE_FILE. ASYS_INLINE -ACE_FILE_Connector::ACE_FILE_Connector (ACE_FILE_IO &new_io, +ACE_FILE_Connector::ACE_FILE_Connector (ACE_FILE_IO &new_io, const ACE_FILE_Addr &remote_sap, ACE_Time_Value *timeout, const ACE_Addr &local_sap, @@ -15,11 +15,13 @@ ACE_FILE_Connector::ACE_FILE_Connector (ACE_FILE_IO &new_io, int perms) { ACE_TRACE ("ACE_FILE_Connector::ACE_FILE_Connector"); - if (this->connect (new_io, remote_sap, timeout, local_sap, + if (this->connect (new_io, remote_sap, timeout, local_sap, reuse_addr, flags, perms) == ACE_IO_SAP::INVALID_HANDLE && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, "address %s, %p\n", - remote_sap.get_path_name (), "ACE_FILE_IO")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("address %s, %p\n"), + remote_sap.get_path_name (), + ASYS_TEXT ("ACE_FILE_IO"))); } ASYS_INLINE int @@ -29,4 +31,3 @@ ACE_FILE_Connector::reset_new_handle (ACE_HANDLE handle) // Nothing to do here since the handle is not a socket return 0; } - diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp index 89a60e91cc4..e421ff78905 100644 --- a/ace/Filecache.cpp +++ b/ace/Filecache.cpp @@ -645,7 +645,7 @@ int ACE_Filecache_Object::error_i (int error_value, const char *s) { s = s; - ACE_ERROR ((LM_ERROR, "%p.\n", s)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p.\n"), s)); this->error_ = error_value; return error_value; } diff --git a/ace/Get_Opt.cpp b/ace/Get_Opt.cpp index ac21a57ad8f..5c0d98476c6 100644 --- a/ace/Get_Opt.cpp +++ b/ace/Get_Opt.cpp @@ -45,14 +45,14 @@ ACE_RCSID(ace, Get_Opt, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_Get_Opt) -ACE_Get_Opt::ACE_Get_Opt (int argc, +ACE_Get_Opt::ACE_Get_Opt (int argc, ASYS_TCHAR **argv, - const ASYS_TCHAR *optstring, - int skip, + const ASYS_TCHAR *optstring, + int skip, int report_errors) - : optarg (0), + : optarg (0), optind (skip), - opterr (report_errors), + opterr (report_errors), argc_ (argc), argv_ (argv), nextchar_ (0), @@ -87,30 +87,30 @@ ACE_Get_Opt::operator () (void) const ASYS_TCHAR *oli; // Option letter index. if (this->nextchar_ == 0 || *this->nextchar_ == '\0') - { + { // Update scanning pointer. - if (this->optind >= this->argc_ - || *(this->nextchar_ = this->argv_[this->optind]) != '-') + if (this->optind >= this->argc_ + || *(this->nextchar_ = this->argv_[this->optind]) != '-') { - this->nextchar_ = ACE_const_cast (char *, ASYS_TEXT ("")); + this->nextchar_ = ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("")); return EOF; } if (this->nextchar_[1] != 0 - && *++this->nextchar_ == '-') - { + && *++this->nextchar_ == '-') + { // Found "--". ++this->optind; - this->nextchar_ = ACE_const_cast (char *, ASYS_TEXT ("")); + this->nextchar_ = ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("")); return EOF; } - } + } - // Option letter okay? + // Option letter okay? opt = (int) *this->nextchar_++; - if (opt == (int) ':' + if (opt == (int) ':' || ((oli = ACE_OS::strchr (this->optstring_, opt)) == 0)) { // If the user didn't specify '-' as an option, assume it means @@ -123,26 +123,26 @@ ACE_Get_Opt::operator () (void) if (this->opterr && *this->optstring_ != ':') ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("%s: illegal option -- %c\n"), + ASYS_TEXT ("%s: illegal option -- %c\n"), this->argv_[0], opt)); return '?'; } - if (*++oli != ':') + if (*++oli != ':') { // Don't need argument. this->optarg = 0; if (!*this->nextchar_) ++this->optind; } - else + else { // Need an argument. if (*this->nextchar_) // No white space. this->optarg = this->nextchar_; - else if (this->argc_ <= ++this->optind) - { + else if (this->argc_ <= ++this->optind) + { // No arg. - this->nextchar_ = ACE_const_cast (char *, ASYS_TEXT ("")); + this->nextchar_ = ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("")); if (*this->optstring_ == ':') return ':'; @@ -155,7 +155,7 @@ ACE_Get_Opt::operator () (void) else // White space. this->optarg = this->argv_[this->optind]; - this->nextchar_ = ACE_const_cast (char *, ASYS_TEXT ("")); + this->nextchar_ = ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("")); ++this->optind; } diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index 503e52dcdbb..4b13767d66e 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -126,7 +126,7 @@ ACE_INET_Addr::string_to_addr (const ASYS_TCHAR s[]) if (ip_addr == 0) // Assume it's a port number. { - if (ACE_OS::strspn (t, "1234567890") + if (ACE_OS::strspn (t, ASYS_TEXT ("1234567890")) == ACE_OS::strlen (t)) { // port number u_short port = (u_short) ACE_OS::atoi (t); @@ -134,7 +134,7 @@ ACE_INET_Addr::string_to_addr (const ASYS_TCHAR s[]) ACE_UINT32 (INADDR_ANY)); } else // port name - result = this->set (t, + result = this->set (t, ACE_UINT32 (INADDR_ANY)); } else @@ -142,10 +142,10 @@ ACE_INET_Addr::string_to_addr (const ASYS_TCHAR s[]) *ip_addr = '\0'; ++ip_addr; // skip over ':' if (ACE_OS::strspn (ip_addr, - "1234567890") == + ASYS_TEXT ("1234567890")) == ACE_OS::strlen (ip_addr)) { - u_short port = + u_short port = (u_short) ACE_OS::atoi (ip_addr); result = this->set (port, t); } @@ -496,7 +496,7 @@ ACE_INET_Addr::get_host_name (void) const static ASYS_TCHAR name[MAXHOSTNAMELEN + 1]; if (this->get_host_name (name, MAXHOSTNAMELEN + 1) == -1) - ACE_OS::strcpy (name, "<unknown>"); + ACE_OS::strcpy (name, ASYS_TEXT ("<unknown>")); return name; } diff --git a/ace/Local_Name_Space_T.cpp b/ace/Local_Name_Space_T.cpp index 143fc3ae0d4..11655934d25 100644 --- a/ace/Local_Name_Space_T.cpp +++ b/ace/Local_Name_Space_T.cpp @@ -439,7 +439,9 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) &options), -1); if (ACE_LOG_MSG->op_status ()) - ACE_ERROR_RETURN ((LM_ERROR, "Allocator::Allocator\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("Allocator::Allocator\n")), + -1); ACE_NEW_RETURN (this->lock_, ACE_LOCK (lock_name_for_local_name_space), @@ -449,7 +451,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) // Now check if the backing store has been created successfully if (ACE_OS::access (this->context_file_, F_OK) != 0) ACE_ERROR_RETURN ((LM_ERROR, - "create_manager\n"), + ASYS_TEXT ("create_manager\n")), -1); #endif /* ACE_LACKS_ACCESS */ @@ -491,7 +493,8 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::create_manager_i (void) -1); if (this->allocator_->bind (ACE_NAME_SERVER_MAP, ns_map) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "create_manager\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("create_manager\n")), -1); } if (ACE::debug ()) diff --git a/ace/Log_Record.cpp b/ace/Log_Record.cpp index d3729cbe707..fd611eadb37 100644 --- a/ace/Log_Record.cpp +++ b/ace/Log_Record.cpp @@ -98,8 +98,8 @@ ACE_Log_Record::round_up (void) { // ACE_TRACE ("ACE_Log_Record::round_up"); // Determine the length of the payload. - int len = (sizeof *this - MAXLOGMSGLEN) - + (ACE_OS::strlen (this->msg_data_) + 1); + int len = (sizeof (*this) - sizeof (this->msg_data_)) + + (sizeof (ASYS_TCHAR) * ((ACE_OS::strlen (this->msg_data_) + 1))); // Round up to the alignment. this->length_ = 1 + ((len + ACE_Log_Record::ALIGN_WORDB - 1) diff --git a/ace/Message_Queue_T.cpp b/ace/Message_Queue_T.cpp index 67e76992def..e77eef128ba 100644 --- a/ace/Message_Queue_T.cpp +++ b/ace/Message_Queue_T.cpp @@ -756,7 +756,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::remove_messages (ACE_Message_Block *&l if (result < 0) return result; - if ((status_flags & (u_int) ACE_Dynamic_Message_Strategy::PENDING) + if ((status_flags & (u_int) ACE_Dynamic_Message_Strategy::PENDING) && this->pending_head_ && this->pending_tail_) { @@ -783,7 +783,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::remove_messages (ACE_Message_Block *&l this->pending_tail_ = 0; } - if ((status_flags & (u_int) ACE_Dynamic_Message_Strategy::LATE) + if ((status_flags & (u_int) ACE_Dynamic_Message_Strategy::LATE) && this->late_head_ && this->late_tail_) { @@ -813,7 +813,7 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::remove_messages (ACE_Message_Block *&l this->late_tail_ = 0; } - if ((status_flags & (u_int) ACE_Dynamic_Message_Strategy::BEYOND_LATE) + if ((status_flags & (u_int) ACE_Dynamic_Message_Strategy::BEYOND_LATE) && this->beyond_late_head_ && this->beyond_late_tail_) { @@ -1470,8 +1470,8 @@ ACE_Dynamic_Message_Queue<ACE_SYNCH_USE>::refresh_late_queue (const ACE_Time_Val case ACE_Dynamic_Message_Strategy::PENDING: // if we got here, something is *seriously* wrong with the queue ACE_ERROR_RETURN((LM_ERROR, - ASYS_TEXT ("Unexpected message priority status " - "[%d] (expected LATE or BEYOND_LATE)"), + ASYS_TEXT ("Unexpected message priority status ") + ASYS_TEXT ("[%d] (expected LATE or BEYOND_LATE)"), (int) current_status), -1); default: diff --git a/ace/Name_Proxy.cpp b/ace/Name_Proxy.cpp index d52d3bc31cd..efcaee781c4 100644 --- a/ace/Name_Proxy.cpp +++ b/ace/Name_Proxy.cpp @@ -148,8 +148,8 @@ ACE_Name_Proxy::recv_reply (ACE_Name_Request &reply) ASYS_TEXT ("****************** recv_reply returned -1\n"))); default: ACE_ERROR ((LM_ERROR, - "%p got %d bytes, expected %d bytes\n", - "recv failed", + ASYS_TEXT ("%p got %d bytes, expected %d bytes\n"), + ASYS_TEXT ("recv failed"), n, sizeof (ACE_UINT32))); // FALLTHROUGH @@ -171,8 +171,9 @@ ACE_Name_Proxy::recv_reply (ACE_Name_Request &reply) // Subtract off the size of the part we skipped over... if (n != ssize_t (length - sizeof (ACE_UINT32))) { - ACE_ERROR ((LM_ERROR, "%p expected %d, got %d\n", - "invalid length", + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p expected %d, got %d\n"), + ASYS_TEXT ("invalid length"), length, n)); return -1; diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp index b165a601ac9..0d133a37ba4 100644 --- a/ace/Naming_Context.cpp +++ b/ace/Naming_Context.cpp @@ -12,9 +12,9 @@ ACE_RCSID(ace, Naming_Context, "$Id$") // Make life easier later on... -typedef ACE_Local_Name_Space <ACE_MMAP_MEMORY_POOL, ACE_RW_Process_Mutex> +typedef ACE_Local_Name_Space <ACE_MMAP_MEMORY_POOL, ACE_RW_Process_Mutex> LOCAL_NAME_SPACE; -typedef ACE_Local_Name_Space <ACE_LITE_MMAP_MEMORY_POOL, ACE_RW_Process_Mutex> +typedef ACE_Local_Name_Space <ACE_LITE_MMAP_MEMORY_POOL, ACE_RW_Process_Mutex> LITE_LOCAL_NAME_SPACE; // The following Factory is used by the ACE_Service_Config and @@ -48,8 +48,10 @@ int ACE_Naming_Context::local (void) { ACE_TRACE ("ACE_Naming_Context::local"); - return ACE_OS::strcmp (this->netnameserver_host_, "localhost") == 0 - || ACE_OS::strcmp (this->netnameserver_host_, this->hostname_) == 0; + return ACE_OS::strcmp (this->netnameserver_host_, + ASYS_TEXT ("localhost")) == 0 + || ACE_OS::strcmp (this->netnameserver_host_, + this->hostname_) == 0; } int @@ -57,7 +59,7 @@ ACE_Naming_Context::open (Context_Scope_Type scope_in, int lite) { ACE_TRACE ("ACE_Naming_Context::open"); ACE_OS::hostname (this->hostname_, - (sizeof this->hostname_ / sizeof (char))); + (sizeof this->hostname_ / sizeof (ASYS_TCHAR))); this->netnameserver_host_ = this->name_options_->nameserver_host (); @@ -101,7 +103,7 @@ ACE_Naming_Context::open (Context_Scope_Type scope_in, int lite) if (ACE_LOG_MSG->op_status () != 0 || this->name_space_ == 0) ACE_ERROR_RETURN ((LM_ERROR, - "NAME_SPACE::NAME_SPACE\n"), + ASYS_TEXT ("NAME_SPACE::NAME_SPACE\n")), -1); return 0; } @@ -345,7 +347,7 @@ ACE_Naming_Context::list_value_entries (ACE_BINDING_SET &set_out, const char *pattern_in) { ACE_TRACE ("ACE_Naming_Context::list_value_entries"); - return this->list_value_entries (set_out, + return this->list_value_entries (set_out, ACE_WString (pattern_in)); } @@ -363,7 +365,7 @@ ACE_Naming_Context::list_type_entries (ACE_BINDING_SET &set_out, const char *pattern_in) { ACE_TRACE ("ACE_Naming_Context::list_type_entries"); - return this->list_type_entries (set_out, + return this->list_type_entries (set_out, ACE_WString (pattern_in)); } @@ -382,7 +384,7 @@ ACE_Naming_Context::dump () } int -ACE_Naming_Context::init (int argc, char *argv[]) +ACE_Naming_Context::init (int argc, ASYS_TCHAR *argv[]) { if (ACE::debug ()) ACE_DEBUG ((LM_DEBUG, @@ -457,14 +459,14 @@ ACE_Name_Options::process_name (LPCTSTR pname) } void -ACE_Name_Options::nameserver_host (const char *host) +ACE_Name_Options::nameserver_host (const ASYS_TCHAR *host) { ACE_TRACE ("ACE_Name_Options::nameserver_host"); ACE_OS::free ((void *) this->nameserver_host_); this->nameserver_host_ = ACE_OS::strdup (host); } -const char * +const ASYS_TCHAR * ACE_Name_Options::nameserver_host (void) { ACE_TRACE ("ACE_Name_Options::nameserver_host"); @@ -564,11 +566,11 @@ ACE_Name_Options::verbose (void) } void -ACE_Name_Options::parse_args (int argc, char *argv[]) +ACE_Name_Options::parse_args (int argc, ASYS_TCHAR *argv[]) { ACE_TRACE ("ACE_Name_Options::parse_args"); ACE_LOG_MSG->open (argv[0]); - this->process_name (ACE_WIDE_STRING (argv[0])); + this->process_name (ASYS_ONLY_WIDE_STRING (argv[0])); // Default is to use the PROC_LOCAL context... this->context (ACE_Naming_Context::PROC_LOCAL); @@ -578,18 +580,18 @@ ACE_Name_Options::parse_args (int argc, char *argv[]) // clean it up in the destructor). this->database (this->process_name ()); - ACE_Get_Opt get_opt (argc, argv, "b:c:dh:l:P:p:s:T:vr"); + ACE_Get_Opt get_opt (argc, argv, ASYS_TEXT ("b:c:dh:l:P:p:s:T:vr")); for (int c; (c = get_opt ()) != -1; ) switch (c) { case 'c': { - if (ACE_OS::strcmp (get_opt.optarg, "PROC_LOCAL") == 0) + if (ACE_OS::strcmp (get_opt.optarg, ASYS_TEXT ("PROC_LOCAL")) == 0) this->context (ACE_Naming_Context::PROC_LOCAL); - else if (ACE_OS::strcmp (get_opt.optarg, "NODE_LOCAL") == 0) + else if (ACE_OS::strcmp (get_opt.optarg, ASYS_TEXT ("NODE_LOCAL")) == 0) this->context (ACE_Naming_Context::NODE_LOCAL); - else if (ACE_OS::strcmp (get_opt.optarg, "NET_LOCAL") == 0) + else if (ACE_OS::strcmp (get_opt.optarg, ASYS_TEXT ("NET_LOCAL")) == 0) this->context (ACE_Naming_Context::NET_LOCAL); } break; @@ -603,24 +605,24 @@ ACE_Name_Options::parse_args (int argc, char *argv[]) this->nameserver_host (get_opt.optarg); break; case 'l': - this->namespace_dir (ACE_WIDE_STRING (get_opt.optarg)); + this->namespace_dir (ASYS_ONLY_WIDE_STRING (get_opt.optarg)); break; case 'P': - this->process_name (ACE_WIDE_STRING (get_opt.optarg)); + this->process_name (ASYS_ONLY_WIDE_STRING (get_opt.optarg)); break; case 'p': this->nameserver_port (ACE_OS::atoi (get_opt.optarg)); break; case 's': - this->database (ACE_WIDE_STRING (get_opt.optarg)); + this->database (ASYS_ONLY_WIDE_STRING (get_opt.optarg)); break; case 'b': this->base_address ((char *) ACE_OS::atoi (get_opt.optarg)); break; case 'T': - if (ACE_OS::strcasecmp (get_opt.optarg, "ON") == 0) + if (ACE_OS::strcasecmp (get_opt.optarg, ASYS_TEXT ("ON")) == 0) ACE_Trace::start_tracing (); - else if (ACE_OS::strcasecmp (get_opt.optarg, "OFF") == 0) + else if (ACE_OS::strcasecmp (get_opt.optarg, ASYS_TEXT ("OFF")) == 0) ACE_Trace::stop_tracing (); break; case 'v': diff --git a/ace/Naming_Context.h b/ace/Naming_Context.h index 078d35356cb..1067635cb82 100644 --- a/ace/Naming_Context.h +++ b/ace/Naming_Context.h @@ -91,7 +91,7 @@ public: // file // = Dynamic initialization hooks. - virtual int init (int argc, char *argv[]); + virtual int init (int argc, ASYS_TCHAR *argv[]); // Initialize name options and naming context when dynamically // linked. @@ -231,10 +231,10 @@ private: ACE_Name_Space *name_space_; // Name space (can be either local or remote) dynamically bound. - char hostname_[MAXHOSTNAMELEN + 1]; + ASYS_TCHAR hostname_[MAXHOSTNAMELEN + 1]; // Holds the local hostname. - const char *netnameserver_host_; + const ASYS_TCHAR *netnameserver_host_; // Holds name of net name server. int netnameserver_port_; @@ -255,7 +255,7 @@ public: ~ACE_Name_Options (void); void parse_args (int argc, - char *argv[]); + ASYS_TCHAR *argv[]); // Parse arguments. // = Set/Get port number @@ -267,8 +267,8 @@ public: void context (ACE_Naming_Context::Context_Scope_Type); // = Set/Get host name - void nameserver_host (const char *host); - const char *nameserver_host (void); + void nameserver_host (const ASYS_TCHAR *host); + const ASYS_TCHAR *nameserver_host (void); // = Set/Get name space directory void namespace_dir (LPCTSTR dir); @@ -309,7 +309,7 @@ private: int nameserver_port_; // Port to connect to nameserver process. - const char *nameserver_host_; + const ASYS_TCHAR *nameserver_host_; // Hostname of nameserver. LPCTSTR namespace_dir_; diff --git a/ace/OS.cpp b/ace/OS.cpp index 8754dbc8f60..3ef46d16730 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -4021,7 +4021,7 @@ ACE_OS::fork_exec (ASYS_TCHAR *argv[]) startup_info.cb = sizeof startup_info; if (::CreateProcess (0, - (LPTSTR) ACE_WIDE_STRING (buf), + (LPTSTR) ASYS_ONLY_WIDE_STRING (buf), 0, // No process attributes. 0, // No thread attributes. TRUE, // Allow handle inheritance. @@ -4032,7 +4032,7 @@ ACE_OS::fork_exec (ASYS_TCHAR *argv[]) &process_info)) # else if (::CreateProcess (0, - (LPTSTR) buf, + (LPTSTR) ASYS_ONLY_WIDE_STRING (buf), 0, // No process attributes. 0, // No thread attributes. FALSE, // Can's inherit handles on CE @@ -5185,19 +5185,19 @@ ACE_OS::difftime (time_t t1, time_t t0) } # endif /* ACE_LACKS_DIFFTIME */ -# if defined (ACE_HAS_WINCE) -wchar_t * -ACE_OS::ctime (const time_t *t) -{ - wchar_t buf[26]; // 26 is a "magic number" ;) - return ACE_OS::ctime_r (t, buf, 26); -} - +# if defined (ACE_HAS_MOSTLY_UNICODE_APIS) wchar_t * ACE_OS::ctime_r (const time_t *clock, wchar_t *buf, int buflen) { +#if !defined (ACE_HAS_WINCE) + wchar_t *result; + ACE_OSCALL (::_wctime (clock), wchar_t *, 0, result); + if (result != 0) + ::wcsncpy (buf, result, buflen); + return buf; +#else // buflen must be at least 26 wchar_t long. if (buflen < 26) // Again, 26 is a magic number. return 0; @@ -5229,8 +5229,9 @@ ACE_OS::ctime_r (const time_t *clock, systime.wSecond, systime.wYear); return buf; +#endif /* ACE_HAS_WINCE */ } -# endif /* ACE_HAS_WINCE */ +# endif /* ACE_HAS_MOSTLY_UNICODE_APIS */ # if !defined (ACE_HAS_WINCE) time_t @@ -412,7 +412,7 @@ # if defined (ACE_HAS_MOSTLY_UNICODE_APIS) # define ASYS_TCHAR wchar_t -# define ASYS_TEXT(STRING) _TEXT(STRING) +# define ASYS_TEXT(STRING) __TEXT (STRING) # else # define ASYS_TCHAR char # define ASYS_TEXT(STRING) STRING @@ -5139,7 +5139,7 @@ public: static int dlclose (ACE_SHLIB_HANDLE handle); // WinCE only supports UNICODE, so we don't need these functions. # if !defined (ACE_HAS_WINCE) - static char *dlerror (void); + static ASYS_TCHAR *dlerror (void); static ACE_SHLIB_HANDLE dlopen (const char *filename, int mode = ACE_DEFAULT_SHLIB_MODE); static void *dlsym (ACE_SHLIB_HANDLE handle, @@ -5380,12 +5380,12 @@ public: static char *ctime_r (const time_t *clock, char *buf, int buflen); -# else - static wchar_t *ctime (const time_t *t); +# endif /* !ACE_HAS_WINCE */ +# if defined (ACE_HAS_MOSTLY_UNICODE_APIS) static wchar_t *ctime_r (const time_t *clock, wchar_t *buf, int buflen); -# endif /* !ACE_HAS_WINCE */ +# endif /* ACE_HAS_MOSTLY_UNICODE_APIS */ static size_t strftime (char *s, size_t maxsize, const char *format, @@ -6024,6 +6024,9 @@ public: const wchar_t *t); static int strcmp (const wchar_t *s, const wchar_t *t); + static size_t strspn (const wchar_t *string, + const wchar_t *charset); + static wchar_t *strenvdup (const wchar_t *str); # endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ #if !defined (ACE_HAS_WCHAR_TYPEDEFS_USHORT) @@ -6085,6 +6088,11 @@ public: static long strtol (const wchar_t *s, wchar_t **ptr, int base); + static u_long strtoul (const wchar_t *s, + wchar_t **ptr, + int base); + static double strtod (const wchar_t *s, + wchar_t **endptr); static int ace_isspace (wchar_t c); # if defined (ACE_WIN32) @@ -6109,9 +6117,9 @@ public: # endif /* 0 */ // the following three are newly added for CE. // but they can also be use on Win32. - // static char *fgets (wchar_t *buf, - // int size, - // FILE *fp); + static wchar_t *fgets (wchar_t *buf, + int size, + FILE *fp); static int fprintf (FILE *fp, const wchar_t *format, ...); @@ -6131,6 +6139,7 @@ public: struct stat *); static int truncate (const wchar_t *filename, off_t length); + static int putenv (const wchar_t *str); static wchar_t *getenv (const wchar_t *symbol); static int system (const wchar_t *s); static int hostname (wchar_t *name, @@ -6148,6 +6157,8 @@ public: static int chdir (const wchar_t *path); static wchar_t *getcwd (wchar_t *, size_t); + static int mkfifo (const wchar_t *file, + mode_t mode = ACE_DEFAULT_FILE_PERMS); # endif /* ACE_WIN32 */ # endif /* ACE_HAS_UNICODE */ @@ -7945,7 +7945,7 @@ ACE_OS::dlclose (ACE_SHLIB_HANDLE handle) } #if !defined (ACE_HAS_WINCE) -ACE_INLINE char * +ACE_INLINE ASYS_TCHAR * ACE_OS::dlerror (void) { ACE_TRACE ("ACE_OS::dlerror"); @@ -7954,10 +7954,11 @@ ACE_OS::dlerror (void) # elif defined (__hpux) ACE_OSCALL_RETURN (::strerror(errno), char *, 0); # elif defined (ACE_WIN32) - static char buf[128]; + static ASYS_TCHAR buf[128]; # if defined (ACE_HAS_PHARLAP) ACE_OS::sprintf (buf, "error code %d", GetLastError()); # else +#if !defined (ACE_HAS_MOSTLY_UNICODE_APIS) FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM, NULL, ::GetLastError (), @@ -7965,6 +7966,15 @@ ACE_OS::dlerror (void) buf, sizeof buf, NULL); +#else + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, + NULL, + ::GetLastError (), + 0, + buf, + sizeof buf / sizeof ASYS_TCHAR, + NULL); +#endif /* ACE_HAS_MOSTLY_UNICODE_APIS */ # endif /* ACE_HAS_PHARLAP */ return buf; # else @@ -10378,6 +10388,19 @@ ACE_OS::strcpy (wchar_t *s, const wchar_t *t) # endif /* ACE_HAS_UNICODE */ } +ACE_INLINE size_t +ACE_OS::strspn (const wchar_t *s, const wchar_t *t) +{ +#if !defined (ACE_HAS_WINCE) + ACE_TRACE ("ACE_OS::strspn"); + return ::wcsspn (s, t); +#else + ACE_UNUSED_ARG (s); + ACE_UNUSED_ARG (t); + ACE_NOTSUP_RETURN (-1); +#endif /* ACE_HAS_WINCE */ +} + ACE_INLINE int ACE_OS::strcmp (const wchar_t *s, const wchar_t *t) { @@ -10704,6 +10727,20 @@ ACE_OS::strtol (const wchar_t *s, wchar_t **ptr, int base) return ::wcstol (s, ptr, base); } +ACE_INLINE unsigned long +ACE_OS::strtoul (const wchar_t *s, wchar_t **ptr, int base) +{ + ACE_TRACE ("ACE_OS::strtoul"); + return ::wcstoul (s, ptr, base); +} + +ACE_INLINE double +ACE_OS::strtod (const wchar_t *s, wchar_t **endptr) +{ + ACE_TRACE ("ACE_OS::strtod"); + return ::wcstod (s, endptr); +} + ACE_INLINE int ACE_OS::ace_isspace (wchar_t c) { @@ -10814,6 +10851,20 @@ ACE_OS::getenv (const wchar_t *symbol) } ACE_INLINE int +ACE_OS::putenv (const wchar_t *string) +{ + ACE_TRACE ("ACE_OS::putenv"); + // VxWorks declares ::putenv with a non-const arg. +#if !defined (ACE_HAS_WINCE) && !defined (ACE_PSOS) + ACE_OSCALL_RETURN (::_wputenv ((wchar_t *) string), int, -1); +#else + // @@ WinCE and pSOS don't have the concept of environment variables. + ACE_UNUSED_ARG (string); + ACE_NOTSUP_RETURN (-1); +#endif /* ! ACE_HAS_WINCE && ! ACE_PSOS */ +} + +ACE_INLINE int ACE_OS::rename (const wchar_t *old_name, const wchar_t *new_name) { # if !defined (ACE_HAS_WINCE) @@ -10938,6 +10989,21 @@ ACE_OS::perror (const wchar_t *s) } +// Here are functions that CE doesn't support at all. +// Notice that some of them might have UNICODE version. +ACE_INLINE wchar_t * +ACE_OS::fgets (wchar_t *buf, int size, FILE *fp) +{ +#if !defined (ACE_HAS_WINCE) + ACE_TRACE ("ACE_OS::fgets"); + ACE_OSCALL_RETURN (::fgetws (buf, size, fp), wchar_t *, 0); +#else + ACE_UNUSED_ARG (buf); + ACE_UNUSED_ARG (size); + ACE_UNUSED_ARG (fp); +#endif /* ACE_HAS_WINCE */ +} + ACE_INLINE int ACE_OS::system (const wchar_t *command) { @@ -10998,6 +11064,15 @@ ACE_OS::getcwd (wchar_t *buf, size_t size) return ::_wgetcwd (buf, size); # endif /* ACE_HAS_WINCE */ } + +ACE_INLINE int +ACE_OS::mkfifo (const wchar_t *file, mode_t mode) +{ + // ACE_TRACE ("ACE_OS::mkfifo"); + ACE_UNUSED_ARG (file); + ACE_UNUSED_ARG (mode); + ACE_NOTSUP_RETURN (-1); +} # endif /* ACE_WIN32 */ #endif /* ACE_HAS_UNICODE */ @@ -11757,6 +11832,25 @@ ACE_OS::strenvdup (const char *str) #endif /* ACE_HAS_WINCE */ } +#if !defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) +ACE_INLINE wchar_t * +ACE_OS::strenvdup (const wchar_t *str) +{ +#if defined (ACE_HAS_WINCE) + // WinCE doesn't have environment variables so we just skip it. + return ACE_OS::strdup (str); +#else + wchar_t *temp = 0; + + if (str[0] == '$' + && (temp = ACE_OS::getenv (&str[1])) != 0) + return ACE_OS::strdup (temp); + else + return ACE_OS::strdup (str); +#endif /* ACE_HAS_WINCE */ +} +#endif /* ACE_HAS_WCHAR_TYPEDEFS_CHAR */ + ACE_INLINE ACE_OS_WString::~ACE_OS_WString (void) { diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index cda7c90ee05..e1335165bbf 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -54,7 +54,7 @@ ACE_Parse_Node::dump (void) const ACE_TRACE ("ACE_Parse_Node::dump"); } -const char * +const ASYS_TCHAR * ACE_Parse_Node::name (void) const { ACE_TRACE ("ACE_Parse_Node::name"); @@ -78,12 +78,12 @@ ACE_Parse_Node::link (ACE_Parse_Node *n) ACE_Stream_Node::ACE_Stream_Node (const ACE_Static_Node *str_ops, const ACE_Parse_Node *str_mods) #if defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) - : ACE_Parse_Node (str_ops == 0 ? ACE_static_cast (char *, + : ACE_Parse_Node (str_ops == 0 ? ACE_static_cast (ASYS_TCHAR *, ASYS_TEXT ("<unknown>")) - : ACE_static_cast (char *, + : ACE_static_cast (ASYS_TCHAR *, str_ops->name ())), #else - : ACE_Parse_Node (str_ops == 0 ? "<unknown>" : str_ops->name ()), + : ACE_Parse_Node ((str_ops == 0 ? ASYS_TEXT ("<unknown>") : str_ops->name ())), #endif /* defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ node_ (str_ops), mods_ (str_mods) @@ -110,7 +110,7 @@ ACE_Parse_Node::ACE_Parse_Node (void) } -ACE_Parse_Node::ACE_Parse_Node (const char *nm) +ACE_Parse_Node::ACE_Parse_Node (const ASYS_TCHAR *nm) : name_ (nm), next_ (0) { @@ -145,7 +145,7 @@ ACE_Suspend_Node::dump (void) const ACE_TRACE ("ACE_Suspend_Node::dump"); } -ACE_Suspend_Node::ACE_Suspend_Node (const char *name) +ACE_Suspend_Node::ACE_Suspend_Node (const ASYS_TCHAR *name) : ACE_Parse_Node (name) { ACE_TRACE ("ACE_Suspend_Node::ACE_Suspend_Node"); @@ -159,7 +159,7 @@ ACE_Resume_Node::dump (void) const ACE_TRACE ("ACE_Resume_Node::dump"); } -ACE_Resume_Node::ACE_Resume_Node (const char *name) +ACE_Resume_Node::ACE_Resume_Node (const ASYS_TCHAR *name) : ACE_Parse_Node (name) { ACE_TRACE ("ACE_Resume_Node::ACE_Resume_Node"); @@ -202,7 +202,7 @@ ACE_Remove_Node::dump (void) const ACE_TRACE ("ACE_Remove_Node::dump"); } -ACE_Remove_Node::ACE_Remove_Node (const char *name) +ACE_Remove_Node::ACE_Remove_Node (const ASYS_TCHAR *name) : ACE_Parse_Node (name) { ACE_TRACE ("ACE_Remove_Node::ACE_Remove_Node"); @@ -223,8 +223,8 @@ ACE_Remove_Node::apply (void) } ACE_Dynamic_Node::ACE_Dynamic_Node (const ACE_Service_Type *sr, - char *parms) - : ACE_Static_Node (sr->chname (), parms), + ASYS_TCHAR *parms) + : ACE_Static_Node (sr->name (), parms), record_ (sr) { ACE_TRACE ("ACE_Dynamic_Node::ACE_Dynamic_Node"); @@ -274,8 +274,8 @@ ACE_Static_Node::dump (void) const ACE_TRACE ("ACE_Static_Node::dump"); } -ACE_Static_Node::ACE_Static_Node (const char *nm, - char *params) +ACE_Static_Node::ACE_Static_Node (const ASYS_TCHAR *nm, + ASYS_TCHAR *params) : ACE_Parse_Node (nm), parameters_ (params) { @@ -289,14 +289,14 @@ ACE_Static_Node::record (void) const ACE_Service_Type *sr; if (ACE_Service_Repository::instance()->find - (ASYS_WIDE_STRING (this->name ()), + (this->name (), (const ACE_Service_Type **) &sr) == -1) return 0; else return sr; } -char * +ASYS_TCHAR * ACE_Static_Node::parameters (void) const { ACE_TRACE ("ACE_Static_Node::parameters"); @@ -344,7 +344,7 @@ ACE_Location_Node::~ACE_Location_Node (void) ACE_TRACE ("ACE_Location_Node::~ACE_Location_Node"); } -const char * +const ASYS_TCHAR * ACE_Location_Node::pathname (void) const { ACE_TRACE ("ACE_Location_Node::pathname"); @@ -352,7 +352,7 @@ ACE_Location_Node::pathname (void) const } void -ACE_Location_Node::pathname (const char *p) +ACE_Location_Node::pathname (const ASYS_TCHAR *p) { ACE_TRACE ("ACE_Location_Node::pathname"); this->pathname_ = p; @@ -395,7 +395,7 @@ ACE_Location_Node::open_handle (void) // Transform the pathname into the appropriate dynamic link library // by searching the ACE_LD_SEARCH_PATH. - int result = ACE::ldfind (ASYS_WIDE_STRING (this->pathname ()), + int result = ACE::ldfind (this->pathname (), dl_pathname, (sizeof dl_pathname / sizeof (ASYS_TCHAR))); @@ -404,7 +404,7 @@ ACE_Location_Node::open_handle (void) return 0; // Set the handle - this->handle (ACE_OS::dlopen (dl_pathname)); + this->handle (ACE_OS::dlopen (ASYS_ONLY_MULTIBYTE_STRING (dl_pathname))); if (this->handle () == 0) { @@ -438,8 +438,8 @@ ACE_Object_Node::dump (void) const ACE_TRACE ("ACE_Object_Node::dump"); } -ACE_Object_Node::ACE_Object_Node (const char *path, - const char *obj_name) +ACE_Object_Node::ACE_Object_Node (const ASYS_TCHAR *path, + const ASYS_TCHAR *obj_name) : object_name_ (obj_name) { ACE_TRACE ("ACE_Object_Node::ACE_Object_Node"); @@ -457,7 +457,7 @@ ACE_Object_Node::symbol (ACE_Service_Object_Exterminator *) this->symbol_ = (void *) ACE_OS::dlsym ((ACE_SHLIB_HANDLE) this->handle (), - object_name); + ASYS_ONLY_MULTIBYTE_STRING (object_name)); if (this->symbol_ == 0) { @@ -498,8 +498,8 @@ ACE_Function_Node::dump (void) const ACE_TRACE ("ACE_Function_Node::dump"); } -ACE_Function_Node::ACE_Function_Node (const char *path, - const char *func_name) +ACE_Function_Node::ACE_Function_Node (const ASYS_TCHAR *path, + const ASYS_TCHAR *func_name) : function_name_ (func_name) { ACE_TRACE ("ACE_Function_Node::ACE_Function_Node"); @@ -519,8 +519,8 @@ ACE_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) // Locate the factory function <function_name> in the shared // object. - char *function_name = ACE_const_cast (char *, - this->function_name_); + ASYS_TCHAR *function_name = ACE_const_cast (ASYS_TCHAR *, + this->function_name_); // According to the new ANSI C++ specification, casting a void* // pointer to a function pointer is not allowed. However, @@ -536,7 +536,7 @@ ACE_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) long temp_ptr = ACE_reinterpret_cast(long, ACE_OS::dlsym ((ACE_SHLIB_HANDLE) this->handle (), - ASYS_WIDE_STRING (function_name))); + ASYS_ONLY_MULTIBYTE_STRING (function_name))); func = ACE_reinterpret_cast(void *(*)(ACE_Service_Object_Exterminator *), temp_ptr); @@ -550,7 +550,7 @@ ACE_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("dlsym failed for function %s\n"), - ASYS_WIDE_STRING (function_name))); + function_name)); ASYS_TCHAR *errmsg = ACE_OS::dlerror (); @@ -573,7 +573,7 @@ ACE_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) ace_yyerrno++; ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_WIDE_STRING (this->function_name_)), + this->function_name_), 0); } } @@ -633,7 +633,7 @@ ACE_Static_Function_Node::dump (void) const ACE_TRACE ("ACE_Static_Function_Node::dump"); } -ACE_Static_Function_Node::ACE_Static_Function_Node (const char *func_name) +ACE_Static_Function_Node::ACE_Static_Function_Node (const ASYS_TCHAR *func_name) : function_name_ (func_name) { ACE_TRACE ("ACE_Static_Function_Node::ACE_Static_Function_Node"); @@ -653,7 +653,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) ACE_Static_Svc_Descriptor **ssdp = 0; ACE_STATIC_SVCS &svcs = *ACE_Service_Config::static_svcs (); - char *function_name = ACE_const_cast (char *, this->function_name_); + ASYS_TCHAR *function_name = ACE_const_cast (ASYS_TCHAR *, this->function_name_); for (ACE_STATIC_SVCS_ITERATOR iter (svcs); iter.next (ssdp) != 0; @@ -661,7 +661,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) { ACE_Static_Svc_Descriptor *ssd = *ssdp; if (ACE_OS::strcmp (ssd->name_, - ASYS_WIDE_STRING (function_name)) == 0) + function_name) == 0) func = (void *(*)(ACE_Service_Object_Exterminator*)) ssd->alloc_; } @@ -675,7 +675,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("no static service registered for function %s\n"), - ASYS_WIDE_STRING (function_name)), + function_name), 0); } } @@ -688,7 +688,7 @@ ACE_Static_Function_Node::symbol (ACE_Service_Object_Exterminator *gobbler) ace_yyerrno++; ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ACE_WIDE_STRING (this->function_name_)), + this->function_name_), 0); } diff --git a/ace/Parse_Node.h b/ace/Parse_Node.h index b6975d1355d..492895e85b2 100644 --- a/ace/Parse_Node.h +++ b/ace/Parse_Node.h @@ -30,14 +30,14 @@ class ACE_Export ACE_Parse_Node // tree of Service Nodes. public: ACE_Parse_Node (void); - ACE_Parse_Node (const char *name); + ACE_Parse_Node (const ASYS_TCHAR *name); virtual ~ACE_Parse_Node (void); ACE_Parse_Node *link (void) const; void link (ACE_Parse_Node *); virtual void apply (void) = 0; - const char *name (void) const; + const ASYS_TCHAR *name (void) const; void print (void) const; void dump (void) const; @@ -47,7 +47,7 @@ public: // Declare the dynamic allocation hooks. private: - const char *name_; + const ASYS_TCHAR *name_; ACE_Parse_Node *next_; }; @@ -56,7 +56,7 @@ class ACE_Export ACE_Suspend_Node : public ACE_Parse_Node // = TITLE // Suspend a Service Node. public: - ACE_Suspend_Node (const char *name); + ACE_Suspend_Node (const ASYS_TCHAR *name); ~ACE_Suspend_Node (void); virtual void apply (void); @@ -73,7 +73,7 @@ class ACE_Export ACE_Resume_Node : public ACE_Parse_Node // = TITLE // Resume a Service Node. public: - ACE_Resume_Node (const char *name); + ACE_Resume_Node (const ASYS_TCHAR *name); ~ACE_Resume_Node (void); virtual void apply (void); @@ -90,7 +90,7 @@ class ACE_Export ACE_Remove_Node : public ACE_Parse_Node // = TITLE // Remove a Service Node. public: - ACE_Remove_Node (const char *name); + ACE_Remove_Node (const ASYS_TCHAR *name); ~ACE_Remove_Node (void); virtual void apply (void); @@ -107,12 +107,12 @@ class ACE_Export ACE_Static_Node : public ACE_Parse_Node // = TITLE // Handle a statically linked node. public: - ACE_Static_Node (const char *name, char *params = 0); + ACE_Static_Node (const ASYS_TCHAR *name, ASYS_TCHAR *params = 0); virtual ~ACE_Static_Node (void); virtual void apply (void); virtual const ACE_Service_Type *record (void) const; - char *parameters (void) const; + ASYS_TCHAR *parameters (void) const; void dump (void) const; // Dump the state of an object. @@ -121,7 +121,7 @@ public: // Declare the dynamic allocation hooks. private: - char *parameters_; + ASYS_TCHAR *parameters_; // "Command-line" parameters. }; @@ -130,7 +130,7 @@ class ACE_Export ACE_Dynamic_Node : public ACE_Static_Node // = TITLE // Handle a dynamically linked node. public: - ACE_Dynamic_Node (const ACE_Service_Type *, char *params); + ACE_Dynamic_Node (const ACE_Service_Type *, ASYS_TCHAR *params); virtual ~ACE_Dynamic_Node (void); virtual const ACE_Service_Type *record (void) const; @@ -179,8 +179,8 @@ public: virtual void set_symbol (void *h); ACE_SHLIB_HANDLE handle (void) const; void handle (const ACE_SHLIB_HANDLE h); - const char *pathname (void) const; - void pathname (const char *h); + const ASYS_TCHAR *pathname (void) const; + void pathname (const ASYS_TCHAR *h); int dispose (void) const; virtual ~ACE_Location_Node (void); @@ -194,7 +194,7 @@ public: protected: ACE_SHLIB_HANDLE open_handle (void); - const char *pathname_; + const ASYS_TCHAR *pathname_; // Pathname to the shared library we are working on. int must_delete_; @@ -212,7 +212,7 @@ class ACE_Export ACE_Object_Node : public ACE_Location_Node // = TITLE // Keeps track of the symbol name for a shared object. public: - ACE_Object_Node (const char *pathname, const char *obj_name); + ACE_Object_Node (const ASYS_TCHAR *pathname, const ASYS_TCHAR *obj_name); virtual void *symbol (ACE_Service_Object_Exterminator * = 0); virtual ~ACE_Object_Node (void); @@ -223,7 +223,7 @@ public: // Declare the dynamic allocation hooks. private: - const char *object_name_; + const ASYS_TCHAR *object_name_; // Name of the object that we're parsing. }; @@ -232,7 +232,7 @@ class ACE_Export ACE_Function_Node : public ACE_Location_Node // = TITLE // Keeps track of the symbol name of for a shared function. public: - ACE_Function_Node (const char *pathname, const char *func_name); + ACE_Function_Node (const ASYS_TCHAR *pathname, const ASYS_TCHAR *func_name); virtual void *symbol (ACE_Service_Object_Exterminator *gobbler = 0); virtual ~ACE_Function_Node (void); @@ -243,7 +243,7 @@ public: // Declare the dynamic allocation hooks. private: - const char *function_name_; + const ASYS_TCHAR *function_name_; // Name of the function that we're parsing. }; @@ -275,7 +275,7 @@ class ACE_Export ACE_Static_Function_Node : public ACE_Location_Node // linked in from a DLL, but is statically linked with the // application. public: - ACE_Static_Function_Node (const char *func_name); + ACE_Static_Function_Node (const ASYS_TCHAR *func_name); virtual void *symbol (ACE_Service_Object_Exterminator * = 0); virtual ~ACE_Static_Function_Node (void); @@ -286,7 +286,7 @@ public: // Declare the dynamic allocation hooks. private: - const char *function_name_; + const ASYS_TCHAR *function_name_; // Name of the function that we're parsing. }; diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index 96a982d9b3e..6089b432e8f 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -179,9 +179,9 @@ ACE_Proactor_Handle_Timeout_Upcall::timeout (TIMER_QUEUE &timer_queue, -1); if (asynch_timer == 0) ACE_ERROR_RETURN ((LM_ERROR, - "%N:%l:(%P | %t):%p\n", - "ACE_Proactor_Handle_Timeout_Upcall::timeout:" - "create_asynch_timer failed"), + ASYS_TEXT ("%N:%l:(%P | %t):%p\n"), + ASYS_TEXT ("ACE_Proactor_Handle_Timeout_Upcall::timeout:") + ASYS_TEXT ("create_asynch_timer failed")), -1); // Post a completion. @@ -511,8 +511,8 @@ ACE_Proactor::close (void) // Close the implementation. if (this->implementation ()->close () == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%N:%l:(%P | %t):%p\n", - "ACE_Proactor::close:implementation couldnt be closed"), + ASYS_TEXT ("%N:%l:(%P | %t):%p\n"), + ASYS_TEXT ("ACE_Proactor::close:implementation couldnt be closed")), -1); // Delete the implementation. diff --git a/ace/Process.cpp b/ace/Process.cpp index b4a90c62f8e..b2be00615fb 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -285,8 +285,8 @@ ACE_Process_Options::inherit_environment (void) // Add the string to our env buffer. if (this->setenv_i (existing_environment + slot, len) == -1) { - ACE_ERROR ((LM_ERROR, "%p.\n", - "ACE_Process_Options::ACE_Process_Options")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p.\n"), + ASYS_TEXT ("ACE_Process_Options::ACE_Process_Options"))); break; } @@ -424,7 +424,7 @@ ACE_Process_Options::setenv_i (LPTSTR assignment, // If environment larger than allocated buffer return. Also check to // make sure we have enough room. - if (environment_argv_index_ == max_environ_argv_index_ + if (environment_argv_index_ == max_environ_argv_index_ || (len + environment_buf_index_) >= environment_buf_len_) return -1; @@ -524,7 +524,7 @@ ACE_Process_Options::~ACE_Process_Options (void) int ACE_Process_Options::command_line (LPCTSTR argv[]) { - // @@ Factor out the code between this + // @@ Factor out the code between this int i = 0; if (argv[i]) diff --git a/ace/RB_Tree.cpp b/ace/RB_Tree.cpp index e1dcc5a859e..5abb8601885 100644 --- a/ace/RB_Tree.cpp +++ b/ace/RB_Tree.cpp @@ -144,8 +144,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::RB_rotate_right (ACE_RB_Tre else if (! (x->left())) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nerror: x->left () is a null pointer in " - "ACE_RB_Tree<EXT_ID, INT_ID>::RB_rotate_right\n"))); + ASYS_TEXT ("\nerror: x->left () is a null pointer in ") + ASYS_TEXT ("ACE_RB_Tree<EXT_ID, INT_ID>::RB_rotate_right\n"))); else { ACE_RB_Tree_Node<EXT_ID, INT_ID> * y; @@ -183,8 +183,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::RB_rotate_left (ACE_RB_Tree else if (! (x->right())) ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nerror: x->right () is a null pointer " - "in ACE_RB_Tree<EXT_ID, INT_ID>::RB_rotate_left\n"))); + ASYS_TEXT ("\nerror: x->right () is a null pointer ") + ASYS_TEXT ("in ACE_RB_Tree<EXT_ID, INT_ID>::RB_rotate_left\n"))); else { ACE_RB_Tree_Node<EXT_ID, INT_ID> * y; @@ -384,8 +384,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::RB_rebalance (ACE_RB_Tree_N // If we got here, something is drastically wrong! ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nerror: parent's parent is null in " - "ACE_RB_Tree<EXT_ID, INT_ID>::RB_rebalance\n"))); + ASYS_TEXT ("\nerror: parent's parent is null in ") + ASYS_TEXT ("ACE_RB_Tree<EXT_ID, INT_ID>::RB_rebalance\n"))); return; } @@ -582,8 +582,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i (const EXT_ID &k, // If there is already a right subtree, complain. ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nright subtree already present in " - "ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), + ASYS_TEXT ("\nright subtree already present in ") + ASYS_TEXT ("ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), 0); else { @@ -614,8 +614,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i (const EXT_ID &k, // If there is already a left subtree, complain. ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nleft subtree already present in " - "ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), + ASYS_TEXT ("\nleft subtree already present in ") + ASYS_TEXT ("ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), 0); else { @@ -693,8 +693,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i (const EXT_ID &k, // If there is already a right subtree, complain. ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nright subtree already present in " - "ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), + ASYS_TEXT ("\nright subtree already present in ") + ASYS_TEXT ("ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), -1); } else @@ -725,8 +725,8 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::insert_i (const EXT_ID &k, // If there is already a left subtree, complain. ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("\nleft subtree already present in " - "ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), + ASYS_TEXT ("\nleft subtree already present in ") + ASYS_TEXT ("ACE_RB_Tree<EXT_ID, INT_ID>::insert_i\n")), -1); else { diff --git a/ace/Registry_Name_Space.cpp b/ace/Registry_Name_Space.cpp index 543ddd1a4e2..30686c25d52 100644 --- a/ace/Registry_Name_Space.cpp +++ b/ace/Registry_Name_Space.cpp @@ -16,7 +16,8 @@ ACE_Registry_Name_Space::ACE_Registry_Name_Space (void) ACE_Registry_Name_Space::ACE_Registry_Name_Space (ACE_Name_Options *name_options) { if (this->open (name_options) != 0) - ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Registry_Name_Space::open"))); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Registry_Name_Space::open"))); } @@ -25,17 +26,19 @@ ACE_Registry_Name_Space::~ACE_Registry_Name_Space (void) } -int +int ACE_Registry_Name_Space::open (ACE_Name_Options *name_options) { - const char *host = name_options->nameserver_host (); + const ASYS_TCHAR *host = name_options->nameserver_host (); ACE_Registry::Naming_Context predefined; - + int result = ACE_Predefined_Naming_Contexts::connect (predefined, HKEY_LOCAL_MACHINE, - ACE_WIDE_STRING (host)); + ASYS_ONLY_WIDE_STRING (host)); if (result != 0) - ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Predefined_Naming_Context::connect")), result); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Predefined_Naming_Context::connect")), + result); else { // Directory @@ -55,68 +58,68 @@ ACE_Registry_Name_Space::open (ACE_Name_Options *name_options) } -int -ACE_Registry_Name_Space::bind (const ACE_WString &name, - const ACE_WString &value, +int +ACE_Registry_Name_Space::bind (const ACE_WString &name, + const ACE_WString &value, const char *type) { // Pointer to data const ACE_USHORT16 *data = value.fast_rep (); - + // Size u_long size = value.length () * sizeof (ACE_USHORT16); - + // Represent value as an ACE_Registry::Object ACE_Registry::Object object ((void *) data, size, REG_SZ); // Add new <key>/<value> pair - return this->context_.bind (name.fast_rep(), + return this->context_.bind (name.fast_rep(), object); } -int -ACE_Registry_Name_Space::rebind (const ACE_WString &name, - const ACE_WString &value, +int +ACE_Registry_Name_Space::rebind (const ACE_WString &name, + const ACE_WString &value, const char *type) { // Pointer to data const ACE_USHORT16 *data = value.fast_rep (); - + // Size u_long size = value.length () * sizeof (ACE_USHORT16); - + // Represent value as an ACE_Registry::Object ACE_Registry::Object object ((void *) data, size, REG_SZ); // Add new <key>/<value> pair - return this->context_.rebind (name.fast_rep (), + return this->context_.rebind (name.fast_rep (), object); } -int +int ACE_Registry_Name_Space::unbind (const ACE_WString &name) { return this->context_.unbind (name.fast_rep ()); } -int -ACE_Registry_Name_Space::resolve (const ACE_WString &name, - ACE_WString &value, +int +ACE_Registry_Name_Space::resolve (const ACE_WString &name, + ACE_WString &value, char *&type) { - // This object will be used to query the size of the data. + // This object will be used to query the size of the data. // Note: The query_object.data will be null for this invocation. ACE_Registry::Object query_object; int result = this->context_.resolve (name.fast_rep (), query_object); if (result != 0) return result; - // Resize the value passed by the user + // Resize the value passed by the user // Note: -1 is used because the size includes the null terminator value.resize ((query_object.size () - 1) / sizeof (ACE_USHORT16)); @@ -134,9 +137,9 @@ ACE_Registry_Name_Space::resolve (const ACE_WString &name, return 0; } - -int -ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, + +int +ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_BINDING_SET binding_set; @@ -144,7 +147,7 @@ ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, pattern); if (result != 0) return result; - + ACE_BINDING_ITERATOR iterator (binding_set); for (ACE_Name_Binding *entry = 0; @@ -157,8 +160,8 @@ ACE_Registry_Name_Space:: list_names (ACE_WSTRING_SET &set, } -int -ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, +int +ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_BINDING_SET binding_set; @@ -166,7 +169,7 @@ ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, pattern); if (result != 0) return result; - + ACE_BINDING_ITERATOR iterator (binding_set); for (ACE_Name_Binding *entry = 0; @@ -179,16 +182,16 @@ ACE_Registry_Name_Space::list_values (ACE_WSTRING_SET &set, } -int -ACE_Registry_Name_Space::list_types (ACE_WSTRING_SET &set, +int +ACE_Registry_Name_Space::list_types (ACE_WSTRING_SET &set, const ACE_WString &pattern) { return 0; } -int -ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, +int +ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_Registry::Binding_List list; @@ -203,22 +206,22 @@ ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, { // Yeeesss! STL rules! ACE_Registry::Binding &binding = *i; - + if (binding.type () == ACE_Registry::OBJECT) - { + { // Key ACE_Registry::Istring string = binding.name (); ACE_WString key (string.c_str ()); - + // Value ACE_WString value; char *type = 0; result = this->resolve (key, value, - type); + type); if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Registry::Naming_Context::resolve")), result); - + // Complete binding ACE_Name_Binding binding (key, value, type); set.insert (binding); @@ -228,23 +231,23 @@ ACE_Registry_Name_Space::list_name_entries (ACE_BINDING_SET &set, } -int -ACE_Registry_Name_Space::list_value_entries (ACE_BINDING_SET &set, +int +ACE_Registry_Name_Space::list_value_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { return this->list_name_entries (set, pattern); } -int -ACE_Registry_Name_Space::list_type_entries (ACE_BINDING_SET &set, +int +ACE_Registry_Name_Space::list_type_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { return this->list_name_entries (set, pattern); } -void +void ACE_Registry_Name_Space::dump (void) const { } diff --git a/ace/Remote_Name_Space.cpp b/ace/Remote_Name_Space.cpp index cbd886b0d13..e33702af313 100644 --- a/ace/Remote_Name_Space.cpp +++ b/ace/Remote_Name_Space.cpp @@ -7,11 +7,11 @@ ACE_RCSID(ace, Remote_Name_Space, "$Id$") int -ACE_Remote_Name_Space::open (const char *servername, u_short port) +ACE_Remote_Name_Space::open (const ASYS_TCHAR *servername, u_short port) { ACE_TRACE ("ACE_Remote_Name_Space::open"); ACE_INET_Addr servaddr; - + // Initialize Addr if (servaddr.set (port, servername) == -1) return -1; @@ -19,7 +19,7 @@ ACE_Remote_Name_Space::open (const char *servername, u_short port) // Connect to Name Server process. if (this->ns_proxy_.open (servaddr) == -1) return -1; - + return 0; } @@ -28,7 +28,7 @@ ACE_Remote_Name_Space::ACE_Remote_Name_Space (void) ACE_TRACE ("ACE_Remote_Name_Space::ACE_Remote_Name_Space"); } -ACE_Remote_Name_Space::ACE_Remote_Name_Space (const char *hostname, +ACE_Remote_Name_Space::ACE_Remote_Name_Space (const ASYS_TCHAR *hostname, u_short port) { ACE_TRACE ("ACE_Remote_Name_Space::ACE_Remote_Name_Space"); @@ -36,9 +36,9 @@ ACE_Remote_Name_Space::ACE_Remote_Name_Space (const char *hostname, ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("ACE_Remote_Name_Space::ACE_Remote_Name_Space"))); } -int -ACE_Remote_Name_Space::bind (const ACE_WString &name, - const ACE_WString &value, +int +ACE_Remote_Name_Space::bind (const ACE_WString &name, + const ACE_WString &value, const char *type) { ACE_TRACE ("ACE_Remote_Name_Space::bind"); @@ -47,14 +47,14 @@ ACE_Remote_Name_Space::bind (const ACE_WString &name, name.length () * sizeof (ACE_USHORT16), value.fast_rep (), value.length () * sizeof (ACE_USHORT16), - type, + type, ACE_OS::strlen (type)); return this->ns_proxy_.request_reply (request); } -int -ACE_Remote_Name_Space::rebind (const ACE_WString &name, - const ACE_WString &value, +int +ACE_Remote_Name_Space::rebind (const ACE_WString &name, + const ACE_WString &value, const char *type) { ACE_TRACE ("ACE_Remote_Name_Space::rebind"); @@ -63,14 +63,14 @@ ACE_Remote_Name_Space::rebind (const ACE_WString &name, name.length () * sizeof (ACE_USHORT16), value.fast_rep (), value.length () * sizeof (ACE_USHORT16), - type, + type, ACE_OS::strlen (type)); return this->ns_proxy_.request_reply (request); } -int -ACE_Remote_Name_Space::resolve (const ACE_WString &name, - ACE_WString &value, +int +ACE_Remote_Name_Space::resolve (const ACE_WString &name, + ACE_WString &value, char *&type) { ACE_TRACE ("ACE_Remote_Name_Space::resolve"); @@ -89,14 +89,14 @@ ACE_Remote_Name_Space::resolve (const ACE_WString &name, ACE_WString temp (reply.value (), reply.value_len () / sizeof (ACE_USHORT16)); value = temp; - ACE_NEW_RETURN (type, + ACE_NEW_RETURN (type, char[reply.type_len () + 1], -1); ACE_OS::strcpy (type, reply.type ()); return 0; } -int +int ACE_Remote_Name_Space::unbind (const ACE_WString &name) { ACE_TRACE ("ACE_Remote_Name_Space::unbind"); @@ -107,8 +107,8 @@ ACE_Remote_Name_Space::unbind (const ACE_WString &name) return this->ns_proxy_.request_reply (request); } -int -ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, +int +ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_names"); @@ -118,7 +118,7 @@ ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, 0, 0, 0, 0); if (this->ns_proxy_.send_request (request) == -1) return -1; - + ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) @@ -138,8 +138,8 @@ ACE_Remote_Name_Space::list_names (ACE_WSTRING_SET &set, return 0; } -int -ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, +int +ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_values"); @@ -149,7 +149,7 @@ ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, 0, 0, 0, 0); if (this->ns_proxy_.send_request (request) == -1) return -1; - + ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) @@ -170,8 +170,8 @@ ACE_Remote_Name_Space::list_values (ACE_WSTRING_SET &set, return 0; } -int -ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, +int +ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_types"); @@ -182,7 +182,7 @@ ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, if (this->ns_proxy_.send_request (request) == -1) return -1; - + ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) @@ -202,8 +202,8 @@ ACE_Remote_Name_Space::list_types (ACE_WSTRING_SET &set, return 0; } -int -ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, +int +ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_names"); @@ -214,7 +214,7 @@ ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, if (this->ns_proxy_.send_request (request) == -1) return -1; - + ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) @@ -240,8 +240,8 @@ ACE_Remote_Name_Space::list_name_entries (ACE_BINDING_SET &set, return 0; } -int -ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, +int +ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_values"); @@ -252,7 +252,7 @@ ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, if (this->ns_proxy_.send_request (request) == -1) return -1; - + ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) @@ -278,8 +278,8 @@ ACE_Remote_Name_Space::list_value_entries (ACE_BINDING_SET &set, return 0; } -int -ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, +int +ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, const ACE_WString &pattern) { ACE_TRACE ("ACE_Remote_Name_Space::list_types"); @@ -290,7 +290,7 @@ ACE_Remote_Name_Space::list_type_entries (ACE_BINDING_SET &set, if (this->ns_proxy_.send_request (request) == -1) return -1; - + ACE_Name_Request reply (0, 0, 0, 0, 0, 0, 0, 0); while (reply.msg_type () != ACE_Name_Request::MAX_ENUM) @@ -330,4 +330,3 @@ ACE_Remote_Name_Space::dump (void) const this->ns_proxy_.dump (); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } - diff --git a/ace/Remote_Name_Space.h b/ace/Remote_Name_Space.h index 3ba0b8edce9..154c57ece5c 100644 --- a/ace/Remote_Name_Space.h +++ b/ace/Remote_Name_Space.h @@ -48,12 +48,12 @@ public: ACE_Remote_Name_Space (void); // "Do-nothing" constructor. - ACE_Remote_Name_Space (const char *hostname, u_short port); + ACE_Remote_Name_Space (const ASYS_TCHAR *hostname, u_short port); // Specifies the scope of this namespace, opens and memory-maps the // associated file (if accessible) or contacts the dedicated name // server process for NET_LOCAL namespace. - int open (const char *servername, u_short port); + int open (const ASYS_TCHAR *servername, u_short port); // Specifies the scope of this namespace, opens and memory-maps the // associated file (if accessible) or contacts the dedicated name // server process for NET_LOCAL namespace. diff --git a/ace/Remote_Tokens.cpp b/ace/Remote_Tokens.cpp index 7e47be74ac0..d9476c4ee15 100644 --- a/ace/Remote_Tokens.cpp +++ b/ace/Remote_Tokens.cpp @@ -102,7 +102,7 @@ ACE_Remote_Token_Proxy::~ACE_Remote_Token_Proxy (void) } int -ACE_Remote_Token_Proxy::open (const char *name, +ACE_Remote_Token_Proxy::open (const ASYS_TCHAR *name, int ignore_deadlock, int debug) { @@ -125,7 +125,8 @@ ACE_Remote_Token_Proxy::initiate_connection (void) if (token_ == 0) { errno = ENOENT; - ACE_ERROR_RETURN ((LM_ERROR, "ACE_Remote_Token_Proxy not open.\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("ACE_Remote_Token_Proxy not open.\n")), -1); } ACE_SOCK_Stream *peer = ACE_Token_Connections::instance ()->get_connection (); @@ -211,8 +212,8 @@ ACE_Remote_Token_Proxy::acquire (int notify, default : ACE_ERROR_RETURN ((LM_ERROR, - "(%t) %p shadow acquire failed\n", - "ACE_Remote_Token_Proxy"), + ASYS_TEXT ("(%t) %p shadow acquire failed\n"), + ASYS_TEXT ("ACE_Remote_Token_Proxy")), -1); } } @@ -220,8 +221,8 @@ ACE_Remote_Token_Proxy::acquire (int notify, ACE_Token_Request request (token_->type (), this->type (), ACE_Token_Request::ACQUIRE, - this->name (), - this->client_id (), + ASYS_ONLY_MULTIBYTE_STRING (this->name ()), + ASYS_ONLY_MULTIBYTE_STRING (this->client_id ()), options); request.notify (notify); @@ -271,8 +272,8 @@ ACE_Remote_Token_Proxy::tryacquire (void (*sleep_hook)(void *)) ACE_Token_Request request (token_->type (), this->type (), ACE_Token_Request::RELEASE, - this->name (), - this->client_id (), + ASYS_ONLY_MULTIBYTE_STRING (this->name ()), + ASYS_ONLY_MULTIBYTE_STRING (this->client_id ()), ACE_Synch_Options::synch); return this->request_reply (request, @@ -293,15 +294,15 @@ ACE_Remote_Token_Proxy::renew (int requeue_position, return -1; else if (debug_) ACE_DEBUG ((LM_DEBUG, - "(%t) shadow: renew would block. owner %s.\n", + ASYS_TEXT ("(%t) shadow: renew would block. owner %s.\n"), this->token_->owner_id ())); } ACE_Token_Request request (token_->type (), this->type (), ACE_Token_Request::RENEW, - this->name (), - this->client_id (), + ASYS_ONLY_MULTIBYTE_STRING (this->name ()), + ASYS_ONLY_MULTIBYTE_STRING (this->client_id ()), options); request.requeue_position (requeue_position); @@ -316,8 +317,8 @@ ACE_Remote_Token_Proxy::renew (int requeue_position, ACE_Token_Proxy::release (); } ACE_ERROR_RETURN ((LM_ERROR, - "%p error on remote renew, releasing shadow mutex.\n", - "ACE_Remote_Token_Proxy"), -1); + ASYS_TEXT ("%p error on remote renew, releasing shadow mutex.\n"), + ASYS_TEXT ("ACE_Remote_Token_Proxy")), -1); } else { @@ -337,8 +338,8 @@ ACE_Remote_Token_Proxy::release (ACE_Synch_Options &options) ACE_Token_Request request (token_->type (), this->type (), ACE_Token_Request::RELEASE, - this->name (), - this->client_id (), + ASYS_ONLY_MULTIBYTE_STRING (this->name ()), + ASYS_ONLY_MULTIBYTE_STRING (this->client_id ()), options); int result = this->request_reply (request, options); @@ -349,7 +350,7 @@ ACE_Remote_Token_Proxy::release (ACE_Synch_Options &options) // If race conditions exist such that we are no longer the owner, // this release will perform a remove. if (ACE_Token_Proxy::release () == -1) - ACE_ERROR ((LM_ERROR, "(%t) shadow: release failed\n")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%t) shadow: release failed\n"))); return result; } @@ -371,7 +372,7 @@ ACE_Remote_Token_Proxy::token_acquired (ACE_TPQ_Entry *) // ACE_Token_Proxy::token_acquired (vp); } -const char* +const ASYS_TCHAR* ACE_Remote_Token_Proxy::owner_id (void) { ACE_TRACE ("ACE_Remote_Token_Proxy::owner_id"); @@ -386,8 +387,8 @@ ACE_Remote_Token_Proxy::dump (void) const ACE_TRACE ("ACE_Remote_Token_Proxy::owner_id"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("ACE_Tokens::dump:\n") - " ignore_shadow_deadlock_ = %d\n", - ignore_shadow_deadlock_)); + ASYS_TEXT (" ignore_shadow_deadlock_ = %d\n"), + ignore_shadow_deadlock_)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("base:\n"))); ACE_Token_Proxy::dump (); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); @@ -433,4 +434,3 @@ template class ACE_Singleton <ACE_TSS_Connection, ACE_TSS_CONNECTION_MUTEX>; #pragma instantiate ACE_TSS <ACE_SOCK_Stream> #pragma instantiate ACE_Singleton <ACE_TSS_Connection, ACE_TSS_CONNECTION_MUTEX> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - diff --git a/ace/Remote_Tokens.h b/ace/Remote_Tokens.h index f9fd4ee6664..4aa5dab587c 100644 --- a/ace/Remote_Tokens.h +++ b/ace/Remote_Tokens.h @@ -51,7 +51,7 @@ public: virtual ~ACE_Remote_Token_Proxy (void); // Death. - int open (const char *name, + int open (const ASYS_TCHAR *name, int ignore_deadlock = 0, int debug = 0); // Same as Token_Proxy. <name> is the string uniquely identifying @@ -113,7 +113,7 @@ public: virtual void token_acquired (ACE_TPQ_Entry *); // Override the default to do nothing. - virtual const char* owner_id (void); + virtual const ASYS_TCHAR* owner_id (void); // the client id of the current token holder static void set_server_address (const ACE_INET_Addr &server_address); @@ -153,7 +153,7 @@ public: ACE_Remote_Mutex (void); // Null creation. Remote_Token_Proxy::open must be called. - ACE_Remote_Mutex (const char *token_name, + ACE_Remote_Mutex (const ASYS_TCHAR *token_name, int ignore_deadlock = 0, int debug = 0); // Calls Remote_Token_Proxy::open for you. @@ -165,7 +165,7 @@ public: // Return deep copy. protected: - virtual ACE_Tokens *create_token (const char *name); + virtual ACE_Tokens *create_token (const ASYS_TCHAR *name); // Make the correct type of ACE_Tokens. This is called by the Token // Manager. }; @@ -186,7 +186,7 @@ class ACE_Export ACE_Remote_RLock : public ACE_Remote_Token_Proxy public: ACE_Remote_RLock (void); - ACE_Remote_RLock (const char *token_name, + ACE_Remote_RLock (const ASYS_TCHAR *token_name, int ignore_deadlock = 0, int debug = 0); @@ -202,7 +202,7 @@ public: // Return deep copy. protected: - virtual ACE_Tokens *create_token (const char *name); + virtual ACE_Tokens *create_token (const ASYS_TCHAR *name); // Make the correct type of ACE_Tokens. This is called by the Token // Manager. }; @@ -222,7 +222,7 @@ class ACE_Export ACE_Remote_WLock : public ACE_Remote_Token_Proxy public: ACE_Remote_WLock (void); - ACE_Remote_WLock (const char *token_name, + ACE_Remote_WLock (const ASYS_TCHAR *token_name, int ignore_deadlock = 0, int debug = 0); @@ -238,7 +238,7 @@ public: // Return deep copy. protected: - virtual ACE_Tokens *create_token (const char *name); + virtual ACE_Tokens *create_token (const ASYS_TCHAR *name); // Make the correct type of ACE_Tokens. This is called by the Token // Manager. }; diff --git a/ace/Remote_Tokens.i b/ace/Remote_Tokens.i index 2a87bf30919..5392280cbe0 100644 --- a/ace/Remote_Tokens.i +++ b/ace/Remote_Tokens.i @@ -10,7 +10,7 @@ ACE_Remote_Mutex::ACE_Remote_Mutex (void) } ACE_INLINE -ACE_Remote_Mutex::ACE_Remote_Mutex (const char *token_name, +ACE_Remote_Mutex::ACE_Remote_Mutex (const ASYS_TCHAR *token_name, int ignore_deadlock, int debug) { @@ -27,7 +27,7 @@ ACE_Remote_Mutex::clone (void) const } ACE_INLINE ACE_Tokens * -ACE_Remote_Mutex::create_token (const char *name) +ACE_Remote_Mutex::create_token (const ASYS_TCHAR *name) { return new ACE_Mutex_Token (name); } @@ -35,7 +35,7 @@ ACE_Remote_Mutex::create_token (const char *name) // ************************************************************ ACE_INLINE -ACE_Remote_RLock::ACE_Remote_RLock (const char *token_name, +ACE_Remote_RLock::ACE_Remote_RLock (const ASYS_TCHAR *token_name, int ignore_deadlock, int debug) { @@ -44,7 +44,7 @@ ACE_Remote_RLock::ACE_Remote_RLock (const char *token_name, } ACE_INLINE ACE_Tokens * -ACE_Remote_RLock::create_token (const char *name) +ACE_Remote_RLock::create_token (const ASYS_TCHAR *name) { return new ACE_RW_Token (name); } @@ -66,7 +66,7 @@ ACE_Remote_RLock::clone (void) const // ************************************************************ ACE_INLINE -ACE_Remote_WLock::ACE_Remote_WLock (const char *token_name, +ACE_Remote_WLock::ACE_Remote_WLock (const ASYS_TCHAR *token_name, int ignore_deadlock, int debug) { @@ -76,7 +76,7 @@ ACE_Remote_WLock::ACE_Remote_WLock (const char *token_name, ACE_INLINE ACE_Tokens * -ACE_Remote_WLock::create_token (const char *name) +ACE_Remote_WLock::create_token (const ASYS_TCHAR *name) { return new ACE_RW_Token (name); } @@ -94,5 +94,3 @@ ACE_Remote_WLock::clone (void) const ignore_deadlock_, debug_); } - - diff --git a/ace/SOCK_Dgram_Mcast.cpp b/ace/SOCK_Dgram_Mcast.cpp index 71d2056cbcb..0a184226281 100644 --- a/ace/SOCK_Dgram_Mcast.cpp +++ b/ace/SOCK_Dgram_Mcast.cpp @@ -106,7 +106,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_i (const ACE_INET_Addr &mcast_addr, { if (this->subscribe (mcast_addr, reuse_addr, - ASYS_WIDE_STRING ("0.0.0.0"), + ASYS_TEXT ("0.0.0.0"), protocol_family, protocol) == 0) ++nr_subscribed; diff --git a/ace/SPIPE_Connector.cpp b/ace/SPIPE_Connector.cpp index 8317a5afae1..8cb2c90822d 100644 --- a/ace/SPIPE_Connector.cpp +++ b/ace/SPIPE_Connector.cpp @@ -26,8 +26,8 @@ ACE_SPIPE_Connector::ACE_SPIPE_Connector (ACE_SPIPE_Stream &new_io, if (this->connect (new_io, remote_sap, timeout, local_sap, reuse_addr, flags, perms) == -1 && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, "address %s, %p\n", - remote_sap.get_path_name (), "ACE_SPIPE_Connector")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("address %s, %p\n"), + remote_sap.get_path_name (), ASYS_TEXT ("ACE_SPIPE_Connector"))); } void diff --git a/ace/SV_Message_Queue.cpp b/ace/SV_Message_Queue.cpp index 90aa454ddc6..60b0b05731a 100644 --- a/ace/SV_Message_Queue.cpp +++ b/ace/SV_Message_Queue.cpp @@ -28,12 +28,12 @@ ACE_SV_Message_Queue::~ACE_SV_Message_Queue (void) ACE_TRACE ("ACE_SV_Message_Queue::~ACE_SV_Message_Queue"); } -ACE_SV_Message_Queue::ACE_SV_Message_Queue (key_t external_id, - int create, +ACE_SV_Message_Queue::ACE_SV_Message_Queue (key_t external_id, + int create, int perms) { ACE_TRACE ("ACE_SV_Message_Queue::ACE_SV_Message_Queue"); if (this->open (external_id, create, perms) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SV_Message_Queue::ACE_SV_Message_Queue")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_SV_Message_Queue::ACE_SV_Message_Queue"))); } diff --git a/ace/SV_Semaphore_Simple.cpp b/ace/SV_Semaphore_Simple.cpp index aacec7f53fc..fda7b6b1cb0 100644 --- a/ace/SV_Semaphore_Simple.cpp +++ b/ace/SV_Semaphore_Simple.cpp @@ -21,8 +21,8 @@ ACE_SV_Semaphore_Simple::dump (void) const } int -ACE_SV_Semaphore_Simple::control (int cmd, - int value, +ACE_SV_Semaphore_Simple::control (int cmd, + int value, u_short semnum) const { ACE_TRACE ("ACE_SV_Semaphore_Simple::control"); @@ -34,7 +34,7 @@ ACE_SV_Semaphore_Simple::control (int cmd, semctl_arg.val = value; return ACE_OS::semctl (this->internal_id_, - semnum, + semnum, cmd, semctl_arg); } @@ -50,9 +50,9 @@ ACE_SV_Semaphore_Simple::init (key_t k, int i) } // General ACE_SV_Semaphore operation. Increment or decrement by a -// specific amount (positive or negative; amount can`t be zero). - -int +// specific amount (positive or negative; amount can`t be zero). + +int ACE_SV_Semaphore_Simple::op (int val, u_short n, int flags) const { ACE_TRACE ("ACE_SV_Semaphore_Simple::op"); @@ -72,11 +72,11 @@ ACE_SV_Semaphore_Simple::op (int val, u_short n, int flags) const // Open or create one or more SV_Semaphores. We return 0 if all is // OK, else -1. -int -ACE_SV_Semaphore_Simple::open (key_t k, - int flags, - int initial_value, - u_short n, +int +ACE_SV_Semaphore_Simple::open (key_t k, + int flags, + int initial_value, + u_short n, int perms) { ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); @@ -102,10 +102,10 @@ ACE_SV_Semaphore_Simple::open (key_t k, return 0; } -ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (key_t k, - int flags, - int initial_value, - u_short n, +ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (key_t k, + int flags, + int initial_value, + u_short n, int perms) : key_ (k) { @@ -121,11 +121,11 @@ ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (key_t k, // measured close to collition ratio of nearly 0.1% for // ACE::unique_name()-like strings. -key_t +key_t ACE_SV_Semaphore_Simple::name_2_key (const char *name) { ACE_TRACE ("ACE_SV_Semaphore_Simple::name_2_key"); - + if (name == 0) { errno = EINVAL; @@ -140,36 +140,36 @@ ACE_SV_Semaphore_Simple::name_2_key (const char *name) // Open or create a ACE_SV_Semaphore. We return 1 if all is OK, else // 0. - -int -ACE_SV_Semaphore_Simple::open (const char *name, - int flags, - int initial_value, - u_short n, + +int +ACE_SV_Semaphore_Simple::open (const char *name, + int flags, + int initial_value, + u_short n, int perms) { ACE_TRACE ("ACE_SV_Semaphore_Simple::open"); key_t key; - + if (name == 0) key = ACE_DEFAULT_SEM_KEY; - else + else key = this->name_2_key (name); return this->open (key, flags, initial_value, n, perms); } -ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (const char *name, - int flags, - int initial_value, - u_short n, +ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (const char *name, + int flags, + int initial_value, + u_short n, int perms) { ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"); if (this->open (name, flags, initial_value, n, perms) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"))); } ACE_SV_Semaphore_Simple::~ACE_SV_Semaphore_Simple (void) @@ -189,8 +189,8 @@ ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (void) // is being shut down, as we do an IPC_RMID on the ACE_SV_Semaphore, // regardless of whether other processes may be using it or not. Most // other processes should use close() below. - -int + +int ACE_SV_Semaphore_Simple::remove (void) const { ACE_TRACE ("ACE_SV_Semaphore_Simple::remove"); @@ -198,4 +198,3 @@ ACE_SV_Semaphore_Simple::remove (void) const ((ACE_SV_Semaphore_Simple *) this)->init (); return result; } - diff --git a/ace/SV_Shared_Memory.cpp b/ace/SV_Shared_Memory.cpp index 128b487415a..de4d8f070e1 100644 --- a/ace/SV_Shared_Memory.cpp +++ b/ace/SV_Shared_Memory.cpp @@ -22,11 +22,11 @@ ACE_SV_Shared_Memory::dump (void) const // this segment. int -ACE_SV_Shared_Memory::open_and_attach (key_t external_id, - size_t sz, +ACE_SV_Shared_Memory::open_and_attach (key_t external_id, + size_t sz, int create, - int perms, - void *virtual_addr, + int perms, + void *virtual_addr, int flags) { ACE_TRACE ("ACE_SV_Shared_Memory::open_and_attach"); @@ -40,24 +40,24 @@ ACE_SV_Shared_Memory::open_and_attach (key_t external_id, // Constructor interface to this->open_and_attach () member function. -ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (key_t external_id, - size_t sz, - int create, - int perms, - void *virtual_addr, +ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (key_t external_id, + size_t sz, + int create, + int perms, + void *virtual_addr, int flags) { ACE_TRACE ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"); - if (this->open_and_attach (external_id, sz, create, + if (this->open_and_attach (external_id, sz, create, perms, virtual_addr, flags) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SV_Shared_Memory::ACE_SV_Shared_Memory")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"))); } // The "do nothing" constructor. ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (void) - : internal_id_ (0), + : internal_id_ (0), size_ (0), segment_ptr_ (0) { @@ -73,11 +73,11 @@ ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (void) ACE_SV_Shared_Memory::ACE_SV_Shared_Memory (ACE_HANDLE int_id, int flags) - : internal_id_ (int_id), + : internal_id_ (int_id), size_ (0) { ACE_TRACE ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"); if (this->attach (0, flags) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_SV_Shared_Memory::ACE_SV_Shared_Memory")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_SV_Shared_Memory::ACE_SV_Shared_Memory"))); } diff --git a/ace/Stats.cpp b/ace/Stats.cpp index 7a4e830d074..45b7eb8258b 100644 --- a/ace/Stats.cpp +++ b/ace/Stats.cpp @@ -272,7 +272,7 @@ ACE_Stats::print_summary (const u_int precision, #if !defined (ACE_HAS_WINCE) ACE_OS::fprintf (file, ASYS_TEXT ("ACE_Stats::print_summary: OVERFLOW: %s\n"), - ASYS_TEXT (strerror (overflow_))); + ASYS_WIDE_STRING (strerror (overflow_))); #else // WinCE doesn't have strerror ;( ACE_OS::fprintf (file, @@ -542,12 +542,12 @@ ACE_Throughput_Stats::accumulate (const ACE_Throughput_Stats &rhs) } void -ACE_Throughput_Stats::dump_results (const char* msg, +ACE_Throughput_Stats::dump_results (const ASYS_TCHAR* msg, ACE_UINT32 sf) { if (this->samples_count_ == 0) { - ACE_DEBUG ((LM_DEBUG, "%s : no data collected\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%s : no data collected\n"))); return; } @@ -572,7 +572,7 @@ ACE_Throughput_Stats::dump_results (const char* msg, double l_dev = ACE_CU64_TO_CU32 (latency_dev) / (sf * sf); ACE_DEBUG ((LM_DEBUG, - "%s latency: %.2f/%.2f/%.2f/%.2f (min/avg/max/var^2)\n", + ASYS_TEXT ("%s latency: %.2f/%.2f/%.2f/%.2f (min/avg/max/var^2)\n"), msg, l_min, l_avg, l_max, l_dev)); double seconds = @@ -586,7 +586,7 @@ ACE_Throughput_Stats::dump_results (const char* msg, double t_avg = ACE_CU64_TO_CU32 (this->samples_count_) / seconds; ACE_DEBUG ((LM_DEBUG, - "%s throughput: %.2f (events/second)\n", + ASYS_TEXT ("%s throughput: %.2f (events/second)\n"), msg, t_avg)); #if 0 diff --git a/ace/Stats.h b/ace/Stats.h index f4ece2f48e5..83feaea3939 100644 --- a/ace/Stats.h +++ b/ace/Stats.h @@ -194,12 +194,12 @@ class ACE_Export ACE_Throughput_Stats // A simple class to make throughput and latency analysis. // // = DESCRIPTION - // Keep the relevant information to perform throughput and latency + // Keep the relevant information to perform throughput and latency // analysis, including: // 1) Minimum, Average and Maximum latency // 2) Jitter for the latency // 3) Linear regression for throughput - // 4) Accumulate results from several samples to obtain aggregated + // 4) Accumulate results from several samples to obtain aggregated // results, across several threads or experiments. // public: @@ -212,7 +212,7 @@ public: void accumulate (const ACE_Throughput_Stats &throughput); // Update the values to reflect the stats in <throughput> - void dump_results (const char* msg, ACE_UINT32 scale_factor); + void dump_results (const ASYS_TCHAR* msg, ACE_UINT32 scale_factor); // Print down the stats private: diff --git a/ace/Strategies_T.cpp b/ace/Strategies_T.cpp index 47a832cbb99..73b4dfb579b 100644 --- a/ace/Strategies_T.cpp +++ b/ace/Strategies_T.cpp @@ -206,7 +206,7 @@ ACE_Thread_Strategy<SVC_HANDLER>::open (ACE_Thread_Manager *thr_mgr, // Must have a thread manager! if (this->thr_mgr_ == 0) ACE_ERROR_RETURN ((LM_ERROR, - "error: must have a non-NULL thread manager\n"), + ASYS_TEXT ("error: must have a non-NULL thread manager\n")), -1); else return 0; diff --git a/ace/Strategies_T.i b/ace/Strategies_T.i index b5ef316cd1c..c456700a6f3 100644 --- a/ace/Strategies_T.i +++ b/ace/Strategies_T.i @@ -125,8 +125,8 @@ ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy (ACE_Reactor *reactor, ACE_TRACE ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy"); if (this->open (reactor, mask, flags) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Reactive_Strategy<SVC_HANDLER>::ACE_Reactive_Strategy"))); } template <class SVC_HANDLER> ASYS_INLINE @@ -153,8 +153,9 @@ ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy (ACE_Thread_Manager *thr_m ACE_TRACE ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy"); if (this->open (thr_mgr, thr_flags, n_threads, flags) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", - "ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_Thread_Strategy<SVC_HANDLER>::ACE_Thread_Strategy"))); } template <class SVC_HANDLER> ASYS_INLINE diff --git a/ace/Svc_Conf.h b/ace/Svc_Conf.h index 76da4a83507..315e5f36063 100644 --- a/ace/Svc_Conf.h +++ b/ace/Svc_Conf.h @@ -108,4 +108,3 @@ typedef union } ACE_YYSTYPE; extern ACE_YYSTYPE ace_yylval; #endif /* ACE_SVC_CONF_H */ - diff --git a/ace/Svc_Conf.y b/ace/Svc_Conf.y index a936a9a2047..908cbb5d721 100644 --- a/ace/Svc_Conf.y +++ b/ace/Svc_Conf.y @@ -12,7 +12,7 @@ ACE_RCSID(ace, Svc_Conf_y, "$Id$") static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type); static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, - const char *svc_name); + const ASYS_TCHAR *svc_name); #define YYDEBUG_LEXER_TEXT (yytext[yyleng] = '\0', yytext) @@ -69,7 +69,7 @@ dynamic : ACE_DYNAMIC svc_location parameters_opt { if ($2 != 0) - $$ = new ACE_Dynamic_Node ($2, $3); + $$ = new ACE_Dynamic_Node ($2, ASYS_WIDE_STRING ($3)); else $$ = 0; } @@ -78,28 +78,28 @@ dynamic static : ACE_STATIC ACE_IDENT parameters_opt { - $$ = new ACE_Static_Node ($2, $3); + $$ = new ACE_Static_Node (ASYS_WIDE_STRING ($2), ASYS_WIDE_STRING ($3)); } ; suspend : ACE_SUSPEND ACE_IDENT { - $$ = new ACE_Suspend_Node ($2); + $$ = new ACE_Suspend_Node (ASYS_WIDE_STRING ($2)); } ; resume : ACE_RESUME ACE_IDENT { - $$ = new ACE_Resume_Node ($2); + $$ = new ACE_Resume_Node (ASYS_WIDE_STRING ($2)); } ; remove : ACE_REMOVE ACE_IDENT { - $$ = new ACE_Remove_Node ($2); + $$ = new ACE_Remove_Node (ASYS_WIDE_STRING ($2)); } ; @@ -108,7 +108,7 @@ stream { $$ = new ACE_Stream_Node ($2, $3); } - | ACE_USTREAM ACE_IDENT { $<static_node_>$ = new ACE_Static_Node ($2); } stream_modules + | ACE_USTREAM ACE_IDENT { $<static_node_>$ = new ACE_Static_Node (ASYS_WIDE_STRING ($2)); } stream_modules { $$ = new ACE_Dummy_Node ($<static_node_>3, $4); } @@ -157,7 +157,7 @@ module { ACE_Static_Node *module = $<static_node_>-1; - ACE_ARGV args (ASYS_WIDE_STRING (svc_type->parameters ())); + ACE_ARGV args (svc_type->parameters ()); ACE_Module_Type *mt = ace_get_module (module, svc_type); ACE_Stream_Type *st = @@ -170,7 +170,7 @@ module { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("dynamic initialization failed for Module %s\n"), - ASYS_WIDE_STRING (svc_type->name ()))); + svc_type->name ())); yyerrno++; } } @@ -215,8 +215,8 @@ module { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("cannot remove Module_Type %s from STREAM_Type %s\n"), - ASYS_WIDE_STRING (module->name ()), - ASYS_WIDE_STRING (stream->name ()))); + module->name (), + stream->name ())); yyerrno++; } } @@ -274,15 +274,15 @@ status svc_initializer : pathname ACE_COLON ACE_IDENT { - $$ = new ACE_Object_Node ($1, $3); + $$ = new ACE_Object_Node (ASYS_WIDE_STRING ($1), ASYS_WIDE_STRING($3)); } | pathname ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN { - $$ = new ACE_Function_Node ($1, $3); + $$ = new ACE_Function_Node (ASYS_WIDE_STRING ($1), ASYS_WIDE_STRING ($3)); } | ACE_COLON ACE_IDENT ACE_LPAREN ACE_RPAREN { - $$ = new ACE_Static_Function_Node ($2); + $$ = new ACE_Static_Function_Node (ASYS_WIDE_STRING ($2)); } ; @@ -334,7 +334,7 @@ yyerror (const char *s) static ACE_Module_Type * ace_get_module (ACE_Static_Node *str_rec, - const char *svc_name) + const ASYS_TCHAR *svc_name) { const ACE_Service_Type *sr = str_rec->record (); const ACE_Service_Type_Impl *type = sr->type (); @@ -343,14 +343,14 @@ ace_get_module (ACE_Static_Node *str_rec, : ACE_dynamic_cast (ACE_Stream_Type *, ACE_const_cast (ACE_Service_Type_Impl *, type)); - ACE_Module_Type *mt = st == 0 ? 0 : st->find (ASYS_WIDE_STRING (svc_name)); + ACE_Module_Type *mt = st == 0 ? 0 : st->find (svc_name); if (sr == 0 || st == 0 || mt == 0) { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("cannot locate Module_Type %s in STREAM_Type %s\n"), - ASYS_WIDE_STRING (svc_name), - ASYS_WIDE_STRING (str_rec->name ()))); + svc_name, + str_rec->name ())); yyerrno++; } @@ -367,14 +367,14 @@ ace_get_module (ACE_Static_Node *str_rec, const ACE_Service_Type *sv = svc_type->record (); type = sv->type (); ACE_Module_Type *mt = (ACE_Module_Type *) type; - const char *module_type_name = svc_type->name (); + const ASYS_TCHAR *module_type_name = svc_type->name (); if (sr == 0 || st == 0 || mt == 0) { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("cannot locate Module_Type %s or STREAM_Type %s\n"), - ASYS_WIDE_STRING (module_type_name), - ASYS_WIDE_STRING (str_rec->name ()))); + module_type_name, + str_rec->name ())); yyerrno++; } @@ -382,13 +382,13 @@ ace_get_module (ACE_Static_Node *str_rec, // Module_Type object from the svc.conf file. ACE_Module<ACE_SYNCH> *mp = (ACE_Module<ACE_SYNCH> *) mt->object (); - if (ACE_OS::strcmp (mp->name (), ASYS_WIDE_STRING (module_type_name)) != 0) + if (ACE_OS::strcmp (mp->name (), module_type_name) != 0) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("warning: assigning Module_Type name %s to Module %s since names differ\n"), - ASYS_WIDE_STRING (module_type_name), + module_type_name, mp->name ())); - mp->name (ASYS_WIDE_STRING (module_type_name)); + mp->name (module_type_name); } return mt; @@ -440,7 +440,7 @@ ace_create_service_type (const ASYS_TCHAR *name, int yylineno = 1; // Name given on the command-line to envoke the program. -char *program_name; +ASYS_TCHAR *program_name; // Main driver program. diff --git a/ace/Svc_Conf_y.cpp b/ace/Svc_Conf_y.cpp index 9083f7fd7e1..a17da8b62ab 100644 --- a/ace/Svc_Conf_y.cpp +++ b/ace/Svc_Conf_y.cpp @@ -16,7 +16,7 @@ ACE_RCSID(ace, Svc_Conf_y, "$Id$") static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, ACE_Static_Node *svc_type); static ACE_Module_Type *ace_get_module (ACE_Static_Node *str_rec, - const char *svc_name); + const ASYS_TCHAR *svc_name); #define ACE_YYDEBUG_LEXER_TEXT (ace_yytext[ace_yyleng] = '\0', ace_yytext) @@ -273,7 +273,7 @@ ace_yyerror (const char *s) static ACE_Module_Type * ace_get_module (ACE_Static_Node *str_rec, - const char *svc_name) + const ASYS_TCHAR *svc_name) { const ACE_Service_Type *sr = str_rec->record (); const ACE_Service_Type_Impl *type = sr->type (); @@ -282,14 +282,14 @@ ace_get_module (ACE_Static_Node *str_rec, : ACE_dynamic_cast (ACE_Stream_Type *, ACE_const_cast (ACE_Service_Type_Impl *, type)); - ACE_Module_Type *mt = st == 0 ? 0 : st->find (ASYS_WIDE_STRING (svc_name)); + ACE_Module_Type *mt = st == 0 ? 0 : st->find (svc_name); if (sr == 0 || st == 0 || mt == 0) { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("cannot locate Module_Type %s in STREAM_Type %s\n"), - ASYS_WIDE_STRING (svc_name), - ASYS_WIDE_STRING (str_rec->name ()))); + svc_name, + str_rec->name ())); ace_yyerrno++; } @@ -306,14 +306,14 @@ ace_get_module (ACE_Static_Node *str_rec, const ACE_Service_Type *sv = svc_type->record (); type = sv->type (); ACE_Module_Type *mt = (ACE_Module_Type *) type; - const char *module_type_name = svc_type->name (); + const ASYS_TCHAR *module_type_name = svc_type->name (); if (sr == 0 || st == 0 || mt == 0) { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("cannot locate Module_Type %s or STREAM_Type %s\n"), - ASYS_WIDE_STRING (module_type_name), - ASYS_WIDE_STRING (str_rec->name ()))); + module_type_name, + str_rec->name ())); ace_yyerrno++; } @@ -321,13 +321,13 @@ ace_get_module (ACE_Static_Node *str_rec, // Module_Type object from the svc.conf file. ACE_Module<ACE_SYNCH> *mp = (ACE_Module<ACE_SYNCH> *) mt->object (); - if (ACE_OS::strcmp (mp->name (), ASYS_WIDE_STRING (module_type_name)) != 0) + if (ACE_OS::strcmp (mp->name (), module_type_name) != 0) { ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("warning: assigning Module_Type name %s to Module %s since names differ\n"), - ASYS_WIDE_STRING (module_type_name), + module_type_name, mp->name ())); - mp->name (ASYS_WIDE_STRING (module_type_name)); + mp->name (module_type_name); } return mt; @@ -379,7 +379,7 @@ ace_create_service_type (const ASYS_TCHAR *name, int ace_yylineno = 1; // Name given on the command-line to envoke the program. -char *program_name; +ASYS_TCHAR *program_name; // Main driver program. @@ -722,7 +722,7 @@ case 10: #line 70 "Svc_Conf.y" { if (ace_yyvsp[-1].svc_record_ != 0) - ace_yyval.parse_node_ = new ACE_Dynamic_Node (ace_yyvsp[-1].svc_record_, ace_yyvsp[0].ident_); + ace_yyval.parse_node_ = new ACE_Dynamic_Node (ace_yyvsp[-1].svc_record_, ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); else ace_yyval.parse_node_ = 0; } @@ -730,25 +730,25 @@ break; case 11: #line 80 "Svc_Conf.y" { - ace_yyval.parse_node_ = new ACE_Static_Node (ace_yyvsp[-1].ident_, ace_yyvsp[0].ident_); + ace_yyval.parse_node_ = new ACE_Static_Node (ASYS_WIDE_STRING (ace_yyvsp[-1].ident_), ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); } break; case 12: #line 87 "Svc_Conf.y" { - ace_yyval.parse_node_ = new ACE_Suspend_Node (ace_yyvsp[0].ident_); + ace_yyval.parse_node_ = new ACE_Suspend_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); } break; case 13: #line 94 "Svc_Conf.y" { - ace_yyval.parse_node_ = new ACE_Resume_Node (ace_yyvsp[0].ident_); + ace_yyval.parse_node_ = new ACE_Resume_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); } break; case 14: #line 101 "Svc_Conf.y" { - ace_yyval.parse_node_ = new ACE_Remove_Node (ace_yyvsp[0].ident_); + ace_yyval.parse_node_ = new ACE_Remove_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); } break; case 15: @@ -759,7 +759,7 @@ case 15: break; case 16: #line 111 "Svc_Conf.y" -{ ace_yyval.static_node_ = new ACE_Static_Node (ace_yyvsp[0].ident_); } +{ ace_yyval.static_node_ = new ACE_Static_Node (ASYS_WIDE_STRING (ace_yyvsp[0].ident_)); } break; case 17: #line 112 "Svc_Conf.y" @@ -817,7 +817,7 @@ case 25: { ACE_Static_Node *module = ace_yyvsp[-2].static_node_; - ACE_ARGV args (ASYS_WIDE_STRING (svc_type->parameters ())); + ACE_ARGV args (svc_type->parameters ()); ACE_Module_Type *mt = ace_get_module (module, svc_type); ACE_Stream_Type *st = @@ -830,7 +830,7 @@ case 25: { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("dynamic initialization failed for Module %s\n"), - ASYS_WIDE_STRING (svc_type->name ()))); + svc_type->name ())); ace_yyerrno++; } } @@ -883,8 +883,8 @@ case 29: { ACE_ERROR ((LM_ERROR, ASYS_TEXT ("cannot remove Module_Type %s from STREAM_Type %s\n"), - ASYS_WIDE_STRING (module->name ()), - ASYS_WIDE_STRING (stream->name ()))); + module->name (), + stream->name ())); ace_yyerrno++; } } @@ -943,19 +943,19 @@ break; case 34: #line 276 "Svc_Conf.y" { - ace_yyval.location_node_ = new ACE_Object_Node (ace_yyvsp[-2].ident_, ace_yyvsp[0].ident_); + ace_yyval.location_node_ = new ACE_Object_Node (ASYS_WIDE_STRING (ace_yyvsp[-2].ident_), ASYS_WIDE_STRING(ace_yyvsp[0].ident_)); } break; case 35: #line 280 "Svc_Conf.y" { - ace_yyval.location_node_ = new ACE_Function_Node (ace_yyvsp[-4].ident_, ace_yyvsp[-2].ident_); + ace_yyval.location_node_ = new ACE_Function_Node (ASYS_WIDE_STRING (ace_yyvsp[-4].ident_), ASYS_WIDE_STRING (ace_yyvsp[-2].ident_)); } break; case 36: #line 284 "Svc_Conf.y" { - ace_yyval.location_node_ = new ACE_Static_Function_Node (ace_yyvsp[-2].ident_); + ace_yyval.location_node_ = new ACE_Static_Function_Node (ASYS_WIDE_STRING (ace_yyvsp[-2].ident_)); } break; case 37: diff --git a/ace/Token_Collection.cpp b/ace/Token_Collection.cpp index e275942ea22..d7317b1f590 100644 --- a/ace/Token_Collection.cpp +++ b/ace/Token_Collection.cpp @@ -11,20 +11,20 @@ ACE_RCSID(ace, Token_Collection, "$Id$") ACE_Token_Collection::ACE_Token_Collection (int debug, - const char *name) + const ASYS_TCHAR *name) : debug_ (debug) { ACE_TRACE ("ACE_Token_Collection::ACE_Token_Collection"); if (name == 0) - name = "no name"; + name = ASYS_TEXT ("no name"); int n = ACE_OS::strlen (name) + 1; if (n >= ACE_MAXTOKENNAMELEN) n = ACE_MAXTOKENNAMELEN - 1; - ACE_OS::strncpy (this->name_, (char *) name, n); + ACE_OS::strncpy (this->name_, ACE_const_cast (ASYS_TCHAR*, name), n); this->name_[ACE_MAXTOKENNAMELEN - 1] = '\0'; } @@ -44,12 +44,12 @@ ACE_Token_Collection::insert (ACE_Token_Proxy &new_token) ACE_Token_Proxy *temp = new_token.clone (); if (collection_.bind (name, temp) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "bind failed\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("bind failed\n")), -1); return 0; } int -ACE_Token_Collection::extract (const char *token_name, ACE_Token_Proxy *&proxy) +ACE_Token_Collection::extract (const ASYS_TCHAR *token_name, ACE_Token_Proxy *&proxy) { ACE_TRACE ("ACE_Token_Collection::extract"); TOKEN_NAME name (token_name); @@ -57,7 +57,7 @@ ACE_Token_Collection::extract (const char *token_name, ACE_Token_Proxy *&proxy) } ACE_Token_Proxy * -ACE_Token_Collection::is_member (const char *token_name) +ACE_Token_Collection::is_member (const ASYS_TCHAR *token_name) { ACE_TRACE ("ACE_Token_Collection::is_member"); TOKEN_NAME name (token_name); @@ -106,7 +106,7 @@ ACE_Token_Collection::acquire (int notify, } int -ACE_Token_Collection::acquire (const char *token_name, +ACE_Token_Collection::acquire (const ASYS_TCHAR *token_name, int notify, void (*sleep_hook)(void *), ACE_Synch_Options &options) @@ -125,7 +125,7 @@ ACE_Token_Collection::acquire (const char *token_name, int -ACE_Token_Collection::tryacquire (const char *token_name, +ACE_Token_Collection::tryacquire (const ASYS_TCHAR *token_name, void (*sleep_hook)(void *)) { ACE_TRACE ("ACE_Token_Collection::tryacquire"); @@ -186,7 +186,7 @@ ACE_Token_Collection::renew (int requeue_position, } int -ACE_Token_Collection::renew (const char *token_name, +ACE_Token_Collection::renew (const ASYS_TCHAR *token_name, int requeue_position, ACE_Synch_Options &options) { @@ -199,8 +199,8 @@ ACE_Token_Collection::renew (const char *token_name, // Did we find it? if (result == -1) - ACE_ERROR_RETURN ((LM_DEBUG, "%p %s\n", - "not in collection ", + ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p %s\n"), + ASYS_TEXT ("not in collection "), token_name), -1); // perform the operation return temp->renew (requeue_position, options); @@ -227,7 +227,7 @@ ACE_Token_Collection::release (ACE_Synch_Options &) } int -ACE_Token_Collection::release (const char *token_name, +ACE_Token_Collection::release (const ASYS_TCHAR *token_name, ACE_Synch_Options &options) { ACE_TRACE ("ACE_Token_Collection::release"); @@ -268,7 +268,7 @@ ACE_Token_Collection::clone (void) const // This method doesn't mean anything for a collection. ACE_Tokens * -ACE_Token_Collection::create_token (const char *) +ACE_Token_Collection::create_token (const ASYS_TCHAR *) { ACE_TRACE ("ACE_Token_Collection::create_token"); return (ACE_Tokens *) 0; @@ -280,7 +280,7 @@ ACE_Token_Collection::dump (void) const ACE_TRACE ("ACE_Token_Collection::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("ACE_Token_Collection::dump:\n") - " debug_ = %d\n", debug_)); + ASYS_TEXT (" debug_ = %d\n"), debug_)); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("collection_\n"))); collection_.dump (); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("base:\n"))); @@ -301,4 +301,3 @@ template class ACE_Map_Entry<ACE_Token_Name, ACE_Token_Proxy *>; #pragma instantiate ACE_Map_Reverse_Iterator<ACE_Token_Name, ACE_Token_Proxy *, ACE_Null_Mutex> #pragma instantiate ACE_Map_Entry<ACE_Token_Name, ACE_Token_Proxy *> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - diff --git a/ace/Token_Collection.h b/ace/Token_Collection.h index ecc02f2231b..075cee8757d 100644 --- a/ace/Token_Collection.h +++ b/ace/Token_Collection.h @@ -59,7 +59,7 @@ class ACE_Export ACE_Token_Collection : public ACE_Token_Proxy // returns zero for now. public: ACE_Token_Collection (int debug = 0, - const char *name = 0); + const ASYS_TCHAR *name = 0); // <debug> print out verbose debugging messages. <name> will give a // name to the collection. Collections don't really need names, but // are sometimes useful for debugging. @@ -79,14 +79,14 @@ public: // thread using the collection will be used. Client ID's can be // changed explicity on each proxy using is_member. - int extract (const char *token_name, ACE_Token_Proxy *&proxy); + int extract (const ASYS_TCHAR *token_name, ACE_Token_Proxy *&proxy); // removes the ACE_Token matching the given token_name from the // collection. On success, extract returns 0. On failure // (token_name was not in the collection,) extract returns -1. On // success, the state of the token found is copied into proxy. // The returned ACE_Token_Proxy* must be deleted by the user. - ACE_Token_Proxy *is_member (const char *token_name); + ACE_Token_Proxy *is_member (const ASYS_TCHAR *token_name); // returns the proxy if true. 0 otherwise. int is_member (const ACE_Token_Proxy &token); @@ -124,7 +124,7 @@ public: // words, once the collection reports deadlock, it is out of our // hands. - virtual int acquire (const char *token_name, + virtual int acquire (const ASYS_TCHAR *token_name, int notify = 0, void (*sleep_hook)(void *) = 0, ACE_Synch_Options &options = @@ -135,7 +135,7 @@ public: virtual int tryacquire (void (*sleep_hook)(void *) = 0); // Try to acquire all tokens in collection. - virtual int tryacquire (const char *token_name, + virtual int tryacquire (const ASYS_TCHAR *token_name, void (*sleep_hook)(void *) = 0); // Try to acquire <token_name>. @@ -149,7 +149,7 @@ public: // problem. - virtual int renew (const char *token_name, + virtual int renew (const ASYS_TCHAR *token_name, int requeue_position = 0, ACE_Synch_Options &options = ACE_Synch_Options::defaults); @@ -165,7 +165,7 @@ public: // problem. - virtual int release (const char *token_name, + virtual int release (const ASYS_TCHAR *token_name, ACE_Synch_Options &options = ACE_Synch_Options::defaults); // Release the token corresponding to <token_name>. The other @@ -176,7 +176,7 @@ public: void dump (void) const; // Dump the state of the class. - virtual const char *name (void) const; + virtual const ASYS_TCHAR *name (void) const; // Return the name of the collection. Not very functionally // important, but sometimes a useful debugging tool. @@ -202,13 +202,13 @@ protected: int debug_; // Whether to print out debug messages or not. - char name_[ACE_MAXTOKENNAMELEN]; + ASYS_TCHAR name_[ACE_MAXTOKENNAMELEN]; // Name of the collection. // = I'm not sure what these mean, but they have to be defined since they're // pure virtual in ACE_Token_Proxy. virtual ACE_Token_Proxy *clone (void) const; - virtual ACE_Tokens *create_token (const char *name); + virtual ACE_Tokens *create_token (const ASYS_TCHAR *name); }; #if defined (__ACE_INLINE__) diff --git a/ace/Token_Collection.i b/ace/Token_Collection.i index f871206c4d8..b10735660bc 100644 --- a/ace/Token_Collection.i +++ b/ace/Token_Collection.i @@ -3,9 +3,8 @@ // Token_Collection.i -ACE_INLINE const char * +ACE_INLINE const ASYS_TCHAR * ACE_Token_Collection::name (void) const { return name_; } - diff --git a/ace/Token_Invariants.cpp b/ace/Token_Invariants.cpp index 19257569899..c9d093664a1 100644 --- a/ace/Token_Invariants.cpp +++ b/ace/Token_Invariants.cpp @@ -45,7 +45,7 @@ ACE_Token_Invariant_Manager::ACE_Token_Invariant_Manager (void) } int -ACE_Token_Invariant_Manager::mutex_acquired (const char *token_name) +ACE_Token_Invariant_Manager::mutex_acquired (const ASYS_TCHAR *token_name) { ACE_TRACE ("ACE_Token_Invariant_Manager::mutex_acquired"); @@ -88,7 +88,7 @@ ACE_Token_Invariant_Manager::releasing (const ACE_Token_Proxy *proxy) } void -ACE_Token_Invariant_Manager::mutex_releasing (const char *token_name) +ACE_Token_Invariant_Manager::mutex_releasing (const ASYS_TCHAR *token_name) { ACE_TRACE ("ACE_Token_Invariant_Manager::mutex_releasing"); ACE_GUARD (ACE_TOKEN_CONST::MUTEX, ace_mon, this->lock_); @@ -99,7 +99,7 @@ ACE_Token_Invariant_Manager::mutex_releasing (const char *token_name) } int -ACE_Token_Invariant_Manager::reader_acquired (const char *token_name) +ACE_Token_Invariant_Manager::reader_acquired (const ASYS_TCHAR *token_name) { ACE_TRACE ("ACE_Token_Invariant_Manager::reader_acquired"); ACE_GUARD_RETURN (ACE_TOKEN_CONST::MUTEX, ace_mon, this->lock_, -1); @@ -112,7 +112,7 @@ ACE_Token_Invariant_Manager::reader_acquired (const char *token_name) } int -ACE_Token_Invariant_Manager::writer_acquired (const char *token_name) +ACE_Token_Invariant_Manager::writer_acquired (const ASYS_TCHAR *token_name) { ACE_TRACE ("ACE_Token_Invariant_Manager::writer_acquired"); @@ -126,7 +126,7 @@ ACE_Token_Invariant_Manager::writer_acquired (const char *token_name) } void -ACE_Token_Invariant_Manager::rwlock_releasing (const char *token_name) +ACE_Token_Invariant_Manager::rwlock_releasing (const ASYS_TCHAR *token_name) { ACE_TRACE ("ACE_Token_Invariant_Manager::rwlock_releasing"); @@ -151,7 +151,7 @@ ACE_Token_Invariant_Manager::dump (void) const int -ACE_Token_Invariant_Manager::get_mutex (const char *token_name, +ACE_Token_Invariant_Manager::get_mutex (const ASYS_TCHAR *token_name, ACE_Mutex_Invariants *&inv) { ACE_TRACE ("ACE_Token_Invariant_Manager::get_mutex"); @@ -179,7 +179,7 @@ ACE_Token_Invariant_Manager::get_mutex (const char *token_name, } int -ACE_Token_Invariant_Manager::get_rwlock (const char *token_name, +ACE_Token_Invariant_Manager::get_rwlock (const ASYS_TCHAR *token_name, ACE_RWLock_Invariants *&inv) { ACE_TRACE ("ACE_Token_Invariant_Manager::get_rwlock"); diff --git a/ace/Token_Invariants.h b/ace/Token_Invariants.h index 8dc667a9d47..1ad9aacf5e4 100644 --- a/ace/Token_Invariants.h +++ b/ace/Token_Invariants.h @@ -138,22 +138,22 @@ public: // = Explicit methods. These to not require actual proxies in order // to test a scenario. - int mutex_acquired (const char *token_name); + int mutex_acquired (const ASYS_TCHAR *token_name); // Returns 1 on success, 0 when an invariant has been violated and // -1 on error. - void mutex_releasing (const char *token_name); + void mutex_releasing (const ASYS_TCHAR *token_name); // Updates internal database. - int reader_acquired (const char *token_name); + int reader_acquired (const ASYS_TCHAR *token_name); // Returns 1 on success, 0 when an invariant has been violated and // -1 on error. - int writer_acquired (const char *token_name); + int writer_acquired (const ASYS_TCHAR *token_name); // Returns 1 on success, 0 when an invariant has been violated and // -1 on error. - void rwlock_releasing (const char *token_name); + void rwlock_releasing (const ASYS_TCHAR *token_name); // Updates internal database. void dump (void) const; @@ -168,11 +168,11 @@ public: // Destruction. protected: - int get_mutex (const char *token_name, + int get_mutex (const ASYS_TCHAR *token_name, ACE_Mutex_Invariants *&inv); // Return or create. - int get_rwlock (const char *token_name, + int get_rwlock (const ASYS_TCHAR *token_name, ACE_RWLock_Invariants *&inv); // Return or create. diff --git a/ace/UPIPE_Acceptor.cpp b/ace/UPIPE_Acceptor.cpp index 46f932138ea..c102e6d089a 100644 --- a/ace/UPIPE_Acceptor.cpp +++ b/ace/UPIPE_Acceptor.cpp @@ -22,7 +22,7 @@ ACE_UPIPE_Acceptor::dump (void) const /* Do nothing routine for constructor. */ -ACE_UPIPE_Acceptor::ACE_UPIPE_Acceptor (void) +ACE_UPIPE_Acceptor::ACE_UPIPE_Acceptor (void) : mb_ (sizeof (ACE_UPIPE_Stream *)) { ACE_TRACE ("ACE_UPIPE_Acceptor::ACE_UPIPE_Acceptor"); @@ -36,7 +36,7 @@ ACE_UPIPE_Acceptor::~ACE_UPIPE_Acceptor (void) // General purpose routine for performing server ACE_UPIPE. int -ACE_UPIPE_Acceptor::open (const ACE_UPIPE_Addr &local_addr, +ACE_UPIPE_Acceptor::open (const ACE_UPIPE_Addr &local_addr, int reuse_addr) { ACE_TRACE ("ACE_UPIPE_Acceptor::open"); @@ -59,13 +59,15 @@ ACE_UPIPE_Acceptor::ACE_UPIPE_Acceptor (const ACE_UPIPE_Addr &local_addr, ACE_TRACE ("ACE_UPIPE_Acceptor::ACE_UPIPE_Acceptor"); if (this->open (local_addr, reuse_addr) == -1) - ACE_ERROR ( (LM_ERROR, "%p\n", "ACE_UPIPE_Acceptor")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ACE_UPIPE_Acceptor"))); } int ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream, ACE_UPIPE_Addr *remote_addr, - ACE_Time_Value *timeout, + ACE_Time_Value *timeout, int restart, int reset_new_handle) { @@ -74,7 +76,7 @@ ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream, ACE_SPIPE_Stream new_io; - if (this->ACE_SPIPE_Acceptor::accept (new_io, remote_addr, + if (this->ACE_SPIPE_Acceptor::accept (new_io, remote_addr, timeout, restart) == -1) return -1; else @@ -83,32 +85,32 @@ ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream, ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, new_stream.lock_, -1)); - new_stream.set_handle (new_io.get_handle ()); - new_stream.reference_count_++; + new_stream.set_handle (new_io.get_handle ()); + new_stream.reference_count_++; // Transfer address ownership. new_io.get_local_addr (new_stream.local_addr_); new_io.get_remote_addr (new_stream.remote_addr_); - + // Now that we got the handle, we'll read the address of the // connector-side ACE_UPIPE_Stream out of the pipe and link that // ACE_UPIPE_Stream to our ACE_UPIPE_Stream. - if (ACE_OS::read (new_stream.get_handle (), + if (ACE_OS::read (new_stream.get_handle (), (char *) &remote_stream, sizeof remote_stream) == -1) - ACE_ERROR ((LM_ERROR, - "ACE_UPIPE_Acceptor: %p\n", - "read stream address failed")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("ACE_UPIPE_Acceptor: %p\n"), + ASYS_TEXT ("read stream address failed"))); else if (new_stream.stream_.link (remote_stream->stream_) == -1) - ACE_ERROR ((LM_ERROR, - "ACE_UPIPE_Acceptor: %p\n", - "link streams failed")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("ACE_UPIPE_Acceptor: %p\n"), + ASYS_TEXT ("link streams failed"))); // Send a message over the new streampipe to confirm acceptance. else if (new_stream.send (&mb_, 0) == -1) - ACE_ERROR ((LM_ERROR, - "ACE_UPIPE_Acceptor: %p\n", - "linked stream.put failed")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("ACE_UPIPE_Acceptor: %p\n"), + ASYS_TEXT ("linked stream.put failed"))); // Close down the new_stream at this point in order to conserve // handles. Note that we don't need the SPIPE connection @@ -119,9 +121,3 @@ ACE_UPIPE_Acceptor::accept (ACE_UPIPE_Stream &new_stream, } #endif /* ACE_HAS_THREADS */ - - - - - - diff --git a/ace/UPIPE_Connector.cpp b/ace/UPIPE_Connector.cpp index 6136583ebee..8dee38a6d65 100644 --- a/ace/UPIPE_Connector.cpp +++ b/ace/UPIPE_Connector.cpp @@ -20,14 +20,14 @@ ACE_UPIPE_Connector::dump (void) const ACE_TRACE ("ACE_UPIPE_Connector::dump"); } -ACE_UPIPE_Connector::ACE_UPIPE_Connector (void) +ACE_UPIPE_Connector::ACE_UPIPE_Connector (void) { ACE_TRACE ("ACE_UPIPE_Connector::ACE_UPIPE_Connector"); } int -ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, - const ACE_UPIPE_Addr &addr, +ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, + const ACE_UPIPE_Addr &addr, ACE_Time_Value *timeout, const ACE_Addr & /* local_sap */, int /* reuse_addr */, @@ -36,8 +36,8 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, { ACE_TRACE ("ACE_UPIPE_Connector::connect"); ACE_ASSERT (new_stream.get_handle () == ACE_INVALID_HANDLE); - - ACE_HANDLE handle = ACE::handle_timed_open (timeout, + + ACE_HANDLE handle = ACE::handle_timed_open (timeout, addr.get_path_name (), flags, perms); @@ -55,18 +55,18 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, new_stream.set_handle (handle); new_stream.remote_addr_ = addr; // class copy. - new_stream.reference_count_++; + new_stream.reference_count_++; // Now send the address of our ACE_UPIPE_Stream over this pipe // to our corresponding ACE_UPIPE_Acceptor, so he may link the // two streams. - ssize_t result = ACE_OS::write (handle, - (const char *) &ustream, + ssize_t result = ACE_OS::write (handle, + (const char *) &ustream, sizeof ustream); if (result == -1) - ACE_ERROR ((LM_ERROR, - "ACE_UPIPE_Connector %p\n", - "write to pipe failed")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("ACE_UPIPE_Connector %p\n"), + ASYS_TEXT ("write to pipe failed"))); // Wait for confirmation of stream linking. ACE_Message_Block *mb_p = 0; @@ -77,8 +77,9 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, // Do *not* coalesce the following two checks for result == -1. // They perform different checks and cannot be merged. if (result == -1) - ACE_ERROR ((LM_ERROR, "ACE_UPIPE_Connector %p\n", - "no confirmation from server")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("ACE_UPIPE_Connector %p\n"), + ASYS_TEXT ("no confirmation from server"))); else // Close down the new_stream at this point in order to // conserve handles. Note that we don't need the SPIPE @@ -89,4 +90,3 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, } } #endif /* ACE_HAS_THREADS */ - diff --git a/ace/UPIPE_Connector.i b/ace/UPIPE_Connector.i index c7f32edb985..339a0b36f81 100644 --- a/ace/UPIPE_Connector.i +++ b/ace/UPIPE_Connector.i @@ -3,10 +3,10 @@ // UPIPE_Connector.i -// Creates a Local ACE_UPIPE. +// Creates a Local ACE_UPIPE. ASYS_INLINE -ACE_UPIPE_Connector::ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream, +ACE_UPIPE_Connector::ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream, const ACE_UPIPE_Addr &addr, ACE_Time_Value *timeout, const ACE_Addr &local_sap, @@ -15,11 +15,13 @@ ACE_UPIPE_Connector::ACE_UPIPE_Connector (ACE_UPIPE_Stream &new_stream, int perms) { ACE_TRACE ("ACE_UPIPE_Connector::ACE_UPIPE_Connector"); - if (this->connect (new_stream, addr, timeout, local_sap, + if (this->connect (new_stream, addr, timeout, local_sap, reuse_addr, flags, perms) == -1 && timeout != 0 && !(errno == EWOULDBLOCK || errno == ETIME)) - ACE_ERROR ((LM_ERROR, "address %s, %p\n", - addr.get_path_name (), "ACE_UPIPE_Connector")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("address %s, %p\n"), + addr.get_path_name (), + ASYS_TEXT ("ACE_UPIPE_Connector"))); } ASYS_INLINE int @@ -29,4 +31,3 @@ ACE_UPIPE_Connector::reset_new_handle (ACE_HANDLE handle) // Nothing to do here since the handle is not a socket return 0; } - diff --git a/ace/WFMO_Reactor.cpp b/ace/WFMO_Reactor.cpp index 8b541928394..a78e3d6f048 100644 --- a/ace/WFMO_Reactor.cpp +++ b/ace/WFMO_Reactor.cpp @@ -81,10 +81,10 @@ ACE_WFMO_Reactor_Handler_Repository::bit_ops (long &existing_masks, ACE_Reactor_Mask old_masks = ACE_Event_Handler::NULL_MASK; - if (ACE_BIT_ENABLED (existing_masks, FD_READ) + if (ACE_BIT_ENABLED (existing_masks, FD_READ) || ACE_BIT_ENABLED (existing_masks, FD_CLOSE)) ACE_SET_BITS (old_masks, ACE_Event_Handler::READ_MASK); - + if (ACE_BIT_ENABLED (existing_masks, FD_WRITE)) ACE_SET_BITS (old_masks, ACE_Event_Handler::WRITE_MASK); @@ -204,8 +204,8 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle, for (i = 0; i < this->max_handlep1_ && error == 0; i++) // Since the handle can either be the event or the I/O handle, // we have to check both - if ((this->current_handles_[i] == handle - || this->current_info_[i].io_handle_ == handle) + if ((this->current_handles_[i] == handle + || this->current_info_[i].io_handle_ == handle) && // Make sure that it is not already marked for deleted !this->current_info_[i].delete_entry_) { @@ -219,8 +219,8 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle, for (i = 0; i < this->suspended_handles_ && error == 0; i++) // Since the handle can either be the event or the I/O handle, we // have to check both - if ((this->current_suspended_info_[i].io_handle_ == handle - || this->current_suspended_info_[i].event_handle_ == handle) + if ((this->current_suspended_info_[i].io_handle_ == handle + || this->current_suspended_info_[i].event_handle_ == handle) && // Make sure that it is not already marked for deleted !this->current_suspended_info_[i].delete_entry_) @@ -235,8 +235,8 @@ ACE_WFMO_Reactor_Handler_Repository::unbind_i (ACE_HANDLE handle, for (i = 0; i < this->handles_to_be_added_ && error == 0; i++) // Since the handle can either be the event or the I/O handle, // we have to check both - if ((this->to_be_added_info_[i].io_handle_ == handle - || this->to_be_added_info_[i].event_handle_ == handle) + if ((this->to_be_added_info_[i].io_handle_ == handle + || this->to_be_added_info_[i].event_handle_ == handle) && // Make sure that it is not already marked for deleted !this->to_be_added_info_[i].delete_entry_) @@ -1727,20 +1727,20 @@ ACE_WFMO_Reactor::upcall (ACE_Event_Handler *event_handler, { long actual_events = events.lNetworkEvents; - if ((interested_events & actual_events & FD_READ) + if ((interested_events & actual_events & FD_READ) && event_handler->handle_input (io_handle) == -1) ACE_SET_BITS (problems, ACE_Event_Handler::READ_MASK); - if ((interested_events & actual_events & FD_CLOSE) - && !ACE_BIT_ENABLED (problems, ACE_Event_Handler::READ_MASK) + if ((interested_events & actual_events & FD_CLOSE) + && !ACE_BIT_ENABLED (problems, ACE_Event_Handler::READ_MASK) && event_handler->handle_input (io_handle) == -1) ACE_SET_BITS (problems, ACE_Event_Handler::READ_MASK); - if ((interested_events & actual_events & FD_ACCEPT) + if ((interested_events & actual_events & FD_ACCEPT) && event_handler->handle_input (io_handle) == -1) ACE_SET_BITS (problems, ACE_Event_Handler::ACCEPT_MASK); - if ((interested_events & actual_events & FD_WRITE) + if ((interested_events & actual_events & FD_WRITE) && event_handler->handle_output (io_handle) == -1) ACE_SET_BITS (problems, ACE_Event_Handler::WRITE_MASK); @@ -1758,7 +1758,7 @@ ACE_WFMO_Reactor::upcall (ACE_Event_Handler *event_handler, ACE_SET_BITS (problems, ACE_Event_Handler::CONNECT_MASK); } - if ((interested_events & actual_events & FD_OOB) + if ((interested_events & actual_events & FD_OOB) && event_handler->handle_exception (io_handle) == -1) ACE_SET_BITS (problems, ACE_Event_Handler::EXCEPT_MASK); @@ -2049,7 +2049,9 @@ ACE_WFMO_Reactor_Notify::dump (void) const ACE_TRACE ("ACE_WFMO_Reactor_Notify::dump"); ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); this->timer_queue_->dump (); - ACE_DEBUG ((LM_DEBUG, "Max. iteration: %d\n", this->max_notify_iterations_)); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("Max. iteration: %d\n"), + this->max_notify_iterations_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); } diff --git a/ace/WIN32_Asynch_IO.cpp b/ace/WIN32_Asynch_IO.cpp index 513af1bb79e..d96db3d62c9 100644 --- a/ace/WIN32_Asynch_IO.cpp +++ b/ace/WIN32_Asynch_IO.cpp @@ -86,7 +86,9 @@ ACE_WIN32_Asynch_Result::post_completion (ACE_Proactor_Impl *proactor) proactor); if (win32_proactor == 0) - ACE_ERROR_RETURN ((LM_ERROR, "Dynamic cast to WIN32 Proactor failed\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, + ASYS_TEXT ("Dynamic cast to WIN32 Proactor failed\n")), + -1); // Post myself. return win32_proactor->post_completion (this); @@ -156,9 +158,9 @@ ACE_WIN32_Asynch_Operation::cancel (void) // @@ This API returns 0 on failure. So, I am returning -1 in that // case. Is that right? (Alex). - + int result = (int) ::CancelIo (this->handle_); - + if (result == 0) // Couldnt cancel the operations. return 2; @@ -1206,7 +1208,7 @@ ACE_WIN32_Asynch_Accept_Result::~ACE_WIN32_Asynch_Accept_Result (void) { } -// Base class operations. These operations are here to kill dominance +// Base class operations. These operations are here to kill dominance // warnings. These methods call the base class methods. u_long @@ -1700,6 +1702,6 @@ ACE_Proactor * ACE_WIN32_Asynch_Transmit_File::proactor (void) const { return ACE_WIN32_Asynch_Operation::proactor (); -} +} #endif /* ACE_WIN32 || ACE_HAS_WINCE */ diff --git a/ace/WIN32_Proactor.cpp b/ace/WIN32_Proactor.cpp index 8dcc988a2d8..00ca490371c 100644 --- a/ace/WIN32_Proactor.cpp +++ b/ace/WIN32_Proactor.cpp @@ -19,10 +19,10 @@ class ACE_Export ACE_WIN32_Wakeup_Completion : public ACE_WIN32_Asynch_Result { // = TITLE - // This is result object is used by the <end_event_loop> of the + // This is result object is used by the <end_event_loop> of the // ACE_Proactor interface to wake up all the threads blocking // for completions. - + public: ACE_WIN32_Wakeup_Completion (ACE_Handler &handler, const void *act = 0, @@ -30,11 +30,11 @@ public: int priority = 0, int signal_number = ACE_SIGRTMIN); // Constructor. - + virtual ~ACE_WIN32_Wakeup_Completion (void); // Destructor. - - + + virtual void complete (u_long bytes_transferred = 0, int success = 1, const void *completion_key = 0, @@ -99,7 +99,7 @@ ACE_WIN32_Proactor::register_handle (ACE_HANDLE handle, { ACE_DEBUG ((LM_ERROR, ASYS_TEXT ("%p\n"), - ASYS_TEXT ("CreateIoCompletionPort"))); + ASYS_TEXT ("CreateIoCompletionPort"))); } return -1; } @@ -487,7 +487,7 @@ ACE_WIN32_Proactor::post_completion (ACE_WIN32_Asynch_Result *result) { // Grab the event associated with the Proactor HANDLE handle = this->get_handle (); - + // If Proactor event is valid, signal it if (handle != ACE_INVALID_HANDLE && handle != 0) @@ -524,13 +524,13 @@ ACE_WIN32_Proactor::post_wakeup_completions (int how_many) ACE_NEW_RETURN (wakeup_completion, ACE_WIN32_Wakeup_Completion (this->wakeup_handler_), -1); - + if (wakeup_completion->post_completion (this) == -1) return -1; } - + return 0; -} +} int ACE_WIN32_Proactor::wake_up_dispatch_threads (void) diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 12b5de61965..907f7ec5b44 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -272,6 +272,10 @@ typedef unsigned __int64 ACE_UINT64; #define NOMINMAX #endif /* NOMINMAX */ +#if defined (ACE_HAS_MOSTLY_UNICODE_APIS) && !defined (UNICODE) +#defined UNICODE +#endif /* ACE_HAS_MOSTLY_UNICODE_APIS && !UNICODE */ + #if defined (_UNICODE) #if !defined (UNICODE) #define UNICODE /* UNICODE is used by Windows headers */ diff --git a/tests/CDR_Test.cpp b/tests/CDR_Test.cpp index daf453aaa3c..377c73e2f16 100644 --- a/tests/CDR_Test.cpp +++ b/tests/CDR_Test.cpp @@ -113,8 +113,8 @@ short_stream (void) if (in_mb->length () != len) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "buffer length not preserved"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("buffer length not preserved")), 1); u_long in_chunk, out_chunk; @@ -125,8 +125,8 @@ short_stream (void) out_chunk = u_long (* (out_mb->rd_ptr () + i)); if (in_chunk != out_chunk ) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "buffer contents not preserved"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("buffer contents not preserved")), 1); } @@ -147,7 +147,7 @@ short_stream (void) ACE_CDR::Double d_array1[3]; ACE_DEBUG ((LM_DEBUG, - "Checking operators and arrays\n\n")); + ASYS_TEXT ("Checking operators and arrays\n\n"))); ACE_InputCDR::to_char tc (ch1); is >> tc; @@ -165,78 +165,78 @@ short_stream (void) if (ch1 != ch) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "char transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("char transfer error")), 1); if (str1 != str) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "string transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("string transfer error")), 1); if (s1 != s) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "short transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("short transfer error")), 1); if (us1 != us) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "ushort transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ushort transfer error")), 1); if (l1 != l) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "long transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("long transfer error")), 1); if (ul1 != ul) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "ulong transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("ulong transfer error")), 1); if (f1 != f) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "float transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("float transfer error")), 1); if (d1 != d) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "double transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("double transfer error")), 1); for (i = 0 ; i < 3; i++) if (s_array1[i] != s_array[i]) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "short array transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("short array transfer error")), 1); for (i = 0 ; i < 3; i++) if (l_array1[i] != l_array[i]) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "long array transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("long array transfer error")), 1); for (i = 0 ; i < 3; i++) if (f_array1[i] != f_array[i]) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "float array transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("float array transfer error")), 1); for (i = 0 ; i < 3; i++) if (d_array1[i] != d_array[i]) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "double array transfer error"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("double array transfer error")), 1); return 0; @@ -252,7 +252,7 @@ main (int argc, ASYS_TCHAR *argv[]) ACE::minor_version(), ACE::beta_version())); - ACE_Get_Opt get_opt (argc, argv, "dn:l:"); + ACE_Get_Opt get_opt (argc, argv, ASYS_TEXT ("dn:l:")); int opt, debug = 0; while ((opt = get_opt ()) != EOF) @@ -271,25 +271,25 @@ main (int argc, ASYS_TCHAR *argv[]) case '?': default: ACE_DEBUG ((LM_DEBUG, - "Usage: %s " - "-d debug" - "-n <num> " - "-l <loops> " - "\n", + ASYS_TEXT ("Usage: %s ") + ASYS_TEXT ("-d debug") + ASYS_TEXT ("-n <num> ") + ASYS_TEXT ("-l <loops> ") + ASYS_TEXT ("\n"), argv[0])); return -1; } } ACE_DEBUG ((LM_DEBUG, - "Testing ACE CDR functions - short stream\n\n")); + ASYS_TEXT ("Testing ACE CDR functions - short stream\n\n"))); if (short_stream () != 0 ) return 1; ACE_DEBUG ((LM_DEBUG, - "Short stream - no errors\n\n" - "Testing basic types - long stream\n\n")); + ASYS_TEXT ("Short stream - no errors\n\n") + ASYS_TEXT ("Testing basic types - long stream\n\n"))); for (int i = 0; i < nloops; ++i) { @@ -303,12 +303,12 @@ main (int argc, ASYS_TCHAR *argv[]) if (debug > 0) { ACE_DEBUG ((LM_DEBUG, - "Output CDR: \n")); + ASYS_TEXT ("Output CDR: \n"))); ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); ACE_DEBUG ((LM_DEBUG, - "Input CDR: \n")); + ASYS_TEXT ("Input CDR: \n"))); ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); @@ -319,8 +319,8 @@ main (int argc, ASYS_TCHAR *argv[]) } ACE_DEBUG ((LM_DEBUG, - "Long stream - no errors\n\n" - "Testing basic types - long stream[2]\n\n")); + ASYS_TEXT ("Long stream - no errors\n\n") + ASYS_TEXT ("Testing basic types - long stream[2]\n\n"))); for (int j = 0; j < nloops; ++j) { @@ -334,12 +334,12 @@ main (int argc, ASYS_TCHAR *argv[]) if (debug > 0) { ACE_DEBUG ((LM_DEBUG, - "Output CDR: \n")); + ASYS_TEXT ("Output CDR: \n"))); ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); ACE_DEBUG ((LM_DEBUG, - "Input CDR: \n")); + ASYS_TEXT ("Input CDR: \n"))); ACE_HEX_DUMP ((LM_DEBUG, input.rd_ptr(), 64)); @@ -350,7 +350,7 @@ main (int argc, ASYS_TCHAR *argv[]) } ACE_DEBUG ((LM_DEBUG, - "Long stream[2] - no errors\n\n")); + ASYS_TEXT ("Long stream[2] - no errors\n\n"))); ACE_END_TEST; @@ -366,33 +366,33 @@ CDR_Test_Types::test_put (ACE_OutputCDR &cdr) { if (cdr.write_octet (this->o) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "write_octet[%d] failed\n", + ASYS_TEXT ("write_octet[%d] failed\n"), i), 1); if (cdr.write_short (this->s) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "write_short[%d] failed\n", + ASYS_TEXT ("write_short[%d] failed\n"), i), 1); if (cdr.write_octet (this->o) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "write_octet-2[%d] failed\n", + ASYS_TEXT ("write_octet-2[%d] failed\n"), i), 1); if (cdr.write_long (this->l) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "write_long[%d] failed\n", + ASYS_TEXT ("write_long[%d] failed\n"), i), 1); if (cdr.write_long (this->l) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "write_long-2[%d] failed\n", + ASYS_TEXT ("write_long-2[%d] failed\n"), i), 1); if (cdr.write_string (this->str) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "write_string[%d] failed\n", + ASYS_TEXT ("write_string[%d] failed\n"), i), 1); @@ -412,64 +412,64 @@ CDR_Test_Types::test_get (ACE_InputCDR &cdr) const { if (cdr.read_octet (xo) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "read_octet[%d] failed\n", + ASYS_TEXT ("read_octet[%d] failed\n"), i), 1); if (xo != this->o) ACE_ERROR_RETURN ((LM_ERROR, - "octet[%d] differs\n", + ASYS_TEXT ("octet[%d] differs\n"), i), 1); if (cdr.read_short (xs) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "read_short[%d] failed\n", + ASYS_TEXT ("read_short[%d] failed\n"), i), 1); if (xs != this->s) ACE_ERROR_RETURN ((LM_ERROR, - "short[%d] differs\n", + ASYS_TEXT ("short[%d] differs\n"), i), 1); if (cdr.read_octet (xo) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "read_octet-2[%d] failed\n", + ASYS_TEXT ("read_octet-2[%d] failed\n"), i), 1); if (xo != this->o) ACE_ERROR_RETURN ((LM_ERROR, - "octet-2[%d] differs\n", + ASYS_TEXT ("octet-2[%d] differs\n"), i), 1); if (cdr.read_long (xl) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "read_long[%d] failed\n", + ASYS_TEXT ("read_long[%d] failed\n"), i), 1); if (xl != this->l) ACE_ERROR_RETURN ((LM_ERROR, - "long[%d] differs\n", + ASYS_TEXT ("long[%d] differs\n"), i), 1); if (cdr.read_long (xl) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "read_long-2[%d] failed\n", + ASYS_TEXT ("read_long-2[%d] failed\n"), i), 1); if (xl != this->l) ACE_ERROR_RETURN ((LM_ERROR, - "long-2[%d] differs\n", + ASYS_TEXT ("long-2[%d] differs\n"), i), 1); ACE_CDR::Char *xstr; if (cdr.read_string (xstr) == 0) ACE_ERROR_RETURN ((LM_ERROR, - "read_string2[%d] failed\n", + ASYS_TEXT ("read_string2[%d] failed\n"), i), 1); ACE_Auto_Basic_Array_Ptr<ACE_CDR::Char> auto_xstr (xstr); if (ACE_OS::strcmp (auto_xstr.get (), this->str) != 0) ACE_ERROR_RETURN ((LM_ERROR, - "string[%d] differs\n", + ASYS_TEXT ("string[%d] differs\n"), i), 1); } diff --git a/tests/Cache_Map_Manager_Test.cpp b/tests/Cache_Map_Manager_Test.cpp index 8cf39463d14..d5e6f62041d 100644 --- a/tests/Cache_Map_Manager_Test.cpp +++ b/tests/Cache_Map_Manager_Test.cpp @@ -193,7 +193,7 @@ run_reverse_iterator_hash_cache (HASH_MAP_CACHE &cache) static void find_test_cache (MAP_CACHE &cache) { - ACE_DEBUG ((LM_DEBUG, "find\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("find\n"))); size_t total_entries = cache.current_size (); @@ -210,17 +210,17 @@ find_test_cache (MAP_CACHE &cache) ACE_ASSERT (j == key); ACE_DEBUG ((LM_DEBUG, - "%d ", + ASYS_TEXT ("%d "), j)); } - ACE_DEBUG ((LM_DEBUG, "\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); } -static void +static void find_test_hash_cache (HASH_MAP_CACHE &cache) { - ACE_DEBUG ((LM_DEBUG, "find\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("find\n"))); size_t total_entries = cache.current_size (); @@ -237,14 +237,14 @@ find_test_hash_cache (HASH_MAP_CACHE &cache) ACE_ASSERT (j == key); ACE_DEBUG ((LM_DEBUG, - "%d ", + ASYS_TEXT ("%d "), j)); } - ACE_DEBUG ((LM_DEBUG, "\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); } -static void +static void purge_test_cache (MAP_CACHE &cache) { // Get the number of entries in the container. @@ -267,11 +267,11 @@ purge_test_cache (MAP_CACHE &cache) ACE_ASSERT (cache.current_size () == resultant_size); } -static void +static void purge_test_hash_cache (HASH_MAP_CACHE &cache) { - - + + // Get the number of entries in the container. size_t current_map_size = cache.current_size (); @@ -307,7 +307,7 @@ functionality_test_cache (void) { int result = cache.bind (i, j); ACE_ASSERT (result != -1); - ACE_DEBUG ((LM_DEBUG, "keys[%d]=%d value=[%d]=%d\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("keys[%d]=%d value=[%d]=%d\n"), i, i, j, j)); ++counter; ACE_ASSERT (cache.current_size () == counter); @@ -317,14 +317,14 @@ functionality_test_cache (void) run_reverse_iterator_cache (cache); find_test_cache (cache); - + ACE_DEBUG ((LM_DEBUG, - "Number of entries in cache before purging : %d\n", - cache.current_size ())); + ASYS_TEXT ("Number of entries in cache before purging : %d\n"), + cache.current_size ())); purge_test_cache (cache); ACE_DEBUG ((LM_DEBUG, - "Number of entries in cache after purging : %d\n", - cache.current_size ())); + ASYS_TEXT ("Number of entries in cache after purging : %d\n"), + cache.current_size ())); run_iterator_cache (cache); run_reverse_iterator_cache (cache); @@ -346,7 +346,7 @@ functionality_test_hash_cache (void) int result = cache.bind (i, j); ACE_ASSERT (result != -1); ACE_DEBUG ((LM_DEBUG, - "keys[%d]=%d value=[%d]=%d\n", + ASYS_TEXT ("keys[%d]=%d value=[%d]=%d\n"), i, i, j, j)); ++counter; ACE_ASSERT (cache.current_size () == counter); @@ -358,11 +358,11 @@ functionality_test_hash_cache (void) find_test_hash_cache (cache); ACE_DEBUG ((LM_DEBUG, - "Number of entries in cache before purging : %d\n", - cache.current_size ())); + ASYS_TEXT ("Number of entries in cache before purging : %d\n"), + cache.current_size ())); purge_test_hash_cache (cache); ACE_DEBUG ((LM_DEBUG, - "Number of entries in cache after purging : %d\n", + ASYS_TEXT ("Number of entries in cache after purging : %d\n"), cache.current_size ())); run_iterator_hash_cache (cache); @@ -370,9 +370,9 @@ functionality_test_hash_cache (void) } static int -parse_args (int argc, char *argv[]) +parse_args (int argc, ASYS_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "r:i:f:p:"); + ACE_Get_Opt get_opt (argc, argv, ASYS_TEXT ("r:i:f:p:")); int c; @@ -380,26 +380,26 @@ parse_args (int argc, char *argv[]) switch (c) { case 'i': - iterations = atoi (get_opt.optarg); + iterations = ACE_OS::atoi (get_opt.optarg); break; case 'f': - no_of_lookups = atoi (get_opt.optarg); + no_of_lookups = ACE_OS::atoi (get_opt.optarg); break; case 'r': - randomize_lookups = atoi (get_opt.optarg); + randomize_lookups = ACE_OS::atoi (get_opt.optarg); break; case 'p': - purge_percent = atoi (get_opt.optarg); + purge_percent = ACE_OS::atoi (get_opt.optarg); break; case '?': case 'h': default: ACE_ERROR ((LM_ERROR, - "usage: %s " - "[-r (randomize lookups)] " - "[-i (iterations)] " - "[-p (purge percent)] " - "[-f (number of lookups)] \n", + ASYS_TEXT ("usage: %s ") + ASYS_TEXT ("[-r (randomize lookups)] ") + ASYS_TEXT ("[-i (iterations)] ") + ASYS_TEXT ("[-p (purge percent)] ") + ASYS_TEXT ("[-f (number of lookups)] \n"), argv[0])); return -1; } diff --git a/tests/Collection_Test.cpp b/tests/Collection_Test.cpp index bdbd04c5ede..d30b7cd3d12 100644 --- a/tests/Collection_Test.cpp +++ b/tests/Collection_Test.cpp @@ -30,7 +30,7 @@ USELIB("..\ace\aced.lib"); typedef int DATA; -int main (int, char *[]) +int main (int, ASYS_TCHAR *[]) { ACE_START_TEST (ASYS_TEXT ("Collection_Test")); @@ -48,7 +48,7 @@ int main (int, char *[]) iterator != unbounded_set.end (); ++iterator) { - ACE_DEBUG ((LM_DEBUG, "%d\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%d\n"), (*iterator))); } } @@ -59,7 +59,7 @@ int main (int, char *[]) { DATA *data = 0; iterator.next (data); - ACE_DEBUG ((LM_DEBUG, "%d\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%d\n"), (*data))); iterator.advance (); } @@ -99,7 +99,7 @@ int main (int, char *[]) i != array1.size (); ++i) { - ACE_DEBUG ((LM_DEBUG, "%d\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%d\n"), array1[i])); ACE_ASSERT (array1[i] == 4); } @@ -111,7 +111,7 @@ int main (int, char *[]) { DATA *data = 0; iterator.next (data); - ACE_DEBUG ((LM_DEBUG, "%d\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%d\n"), (*data))); ACE_ASSERT (*data == 4); iterator.advance (); diff --git a/tests/DLL_Test.cpp b/tests/DLL_Test.cpp index bce4250792d..a35b9b19a76 100644 --- a/tests/DLL_Test.cpp +++ b/tests/DLL_Test.cpp @@ -83,12 +83,12 @@ Hello *get_hello (void) typedef Hello *(*TC) (void); int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { ACE_UNUSED_ARG (argc); ACE_UNUSED_ARG (argv); - ACE_START_TEST ("DLL_Test"); + ACE_START_TEST (ASYS_TEXT ("DLL_Test")); // Protection against this test being run on platforms not supporting Dlls. #if defined (ACE_WIN32) || defined (ACE_HAS_SVR4_DYNAMIC_LINKING) || \ @@ -98,7 +98,7 @@ main (int argc, char *argv[]) int retval = dll.open (OBJ_PREFIX "DLL_Test" OBJ_SUFFIX); if (retval != 0) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", + ASYS_TEXT ("%p\n"), dll.error ()), -1); @@ -114,7 +114,7 @@ main (int argc, char *argv[]) TC f = ACE_reinterpret_cast (Hello * (*)(void), tmp); if (f == 0) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", + ASYS_TEXT ("%p\n"), dll.error ()), -1); diff --git a/tests/DLL_Test.h b/tests/DLL_Test.h index c319f0fdc57..bbdc085c520 100644 --- a/tests/DLL_Test.h +++ b/tests/DLL_Test.h @@ -27,13 +27,13 @@ public: void say_hello (void) { ACE_DEBUG ((LM_DEBUG, - "Hello\n")); + ASYS_TEXT ("Hello\n"))); } void say_next (void) { ACE_DEBUG ((LM_DEBUG, - "How are you?\n")); + ASYS_TEXT ("How are you?\n"))); } }; diff --git a/tests/DLList_Test.cpp b/tests/DLList_Test.cpp index 7b37922e623..e018d3307d0 100644 --- a/tests/DLList_Test.cpp +++ b/tests/DLList_Test.cpp @@ -37,12 +37,12 @@ static STRING string_table[] = // Note: all these casts are to appease SC 5.0 which is not pleased // with using string literals (i.e. const char *'s) as char // *'s. It's ugly, but necessary. - ASYS_TEXT (ACE_const_cast (char *, "hello")), - ASYS_TEXT (ACE_const_cast (char *, "guten Tag")), - ASYS_TEXT (ACE_const_cast (char *, "goodbye")), - ASYS_TEXT (ACE_const_cast (char *, "auf wiedersehen")), - ASYS_TEXT (ACE_const_cast (char *, "funny")), - ASYS_TEXT (ACE_const_cast (char *, "lustig")), + ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("hello")), + ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("guten Tag")), + ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("goodbye")), + ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("auf wiedersehen")), + ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("funny")), + ACE_const_cast (ASYS_TCHAR *, ASYS_TEXT ("lustig")), 0 }; diff --git a/tests/Dynamic_Priority_Test.cpp b/tests/Dynamic_Priority_Test.cpp index 8348b1cbda4..900f2b39dba 100644 --- a/tests/Dynamic_Priority_Test.cpp +++ b/tests/Dynamic_Priority_Test.cpp @@ -357,7 +357,7 @@ performance_consumer (void * args) timer.stop (); ACE_Time_Value tv; timer.elapsed_time (tv); - ACE_DEBUG ((LM_INFO, "%6u, %6u, %f", + ACE_DEBUG ((LM_INFO, ASYS_TEXT ("%6u, %6u, %f"), local_count, tv.msec (), (ACE_timer_t) tv.msec () / local_count)); @@ -415,7 +415,7 @@ performance_producer (void *args) timer.stop (); ACE_Time_Value tv; timer.elapsed_time (tv); - ACE_DEBUG ((LM_INFO, "%6u, %6u, %f, ", + ACE_DEBUG ((LM_INFO, ASYS_TEXT ("%6u, %6u, %f, "), local_count, tv.msec (), (ACE_timer_t) tv.msec () / local_count)); @@ -465,35 +465,35 @@ run_performance_test (u_int min_load, { case BEST: ACE_DEBUG ((LM_INFO, - "\n\nenqueued, best static time, best static avg, " - "dequeued, best static time, best static avg, " - "enqueued, best deadline time, best deadline avg, " - "dequeued, best deadline time, best deadline avg, " - "enqueued, best laxity time, best laxity avg, " - "dequeued, best laxity time, best laxity avg\n")); + ASYS_TEXT ("\n\nenqueued, best static time, best static avg, ") + ASYS_TEXT ("dequeued, best static time, best static avg, ") + ASYS_TEXT ("enqueued, best deadline time, best deadline avg, ") + ASYS_TEXT ("dequeued, best deadline time, best deadline avg, ") + ASYS_TEXT ("enqueued, best laxity time, best laxity avg, ") + ASYS_TEXT ("dequeued, best laxity time, best laxity avg\n"))); break; case WORST: ACE_DEBUG ((LM_INFO, - "\n\nenqueued, worst static time, worst static avg, " - "dequeued, worst static time, worst static avg, " - "enqueued, worst deadline time, worst deadline avg, " - "dequeued, worst deadline time, worst deadline avg, " - "enqueued, worst laxity time, worst laxity avg, " - "dequeued, worst laxity time, worst laxity avg\n")); + ASYS_TEXT ("\n\nenqueued, worst static time, worst static avg, ") + ASYS_TEXT ("dequeued, worst static time, worst static avg, ") + ASYS_TEXT ("enqueued, worst deadline time, worst deadline avg, ") + ASYS_TEXT ("dequeued, worst deadline time, worst deadline avg, ") + ASYS_TEXT ("enqueued, worst laxity time, worst laxity avg, ") + ASYS_TEXT ("dequeued, worst laxity time, worst laxity avg\n"))); break; case RANDOM: ACE_DEBUG ((LM_INFO, - "\n\nenqueued, random static time, random static avg, " - "dequeued, random static time, random static avg, " - "enqueued, random deadline time, random deadline avg, " - "dequeued, random deadline time, random deadline avg, " - "enqueued, random laxity time, random laxity avg, " - "dequeued, random laxity time, random laxity avg\n")); + ASYS_TEXT ("\n\nenqueued, random static time, random static avg, ") + ASYS_TEXT ("dequeued, random static time, random static avg, ") + ASYS_TEXT ("enqueued, random deadline time, random deadline avg, ") + ASYS_TEXT ("dequeued, random deadline time, random deadline avg, ") + ASYS_TEXT ("enqueued, random laxity time, random laxity avg, ") + ASYS_TEXT ("dequeued, random laxity time, random laxity avg\n"))); break; default: ACE_ERROR_RETURN ((LM_ERROR, - "unknown test type %d", + ASYS_TEXT ("unknown test type %d"), test_type), -1); } @@ -598,7 +598,7 @@ run_performance_test (u_int min_load, // This should only happen for a *very* large messages // relative to the system's representation size. ACE_ERROR_RETURN ((LM_ERROR, - "Insufficient range of random numbers"), + ASYS_TEXT ("Insufficient range of random numbers")), -1); shuffle_index = random_int % load; @@ -617,7 +617,7 @@ run_performance_test (u_int min_load, break; default: ACE_ERROR_RETURN ((LM_ERROR, - "unknown test type %d", + ASYS_TEXT ("unknown test type %d"), test_type), -1); } @@ -637,7 +637,7 @@ run_performance_test (u_int min_load, // Add a comma delimiter for most recent outputs. ACE_DEBUG ((LM_INFO, - ", ")); + ASYS_TEXT (", "))); // Run the performance test producer and consumer on the // deadline queue. @@ -648,7 +648,7 @@ run_performance_test (u_int min_load, // Add a comma delimiter for most recent outputs. ACE_DEBUG ((LM_INFO, - ", ")); + ASYS_TEXT (", "))); // Run the performance test producer and consumer on the laxity // queue. @@ -659,7 +659,7 @@ run_performance_test (u_int min_load, // Move to the next line of output. ACE_DEBUG ((LM_INFO, - "\n")); + ASYS_TEXT ("\n"))); delete [] time_offsets; @@ -693,15 +693,15 @@ main (int, ASYS_TCHAR *[]) { if (ACE_OS::last_error () == EPERM) ACE_DEBUG ((LM_MAX, - "user is not superuser, " - "so remain in time-sharing class\n")); + ASYS_TEXT ("user is not superuser, ") + ASYS_TEXT ("so remain in time-sharing class\n"))); else if (ACE_OS::last_error () == ENOTSUP) ACE_DEBUG ((LM_MAX, - "process scope scheduling is not available, " - "so remain in time-sharing class\n")); + ASYS_TEXT ("process scope scheduling is not available, ") + ASYS_TEXT ("so remain in time-sharing class\n"))); else ACE_ERROR_RETURN ((LM_ERROR, - "%n: ACE_OS::sched_params failed\n%a"), + ASYS_TEXT ("%n: ACE_OS::sched_params failed\n%a")), -1); } diff --git a/tests/Env_Value_Test.cpp b/tests/Env_Value_Test.cpp index 44a9c94e80a..e9d0a79b1c0 100644 --- a/tests/Env_Value_Test.cpp +++ b/tests/Env_Value_Test.cpp @@ -31,7 +31,7 @@ do { \ ACE_Env_Value<type> val (varname, (defval)); \ if (val != (expval)) { \ ACE_ERROR ((LM_ERROR, \ - "val %d does not match expected value of %d\n", \ + ASYS_TEXT ("val %d does not match expected value of %d\n"), \ (int) (type) val, (int) (expval))); \ } \ ACE_ASSERT (val == (expval)); \ @@ -46,8 +46,8 @@ int main (int argc, ASYS_TCHAR* []) { ACE_UNUSED_ARG (argc); - ACE_OS::putenv ("TEST_VALUE_POSITIVE=10.2"); - ACE_OS::putenv ("TEST_VALUE_NEGATIVE=-10.2"); + ACE_OS::putenv (ASYS_TEXT ("TEST_VALUE_POSITIVE=10.2")); + ACE_OS::putenv (ASYS_TEXT ("TEST_VALUE_NEGATIVE=-10.2")); #else /* ! ACE_HAS_NONSTATIC_OBJECT_MANAGER */ main (int argc, LPTSTR [], LPTSTR envp[]) { @@ -81,28 +81,28 @@ main (int argc, LPTSTR [], LPTSTR envp[]) #endif /* ! ACE_HAS_NONSTATIC_OBJECT_MANAGER */ { // In this case we're the child - ACE_START_TEST ("Env_Value_Test"); + ACE_START_TEST (ASYS_TEXT ("Env_Value_Test")); - TEST_THIS (int, "TEST_VALUE_POSITIVE", 4, 10); + TEST_THIS (int, ASYS_TEXT ("TEST_VALUE_POSITIVE"), 4, 10); #if !defined (ACE_LACKS_FLOATING_POINT) - TEST_THIS (double, "TEST_VALUE_POSITIVE", -1.0, 10.2); + TEST_THIS (double, ASYS_TEXT ("TEST_VALUE_POSITIVE"), -1.0, 10.2); #endif /* ! ACE_LACKS_FLOATING_POINT */ - TEST_THIS (long, "TEST_VALUE_POSITIVE", 0, 10); - TEST_THIS (unsigned long, "TEST_VALUE_POSITIVE", 0, 10); - TEST_THIS (short, "TEST_VALUE_POSITIVE", 0, 10); - TEST_THIS (unsigned short, "TEST_VALUE_POSITIVE", 0, 10); + TEST_THIS (long, ASYS_TEXT ("TEST_VALUE_POSITIVE"), 0, 10); + TEST_THIS (unsigned long, ASYS_TEXT ("TEST_VALUE_POSITIVE"), 0, 10); + TEST_THIS (short, ASYS_TEXT ("TEST_VALUE_POSITIVE"), 0, 10); + TEST_THIS (unsigned short, ASYS_TEXT ("TEST_VALUE_POSITIVE"), 0, 10); - TEST_THIS (int, "TEST_VALUE_NEGATIVE", 4, -10); + TEST_THIS (int, ASYS_TEXT ("TEST_VALUE_NEGATIVE"), 4, -10); #if !defined (ACE_LACKS_FLOATING_POINT) - TEST_THIS (double, "TEST_VALUE_NEGATIVE", -1.0, -10.2); + TEST_THIS (double, ASYS_TEXT ("TEST_VALUE_NEGATIVE"), -1.0, -10.2); #endif /* ! ACE_LACKS_FLOATING_POINT */ - TEST_THIS (long, "TEST_VALUE_NEGATIVE", 0, -10L); - TEST_THIS (unsigned long, "TEST_VALUE_NEGATIVE", 0, (unsigned long) -10); - TEST_THIS (short, "TEST_VALUE_NEGATIVE", 0, -10); - TEST_THIS (unsigned short, "TEST_VALUE_NEGATIVE", 0, (unsigned short) -10); + TEST_THIS (long, ASYS_TEXT ("TEST_VALUE_NEGATIVE"), 0, -10L); + TEST_THIS (unsigned long, ASYS_TEXT ("TEST_VALUE_NEGATIVE"), 0, (unsigned long) -10); + TEST_THIS (short, ASYS_TEXT ("TEST_VALUE_NEGATIVE"), 0, -10); + TEST_THIS (unsigned short, ASYS_TEXT ("TEST_VALUE_NEGATIVE"), 0, (unsigned short) -10); - const char *defstr = "Sarah Cleeland is Two!"; - ACE_Env_Value<const char *> sval ("This_Shouldnt_Be_Set_Hopefully", + const ASYS_TCHAR *defstr = ASYS_TEXT ("Sarah Cleeland is Two!"); + ACE_Env_Value<const ASYS_TCHAR *> sval (ASYS_TEXT ("This_Shouldnt_Be_Set_Hopefully"), defstr); ACE_ASSERT (ACE_OS::strcmp (sval, defstr) == 0); ACE_END_TEST; diff --git a/tests/Handle_Set_Test.cpp b/tests/Handle_Set_Test.cpp index 0fbf86f8da0..ee4c6c25f7a 100644 --- a/tests/Handle_Set_Test.cpp +++ b/tests/Handle_Set_Test.cpp @@ -104,8 +104,8 @@ test_boundaries (void) const int SET_IS_EMPTY_SO_SHOULD_NOT_SEE_THIS = 1; ACE_ASSERT (0 == SET_IS_EMPTY_SO_SHOULD_NOT_SEE_THIS); #else /* ! defined (ACE_PSOS_DIAB) */ - ACE_ASSERT (0 == ASYS_TEXT ("this shouldn't get called since " - "the set is empty!\n")); + ACE_ASSERT (0 == ASYS_TEXT ("this shouldn't get called since ") + ASYS_TEXT ("the set is empty!\n")); #endif /* defined (ACE_PSOS_DIAB) */ } diff --git a/tests/High_Res_Timer_Test.cpp b/tests/High_Res_Timer_Test.cpp index 804d7da0ba4..b20f86304d4 100644 --- a/tests/High_Res_Timer_Test.cpp +++ b/tests/High_Res_Timer_Test.cpp @@ -47,8 +47,8 @@ check (const u_int interval, const u_int measured) else { ACE_ERROR ((LM_ERROR, - ASYS_TEXT ("The measured time of %u differs from " - "the interval of %u by %u percent.\n"), + ASYS_TEXT ("The measured time of %u differs from ") + ASYS_TEXT ("the interval of %u by %u percent.\n"), measured, interval, percentage_difference)); return 1; } @@ -78,8 +78,8 @@ main (int argc, ASYS_TCHAR *argv[]) { ACE_START_TEST (ASYS_TEXT ("High_Res_Timer_Test")); - ACE_DEBUG ((LM_DEBUG, "The ACE_High_Res_Timer scale factor is %u " - "1/microsecond\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("The ACE_High_Res_Timer scale factor is %u ") + ASYS_TEXT ("1/microsecond\n"), ACE_High_Res_Timer::global_scale_factor ())); u_int errors = 0; @@ -105,11 +105,11 @@ main (int argc, ASYS_TCHAR *argv[]) { const ACE_Time_Value interval (0, intervals[i]); const ACE_Time_Value measured = time_interval (interval); - ACE_DEBUG ((LM_DEBUG, "interval: %u usec, measured: %u usec%s\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("interval: %u usec, measured: %u usec%s\n"), interval.sec () * 1000000 + interval.usec (), measured.sec () * 1000000 + measured.usec (), intervals[i] <= TIMER_RESOLUTION ? - " (interval and measured may differ)" : "")); + ASYS_TEXT (" (interval and measured may differ)") : ASYS_TEXT (""))); if (intervals[i] > TIMER_RESOLUTION) { diff --git a/tests/IOStream_Test.cpp b/tests/IOStream_Test.cpp index b9673a8a00c..b7867aa97dc 100644 --- a/tests/IOStream_Test.cpp +++ b/tests/IOStream_Test.cpp @@ -184,13 +184,14 @@ client (void *arg = 0) if (connector.connect (server, addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - " (%t) %p\n", - "Failed to connect to server thread"), + ASYS_TEXT (" (%t) %p\n"), + ASYS_TEXT ("Failed to connect to server thread")), 0); // Send a string to the server which it can interpret as a qchar[] const char *str = "\"This is a test string.\""; - ACE_DEBUG ((LM_DEBUG, " (%P|%t) Client Sending: (%s)\n", str)); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT (" (%P|%t) Client Sending: (%s)\n"), + ASYS_WIDE_STRING (str))); server << str << endl; // Allow the server to get the string and echo it to the user. (The @@ -203,8 +204,8 @@ client (void *arg = 0) str = "\"THIS IS A TEST STRING.\""; ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Client Sending: (%s)\n", - str)); + ASYS_TEXT (" (%P|%t) Client Sending: (%s)\n"), + ASYS_WIDE_STRING (str))); server << str << endl; // Again, give the server time to display the happenings to the @@ -216,7 +217,7 @@ client (void *arg = 0) // the server. ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Client Receiving\n")); + ASYS_TEXT (" (%P|%t) Client Receiving\n"))); ACE_Time_Value timeout (2); ACE_Time_Value *timeoutp = &timeout; @@ -234,13 +235,13 @@ client (void *arg = 0) if (eof) { ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Unrecoverable stream error/eof\n")); + ASYS_TEXT (" (%P|%t) Unrecoverable stream error/eof\n"))); break; } else { ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Recoverable stream error/timed out)\n")); + ASYS_TEXT (" (%P|%t) Recoverable stream error/timed out)\n"))); server.clear (0); } } @@ -251,7 +252,7 @@ client (void *arg = 0) server >> d; ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Client Received: int %d float %f long %d float %f double %f\n", + ASYS_TEXT (" (%P|%t) Client Received: int %d float %f long %d float %f double %f\n"), i, f1, (int) l, @@ -298,8 +299,8 @@ server (void *arg = 0) if (acceptor->get_local_addr (server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "get_local_addr"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("get_local_addr")), 0); #if defined (ACE_HAS_THREADS) @@ -307,14 +308,14 @@ server (void *arg = 0) (void *) &server_addr, THR_NEW_LWP | THR_DETACHED) == -1) ACE_ERROR_RETURN ((LM_ERROR, - " (%t) %p\n", - "spawing client thread"), + ASYS_TEXT (" (%t) %p\n"), + ASYS_TEXT ("spawing client thread")), 0); #endif /* ACE_HAS_THREADS */ if (acceptor->accept (client_handler) == -1) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Failed to accept new client_handler"), + ASYS_TEXT (" (%P|%t) Failed to accept new client_handler")), 0); // Read a qbuf[] from the client. Notice that all of the client's @@ -324,8 +325,8 @@ server (void *arg = 0) client_handler >> qbuf; ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Server Received: (\"%s\")\n", - qbuf)); + ASYS_TEXT (" (%P|%t) Server Received: (\"%s\")\n"), + ASYS_WIDE_STRING ((char *) qbuf))); // Give the client time to announce the next test to the user. ACE_OS::sleep (2); @@ -348,7 +349,7 @@ server (void *arg = 0) if (buf.length () > 0) ACE_DEBUG ((LM_DEBUG, "%s ", - buf.c_str ())); + ASYS_WIDE_STRING (buf.c_str ()))); } ACE_DEBUG ((LM_DEBUG, @@ -357,7 +358,7 @@ server (void *arg = 0) char buf[BUFSIZ]; ACE_OS::memset (buf, 0, sizeof buf); ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Server Received: (")); + ASYS_TEXT (" (%P|%t) Server Received: ("))); while (ACE_OS::strlen (buf) == 0 || buf[ACE_OS::strlen (buf) - 1] != '"') @@ -365,12 +366,12 @@ server (void *arg = 0) if (! (client_handler >> buf)) break; ACE_DEBUG ((LM_DEBUG, - "%s ", - buf)); + ASYS_TEXT ("%s "), + ASYS_WIDE_STRING (buf))); } ACE_DEBUG ((LM_DEBUG, - ")\n")); + ASYS_TEXT (")\n"))); #endif /* ACE_HAS_STRING_CLASS */ // Send some non-textual data to the client. We use a single @@ -380,11 +381,11 @@ server (void *arg = 0) // command or the implicit <<endl. ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Server sleeping\n")); + ASYS_TEXT (" (%P|%t) Server sleeping\n"))); ACE_OS::sleep (5); ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Server Sending: 1 .12342134 666555444 23.45 -46.5e9 \n")); + ASYS_TEXT (" (%P|%t) Server Sending: 1 .12342134 666555444 23.45 -46.5e9 \n"))); client_handler << 1 << " "; client_handler << .12342134 << " "; client_handler << 666555444 << " "; @@ -403,7 +404,7 @@ server (void *arg = 0) client_handler >> i >> f1 >> l >> f2 >> d; ACE_DEBUG ((LM_DEBUG, - " (%P|%t) Server Received: int %d float %g long %d float %g double %g\n", + ASYS_TEXT (" (%P|%t) Server Received: int %d float %g long %d float %g double %g\n"), i, f1, (int) l, @@ -428,15 +429,16 @@ spawn (void) if (acceptor.open (ACE_sap_any_cast (const ACE_INET_Addr &)) == -1) ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) %p\n", - "open"), + ASYS_TEXT (" (%P|%t) %p\n"), + ASYS_TEXT ("open")), -1); #if defined (ACE_HAS_THREADS) else if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (server), &acceptor, THR_NEW_LWP | THR_DETACHED) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", "spawning server thread"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("spawning server thread")), -1); // Wait for the client and server thread to exit. @@ -448,8 +450,8 @@ spawn (void) { case -1: ACE_ERROR ((LM_ERROR, - "%p\n%a", - "fork failed")); + ASYS_TEXT ("%p\n%a"), + ASYS_TEXT ("fork failed"))); ACE_OS::_exit (-1); case 0: // In child { @@ -458,8 +460,8 @@ spawn (void) if (acceptor.get_local_addr (server_addr) == -1) ACE_ERROR ((LM_ERROR, - "%p\n", - "get_local_addr")); + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("get_local_addr"))); else client ((void *) &server_addr); ACE_END_LOG; @@ -474,7 +476,7 @@ spawn (void) } #else ACE_ERROR_RETURN ((LM_INFO, - "threads *and* processes not supported on this platform\n"), + ASYS_TEXT ("threads *and* processes not supported on this platform\n")), -1); #endif /* ACE_HAS_THREADS */ @@ -485,16 +487,16 @@ spawn (void) #endif /* !ACE_LACKS_ACE_IOSTREAM */ int -main (int, char *[]) +main (int, ASYS_TCHAR *[]) { - ACE_START_TEST ("IOStream_Test"); + ACE_START_TEST (ASYS_TEXT ("IOStream_Test")); #if !defined (ACE_LACKS_ACE_IOSTREAM) - ACE_INIT_LOG ("IOStream_Test-children"); + ACE_INIT_LOG (ASYS_TEXT ("IOStream_Test-children")); spawn (); #else ACE_ERROR ((LM_INFO, - "ACE_IOSTREAM not supported on this platform\n")); + ASYS_TEXT ("ACE_IOSTREAM not supported on this platform\n"))); #endif /* !ACE_LACKS_ACE_IOSTREAM */ ACE_END_TEST; return 0; diff --git a/tests/MT_Reactor_Timer_Test.cpp b/tests/MT_Reactor_Timer_Test.cpp index 398a863645e..2118f309808 100644 --- a/tests/MT_Reactor_Timer_Test.cpp +++ b/tests/MT_Reactor_Timer_Test.cpp @@ -133,7 +133,7 @@ Time_Handler::handle_timeout (const ACE_Time_Value &tv, ACE_GUARD_RETURN (ACE_Thread_Mutex, id_lock, this->lock_, 0); ACE_DEBUG ((LM_DEBUG, - "%T (%t): Timer #%d (id #%d) expired\n", + ASYS_TEXT ("%T (%t): Timer #%d (id #%d) expired\n"), time_tag, this->timer_id_[time_tag])); diff --git a/tests/Map_Manager_Test.cpp b/tests/Map_Manager_Test.cpp index 69ca50608fb..7fb4bd34b96 100644 --- a/tests/Map_Manager_Test.cpp +++ b/tests/Map_Manager_Test.cpp @@ -843,12 +843,12 @@ run_test (void (*ptf) (size_t, size_t, int), if (test_iterators) test_iterators_string = - ASYS_TEXT (ACE_const_cast (char*, - "includes executing iterators")); + ACE_const_cast (ASYS_TCHAR*, + ASYS_TEXT ( "includes executing iterators")); else test_iterators_string = - ASYS_TEXT (ACE_const_cast (char*, - "doesn't include executing iterators")); + ACE_const_cast (ASYS_TCHAR*, + ASYS_TEXT ("doesn't include executing iterators")); ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("time to test a map of size %d for %d iterations using %s (%s)\n"), diff --git a/tests/Map_Test.cpp b/tests/Map_Test.cpp index f59178295ee..4dd11067862 100644 --- a/tests/Map_Test.cpp +++ b/tests/Map_Test.cpp @@ -48,25 +48,25 @@ typedef ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, Hash_Key, ACE_Equal_To<KEY>, typedef ACE_Active_Map_Manager_Adapter<KEY, VALUE, Key_Adapter> ACTIVE_MAP_MANAGER_ADAPTER; static void -functionality_test (MAP &map, +functionality_test (MAP &map, size_t iterations) { size_t counter; VALUE i; KEY *original_keys = new KEY[iterations]; KEY *modified_keys = new KEY[iterations]; - + // Setup the keys to have some initial data. - for (i = 0; - i < iterations; + for (i = 0; + i < iterations; ++i) { original_keys[i].size (sizeof i / sizeof (KEY::TYPE)); ACE_OS::memcpy (&original_keys[i][0], - &i, - sizeof i); + &i, + sizeof i); } - + // Make a copy of the keys so that we can compare with the original // keys later. for (i = 0; i < iterations; ++i) @@ -82,7 +82,7 @@ functionality_test (MAP &map, ++counter; ACE_ASSERT (map.current_size () == counter); } - + // Forward iteration... { counter = 0; @@ -98,7 +98,7 @@ functionality_test (MAP &map, KEY original_key; ACE_ASSERT (map.recover_key (entry.first (), original_key) == 0); - + // Make sure recovering keys work. ACE_ASSERT (original_keys[entry.second ()] == original_key); @@ -123,9 +123,9 @@ functionality_test (MAP &map, // Reverse iteration... { - counter = iterations; + counter = iterations; MAP::reverse_iterator end = map.rend (); - + for (MAP::reverse_iterator iter = map.rbegin (); iter != end; ++iter) @@ -137,7 +137,7 @@ functionality_test (MAP &map, KEY original_key; ACE_ASSERT (map.recover_key (entry.first (), original_key) == 0); - + // Make sure recovering keys work. ACE_ASSERT (original_keys[entry.second ()] == original_key); @@ -154,7 +154,7 @@ functionality_test (MAP &map, original_value, entry.second ())); } - + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); ACE_ASSERT (counter == 0); @@ -183,7 +183,7 @@ functionality_test (MAP &map, } static void -insert_test (MAP &map, +insert_test (MAP &map, size_t iterations, KEY *keys) { @@ -198,7 +198,7 @@ insert_test (MAP &map, } static void -find_test (MAP &map, +find_test (MAP &map, size_t iterations, KEY *keys) { @@ -212,7 +212,7 @@ find_test (MAP &map, } static void -unbind_test (MAP &map, +unbind_test (MAP &map, size_t iterations, KEY *keys) { @@ -288,45 +288,90 @@ main (int argc, ASYS_TCHAR *argv[]) if (functionality_tests) { // Functionality test of the maps. - ACE_DEBUG ((LM_DEBUG, "\nMap Manager functionality test\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nMap Manager functionality test\n"))); functionality_test (map1, iterations); - - ACE_DEBUG ((LM_DEBUG, "\nHash Map Manager functionality test\n")); + + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nHash Map Manager functionality test\n"))); functionality_test (map2, iterations); - - ACE_DEBUG ((LM_DEBUG, "\nActive Map Manager functionality test\n")); + + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\nActive Map Manager functionality test\n"))); functionality_test (map3, iterations); - - ACE_DEBUG ((LM_DEBUG, "\n")); + + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); } // Performance test of the maps. KEY *keys = new KEY[iterations]; - - // Map Manager - performance_test (&insert_test, map1, iterations, keys, table_size, "Map Manager (insert test)"); - performance_test (&find_test, map1, iterations, keys, table_size, "Map Manager (find test)"); - performance_test (&unbind_test, map1, iterations, keys, table_size, "Map Manager (unbind test)"); - ACE_DEBUG ((LM_DEBUG, "\n")); + // Map Manager + performance_test (&insert_test, + map1, + iterations, + keys, + table_size, + ASYS_TEXT ("Map Manager (insert test)")); + performance_test (&find_test, + map1, + iterations, + keys, + table_size, + ASYS_TEXT ("Map Manager (find test)")); + performance_test (&unbind_test, + map1, + iterations, + keys, + table_size, + ASYS_TEXT ("Map Manager (unbind test)")); + + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); // Hash Map Manager - performance_test (&insert_test, map2, iterations, keys, table_size, "Hash Map Manager (insert test)"); - performance_test (&find_test, map2, iterations, keys, table_size, "Hash Map Manager (find test)"); - performance_test (&unbind_test, map2, iterations, keys, table_size, "Hash Map Manager (unbind test)"); - - ACE_DEBUG ((LM_DEBUG, "\n")); + performance_test (&insert_test, + map2, + iterations, + keys, + table_size, + ASYS_TEXT ("Hash Map Manager (insert test)")); + performance_test (&find_test, + map2, + iterations, + keys, + table_size, + ASYS_TEXT ("Hash Map Manager (find test)")); + performance_test (&unbind_test, + map2, + iterations, + keys, + table_size, + ASYS_TEXT ("Hash Map Manager (unbind test)")); + + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n"))); // Active Map Manager - performance_test (&insert_test, map3, iterations, keys, table_size, "Active Map Manager (insert test)"); - performance_test (&find_test, map3, iterations, keys, table_size, "Active Map Manager (find test)"); - performance_test (&unbind_test, map3, iterations, keys, table_size, "Active Map Manager (unbind test)"); + performance_test (&insert_test, + map3, + iterations, + keys, + table_size, + ASYS_TEXT ("Active Map Manager (insert test)")); + performance_test (&find_test, + map3, + iterations, + keys, + table_size, + ASYS_TEXT ("Active Map Manager (find test)")); + performance_test (&unbind_test, + map3, + iterations, + keys, + table_size, + ASYS_TEXT ("Active Map Manager (unbind test)")); delete[] keys; ACE_LOG_MSG->set_flags (ACE_Log_Msg::VERBOSE_LITE); ACE_END_TEST; - + return 0; } @@ -341,7 +386,7 @@ typedef ACE_Equal_To<KEY> COMPARE_KEYS; template class ACE_Array<char>; template class ACE_Array_Base<char>; -// Common +// Common template class ACE_Reference_Pair<const KEY, VALUE>; // Map and iterator classes. @@ -363,7 +408,7 @@ template class ACE_Map_Manager<ACE_Active_Map_Manager_Key, expanded_value, ACE_N template class ACE_Map_Iterator_Base<ACE_Active_Map_Manager_Key, expanded_value, ACE_Null_Mutex>; template class ACE_Map_Iterator<ACE_Active_Map_Manager_Key, expanded_value, ACE_Null_Mutex>; template class ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, expanded_value, ACE_Null_Mutex>; -template class ACE_Map_Entry<ACE_Active_Map_Manager_Key, expanded_value>; +template class ACE_Map_Entry<ACE_Active_Map_Manager_Key, expanded_value>; // Hash Map Manager related. template class ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, Hash_Key, COMPARE_KEYS, Key_Generator>; @@ -397,7 +442,7 @@ typedef ACE_Equal_To<KEY> COMPARE_KEYS; #pragma instantiate ACE_Array<char> #pragma instantiate ACE_Array_Base<char> -// Common +// Common #pragma instantiate ACE_Reference_Pair<const KEY, VALUE> // Map and iterator classes. @@ -419,7 +464,7 @@ typedef ACE_Equal_To<KEY> COMPARE_KEYS; #pragma instantiate ACE_Map_Iterator_Base<ACE_Active_Map_Manager_Key, expanded_value, ACE_Null_Mutex> #pragma instantiate ACE_Map_Iterator<ACE_Active_Map_Manager_Key, expanded_value, ACE_Null_Mutex> #pragma instantiate ACE_Map_Reverse_Iterator<ACE_Active_Map_Manager_Key, expanded_value, ACE_Null_Mutex> -#pragma instantiate ACE_Map_Entry<ACE_Active_Map_Manager_Key, expanded_value> +#pragma instantiate ACE_Map_Entry<ACE_Active_Map_Manager_Key, expanded_value> // Hash Map Manager related. #pragma instantiate ACE_Hash_Map_Manager_Ex_Adapter<KEY, VALUE, Hash_Key, COMPARE_KEYS, Key_Generator> diff --git a/tests/Message_Queue_Test.cpp b/tests/Message_Queue_Test.cpp index bbf1721b103..3e27c5858ae 100644 --- a/tests/Message_Queue_Test.cpp +++ b/tests/Message_Queue_Test.cpp @@ -208,7 +208,7 @@ single_thread_performance_test (int queue_type = 0) ACE_NEW_RETURN (msgq, ACE_Message_Queue_NT, -1); - message = "ACE_Message_Queue_NT, single thread test"; + message = ASYS_TEXT ("ACE_Message_Queue_NT, single thread test"); } #endif /* VXWORKS */ diff --git a/tests/Naming_Test.cpp b/tests/Naming_Test.cpp index b1be2e29b13..937a5411cf8 100644 --- a/tests/Naming_Test.cpp +++ b/tests/Naming_Test.cpp @@ -4,7 +4,7 @@ // // = LIBRARY // tests -// +// // = FILENAME // Naming_Test.cpp // @@ -15,7 +15,7 @@ // // = AUTHOR // Prashant Jain and Irfan Pyarali -// +// // ============================================================================ #include "test_config.h" @@ -34,18 +34,19 @@ static char name[BUFSIZ]; static char value[BUFSIZ]; static char type[BUFSIZ]; -static void +static void print_time (ACE_Profile_Timer &timer, const char *test) { ACE_Profile_Timer::ACE_Elapsed_Time et; timer.stop (); timer.elapsed_time (et); - - ACE_DEBUG ((LM_DEBUG, "\n ***** %s ***** \n", test)); - ACE_DEBUG ((LM_DEBUG, "real time = %f secs, user time = %f secs, system time = %f secs\n", + + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("\n ***** %s ***** \n"), test)); + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("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\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("time per call = %f usecs\n\n"), (et.real_time / double (ACE_NS_MAX_ENTRIES)) * 1000000)); } @@ -56,14 +57,14 @@ test_bind (ACE_Naming_Context &ns_context) randomize (array, sizeof array / sizeof (int)); // do the binds - for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) + for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) { ACE_OS::sprintf (name, "%s%d", "name", array[i]); ACE_WString w_name (name); - + ACE_OS::sprintf (value, "%s%d", "value", array[i]); ACE_WString w_value (value); - + ACE_OS::sprintf (type, "%s%d", "type", array [i]); ACE_ASSERT (ns_context.bind (w_name, w_value, type) != -1); } @@ -76,9 +77,9 @@ test_find_failure (ACE_Naming_Context &ns_context) ACE_WString w_name (name); ACE_WString w_value; char *l_type = 0; - + // Do the finds. - for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) + for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) ACE_ASSERT (ns_context.resolve (w_name, w_value, l_type) == -1); } @@ -89,7 +90,7 @@ test_rebind (ACE_Naming_Context &ns_context) randomize (array, sizeof array / sizeof (int)); // do the rebinds - for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) + for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) { ACE_OS::sprintf (name, "%s%d", "name", array[i]); ACE_WString w_name (name); @@ -109,7 +110,7 @@ test_unbind (ACE_Naming_Context &ns_context) randomize (array, sizeof array / sizeof (int)); // do the unbinds - for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) + for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) { ACE_OS::sprintf (name, "%s%d", "name", array[i]); ACE_WString w_name (name); @@ -127,13 +128,13 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result) randomize (array, sizeof array / sizeof (int)); // do the finds - for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) + for (size_t i = 0; i < ACE_NS_MAX_ENTRIES; i++) { if (sign == 1) { ACE_OS::sprintf (temp_val, "%s%d", "value", array[i]); ACE_OS::sprintf (temp_type, "%s%d", "type", array[i]); - } + } else { ACE_OS::sprintf (temp_val, "%s%d", "value", -array[i]); @@ -142,11 +143,11 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result) ACE_OS::sprintf (name, "%s%d", "name", array[i]); - ACE_WString w_name (name); + ACE_WString w_name (name); ACE_WString w_value; char *type_out = 0; ACE_WString val (temp_val); - + ACE_ASSERT (ns_context.resolve (w_name, w_value, type_out) == result); char *l_value = w_value.char_rep (); @@ -157,10 +158,11 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result) if (ns_context.name_options ()->debug ()) { if (type_out) - ACE_DEBUG ((LM_DEBUG, "Name: %s\tValue: %s\tType: %s\n", + ACE_DEBUG ((LM_DEBUG, + ASYS_TEXT ("Name: %s\tValue: %s\tType: %s\n"), name, l_value, type_out)); else - ACE_DEBUG ((LM_DEBUG, "Name: %s\tValue: %s\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Name: %s\tValue: %s\n"), name, l_value)); } @@ -172,14 +174,14 @@ test_find (ACE_Naming_Context &ns_context, int sign, int result) } delete[] l_value; - } + } } int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { TCHAR temp_file [BUFSIZ]; - ACE_START_TEST ("Naming_Test"); + ACE_START_TEST (ASYS_TEXT ("Naming_Test")); ACE_Naming_Context *ns_context; ACE_NEW_RETURN (ns_context, ACE_Naming_Context, -1); @@ -195,22 +197,23 @@ main (int argc, char *argv[]) if (unicode && name_options->use_registry () == 1) { name_options->namespace_dir (ACE_TEXT ("Software\\ACE\\Name Service")); - name_options->database (ACE_TEXT ("Version 1")); + name_options->database (ACE_TEXT ("Version 1")); } else { ACE_OS::strcpy (temp_file, ACE::basename (name_options->process_name (), ACE_DIRECTORY_SEPARATOR_CHAR)); ACE_OS::strcat (temp_file, ACE_TEXT ("XXXXXX")); - + // Set the database name using mktemp to generate a unique file name name_options->database (ACE_OS::mktemp (temp_file)); } ACE_ASSERT (ns_context->open (ACE_Naming_Context::PROC_LOCAL, 1) != -1); - ACE_DEBUG ((LM_DEBUG, "time to test %d iterations using %s\n", - ACE_NS_MAX_ENTRIES, name_options->use_registry () ? "Registry" : "ACE")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("time to test %d iterations using %s\n"), + ACE_NS_MAX_ENTRIES, name_options->use_registry () ? + ASYS_TEXT ("Registry") : ASYS_TEXT ("ACE"))); ACE_Profile_Timer timer; @@ -241,7 +244,7 @@ main (int argc, char *argv[]) timer.start (); // Remove all bindings from database - test_unbind (*ns_context); + test_unbind (*ns_context); print_time (timer, "Unbinds"); ACE_OS::sprintf (temp_file, ACE_TEXT ("%s%s%s"), @@ -253,7 +256,7 @@ main (int argc, char *argv[]) // Remove any existing files. No need to check return value here // since we don't care if the file doesn't exist. - ACE_OS::unlink (temp_file); + ACE_OS::unlink (temp_file); ACE_END_TEST; return 0; diff --git a/tests/New_Fail_Test.cpp b/tests/New_Fail_Test.cpp index bec580eda47..82b6d5db501 100644 --- a/tests/New_Fail_Test.cpp +++ b/tests/New_Fail_Test.cpp @@ -76,8 +76,8 @@ main (int, ASYS_TCHAR *[]) // conditions, exceptions can be disabled when the port is complete. #if (defined (__SUNPRO_CC) || defined (__GNUG__)) && \ !defined (ACE_HAS_EXCEPTIONS) - ACE_DEBUG ((LM_NOTICE, "Out-of-memory will throw an unhandled exception\n")); - ACE_DEBUG ((LM_NOTICE, "Rebuild with exceptions=1 to prevent this, but it may impair performance.\n")); + ACE_DEBUG ((LM_NOTICE, ASYS_TEXT ("Out-of-memory will throw an unhandled exception\n"))); + ACE_DEBUG ((LM_NOTICE, ASYS_TEXT ("Rebuild with exceptions=1 to prevent this, but it may impair performance.\n"))); // Use the static function addresses, to prevent warnings about the // functions not being used. @@ -102,14 +102,14 @@ main (int, ASYS_TCHAR *[]) if (i == MAX_ALLOCS_IN_TEST) { ACE_ERROR((LM_WARNING, - "Test didn't exhaust all available memory\n")); + ASYS_TEXT ("Test didn't exhaust all available memory\n"))); --i; // Back up to valid pointer for deleting } else { ACE_ASSERT (blocks[i] == 0); ACE_ASSERT (errno == ENOMEM); - ACE_DEBUG((LM_DEBUG, "ACE_NEW failed properly at block %d\n", i)); + ACE_DEBUG((LM_DEBUG, ASYS_TEXT ("ACE_NEW failed properly at block %d\n"), i)); } // Free the memory to try ACE_NEW_RETURN @@ -126,14 +126,14 @@ main (int, ASYS_TCHAR *[]) if (i == MAX_ALLOCS_IN_TEST) { ACE_ERROR((LM_WARNING, - "Test didn't exhaust all available memory\n")); + ASYS_TEXT ("Test didn't exhaust all available memory\n"))); --i; // Back up to valid pointer } else { ACE_ASSERT (blocks[i] == 0); ACE_ASSERT (errno == ENOMEM); - ACE_DEBUG ((LM_DEBUG, "ACE_NEW_RETURN failed properly at block %d\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("ACE_NEW_RETURN failed properly at block %d\n"), i)); } while (i >= 0) @@ -145,10 +145,10 @@ main (int, ASYS_TCHAR *[]) catch (...) { ACE_ERROR ((LM_ERROR, - "Caught exception during test; " - "ACE_bad_alloc not defined correctly, or\n")); + ASYS_TEXT ("Caught exception during test; ") + ASYS_TEXT ("ACE_bad_alloc not defined correctly, or\n"))); ACE_ERROR ((LM_ERROR, - "ACE_NEW_THROWS_EXCEPTIONS is not #defined (and should be).\n")); + ASYS_TEXT ("ACE_NEW_THROWS_EXCEPTIONS is not #defined (and should be).\n"))); status = 1; // Mark test failure } #endif /* ACE_HAS_EXCEPTIONS */ diff --git a/tests/Pipe_Test.cpp b/tests/Pipe_Test.cpp index 84bbefad8ce..8d4f1d9717e 100644 --- a/tests/Pipe_Test.cpp +++ b/tests/Pipe_Test.cpp @@ -83,14 +83,14 @@ open (ACE_Pipe &pipe, #endif /* ! ACE_LACKS_FORK */ int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { #if defined (ACE_LACKS_FORK) ACE_UNUSED_ARG (argc); ACE_UNUSED_ARG (argv); - ACE_START_TEST ("Pipe_Test"); - ACE_ERROR ((LM_INFO, "fork is not supported on this platform\n")); + ACE_START_TEST (ASYS_TEXT ("Pipe_Test")); + ACE_ERROR ((LM_INFO, ASYS_TEXT ("fork is not supported on this platform\n"))); ACE_END_TEST; #else /* ! ACE_LACKS_FORK */ parse_args (argc, argv); diff --git a/tests/Priority_Reactor_Test.cpp b/tests/Priority_Reactor_Test.cpp index 59b5f132e8b..08a91bb1f65 100644 --- a/tests/Priority_Reactor_Test.cpp +++ b/tests/Priority_Reactor_Test.cpp @@ -92,14 +92,14 @@ Read_Handler::open (void *) { if (this->peer ().enable (ACE_NONBLOCK) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) Read_Handler::open, " - "cannot set non blocking mode"), + ASYS_TEXT ("(%P|%t) Read_Handler::open, ") + ASYS_TEXT ("cannot set non blocking mode")), -1); if (reactor ()->register_handler (this, READ_MASK) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) Read_Handler::open, " - "cannot register handler"), + ASYS_TEXT ("(%P|%t) Read_Handler::open, ") + ASYS_TEXT ("cannot register handler")), -1); // A number larger than the actual number of priorities, so some @@ -110,8 +110,8 @@ Read_Handler::open (void *) started_++; ACE_DEBUG ((LM_DEBUG, - "(%P|%t) created svc_handler for handle %d " - "with priority %d\n", + ASYS_TEXT ("(%P|%t) created svc_handler for handle %d ") + ASYS_TEXT ("with priority %d\n"), get_handle (), priority ())); return 0; @@ -134,19 +134,19 @@ Read_Handler::handle_input (ACE_HANDLE h) return 0; if (result != 0) - ACE_DEBUG ((LM_DEBUG, "(%P|%t) %p\n", - "Read_Handler::handle_input")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("Read_Handler::handle_input"))); waiting_--; if (waiting_ == 0) { ACE_DEBUG ((LM_DEBUG, - "Last svc_handler closed, shutting down\n")); + ASYS_TEXT ("Last svc_handler closed, shutting down\n"))); ACE_Reactor::instance()->end_event_loop(); } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Read_Handler::handle_input closing down\n")); + ASYS_TEXT ("(%P|%t) Read_Handler::handle_input closing down\n"))); return -1; } @@ -174,8 +174,8 @@ Write_Handler::svc (void) if (this->peer ().send_n (ACE_ALPHABET, sizeof (ACE_ALPHABET) - 1) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "send_n")); + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("send_n"))); ACE_OS::sleep (pause); } @@ -189,7 +189,7 @@ client (void *arg) ACE_INET_Addr *connection_addr = ACE_reinterpret_cast (ACE_INET_Addr *, arg); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) running client\n")); + ASYS_TEXT ("(%P|%t) running client\n"))); CONNECTOR connector; Write_Handler *writer = 0; @@ -214,7 +214,7 @@ client (void *arg) options.timeout (tmp); writer = 0; ACE_DEBUG ((LM_DEBUG, - "(%P|%t) still trying to connect\n")); + ASYS_TEXT ("(%P|%t) still trying to connect\n"))); } else { @@ -225,23 +225,23 @@ client (void *arg) writer->destroy (); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) finishing client\n")); + ASYS_TEXT ("(%P|%t) finishing client\n"))); return 0; } } ACE_ERROR ((LM_ERROR, - "(%P|%t) failed to connect after %d retries\n", + ASYS_TEXT ("(%P|%t) failed to connect after %d retries\n"), max_retries)); return 0; } int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { - ACE_START_TEST ("Priority_Reactor_Test"); + ACE_START_TEST (ASYS_TEXT ("Priority_Reactor_Test")); - ACE_Get_Opt getopt (argc, argv, "dc:l:m:t:"); + ACE_Get_Opt getopt (argc, argv, ASYS_TEXT ("dc:l:m:t:")); for (int c; (c = getopt ()) != -1; ) switch (c) @@ -250,26 +250,26 @@ main (int argc, char *argv[]) opt_priority_reactor = 0; break; case 'c': - opt_nchildren = atoi (getopt.optarg); + opt_nchildren = ACE_OS::atoi (getopt.optarg); break; case 'l': - opt_nloops = atoi (getopt.optarg); + opt_nloops = ACE_OS::atoi (getopt.optarg); break; case 'm': - max_retries = atoi (getopt.optarg); + max_retries = ACE_OS::atoi (getopt.optarg); break; case 't': - opt_max_duration = atoi (getopt.optarg); + opt_max_duration = ACE_OS::atoi (getopt.optarg); break; case '?': default: ACE_ERROR_RETURN ((LM_ERROR, - "Usage: Priority_Reactor_Test " - " [-d] (disable priority reactor)\n" - " [-c nchildren] (number of threads/processes)\n" - " [-l loops] (number of loops per child)\n" - " [-m maxretries] (attempts to connect)\n" - " [-t max_time] (limits test duration)\n"), + ASYS_TEXT ("Usage: Priority_Reactor_Test ") + ASYS_TEXT (" [-d] (disable priority reactor)\n") + ASYS_TEXT (" [-c nchildren] (number of threads/processes)\n") + ASYS_TEXT (" [-l loops] (number of loops per child)\n") + ASYS_TEXT (" [-m maxretries] (attempts to connect)\n") + ASYS_TEXT (" [-t max_time] (limits test duration)\n")), -1); ACE_NOTREACHED (break); } @@ -305,12 +305,12 @@ main (int argc, char *argv[]) if (acceptor.open (ACE_sap_any_cast (const ACE_INET_Addr &)) == -1 || acceptor.acceptor ().get_local_addr (server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "open"), + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("open")), -1); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) starting server at port %d\n", + ASYS_TEXT ("(%P|%t) starting server at port %d\n"), server_addr.get_port_number ())); ACE_INET_Addr connection_addr (server_addr.get_port_number (), @@ -326,8 +326,8 @@ main (int argc, char *argv[]) (void *) &connection_addr, THR_NEW_LWP | THR_DETACHED) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n%a", - "thread create failed")); + ASYS_TEXT ("(%P|%t) %p\n%a"), + ASYS_TEXT ("thread create failed"))); } #elif !defined (ACE_LACKS_FORK) for (i = 0; i < opt_nchildren; ++i) @@ -336,7 +336,7 @@ main (int argc, char *argv[]) { case -1: ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n%a", "fork failed")); + ASYS_TEXT ("(%P|%t) %p\n%a"), ASYS_TEXT ("fork failed"))); exit (-1); /* NOTREACHED */ case 0: @@ -351,7 +351,7 @@ main (int argc, char *argv[]) } #else ACE_ERROR ((LM_ERROR, - "(%P|%t) only one thread may be run in a process on this platform\n%a", 1)); + ASYS_TEXT ("(%P|%t) only one thread may be run in a process on this platform\n%a"), 1)); #endif /* ACE_HAS_THREADS */ ACE_Time_Value tv (opt_max_duration); @@ -363,12 +363,12 @@ main (int argc, char *argv[]) if (Read_Handler::get_countdown () != 0) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) running out of time, " - "probably due to failed connections.\n")); + ASYS_TEXT ("(%P|%t) running out of time, ") + ASYS_TEXT ("probably due to failed connections.\n"))); } ACE_DEBUG ((LM_DEBUG, - "(%P|%t) waiting for the children...\n")); + ASYS_TEXT ("(%P|%t) waiting for the children...\n"))); #if defined (ACE_HAS_THREADS) ACE_Thread_Manager::instance ()->wait (); @@ -377,7 +377,7 @@ main (int argc, char *argv[]) { pid_t pid = ACE_OS::wait(); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) child %d terminated\n", + ASYS_TEXT ("(%P|%t) child %d terminated\n"), pid)); } #else diff --git a/tests/Process_Mutex_Test.cpp b/tests/Process_Mutex_Test.cpp index 065c9f20ada..f2644810065 100644 --- a/tests/Process_Mutex_Test.cpp +++ b/tests/Process_Mutex_Test.cpp @@ -98,14 +98,14 @@ acquire_release (void) #endif /* ! ACE_LACKS_FORK */ int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { #if defined (ACE_LACKS_FORK) ACE_UNUSED_ARG (argc); ACE_UNUSED_ARG (argv); - ACE_START_TEST ("Process_Mutex_Test"); - ACE_ERROR ((LM_INFO, "fork is not supported on this platform\n")); + ACE_START_TEST (ASYS_TEXT ("Process_Mutex_Test")); + ACE_ERROR ((LM_INFO, ASYS_TEXT ("fork is not supported on this platform\n"))); ACE_END_TEST; #else /* ! ACE_LACKS_FORK */ @@ -120,7 +120,7 @@ main (int argc, char *argv[]) } else { - ACE_START_TEST ("Process_Mutex_Test"); + ACE_START_TEST (ASYS_TEXT ("Process_Mutex_Test")); ACE_INIT_LOG ("Process_Mutex_Test-children"); ACE_Process_Options options; diff --git a/tests/Process_Strategy_Test.cpp b/tests/Process_Strategy_Test.cpp index c60e343395c..6c7e52b43e8 100644 --- a/tests/Process_Strategy_Test.cpp +++ b/tests/Process_Strategy_Test.cpp @@ -135,7 +135,7 @@ Options::concurrency_strategy (void) return this->concurrency_strategy_; } -const char * +const ASYS_TCHAR * Options::filename (void) { return this->filename_; @@ -161,32 +161,32 @@ Options::~Options (void) } int -Options::parse_args (int argc, char *argv[]) +Options::parse_args (int argc, ASYS_TCHAR *argv[]) { - ACE_Get_Opt get_opt (argc, argv, "p:c:f:"); + ACE_Get_Opt get_opt (argc, argv, ASYS_TEXT ("p:c:f:")); - this->filename_ = ACE_TEMP_FILE_NAME_A; + this->filename_ = ASYS_TEXT (ACE_TEMP_FILE_NAME_A); for (int c; (c = get_opt ()) != -1; ) switch (c) { case 'c': if (ACE_OS::strcmp (get_opt.optarg, - "REACTIVE") == 0) + ASYS_TEXT ("REACTIVE")) == 0) OPTIONS::instance ()->concurrency_type (Options::REACTIVE); #if !defined (ACE_LACKS_FORK) else if (ACE_OS::strcmp (get_opt.optarg, - "PROCESS") == 0) + ASYS_TEXT ("PROCESS")) == 0) OPTIONS::instance ()->concurrency_type (Options::PROCESS); #endif /* !ACE_LACKS_FORK */ #if defined (ACE_HAS_THREADS) else if (ACE_OS::strcmp (get_opt.optarg, - "THREAD") == 0) + ASYS_TEXT ("THREAD")) == 0) OPTIONS::instance ()->concurrency_type (Options::THREAD); #endif /* ACE_HAS_THREADS */ else ACE_DEBUG ((LM_DEBUG, - "WARNING: concurrency strategy \"%s\" is not supported\n", + ASYS_TEXT ("WARNING: concurrency strategy \"%s\" is not supported\n"), get_opt.optarg)); break; case 'f': @@ -194,22 +194,22 @@ Options::parse_args (int argc, char *argv[]) break; default: ACE_DEBUG ((LM_DEBUG, - "usage: %n [-f (filename)] [-c (concurrency strategy)]\n%a", 1)); + ASYS_TEXT ("usage: %n [-f (filename)] [-c (concurrency strategy)]\n%a"), 1)); /* NOTREACHED */ } // Initialize the file lock. Note that this object lives beyond the // lifetime of the Acceptor. - if (this->file_lock_.open (ACE_WIDE_STRING (this->filename_), + if (this->file_lock_.open (ASYS_ONLY_WIDE_STRING (this->filename_), O_RDWR | O_CREAT, ACE_DEFAULT_FILE_PERMS) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("open")), -1); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) opening %s on handle %d.\n", + ASYS_TEXT ("(%P|%t) opening %s on handle %d.\n"), this->filename_, this->file_lock_.get_handle ())); @@ -220,8 +220,8 @@ Options::parse_args (int argc, char *argv[]) (const void *) &count, sizeof count) != sizeof count) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n", - "write")); + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("write"))); // Initialize the Concurrency strategy. switch (this->concurrency_type_) @@ -283,7 +283,7 @@ Options::concurrency_type (Options::Concurrency_Type cs) Counting_Service::Counting_Service (ACE_Thread_Manager *) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) creating the Counting_Service\n")); + ASYS_TEXT ("(%P|%t) creating the Counting_Service\n"))); } // Read the current value from the shared file and return it to the @@ -295,7 +295,7 @@ Counting_Service::read (void) ACE_READ_GUARD_RETURN (ACE_File_Lock, ace_mon, OPTIONS::instance ()->file_lock (), -1); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) reading on handle %d.\n", + ASYS_TEXT ("(%P|%t) reading on handle %d.\n"), OPTIONS::instance ()->file_lock ().get_handle ())); int count; @@ -304,8 +304,8 @@ Counting_Service::read (void) sizeof count, 0) != sizeof count) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "read"), + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("read")), -1); char buf[BUFSIZ]; @@ -313,13 +313,13 @@ Counting_Service::read (void) "count = %d\n", count); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) count = %d\n", + ASYS_TEXT ("(%P|%t) count = %d\n"), count)); if (this->peer ().send_n (buf, n) != n) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "send_n"), + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("send_n")), -1); return 0; } @@ -332,7 +332,7 @@ Counting_Service::inc (void) ACE_WRITE_GUARD_RETURN (ACE_File_Lock, ace_mon, OPTIONS::instance ()->file_lock (), -1); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) incrementing on handle %d.\n", + ASYS_TEXT ("(%P|%t) incrementing on handle %d.\n"), OPTIONS::instance ()->file_lock ().get_handle ())); int count; @@ -341,12 +341,12 @@ Counting_Service::inc (void) sizeof count, 0) != sizeof count) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "read"), + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("read")), -1); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) incrementing count from %d to %d\n", + ASYS_TEXT ("(%P|%t) incrementing count from %d to %d\n"), count, count + 1)); count++; @@ -356,8 +356,8 @@ Counting_Service::inc (void) sizeof count, 0) != sizeof count) ACE_ERROR_RETURN ((LM_ERROR, - "(%P|%t) %p\n", - "write"), + ASYS_TEXT ("(%P|%t) %p\n"), + ASYS_TEXT ("write")), -1); return 0; } @@ -371,7 +371,7 @@ Counting_Service::handle_input (ACE_HANDLE) char buf[BUFSIZ]; ACE_DEBUG ((LM_DEBUG, - "(%P|%t) reading from peer on %d\n", + ASYS_TEXT ("(%P|%t) reading from peer on %d\n"), this->peer ().get_handle ())); size_t len; @@ -389,7 +389,7 @@ Counting_Service::handle_input (ACE_HANDLE) else { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) %d bytes of input on %d is %*s\n", + ASYS_TEXT ("(%P|%t) %d bytes of input on %d is %*s\n"), bytes, this->peer ().get_handle (), bytes, @@ -405,7 +405,7 @@ Counting_Service::handle_input (ACE_HANDLE) return this->inc (); else ACE_DEBUG ((LM_DEBUG, - "(%P|%t) no match...\n")); + ASYS_TEXT ("(%P|%t) no match...\n"))); return 0; } } @@ -414,7 +414,7 @@ int Counting_Service::svc (void) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) handling thread\n")); + ASYS_TEXT ("(%P|%t) handling thread\n"))); while (this->handle_input () >= 0) continue; @@ -440,7 +440,7 @@ int Counting_Service::open (void *) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) opening service\n")); + ASYS_TEXT ("(%P|%t) opening service\n"))); if (OPTIONS::instance ()->concurrency_type () == Options::PROCESS) { @@ -451,7 +451,7 @@ Counting_Service::open (void *) continue; ACE_DEBUG ((LM_DEBUG, - "(%P|%t) About to exit from the child\n")); + ASYS_TEXT ("(%P|%t) About to exit from the child\n"))); // Exit the child. ACE_OS::exit (0); @@ -482,12 +482,12 @@ client (void *arg) for (i = 0; i < ACE_MAX_ITERATIONS; i++) { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) client iteration %d\n", + ASYS_TEXT ("(%P|%t) client iteration %d\n"), i)); if (connector.connect (stream, server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("open")), 0); command = "inc"; command_len = ACE_OS::strlen (command); @@ -496,8 +496,8 @@ client (void *arg) &command_len, sizeof command_len, command, command_len) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("send")), 0); command = "read"; command_len = ACE_OS::strlen (command); @@ -506,23 +506,23 @@ client (void *arg) &command_len, sizeof command_len, command, command_len) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("send")), 0); else if (stream.recv (buf, sizeof buf) <= 0) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "recv"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("recv")), 0); // ACE_DEBUG ((LM_DEBUG, - // "(%P|%t) client iteration %d, buf = %s\n", + // ASYS_TEXT ("(%P|%t) client iteration %d, buf = %s\n"), // i, buf)); if (stream.close () == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "close"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("close")), 0); } @@ -532,20 +532,20 @@ client (void *arg) if (connector.connect (stream, server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("open")), 0); else if (stream.send (4, &command_len, sizeof command_len, command, command_len) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "send"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("send")), 0); else if ((bytes_read = stream.recv (buf, sizeof buf)) <= 0) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "recv"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("recv")), 0); else { @@ -556,7 +556,7 @@ client (void *arg) size_t count = ACE_OS::atoi (ACE_OS::strrchr (buf, ' ')); ACE_DEBUG ((LM_DEBUG, - "(%P|%t) count = %d\n", + ASYS_TEXT ("(%P|%t) count = %d\n"), count)); // Make sure that the count is correct. ACE_ASSERT (count == ACE_MAX_ITERATIONS); @@ -564,8 +564,8 @@ client (void *arg) if (stream.close () == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "close"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("close")), 0); // Remove the filename. @@ -590,14 +590,14 @@ server (void *) } int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { - ACE_START_TEST ("Process_Strategy_Test"); + ACE_START_TEST (ASYS_TEXT ("Process_Strategy_Test")); if (OPTIONS::instance ()->parse_args (argc, argv) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "parse_args"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("parse_args")), -1); ACCEPTOR acceptor; @@ -613,13 +613,13 @@ main (int argc, char *argv[]) OPTIONS::instance ()->concurrency_strategy ()) == -1 || acceptor.acceptor ().get_local_addr (server_addr) == -1) ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "open"), + ASYS_TEXT ("%p\n"), + ASYS_TEXT ("open")), -1); else { ACE_DEBUG ((LM_DEBUG, - "(%P|%t) starting server at port %d\n", + ASYS_TEXT ("(%P|%t) starting server at port %d\n"), server_addr.get_port_number ())); #if !defined (ACE_LACKS_FORK) @@ -631,8 +631,8 @@ main (int argc, char *argv[]) { case -1: ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n%a", - "fork failed")); + ASYS_TEXT ("(%P|%t) %p\n%a"), + ASYS_TEXT ("fork failed"))); exit (-1); /* NOTREACHED */ case 0: @@ -650,22 +650,22 @@ main (int argc, char *argv[]) (void *) 0, THR_NEW_LWP | THR_DETACHED) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n%a", - "thread create failed")); + ASYS_TEXT ("(%P|%t) %p\n%a"), + ASYS_TEXT ("thread create failed"))); if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (client), (void *) &server_addr, THR_NEW_LWP | THR_DETACHED) == -1) ACE_ERROR ((LM_ERROR, - "(%P|%t) %p\n%a", - "thread create failed")); + ASYS_TEXT ("(%P|%t) %p\n%a"), + ASYS_TEXT ("thread create failed"))); // Wait for the threads to exit. ACE_Thread_Manager::instance ()->wait (); #else ACE_ERROR ((LM_ERROR, - "(%P|%t) only one thread may be run in a process on this platform\n%a", + ASYS_TEXT ("(%P|%t) only one thread may be run in a process on this platform\n%a"), 1)); #endif /* ACE_HAS_THREADS */ } diff --git a/tests/Process_Strategy_Test.h b/tests/Process_Strategy_Test.h index 7944355255b..48b3f29d3bf 100644 --- a/tests/Process_Strategy_Test.h +++ b/tests/Process_Strategy_Test.h @@ -100,7 +100,7 @@ public: ~Options (void); // Destructor. - int parse_args (int argc, char *argv[]); + int parse_args (int argc, ASYS_TCHAR *argv[]); // Read command-line arguments and initialize options. enum Concurrency_Type @@ -117,7 +117,7 @@ public: ACE_File_Lock &file_lock (void); // Returns the file lock. - const char *filename (void); + const ASYS_TCHAR *filename (void); // Returns the filename that we're using as the lock. ACE_Concurrency_Strategy <Counting_Service> *concurrency_strategy (void); @@ -134,7 +134,7 @@ private: // Activation strategy that either forks a new process or spawns a // new thread for each client connection. - const char *filename_; + const ASYS_TCHAR *filename_; // Name of the counting file. }; diff --git a/tests/Reactor_Performance_Test.cpp b/tests/Reactor_Performance_Test.cpp index bff9127cca0..20db2146afc 100644 --- a/tests/Reactor_Performance_Test.cpp +++ b/tests/Reactor_Performance_Test.cpp @@ -111,8 +111,8 @@ Read_Handler::handle_input (ACE_HANDLE handle) return 0; else { - ACE_ERROR ((LM_ERROR, "handle_input: %p (errno: %d)\n", - "recv", errno)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("handle_input: %p (errno: %d)\n"), + ASYS_TEXT ("recv"), errno)); // This will cause handle_close to get called. return -1; diff --git a/tests/SOCK_Connector_Test.cpp b/tests/SOCK_Connector_Test.cpp index 9605321d521..171ee42777c 100644 --- a/tests/SOCK_Connector_Test.cpp +++ b/tests/SOCK_Connector_Test.cpp @@ -172,8 +172,8 @@ fail_no_listener_nonblocking (void) else { ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("Test not executed fully; " - "expected EWOULDBLOCK, %p (%d)\n"), + ASYS_TEXT ("Test not executed fully; ") + ASYS_TEXT ("expected EWOULDBLOCK, %p (%d)\n"), ASYS_TEXT ("not"), errno)); status = -1; } diff --git a/tests/SPIPE_Test.cpp b/tests/SPIPE_Test.cpp index 0fdcb2c56d7..ca977366c58 100644 --- a/tests/SPIPE_Test.cpp +++ b/tests/SPIPE_Test.cpp @@ -50,14 +50,14 @@ client (void *) ACE_OS::sleep (10); if (con.connect (cli_stream, ACE_SPIPE_Addr (ACE_WIDE_STRING (rendezvous))) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", rendezvous)); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), rendezvous)); for (char *c = ACE_ALPHABET; *c != '\0'; c++) if (cli_stream.send (c, 1) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "send_n")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("send_n"))); if (cli_stream.close () == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "close")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("close"))); #if !defined (ACE_WIN32) ACE_OS::exit (0); @@ -78,22 +78,22 @@ server (void *) // Initialize named pipe listener. if (acceptor.open (ACE_SPIPE_Addr (ACE_WIDE_STRING (rendezvous))) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "open")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("open"))); - ACE_DEBUG ((LM_DEBUG, "waiting for connection\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("waiting for connection\n"))); // Accept a client connection if (acceptor.accept (new_stream, 0) == -1) - ACE_ERROR ((LM_ERROR, "%p\n", "accept")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("accept"))); - ACE_DEBUG ((LM_DEBUG, "Accepted connection\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Accepted connection\n"))); while (new_stream.recv (buf, 1) > 0) { ACE_ASSERT (*t == buf[0]); t++; } - ACE_DEBUG ((LM_DEBUG, "End of connection. Closing handle\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("End of connection. Closing handle\n"))); new_stream.close (); acceptor.close (); return 0; @@ -101,16 +101,16 @@ server (void *) #endif /* ACE_HAS_STREAM_PIPES || ACE_WIN32 */ int -main (int, char *[]) +main (int, ASYS_TCHAR *[]) { - ACE_START_TEST ("SPIPE_Test"); + ACE_START_TEST (ASYS_TEXT ("SPIPE_Test")); #if defined (ACE_HAS_STREAM_PIPES) || defined (ACE_WIN32) #if !defined (ACE_LACKS_FORK) switch (ACE_OS::fork ()) { case -1: - ACE_ERROR ((LM_ERROR, "%p\n%a", "fork failed")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n%a"), ASYS_TEXT ("fork failed"))); exit (-1); case 0: client (0); @@ -121,18 +121,18 @@ main (int, char *[]) if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (client), (void *) 0, THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR ((LM_ERROR, "%p\n%a", "thread create failed")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n%a"), ASYS_TEXT ("thread create failed"))); if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (server), (void *) 0, THR_NEW_LWP | THR_DETACHED) == -1) - ACE_ERROR ((LM_ERROR, "%p\n%a", "thread create failed")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("%p\n%a"), ASYS_TEXT ("thread create failed"))); ACE_Thread_Manager::instance ()->wait (); #endif /* !ACE_LACKS_EXEC */ #else ACE_DEBUG ((LM_INFO, - "SPIPE is not supported on this platform\n")); + ASYS_TEXT ("SPIPE is not supported on this platform\n"))); #endif /* ACE_HAS_STREAM_PIPES || ACE_WIN32 */ ACE_END_TEST; return 0; diff --git a/tests/SV_Shared_Memory_Test.cpp b/tests/SV_Shared_Memory_Test.cpp index cbc5ee7a35a..c612e868b6f 100644 --- a/tests/SV_Shared_Memory_Test.cpp +++ b/tests/SV_Shared_Memory_Test.cpp @@ -68,16 +68,16 @@ parent (char *shm) shm[i] = SHMDATA[i]; if (mutex.release () == -1) - ACE_ERROR ((LM_ERROR, "(%P) %p", "parent mutex.release")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%P) %p"), ASYS_TEXT ("parent mutex.release"))); else if (synch.acquire () == -1) - ACE_ERROR ((LM_ERROR, "(%P) %p", "parent synch.acquire")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%P) %p"), ASYS_TEXT ("parent synch.acquire"))); if (myallocator ().remove () == -1) - ACE_ERROR ((LM_ERROR, "(%P) %p\n", "parent allocator.remove")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%P) %p\n"), ASYS_TEXT ("parent allocator.remove"))); if (mutex.remove () == -1) - ACE_ERROR ((LM_ERROR, "(%P) %p\n", "parent mutex.remove")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%P) %p\n"), ASYS_TEXT ("parent mutex.remove"))); if (synch.remove () == -1) - ACE_ERROR ((LM_ERROR, "(%P) %p\n", "parent synch.remove")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%P) %p\n"), ASYS_TEXT ("parent synch.remove"))); return 0; } @@ -102,15 +102,15 @@ child (char *shm) // semaphore wrappers. while (mutex.tryacquire () == -1) if (errno == EAGAIN) - ACE_DEBUG ((LM_DEBUG, "(%P) spinning in child!\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P) spinning in child!\n"))); else - ACE_ERROR_RETURN ((LM_ERROR, "(%P) child mutex.tryacquire"), 1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("(%P) child mutex.tryacquire")), 1); for (int i = 0; i < SHMSZ; i++) ACE_ASSERT (SHMDATA[i] == shm[i]); if (synch.release () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "(%P) child synch.release"), 1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("(%P) child synch.release")), 1); return 0; } @@ -127,9 +127,9 @@ template class ACE_Read_Guard<ACE_SV_Semaphore_Simple>; #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ #endif /* ACE_HAS_SYSV_IPC */ int -main (int, char *[]) +main (int, ASYS_TCHAR *[]) { - ACE_START_TEST ("SV_Shared_Memory_Test"); + ACE_START_TEST (ASYS_TEXT ("SV_Shared_Memory_Test")); #if defined (ACE_HAS_SYSV_IPC) && !defined (ACE_LACKS_FORK) && !defined(ACE_LACKS_SYSV_SHMEM) char *shm = (char *) myallocator ().malloc (27); @@ -137,7 +137,7 @@ main (int, char *[]) switch (ACE_OS::fork ("SV_Shared_Memory_Test.cpp")) { case -1: - ACE_ERROR_RETURN ((LM_ERROR, "(%P) fork failed\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("(%P) fork failed\n")), -1); /* NOTREACHED */ case 0: child (shm); @@ -148,7 +148,7 @@ main (int, char *[]) } #else ACE_ERROR ((LM_INFO, - "SYSV IPC, SYSV SHMEM, or fork are not supported on this platform\n")); + ASYS_TEXT ("SYSV IPC, SYSV SHMEM, or fork are not supported on this platform\n"))); #endif /* ACE_HAS_SYSV_IPC */ ACE_END_TEST; return 0; diff --git a/tests/Service_Config_Test.cpp b/tests/Service_Config_Test.cpp index 6f6e3b912a9..969df5f69c0 100644 --- a/tests/Service_Config_Test.cpp +++ b/tests/Service_Config_Test.cpp @@ -91,7 +91,7 @@ Test_Singleton::Test_Singleton (u_short variety) if (variety_ != current_++) { ACE_DEBUG ((LM_ERROR, - "ERROR: instance %u created out of order!\n", + ASYS_TEXT ("ERROR: instance %u created out of order!\n"), variety_)); ++error; } @@ -102,21 +102,21 @@ Test_Singleton::Test_Singleton (u_short variety) Test_Singleton::~Test_Singleton (void) { - /* ACE_DEBUG ((LM_DEBUG, "Test_Singleton %u dtor\n", variety_)); */ + /* ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Test_Singleton %u dtor\n"), variety_)); */ if (variety_ != --current_) { ACE_OS::fprintf (stderr, - "ERROR: instance %u destroyed out of order!\n", + ASYS_TEXT ("ERROR: instance %u destroyed out of order!\n"), variety_); - /* ACE_DEBUG ((LM_ERROR, "ERROR: instance %u destroyed out of order!\n", + /* ACE_DEBUG ((LM_ERROR, ASYS_TEXT ("ERROR: instance %u destroyed out of order!\n"), variety_)); */ ++error; } } static void -run_test (int argc, char *argv[]) +run_test (int argc, ASYS_TCHAR *argv[]) { // We need this scope to make sure that the destructor for the // <ACE_Service_Config> gets called. @@ -124,15 +124,15 @@ run_test (int argc, char *argv[]) ACE_ASSERT (daemon.open (argc, argv) != -1 || errno == ENOENT); - ACE_Time_Value tv (argc > 1 ? atoi (argv[1]) : 2); + ACE_Time_Value tv (argc > 1 ? ACE_OS::atoi (argv[1]) : 2); ACE_ASSERT (ACE_Reactor::run_event_loop (tv) == 0); } int -main (int argc, char *argv[]) +main (int argc, ASYS_TCHAR *argv[]) { - ACE_START_TEST ("Service_Config_Test"); + ACE_START_TEST (ASYS_TEXT ("Service_Config_Test")); for (u_int i = 0; i < VARIETIES; ++i) { @@ -140,7 +140,7 @@ main (int argc, char *argv[]) if (s == 0) ACE_ERROR_RETURN ((LM_ERROR, - "instance () allocate failed!\n"), + ASYS_TEXT ("instance () allocate failed!\n")), 1); } diff --git a/tests/Thread_Manager_Test.cpp b/tests/Thread_Manager_Test.cpp index c7141560e27..da7aaec3e3c 100644 --- a/tests/Thread_Manager_Test.cpp +++ b/tests/Thread_Manager_Test.cpp @@ -235,8 +235,8 @@ main (int, ASYS_TCHAR *[]) // so it's allowed to ENOTSUP; anything else is a hard fail. ACE_ASSERT (errno == ENOTSUP); ACE_DEBUG((LM_DEBUG, - ASYS_TEXT (" OK: suspend_grp isn't supported with " - "Pthreads\n"))); + ASYS_TEXT (" OK: suspend_grp isn't supported with ") + ASYS_TEXT ("Pthreads\n"))); } // Wait for 1 more second and then resume every thread in the @@ -250,8 +250,8 @@ main (int, ASYS_TCHAR *[]) { ACE_ASSERT (errno == ENOTSUP); ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT (" OK: resume_grp isn't supported with " - "Pthreads\n"))); + ASYS_TEXT (" OK: resume_grp isn't supported with ") + ASYS_TEXT ("Pthreads\n"))); } // Wait for 1 more second and then send a SIGINT to every thread in @@ -293,7 +293,7 @@ main (int, ASYS_TCHAR *[]) max_wait.msec ())); else ACE_ERROR ((LM_ERROR, - "%p\n", "wait")); + ASYS_TEXT ("%p\n"), ASYS_TEXT ("wait"))); status = -1; } diff --git a/tests/Time_Service_Test.cpp b/tests/Time_Service_Test.cpp index ecb5436bb28..acea9415223 100644 --- a/tests/Time_Service_Test.cpp +++ b/tests/Time_Service_Test.cpp @@ -39,9 +39,9 @@ ACE_TEXT ("main") ACE_PLATFORM_EXE_SUFFIX \ ACE_TEXT (" -f ") ACE_PLATFORM int -main (int, char *[]) +main (int, ASYS_TCHAR *[]) { - ACE_START_TEST ("Time_Service_Test"); + ACE_START_TEST (ASYS_TEXT ("Time_Service_Test")); // Make sure that the backing store is not there. We need to make // sure because this test kills the Time Clerk and on some platforms @@ -56,10 +56,10 @@ main (int, char *[]) ACE_Process server; if (server.spawn (server_options) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, "%n; %p (%s).\n", - "Server fork failed", server_cl), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%n; %p (%s).\n"), + ASYS_TEXT ("Server fork failed"), server_cl), -1); else - ACE_DEBUG ((LM_DEBUG, "Server forked with pid = %d.\n", server.getpid ())); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Server forked with pid = %d.\n"), server.getpid ())); ACE_OS::sleep (3); @@ -69,19 +69,19 @@ main (int, char *[]) ACE_Process clerk; if (clerk.spawn (clerk_options) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, "%n; %p: (%s).\n", - "Clerk fork failed", clerk_cl), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%n; %p: (%s).\n"), + ASYS_TEXT ("Clerk fork failed"), clerk_cl), -1); else - ACE_DEBUG ((LM_DEBUG, "Clerk forked with pid = %d.\n", clerk.getpid ())); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Clerk forked with pid = %d.\n"), clerk.getpid ())); - ACE_DEBUG ((LM_DEBUG, "Sleeping...\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Sleeping...\n"))); ACE_OS::sleep (10); if (clerk.terminate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "Terminate failed for clerk.\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("Terminate failed for clerk.\n")), -1); if (server.terminate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "Terminate failed for server.\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("Terminate failed for server.\n")), -1); // Since we kill the clerk process, on Win32 it may not do a // graceful shutdown and the backing store file is left behind. diff --git a/tests/Tokens_Test.cpp b/tests/Tokens_Test.cpp index b4b75cb6c7d..d6678b9a168 100644 --- a/tests/Tokens_Test.cpp +++ b/tests/Tokens_Test.cpp @@ -45,7 +45,7 @@ USELIB("..\ace\aced.lib"); typedef ACE_Token_Invariant_Manager TOKEN_INVARIANTS; -static const char *server_host = ACE_DEFAULT_SERVER_HOST; +static const ASYS_TCHAR *server_host = ACE_DEFAULT_SERVER_HOST; static const int server_port = 23456; // Synchronize starts of threads, so that they all start before one @@ -59,7 +59,7 @@ struct Test_Params public: ACE_Token_Proxy *token1_; ACE_Token_Proxy *token2_; - const char *collection_name_; + const ASYS_TCHAR *collection_name_; }; static void * @@ -70,7 +70,7 @@ run_thread (void *vp) collection.insert (*(tp->token1_)); collection.insert (*(tp->token2_)); - ACE_DEBUG ((LM_DEBUG, "(%t) new thread.\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) new thread.\n"))); thread_start->wait (); int count = 50; @@ -80,17 +80,19 @@ run_thread (void *vp) { if (ACE_OS::last_error () == EDEADLK) { - ACE_DEBUG ((LM_DEBUG, "deadlock detected in acquire")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("deadlock detected in acquire"))); continue; } - ACE_ERROR ((LM_ERROR, "(%t) %p acquire failed\n","run_thread")); + ACE_ERROR ((LM_ERROR, + ASYS_TEXT ("(%t) %p acquire failed\n"), + ASYS_TEXT ("run_thread"))); return (void *) -1; } ACE_ASSERT ((TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1) || (TOKEN_INVARIANTS::instance ()->acquired (tp->token2_) == 1)); - ACE_DEBUG ((LM_DEBUG, "(%t) %s acquired.\n", collection.name ())); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %s acquired.\n"), collection.name ())); TOKEN_INVARIANTS::instance ()->releasing (tp->token1_); TOKEN_INVARIANTS::instance ()->releasing (tp->token2_); @@ -99,17 +101,18 @@ run_thread (void *vp) { if (ACE_OS::last_error () == EDEADLK) { - ACE_DEBUG ((LM_DEBUG, "deadlock detected")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("deadlock detected"))); goto deadlock; } - ACE_ERROR ((LM_ERROR, "(%t) %p renew failed\n","run_thread")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%t) %p renew failed\n"), + ASYS_TEXT ("run_thread"))); return (void *) -1; } ACE_ASSERT (TOKEN_INVARIANTS::instance ()->acquired (tp->token1_) == 1 || TOKEN_INVARIANTS::instance ()->acquired (tp->token2_) == 1); - ACE_DEBUG ((LM_DEBUG, "(%t) %s renewed.\n", collection.name ())); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %s renewed.\n"), collection.name ())); deadlock: @@ -118,15 +121,15 @@ run_thread (void *vp) if (collection.release () == -1) { - ACE_ERROR ((LM_ERROR, "(%t) %p release failed\n","run_thread")); + ACE_ERROR ((LM_ERROR, ASYS_TEXT ("(%t) %p release failed\n"),ASYS_TEXT ("run_thread"))); return (void *) -1; } - ACE_DEBUG ((LM_DEBUG, "(%t) %s released.\n", collection.name ())); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) %s released.\n"), collection.name ())); } - ACE_DEBUG ((LM_DEBUG, "(%t) thread finished.\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) thread finished.\n"))); return 0; } @@ -142,15 +145,15 @@ run_test (ACE_Token_Proxy *A, // tp1 and tp2 can run concurrently. Neither tp1 or tp3 can run // when tp2 is running. - tp1.collection_name_ = "A and Reader"; + tp1.collection_name_ = ASYS_TEXT ("A and Reader"); tp1.token1_ = A; tp1.token2_ = R; - tp2.collection_name_ = "A and Writer"; + tp2.collection_name_ = ASYS_TEXT ("A and Writer"); tp2.token1_ = A; tp2.token2_ = W; - tp3.collection_name_ = "B and Reader"; + tp3.collection_name_ = ASYS_TEXT ("B and Reader"); tp3.token1_ = B; tp3.token2_ = R; @@ -159,35 +162,35 @@ run_test (ACE_Token_Proxy *A, if (mgr->spawn (ACE_THR_FUNC (run_thread), (void *) &tp1, THR_BOUND) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, "%p\n", "spawn 1 failed"), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn 1 failed")), -1); if (mgr->spawn (ACE_THR_FUNC (run_thread), (void *) &tp2, THR_BOUND) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, "%p\n", "spawn 2 failed"), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn 2 failed")), -1); if (mgr->spawn (ACE_THR_FUNC (run_thread), (void *) &tp3, THR_BOUND) == -1) - ACE_ERROR_RETURN ((LM_DEBUG, "%p\n", "spawn 3 failed"), -1); + ACE_ERROR_RETURN ((LM_DEBUG, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn 3 failed")), -1); // Wait for all threads to exit. mgr->wait (); - ACE_DEBUG ((LM_DEBUG, "Test finished.\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Test finished.\n"))); return 0; } #endif /* ACE_HAS_THREADS */ int -main (int, char *[]) +main (int, ASYS_TCHAR *[]) { - ACE_START_TEST ("Tokens_Test"); + ACE_START_TEST (ASYS_TEXT ("Tokens_Test")); #if defined (ACE_HAS_THREADS) ACE_Token_Proxy *A = 0, *B = 0, *R = 0, *W = 0; - ACE_NEW_RETURN (A, ACE_Local_Mutex ("L Mutex A", 0, 0), -1); - ACE_NEW_RETURN (B, ACE_Local_Mutex ("L Mutex B", 0, 0), -1); - ACE_NEW_RETURN (R, ACE_Local_RLock ("L Reader Lock", 0, 0), -1); - ACE_NEW_RETURN (W, ACE_Local_WLock ("L Writer Lock", 0, 0), -1); + ACE_NEW_RETURN (A, ACE_Local_Mutex (ASYS_TEXT ("L Mutex A"), 0, 0), -1); + ACE_NEW_RETURN (B, ACE_Local_Mutex (ASYS_TEXT ("L Mutex B"), 0, 0), -1); + ACE_NEW_RETURN (R, ACE_Local_RLock (ASYS_TEXT ("L Reader Lock"), 0, 0), -1); + ACE_NEW_RETURN (W, ACE_Local_WLock (ASYS_TEXT ("L Writer Lock"), 0, 0), -1); ACE_NEW_RETURN (thread_start, ACE_Barrier (3), -1); run_test (A, B, R, W); @@ -203,23 +206,23 @@ main (int, char *[]) ACE_Process_Options options; options.command_line (cl); - ACE_DEBUG ((LM_DEBUG, "Forking Token Service.\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Forking Token Service.\n"))); // Start up the token server for the remote test. ACE_Process new_process; if (new_process.spawn (options) == -1) - ACE_ERROR ((LM_DEBUG, "%n; %p (%s), will not run remote test.\n", - "Server fork failed", cl)); + ACE_ERROR ((LM_DEBUG, ASYS_TEXT ("%n; %p (%s), will not run remote test.\n"), + ASYS_TEXT ("Server fork failed"), cl)); else { - ACE_DEBUG ((LM_DEBUG, "Server forked with pid = %d.\n", + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("Server forked with pid = %d.\n"), new_process.getpid ())); // Wait for the server to start. ACE_OS::sleep (3); ACE_DEBUG ((LM_DEBUG, - "Using Token Server on %s at port %d.\n", + ASYS_TEXT ("Using Token Server on %s at port %d.\n"), server_host, server_port)); ACE_Remote_Mutex::set_server_address (ACE_INET_Addr (server_port, server_host)); @@ -229,10 +232,10 @@ main (int, char *[]) delete R; delete W; - ACE_NEW_RETURN (A, ACE_Remote_Mutex ("R Mutex A", 0, 1), -1); - ACE_NEW_RETURN (B, ACE_Remote_Mutex ("R Mutex B", 0, 1), -1); - ACE_NEW_RETURN (R, ACE_Remote_RLock ("R Reader Lock", 0, 1), -1); - ACE_NEW_RETURN (W, ACE_Remote_WLock ("R Writer Lock", 0, 1), -1); + ACE_NEW_RETURN (A, ACE_Remote_Mutex (ASYS_TEXT ("R Mutex A"), 0, 1), -1); + ACE_NEW_RETURN (B, ACE_Remote_Mutex (ASYS_TEXT ("R Mutex B"), 0, 1), -1); + ACE_NEW_RETURN (R, ACE_Remote_RLock (ASYS_TEXT ("R Reader Lock"), 0, 1), -1); + ACE_NEW_RETURN (W, ACE_Remote_WLock (ASYS_TEXT ("R Writer Lock"), 0, 1), -1); run_test (A, B, R, W); @@ -241,7 +244,7 @@ main (int, char *[]) // Kill the token server. if (new_process.terminate () == -1) - ACE_ERROR_RETURN ((LM_ERROR, "Kill failed.\n"), -1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("Kill failed.\n")), -1); } delete thread_start; @@ -251,10 +254,10 @@ main (int, char *[]) delete R; delete W; - ACE_DEBUG ((LM_DEBUG, "(%t) main thread exiting.\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) main thread exiting.\n"))); #else ACE_ERROR ((LM_INFO, - "threads not supported on this platform\n")); + ASYS_TEXT ("threads not supported on this platform\n"))); #endif /* ACE_HAS_THREADS */ ACE_END_TEST; return 0; diff --git a/tests/UPIPE_SAP_Test.cpp b/tests/UPIPE_SAP_Test.cpp index 04fcd624c91..4401fc202d8 100644 --- a/tests/UPIPE_SAP_Test.cpp +++ b/tests/UPIPE_SAP_Test.cpp @@ -45,11 +45,11 @@ connector (void *) ACE_OS::sleep (5); - ACE_DEBUG ((LM_DEBUG, "(%t) connector starting connect\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) connector starting connect\n"))); ACE_UPIPE_Connector con; if (con.connect (c_stream, addr) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) connector ACE_UPIPE_Connector failed\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) connector ACE_UPIPE_Connector failed\n"))); ACE_Message_Block *mb; @@ -58,10 +58,10 @@ connector (void *) mb->copy ("hello"); if (c_stream.send (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) error connector send\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) error connector send\n"))); if (c_stream.recv (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) error connector recv\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) error connector recv\n"))); ACE_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), "thanks") == 0); @@ -71,10 +71,10 @@ connector (void *) // Now try the send()/recv() interface. char mytext[] = "This string is sent by connector as a buffer"; - ACE_DEBUG ((LM_DEBUG, "(%t) connector sending text\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) connector sending text\n"))); if (c_stream.send (mytext, sizeof (mytext)) == -1) ACE_DEBUG ((LM_DEBUG, - "(%t) buffer send from connector failed\n")); + ASYS_TEXT ("(%t) buffer send from connector failed\n"))); char conbuf[BUFSIZ]; // Buffer to receive response. @@ -84,17 +84,17 @@ connector (void *) { if (c_stream.recv (&c, 1) == -1) ACE_DEBUG ((LM_DEBUG, - "(%t) buffer recv from connector failed\n")); + ASYS_TEXT ("(%t) buffer recv from connector failed\n"))); else conbuf[i] = c; } conbuf[i] = '\0'; - ACE_DEBUG ((LM_DEBUG, "(%t) conbuf = %s\n", conbuf)); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) conbuf = %s\n"), conbuf)); ACE_ASSERT (ACE_OS::strcmp (conbuf, "this is the acceptor response!") == 0); c_stream.close (); - ACE_DEBUG ((LM_DEBUG, "(%t) exiting thread\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) exiting thread\n"))); return 0; } @@ -106,12 +106,12 @@ acceptor (void *args) if (acceptor->accept (s_stream) == -1) ACE_DEBUG ((LM_DEBUG, - "(%t) ACE_UPIPE_Acceptor.accept failed\n")); + ASYS_TEXT ("(%t) ACE_UPIPE_Acceptor.accept failed\n"))); ACE_Message_Block *mb = 0; if (s_stream.recv (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) acceptor recv failed\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) acceptor recv failed\n"))); ACE_ASSERT (ACE_OS::strcmp (mb->rd_ptr (), "hello") == 0); @@ -119,13 +119,13 @@ acceptor (void *args) mb->copy ("thanks"); if (s_stream.send (mb) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) acceptor send failed\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) acceptor send failed\n"))); char s_buf[BUFSIZ]; - ACE_DEBUG ((LM_DEBUG, "(%t) acceptor sleeping on recv\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) acceptor sleeping on recv\n"))); if (s_stream.recv (s_buf, sizeof (s_buf)) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) acceptor recv failed\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) acceptor recv failed\n"))); else ACE_ASSERT (ACE_OS::strcmp (s_buf, "This string is sent by connector as a buffer") == 0); @@ -134,18 +134,18 @@ acceptor (void *args) ACE_OS::strcpy (s_buf, svr_response); if (s_stream.send (s_buf, sizeof (svr_response)) == -1) - ACE_DEBUG ((LM_DEBUG, "(%t) acceptor send failed\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) acceptor send failed\n"))); s_stream.close (); - ACE_DEBUG ((LM_DEBUG, "(%t) exiting thread\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) exiting thread\n"))); return 0; } #endif /* ACE_HAS_THREADS && defined ACE_HAS_STREAM_PIPES || (ACE_WIN32&&NT4)*/ int -main (int, char *[]) +main (int, ASYS_TCHAR *[]) { - ACE_START_TEST ("UPIPE_SAP_Test"); + ACE_START_TEST (ASYS_TEXT ("UPIPE_SAP_Test")); #if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_STREAM_PIPES) || \ (defined (ACE_WIN32) && \ @@ -158,17 +158,17 @@ main (int, char *[]) (void *) &acc, THR_NEW_LWP, 0) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn"), 1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn")), 1); // Spawn a connector thread. if (ACE_Thread_Manager::instance ()->spawn (ACE_THR_FUNC (connector), (void *) 0, THR_NEW_LWP, 0) == -1) - ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "spawn"), 1); + ACE_ERROR_RETURN ((LM_ERROR, ASYS_TEXT ("%p\n"), ASYS_TEXT ("spawn")), 1); ACE_Thread_Manager::instance ()->wait (); - ACE_DEBUG ((LM_DEBUG, "(%t) joined with acceptor thread\n")); + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%t) joined with acceptor thread\n"))); // Close the acceptor acc.close (); @@ -176,9 +176,9 @@ main (int, char *[]) #else #if !defined (ACE_HAS_THREADS) - ACE_ERROR ((LM_INFO, "threads not supported on this platform\n")); + ACE_ERROR ((LM_INFO, ASYS_TEXT ("threads not supported on this platform\n"))); #else - ACE_ERROR ((LM_INFO, "UPIPE is not supported on this platform\n")); + ACE_ERROR ((LM_INFO, ASYS_TEXT ("UPIPE is not supported on this platform\n"))); #endif /* !defined (ACE_HAS_THREADS) */ #endif /* defined (ACE_HAS_THREADS) && (defined (ACE_HAS_STREAM_PIPES) || defined (ACE_WIN32) && NT4) */ diff --git a/tests/Upgradable_RW_Test.cpp b/tests/Upgradable_RW_Test.cpp index 90e76e41331..791b6d89d1b 100644 --- a/tests/Upgradable_RW_Test.cpp +++ b/tests/Upgradable_RW_Test.cpp @@ -110,9 +110,9 @@ static void print_usage_and_die (void) { ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("usage: %n [-r n_readers] [-w n_writers]\n" - " [-e max_entries] [-u try update] " - "[-n iteration_count] [-f for FIFO threads]\n"))); + ASYS_TEXT ("usage: %n [-r n_readers] [-w n_writers]\n") + ASYS_TEXT (" [-e max_entries] [-u try update] ") + ASYS_TEXT ("[-n iteration_count] [-f for FIFO threads]\n"))); ACE_OS::exit (1); } @@ -295,11 +295,11 @@ Time_Calculation ::print_stats (void) double tmp = 1000 / elapsed_time.real_time; ACE_DEBUG ((LM_DEBUG, - ASYS_TEXT ("\n" - "\treal_time\t = %0.06f ms, \n" - "\tuser_time\t = %0.06f ms, \n" - "\tsystem_time\t = %0.06f ms, \n" - "\t%0.00f calls/second\n"), + ASYS_TEXT ("\n") + ASYS_TEXT ("\treal_time\t = %0.06f ms, \n") + ASYS_TEXT ("\tuser_time\t = %0.06f ms, \n") + ASYS_TEXT ("\tsystem_time\t = %0.06f ms, \n") + ASYS_TEXT ("\t%0.00f calls/second\n"), elapsed_time.real_time < 0.0 ? 0.0 : elapsed_time.real_time, elapsed_time.user_time < 0.0 ? 0.0 : elapsed_time.user_time, elapsed_time.system_time < 0.0 ? 0.0 : elapsed_time.system_time, @@ -311,7 +311,7 @@ Time_Calculation ::print_stats (void) } else ACE_ERROR ((LM_ERROR, - "\tNo time stats printed. Zero iterations or error ocurred.\n")); + ASYS_TEXT ("\tNo time stats printed. Zero iterations or error ocurred.\n"))); } static int diff --git a/tests/test_config.h b/tests/test_config.h index 2b5f34ae755..6b2f2a11bae 100644 --- a/tests/test_config.h +++ b/tests/test_config.h @@ -173,12 +173,12 @@ char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz"; // This is the only way I could figure out to avoid an error // about attempting to unlink a non-existant file. #define ACE_INIT_LOG(NAME) \ - char temp[MAXPATHLEN]; \ - ACE_OS::sprintf (temp, "%s%s%s", \ - ACE_LOG_DIRECTORY_A, \ - ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR_A), \ - ACE_LOG_FILE_EXT_NAME_A); \ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Deleting old log file %s (if any)\n\n", temp)); \ + ASYS_TCHAR temp[MAXPATHLEN]; \ + ACE_OS::sprintf (temp, ASYS_TEXT ("%s%s%s"), \ + ACE_SYS_TEXT (ACE_LOG_DIRECTORY_A), \ + ACE::basename (NAME, ASYS_TEXT (ACE_DIRECTORY_SEPARATOR_CHAR_A)), \ + ASYS_TEXT (ACE_LOG_FILE_EXT_NAME_A)); \ + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) Deleting old log file %s (if any)\n\n"), temp)); \ int fd_init_log; \ if ((fd_init_log = ACE_OS::open (temp, \ O_WRONLY | O_CREAT, 0x644)) != ERROR) \ @@ -194,12 +194,12 @@ char ACE_ALPHABET[] = "abcdefghijklmnopqrstuvwxyz"; #endif /* ghs */ #else /* ! VXWORKS */ #define ACE_INIT_LOG(NAME) \ - char temp[MAXPATHLEN]; \ - ACE_OS::sprintf (temp, "%s%s%s", \ - ACE_LOG_DIRECTORY_A, \ - ACE::basename (NAME, ACE_DIRECTORY_SEPARATOR_CHAR_A), \ - ACE_LOG_FILE_EXT_NAME_A); \ - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Deleting old log file %s (if any)\n\n", temp)); \ + ASYS_TCHAR temp[MAXPATHLEN]; \ + ACE_OS::sprintf (temp, ASYS_TEXT ("%s%s%s"), \ + ASYS_TEXT (ACE_LOG_DIRECTORY_A), \ + ACE::basename (NAME, ASYS_TEXT (ACE_DIRECTORY_SEPARATOR_CHAR_A)), \ + ASYS_TEXT (ACE_LOG_FILE_EXT_NAME_A)); \ + ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("(%P|%t) Deleting old log file %s (if any)\n\n"), temp)); \ ACE_OS::unlink (temp); #endif /* ! VXWORKS */ @@ -290,7 +290,7 @@ ACE_Test_Output::set_output (const ASYS_TCHAR *filename, int append) // directory does exist, it causes a wierd console error message // about "cat: input error on standard input: Is a directory". So, // VxWorks users must create the directory manually. - ACE_OS::mkdir (ACE_LOG_DIRECTORY_A); + ACE_OS::mkdir (ASYS_TEXT (ACE_LOG_DIRECTORY_A)); # endif /* ! VXWORKS */ # if !defined (ACE_LACKS_IOSTREAM_TOTALLY) @@ -300,7 +300,8 @@ ACE_Test_Output::set_output (const ASYS_TCHAR *filename, int append) else flags |= ios::trunc; - this->output_file_->open (temp, flags); + this->output_file_->open (ASYS_ONLY_MULTIBYTE_STRING (temp), + flags); if (this->output_file_->bad ()) return -1; #else /* when ACE_LACKS_IOSTREAM_TOTALLY */ |