diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-06-23 08:05:03 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-06-23 08:05:03 +0000 |
commit | 31d9a45d1387a00a3c04c231d481e3af9a874ee7 (patch) | |
tree | f0131bd31b083c7c7a26da9fb807c6ed9e689859 | |
parent | bad20233663443a04c3a334ea5f1534b2e876bdc (diff) | |
download | ATCD-31d9a45d1387a00a3c04c231d481e3af9a874ee7.tar.gz |
*** empty log message ***
-rw-r--r-- | ace/Acceptor.cpp | 24 | ||||
-rw-r--r-- | ace/Auto_Ptr.cpp | 20 | ||||
-rw-r--r-- | ace/Auto_Ptr.h | 52 | ||||
-rw-r--r-- | ace/Auto_Ptr.i | 109 | ||||
-rw-r--r-- | ace/Connector.cpp | 2 | ||||
-rw-r--r-- | ace/DEV_Addr.h | 7 | ||||
-rw-r--r-- | ace/DEV_Addr.i | 18 | ||||
-rw-r--r-- | ace/FILE_Addr.h | 7 | ||||
-rw-r--r-- | ace/FILE_Addr.i | 13 | ||||
-rw-r--r-- | ace/OS.cpp | 8 | ||||
-rw-r--r-- | ace/OS.h | 24 | ||||
-rw-r--r-- | ace/SPIPE_Addr.cpp | 10 | ||||
-rw-r--r-- | ace/SPIPE_Addr.h | 13 | ||||
-rw-r--r-- | ace/SPIPE_Addr.i | 13 | ||||
-rw-r--r-- | examples/Registry/test_registry_iterator.cpp | 6 |
15 files changed, 223 insertions, 103 deletions
diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp index b75355070d0..7b92667a9b7 100644 --- a/ace/Acceptor.cpp +++ b/ace/Acceptor.cpp @@ -128,11 +128,13 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (char **strp, if (this->acceptor ().get_local_addr (addr) == -1) return -1; - else if (addr.addr_to_string (addr_str, sizeof addr) == -1) + else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) return -1; - + ACE_OS::sprintf (buf, "%s\t %s %s", - "ACE_Acceptor", addr_str, "# acceptor factory\n"); + "ACE_Acceptor", + addr_str, + "# acceptor factory\n"); if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; @@ -619,7 +621,7 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_signal (int, sig template <class SVC_HANDLER, ACE_PEER_ACCEPTOR_1> int ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (char **strp, - size_t length) const + size_t length) const { ACE_TRACE ("ACE_Strategy_Acceptor::info"); char buf[BUFSIZ]; @@ -628,7 +630,7 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (char **strp, if (this->acceptor ().get_local_addr (addr) == -1) return -1; - else if (addr.addr_to_string (service_addr_str, sizeof addr) == -1) + else if (addr.addr_to_string (service_addr_str, sizeof service_addr_str) == -1) return -1; // @@ Should add the protocol in... @@ -933,15 +935,17 @@ ACE_Oneshot_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (char **strp, char buf[BUFSIZ]; char addr_str[BUFSIZ]; ACE_PEER_ACCEPTOR_ADDR addr; - + if (this->peer_acceptor_.get_local_addr (addr) == -1) return -1; - else if (addr.addr_to_string (addr_str, sizeof addr) == -1) + else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) return -1; - ACE_OS::sprintf (buf, "%s\t %s %s", "ACE_Oneshot_Acceptor", - addr_str, "#oneshot acceptor factory\n"); - + ACE_OS::sprintf (buf, "%s\t %s %s", + "ACE_Oneshot_Acceptor", + addr_str, + "#oneshot acceptor factory\n"); + if (*strp == 0 && (*strp = ACE_OS::strdup (buf)) == 0) return -1; else diff --git a/ace/Auto_Ptr.cpp b/ace/Auto_Ptr.cpp index 67bc370b505..f5a2103e17d 100644 --- a/ace/Auto_Ptr.cpp +++ b/ace/Auto_Ptr.cpp @@ -11,36 +11,36 @@ #include "ace/Auto_Ptr.i" #endif /* __ACE_INLINE__ */ -ACE_ALLOC_HOOK_DEFINE(auto_ptr) +ACE_ALLOC_HOOK_DEFINE(auto_basic_ptr) template<class X> void -auto_ptr<X>::dump (void) const +auto_basic_ptr<X>::dump (void) const { - ACE_TRACE ("auto_ptr<X>::dump"); + ACE_TRACE ("auto_basic_ptr<X>::dump"); } template<class X> void -auto_ptr<X>::remove (X *& x) +auto_basic_ptr<X>::remove (X *& x) { - ACE_TRACE ("auto_ptr<X>::remove"); + ACE_TRACE ("auto_basic_ptr<X>::remove"); X *tp = x; x = 0; delete tp; } -ACE_ALLOC_HOOK_DEFINE(auto_array_ptr) +ACE_ALLOC_HOOK_DEFINE(auto_basic_array_ptr) template<class X> void -auto_array_ptr<X>::dump (void) const +auto_basic_array_ptr<X>::dump (void) const { - ACE_TRACE ("auto_array_ptr<X>::dump"); + ACE_TRACE ("auto_basic_array_ptr<X>::dump"); } template<class X> void -auto_array_ptr<X>::remove (X *& x) +auto_basic_array_ptr<X>::remove (X *& x) { - ACE_TRACE ("auto_array_ptr<X>::remove"); + ACE_TRACE ("auto_basic_array_ptr<X>::remove"); X *tp = x; x = 0; diff --git a/ace/Auto_Ptr.h b/ace/Auto_Ptr.h index 57251fec225..e60eca399c4 100644 --- a/ace/Auto_Ptr.h +++ b/ace/Auto_Ptr.h @@ -22,20 +22,20 @@ #include "ace/ACE.h" template <class X> -class auto_ptr +class auto_basic_ptr // = TITLE // Implements the draft C++ standard auto_ptr abstraction. + // This class allows one to work on non-object (basic) types { public: // = Initialization and termination methods - auto_ptr (X *p = 0); - auto_ptr (auto_ptr<X> &ap); - ~auto_ptr (void); - void operator= (auto_ptr<X> &rhs); + auto_basic_ptr (X *p = 0); + auto_basic_ptr (auto_basic_ptr<X> &ap); + ~auto_basic_ptr (void); + void operator= (auto_basic_ptr<X> &rhs); // = Accessor methods. X &operator *() const; - X *operator-> () const; X *get (void) const; X *release (void); X *reset (X *p); @@ -52,22 +52,35 @@ private: X *p_; }; +template <class X> +class auto_ptr : public auto_basic_ptr <X> + // = TITLE + // Implements the draft C++ standard auto_ptr abstraction. +{ +public: + // = Initialization and termination methods + auto_ptr (X *p = 0); + + X *operator-> () const; +}; + + template<class X> -class auto_array_ptr +class auto_basic_array_ptr // = TITLE // Implements an extension to the draft C++ standard auto_ptr - // abstraction. + // abstraction. This class allows one to work on non-object + // (basic) types { public: // = Initialization and termination methods. - auto_array_ptr (X *p = 0); - auto_array_ptr (auto_array_ptr<X> &ap); - ~auto_array_ptr (void); - void operator= (auto_array_ptr<X> &rhs); + auto_basic_array_ptr (X *p = 0); + auto_basic_array_ptr (auto_basic_array_ptr<X> &ap); + ~auto_basic_array_ptr (void); + void operator= (auto_basic_array_ptr<X> &rhs); // = Accessor methods. X &operator* (); - X *operator-> (); X &operator[] (int i); X operator[] (int i) const; X *get (void) const; @@ -86,6 +99,19 @@ private: X *p_; }; +template<class X> +class auto_array_ptr : public auto_basic_array_ptr + // = TITLE + // Implements an extension to the draft C++ standard auto_ptr + // abstraction. +{ +public: + // = Initialization and termination methods. + auto_array_ptr (X *p = 0); + + X *operator-> (); +}; + #if defined (__ACE_INLINE__) #include "ace/Auto_Ptr.i" #endif /* __ACE_INLINE__ */ diff --git a/ace/Auto_Ptr.i b/ace/Auto_Ptr.i index f0209505c17..9fc759b071d 100644 --- a/ace/Auto_Ptr.i +++ b/ace/Auto_Ptr.i @@ -4,148 +4,163 @@ // Auto_Ptr.i template<class X> ACE_INLINE void -auto_ptr<X>::operator= (auto_ptr<X> &rhs) +auto_basic_ptr<X>::operator= (auto_basic_ptr<X> &rhs) { - ACE_TRACE ("auto_ptr<X>::operator="); + ACE_TRACE ("auto_basic_ptr<X>::operator="); if (this != &rhs) { - auto_ptr<X>::remove (p_); + auto_basic_ptr<X>::remove (p_); p_ = rhs.release (); } } template<class X> ACE_INLINE -auto_ptr<X>::auto_ptr (X *p) +auto_basic_ptr<X>::auto_basic_ptr (X *p) : p_ (p) { - ACE_TRACE ("auto_ptr<X>::auto_ptr"); + ACE_TRACE ("auto_basic_ptr<X>::auto_basic_ptr"); } template<class X> ACE_INLINE -auto_ptr<X>::auto_ptr (auto_ptr<X> &ap) +auto_basic_ptr<X>::auto_basic_ptr (auto_basic_ptr<X> &ap) : p_ (ap.release ()) { - ACE_TRACE ("auto_ptr<X>::auto_ptr"); + ACE_TRACE ("auto_basic_ptr<X>::auto_basic_ptr"); } template<class X> ACE_INLINE -auto_ptr<X>::~auto_ptr (void) +auto_basic_ptr<X>::~auto_basic_ptr (void) { - ACE_TRACE ("auto_ptr<X>::~auto_ptr"); + ACE_TRACE ("auto_basic_ptr<X>::~auto_basic_ptr"); delete p_; } template<class X> ACE_INLINE X & -auto_ptr<X>::operator *() const +auto_basic_ptr<X>::operator *() const { return *p_; } template<class X> ACE_INLINE X * -auto_ptr<X>::operator-> () const -{ - ACE_TRACE ("auto_ptr<X>::operator->"); - return p_; -} - -template<class X> ACE_INLINE X * -auto_ptr<X>::get (void) const +auto_basic_ptr<X>::get (void) const { - ACE_TRACE ("auto_ptr<X>::get"); + ACE_TRACE ("auto_basic_ptr<X>::get"); return p_; } template<class X> ACE_INLINE X * -auto_ptr<X>::release (void) +auto_basic_ptr<X>::release (void) { - ACE_TRACE ("auto_ptr<X>::release"); + ACE_TRACE ("auto_basic_ptr<X>::release"); return this->reset (0); } template<class X> ACE_INLINE X * -auto_ptr<X>::reset (X *p) +auto_basic_ptr<X>::reset (X *p) { - ACE_TRACE ("auto_ptr<X>::reset"); + ACE_TRACE ("auto_basic_ptr<X>::reset"); X *tp = p_; p_ = p; return tp; } template<class X> ACE_INLINE -auto_array_ptr<X>::auto_array_ptr (X *p) +auto_ptr<X>::auto_ptr (X *p) + : auto_basic_ptr<X> (p) +{ + ACE_TRACE ("auto_basic_ptr<X>::auto_basic_ptr"); +} + +template<class X> ACE_INLINE X * +auto_ptr<X>::operator-> () const +{ + ACE_TRACE ("auto_ptr<X>::operator->"); + return p_; +} + +template<class X> ACE_INLINE +auto_basic_array_ptr<X>::auto_basic_array_ptr (X *p) : p_ (p) { - ACE_TRACE ("auto_array_ptr<X>::auto_array_ptr"); + ACE_TRACE ("auto_basic_array_ptr<X>::auto_basic_array_ptr"); } template<class X> ACE_INLINE -auto_array_ptr<X>::auto_array_ptr (auto_array_ptr<X> &ap) +auto_basic_array_ptr<X>::auto_basic_array_ptr (auto_basic_array_ptr<X> &ap) : p_ (ap.release ()) { - ACE_TRACE ("auto_array_ptr<X>::auto_array_ptr"); + ACE_TRACE ("auto_basic_array_ptr<X>::auto_basic_array_ptr"); } template<class X> ACE_INLINE -auto_array_ptr<X>::~auto_array_ptr (void) +auto_basic_array_ptr<X>::~auto_basic_array_ptr (void) { - ACE_TRACE ("auto_array_ptr<X>::~auto_array_ptr"); + ACE_TRACE ("auto_basic_array_ptr<X>::~auto_basic_array_ptr"); delete [] p_; } template<class X> ACE_INLINE X & -auto_array_ptr<X>::operator*() +auto_basic_array_ptr<X>::operator*() { return *p_; } -template<class X> ACE_INLINE X * -auto_array_ptr<X>::operator->() -{ - return p_; -} - template<class X> ACE_INLINE X & -auto_array_ptr<X>::operator[](int i) +auto_basic_array_ptr<X>::operator[](int i) { return p_[i]; } template<class X> ACE_INLINE X -auto_array_ptr<X>::operator[](int i) const +auto_basic_array_ptr<X>::operator[](int i) const { return p_[i]; } template<class X> ACE_INLINE X * -auto_array_ptr<X>::get (void) const +auto_basic_array_ptr<X>::get (void) const { - ACE_TRACE ("auto_array_ptr<X>::get"); + ACE_TRACE ("auto_basic_array_ptr<X>::get"); return p_; } template<class X> ACE_INLINE X * -auto_array_ptr<X>::release (void) +auto_basic_array_ptr<X>::release (void) { - ACE_TRACE ("auto_array_ptr<X>::release"); + ACE_TRACE ("auto_basic_array_ptr<X>::release"); return this->reset (0); } template<class X> ACE_INLINE X * -auto_array_ptr<X>::reset (X *p) +auto_basic_array_ptr<X>::reset (X *p) { - ACE_TRACE ("auto_array_ptr<X>::reset"); + ACE_TRACE ("auto_basic_array_ptr<X>::reset"); X *tp = p_; p_ = p; return tp; } template<class X> ACE_INLINE void -auto_array_ptr<X>::operator= (auto_array_ptr<X> &rhs) +auto_basic_array_ptr<X>::operator= (auto_basic_array_ptr<X> &rhs) { - ACE_TRACE ("auto_array_ptr<X>::operator="); + ACE_TRACE ("auto_basic_array_ptr<X>::operator="); if (this != &rhs) { - auto_array_ptr<X>::remove (p_); + auto_basic_array_ptr<X>::remove (p_); p_ = rhs.release (); } } + +template<class X> ACE_INLINE +auto_array_ptr<X>::auto_array_ptr (X *p) + : auto_basic_array_ptr<T> (p) +{ + ACE_TRACE ("auto_basic_array_ptr<X>::auto_basic_array_ptr"); +} + +template<class X> ACE_INLINE X * +auto_array_ptr<X>::operator->() +{ + return p_; +} + diff --git a/ace/Connector.cpp b/ace/Connector.cpp index 2272964a4ee..75ed6336145 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -577,7 +577,7 @@ ACE_Connector<SH, PR_CO_2>::info (char **strp, size_t length) const if (this->connector ().get_local_addr (addr) == -1) return -1; - else if (addr.addr_to_string (addr_str, sizeof addr) == -1) + else if (addr.addr_to_string (addr_str, sizeof addr_str) == -1) return -1; ACE_OS::sprintf (buf, diff --git a/ace/DEV_Addr.h b/ace/DEV_Addr.h index 5dd960831f6..8f5d995b6a4 100644 --- a/ace/DEV_Addr.h +++ b/ace/DEV_Addr.h @@ -45,7 +45,12 @@ public: virtual void *get_addr (void) const; // Return a pointer to the address. - virtual int addr_to_string (LPTSTR addr, size_t) const; +#if defined (UNICODE) + virtual int addr_to_string (wchar_t *addr, size_t) const; + // Transform the current address into string format. +#endif + + virtual int addr_to_string (char *addr, size_t) const; // Transform the current address into string format. virtual int operator == (const ACE_Addr &SAP) const; diff --git a/ace/DEV_Addr.i b/ace/DEV_Addr.i index 70efc566c6e..f9c213c35e5 100644 --- a/ace/DEV_Addr.i +++ b/ace/DEV_Addr.i @@ -13,15 +13,29 @@ ACE_DEV_Addr::set (LPCTSTR devname) } // Transform the current address into string format. - +#if defined (UNICODE) ACE_INLINE int -ACE_DEV_Addr::addr_to_string (LPTSTR s, size_t len) const +ACE_DEV_Addr::addr_to_string (wchar_t *s, size_t len) const { ACE_TRACE ("ACE_DEV_Addr::addr_to_string"); ACE_OS::strncpy (s, this->devname_, len); return 0; } +#endif /* UNICODE */ + +// Transform the current address into string format. + +ACE_INLINE int +ACE_DEV_Addr::addr_to_string (char *s, size_t len) const +{ + ACE_TRACE ("ACE_DEV_Addr::addr_to_string"); + + ACE_OS::strncpy (s, + ACE_MULTIBYTE_STRING (this->devname_), + len); + return 0; +} // Return a pointer to the address. diff --git a/ace/FILE_Addr.h b/ace/FILE_Addr.h index dcfd2dbef7b..e49240dbe7f 100644 --- a/ace/FILE_Addr.h +++ b/ace/FILE_Addr.h @@ -45,7 +45,12 @@ public: virtual void *get_addr (void) const; // Return a pointer to the address. - virtual int addr_to_string (LPTSTR addr, size_t) const; +#if defined (UNICODE) + virtual int addr_to_string (wchar_t *addr, size_t) const; + // Transform the current address into string format. +#endif /* UNICODE */ + + virtual int addr_to_string (char *addr, size_t) const; // Transform the current address into string format. virtual int operator == (const ACE_Addr &SAP) const; diff --git a/ace/FILE_Addr.i b/ace/FILE_Addr.i index 735496c9ff7..810e35b74d6 100644 --- a/ace/FILE_Addr.i +++ b/ace/FILE_Addr.i @@ -55,12 +55,23 @@ ACE_FILE_Addr::ACE_FILE_Addr (LPCTSTR filename) // Transform the current address into string format. +#if defined (UNICODE) ACE_INLINE int -ACE_FILE_Addr::addr_to_string (LPTSTR s, size_t len) const +ACE_FILE_Addr::addr_to_string (wchar_t * s, size_t len) const { ACE_OS::strncpy (s, this->filename_, len); return 0; } +#endif /* UNICODE */ + +ACE_INLINE int +ACE_FILE_Addr::addr_to_string (char *s, size_t len) const +{ + ACE_OS::strncpy (s, + ACE_MULTIBYTE_STRING (this->filename_), + len); + return 0; +} // Return the address. diff --git a/ace/OS.cpp b/ace/OS.cpp index 52e08d92bc5..969972c9436 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -1988,17 +1988,15 @@ ACE_OS::fork_exec (char *argv[]) #if defined (ACE_WIN32) ACE_ARGV argv_buf (argv); - LPTSTR buf = (LPTSTR) ACE_WIDE_STRING (argv_buf.buf ()); - - if (buf != 0) + if (argv_buf.buf () != 0) { PROCESS_INFORMATION process_info; STARTUPINFO startup_info; ACE_OS::memset ((void *) &startup_info, 0, sizeof startup_info); startup_info.cb = sizeof startup_info; - + if (::CreateProcess (NULL, - buf, + (LPTSTR) ACE_WIDE_STRING (argv_buf.buf ()), NULL, // No process attributes. NULL, // No thread attributes. TRUE, // Allow handle inheritance. @@ -3513,12 +3513,30 @@ private: // These need to come here to avoid problems with circular dependencies. #include "ace/Log_Msg.h" + +// The following are some insane macros that are useful in cases when +// one has to have a string in a certain format. Both of these macros +// allow the user to create a temporary copy. If the user needs to +// keep this temporary string around, they must do some sort of strdup +// on the temporary string. +// +// The ACE_WIDE_STRING macro allows the user to create a temporary +// representation of an ASCII string as a WIDE string. +// +// The ACE_MULTIBYTE_STRING macro allows the user to create a +// temporary representation of a WIDE string as an ASCII string. Note +// that some data may be lost in this conversion. + #if defined (UNICODE) +#include "ace/Auto_Ptr.h" #include "ace/SString.h" -#define ACE_WIDE_STRING(ASCII) \ -ACE_WString (ASCII).fast_rep () +#define ACE_WIDE_STRING(ASCII_STRING) \ +ACE_WString (ASCII_STRING).fast_rep () +#define ACE_MULTIBYTE_STRING(WIDE_STRING) \ +auto_basic_array_ptr<char> (ACE_WString (WIDE_STRING).char_rep ()).get () #else -#define ACE_WIDE_STRING(ASCII) ASCII +#define ACE_WIDE_STRING(ASCII_STRING) ASCII_STRING +#define ACE_MULTIBYTE_STRING(WIDE_STRING) WIDE_STRING #endif /* UNICODE */ #endif /* ACE_OS_H */ diff --git a/ace/SPIPE_Addr.cpp b/ace/SPIPE_Addr.cpp index 688735e27db..c68495de3b1 100644 --- a/ace/SPIPE_Addr.cpp +++ b/ace/SPIPE_Addr.cpp @@ -38,11 +38,19 @@ ACE_SPIPE_Addr::ACE_SPIPE_Addr (void) // Transform the string into the current addressing format. +#if defined (UNICODE) int -ACE_SPIPE_Addr::string_to_addr (LPCTSTR addr) +ACE_SPIPE_Addr::string_to_addr (const wchar_t *addr) { return this->set (addr); } +#endif /* UNICODE */ + +int +ACE_SPIPE_Addr::string_to_addr (const char *addr) +{ + return this->set (ACE_WIDE_STRING (addr)); +} /* Copy constructor. */ diff --git a/ace/SPIPE_Addr.h b/ace/SPIPE_Addr.h index 372c9ea9ac5..2a69c851e2b 100644 --- a/ace/SPIPE_Addr.h +++ b/ace/SPIPE_Addr.h @@ -1,6 +1,7 @@ /* -*- C++ -*- */ // $Id$ + // ============================================================================ // // = LIBRARY @@ -43,10 +44,18 @@ public: virtual void set_addr (void *addr, int len); // Set a pointer to the underlying network address. - virtual int addr_to_string (LPTSTR addr, size_t) const; +#if defined (UNICODE) + virtual int addr_to_string (wchar_t *addr, size_t) const; + // Transform the current address into string format. + + virtual int string_to_addr (const wchar_t *addr); + // Transform the string into the current addressing format. +#endif /* UNICODE */ + + virtual int addr_to_string (char *addr, size_t) const; // Transform the current address into string format. - virtual int string_to_addr (LPCTSTR addr); + virtual int string_to_addr (const char *addr); // Transform the string into the current addressing format. // = Equality/inequality tests diff --git a/ace/SPIPE_Addr.i b/ace/SPIPE_Addr.i index f588a1702b7..527c1bf2322 100644 --- a/ace/SPIPE_Addr.i +++ b/ace/SPIPE_Addr.i @@ -7,12 +7,23 @@ // Transform the current address into string format. +#if defined (UNICODE) ACE_INLINE int -ACE_SPIPE_Addr::addr_to_string (LPTSTR s, size_t len) const +ACE_SPIPE_Addr::addr_to_string (wchar_t *s, size_t len) const { ACE_OS::strncpy (s, this->SPIPE_addr_.rendezvous_, len); return 0; } +#endif /* UNICODE */ + +ACE_INLINE int +ACE_SPIPE_Addr::addr_to_string (char *s, size_t len) const +{ + ACE_OS::strncpy (s, + ACE_MULTIBYTE_STRING (this->SPIPE_addr_.rendezvous_), + len); + return 0; +} // Return the address. diff --git a/examples/Registry/test_registry_iterator.cpp b/examples/Registry/test_registry_iterator.cpp index c54af455eea..5e47c2cfa93 100644 --- a/examples/Registry/test_registry_iterator.cpp +++ b/examples/Registry/test_registry_iterator.cpp @@ -28,17 +28,13 @@ main (int argc, char *argv[]) int result; ACE_Registry::Naming_Context naming_context; - LPCTSTR host = 0; - if (argc == 2) - host = ACE_WIDE_STRING (argv[1]); - // Connect to a predefined naming context result = ACE_Predefined_Naming_Contexts::connect (naming_context, HKEY_LOCAL_MACHINE, // HKEY_CLASSES_ROOT, // HKEY_USERS, // HKEY_CURRENT_USER, - host); + argc == 2 ? ACE_WIDE_STRING (argv[1]), 0); if (result != 0) ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "ACE_Predefined_Naming_Contexts::connect failed"), -1); |