diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-05 09:52:56 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-05 09:52:56 +0000 |
commit | a88a9ed99c706658a9e6cdb5cdedbb3d977c6a62 (patch) | |
tree | 80ad8b136bf72d82f20771a08d5a39f4ffbab77d /ace | |
parent | c4c4914a8a212dffcedccf3ab15ec1118eab5bbb (diff) | |
download | ATCD-a88a9ed99c706658a9e6cdb5cdedbb3d977c6a62.tar.gz |
Pure unicode fixes.
Diffstat (limited to 'ace')
65 files changed, 724 insertions, 598 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 */ |