diff options
-rw-r--r-- | ACE/ChangeLog | 29 | ||||
-rw-r--r-- | ACE/ace/ACE.cpp | 4 | ||||
-rw-r--r-- | ACE/ace/DLL.cpp | 19 | ||||
-rw-r--r-- | ACE/ace/DLL.h | 14 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.cpp | 23 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.h | 14 | ||||
-rw-r--r-- | ACE/ace/Task_Ex_T.h | 5 | ||||
-rw-r--r-- | ACE/ace/Task_Ex_T.inl | 5 | ||||
-rw-r--r-- | ACE/ace/Task_T.inl | 3 |
9 files changed, 81 insertions, 35 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 1e4d92d566a..6e5be8fc065 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,32 @@ +Thu Jan 17 19:24:12 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * ace/Task_Ex_T.h: + Marked can_put as deprecated like in Task_T.h + + * ace/Task_Ex_T.inl: + Replaced assert with notsup return + + * ace/Task_T.inl: + Removed not needed includes + + * ace/ACE.cpp: + Const change + + * ace/DLL.cpp: + Changed close_handle_on_destruction flag and error flag to bool. + Use ACE_OS::dl_error() to get the error message + + * ace/DLL.h: + Changed close_handle_on_destruction flag and error flag to bool + + * ace/Log_Msg.cpp: + Use bool and print the process id as hex on OpenVMS, the DCL + scripts also prints the process id as hax + + * ace/Log_Msg.h: + Only defined the ACE_DEBUG, ACE_ERROR, and other + macros when they are not defined yet + Thu Jan 17 18:57:12 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> * ace/config-vxworks6.6.h: diff --git a/ACE/ace/ACE.cpp b/ACE/ace/ACE.cpp index be4e8fce7a3..233ef720f4c 100644 --- a/ACE/ace/ACE.cpp +++ b/ACE/ace/ACE.cpp @@ -2840,11 +2840,11 @@ ACE::max_handles (void) ACE_TRACE ("ACE::max_handles"); #if defined (RLIMIT_NOFILE) && !defined (ACE_LACKS_RLIMIT) rlimit rl; - int r = ACE_OS::getrlimit (RLIMIT_NOFILE, &rl); + int const r = ACE_OS::getrlimit (RLIMIT_NOFILE, &rl); # if !defined (RLIM_INFINITY) if (r == 0) return rl.rlim_cur; -#else +# else if (r == 0 && rl.rlim_cur != RLIM_INFINITY) return rl.rlim_cur; // If == RLIM_INFINITY, fall through to the ACE_LACKS_RLIMIT sections diff --git a/ACE/ace/DLL.cpp b/ACE/ace/DLL.cpp index f4ecdbb4aa2..cdee3c6bd24 100644 --- a/ACE/ace/DLL.cpp +++ b/ACE/ace/DLL.cpp @@ -18,7 +18,7 @@ ACE_RCSID(ace, DLL, "$Id$") // Default constructor. Also, by default, the object will be closed // before it is destroyed. -ACE_DLL::ACE_DLL (int close_handle_on_destruction) +ACE_DLL::ACE_DLL (bool close_handle_on_destruction) : open_mode_ (0), dll_name_ (0), close_handle_on_destruction_ (close_handle_on_destruction), @@ -31,7 +31,7 @@ ACE_DLL::ACE_DLL (int close_handle_on_destruction) ACE_DLL::ACE_DLL (const ACE_DLL &rhs) : open_mode_ (0), dll_name_ (0), - close_handle_on_destruction_ (0), + close_handle_on_destruction_ (false), dll_handle_ (0), error_ (0) { @@ -73,7 +73,7 @@ ACE_DLL::operator= (const ACE_DLL &rhs) ACE_DLL::ACE_DLL (const ACE_TCHAR *dll_name, int open_mode, - int close_handle_on_destruction) + bool close_handle_on_destruction) : open_mode_ (open_mode), dll_name_ (0), close_handle_on_destruction_ (close_handle_on_destruction), @@ -120,7 +120,7 @@ ACE_DLL::~ACE_DLL (void) int ACE_DLL::open (const ACE_TCHAR *dll_filename, int open_mode, - int close_handle_on_destruction) + bool close_handle_on_destruction) { ACE_TRACE ("ACE_DLL::open"); @@ -130,7 +130,7 @@ ACE_DLL::open (const ACE_TCHAR *dll_filename, int ACE_DLL::open_i (const ACE_TCHAR *dll_filename, int open_mode, - int close_handle_on_destruction, + bool close_handle_on_destruction, ACE_SHLIB_HANDLE handle) { ACE_TRACE ("ACE_DLL::open_i"); @@ -211,7 +211,7 @@ ACE_DLL::close (void) this->dll_handle_ = 0; delete [] this->dll_name_; this->dll_name_ = 0; - this->close_handle_on_destruction_ = 0; + this->close_handle_on_destruction_ = false; return retval; } @@ -223,8 +223,9 @@ ACE_DLL::error (void) const { ACE_TRACE ("ACE_DLL::error"); if (this->error_) - return - const_cast<ACE_TCHAR *> (ACE_TEXT ("Error: check log for details.")); + { + return ACE_OS::dlerror (); + } return 0; } @@ -251,7 +252,7 @@ ACE_DLL::get_handle (int become_owner) const int ACE_DLL::set_handle (ACE_SHLIB_HANDLE handle, - int close_handle_on_destruction) + bool close_handle_on_destruction) { ACE_TRACE ("ACE_DLL::set_handle"); diff --git a/ACE/ace/DLL.h b/ACE/ace/DLL.h index be6b43b68ae..64cb646576a 100644 --- a/ACE/ace/DLL.h +++ b/ACE/ace/DLL.h @@ -54,7 +54,7 @@ public: * is controlled in a scope other than that of this ACE_DLL object. * For example, termination by ACE_DLL_Manager via ACE::fini(). */ - explicit ACE_DLL (int close_handle_on_destruction = 1); + explicit ACE_DLL (bool close_handle_on_destruction = true); /// Allow assignment ACE_DLL& operator= (const ACE_DLL &rhs); @@ -81,7 +81,7 @@ public: */ explicit ACE_DLL (const ACE_TCHAR *dll_name, int open_mode = ACE_DEFAULT_SHLIB_MODE, - int close_handle_on_destruction = 1); + bool close_handle_on_destruction = true); /// Copy constructor. ACE_DLL (const ACE_DLL &); @@ -118,7 +118,7 @@ public: */ int open (const ACE_TCHAR *dll_name, int open_mode = ACE_DEFAULT_SHLIB_MODE, - int close_handle_on_destruction = 1); + bool close_handle_on_destruction = true); /// Call to close the DLL object. int close (void); @@ -158,13 +158,13 @@ public: /// Set the handle for the DLL object. By default, the close() //operation on / the object will be invoked before it is destroyed. int set_handle (ACE_SHLIB_HANDLE handle, - int close_handle_on_destruction = 1); + bool close_handle_on_destruction = true); private: int open_i (const ACE_TCHAR *dll_name, int open_mode = ACE_DEFAULT_SHLIB_MODE, - int close_handle_on_destruction = 1, + bool close_handle_on_destruction = true, ACE_SHLIB_HANDLE handle = 0); @@ -181,12 +181,12 @@ public: /// This flag keeps track of whether we should close the handle /// automatically when the object is destroyed. - int close_handle_on_destruction_; + bool close_handle_on_destruction_; ACE_DLL_Handle *dll_handle_; /// Flag to record if the last operation had an error. - int error_; + bool error_; }; diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp index 727c82fd040..0f2bf798c25 100644 --- a/ACE/ace/Log_Msg.cpp +++ b/ACE/ace/Log_Msg.cpp @@ -1110,8 +1110,8 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, ACE_TCHAR format[128]; // Converted format string ACE_TCHAR *fp; // Current format pointer int wp = 0; // Width/precision extracted from args - int done = 0; - int skip_nul_locate = 0; + bool done = false; + bool skip_nul_locate = false; int this_len = 0; // How many chars s[n]printf wrote fp = format; @@ -1128,7 +1128,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, while (!done) { - done = 1; // Unless a conversion spec changes it + done = true; // Unless a conversion spec changes it switch (*format_str) { @@ -1155,14 +1155,14 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, case 'L': case 'h': *fp++ = *format_str; - done = 0; + done = false; break; case '*': wp = va_arg (argp, int); ACE_OS::sprintf (fp, ACE_TEXT ("%d"), wp); fp += ACE_OS::strlen (fp); - done = 0; + done = false; break; case 'A': // ACE_timer_t @@ -1238,7 +1238,12 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case 'P': // Process ID +#if defined (ACE_OPENVMS) + // Print the process id in hex on OpenVMS. + ACE_OS::strcpy (fp, ACE_TEXT ("x")); +#else ACE_OS::strcpy (fp, ACE_TEXT ("d")); +#endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, @@ -1451,12 +1456,12 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case '{': // Increment the trace_depth, then indent - skip_nul_locate = 1; + skip_nul_locate = true; (void) this->inc (); break; case '}': // indent, then decrement trace_depth - skip_nul_locate = 1; + skip_nul_locate = true; (void) this->dec (); break; @@ -1486,7 +1491,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, *bp = '\0'; bspace -= static_cast<size_t> (wp); - skip_nul_locate = 1; + skip_nul_locate = true; break; case 'r': // Run (invoke) this subroutine. @@ -1513,7 +1518,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, *bp++ = '}'; } *bp = '\0'; - skip_nul_locate = 1; + skip_nul_locate = true; ACE_Log_Msg::msg_off_ = osave; break; } diff --git a/ACE/ace/Log_Msg.h b/ACE/ace/Log_Msg.h index d99a7f71dd8..6084902bf30 100644 --- a/ACE/ace/Log_Msg.h +++ b/ACE/ace/Log_Msg.h @@ -38,6 +38,7 @@ #define ACE_DEBUG(X) do {} while (0) #define ACE_ERROR_INIT(VALUE, FLAGS) #else +#if !defined (ACE_HEX_DUMP) #define ACE_HEX_DUMP(X) \ do { \ int __ace_error = ACE_Log_Msg::last_error_adapter (); \ @@ -45,6 +46,8 @@ ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \ ace___->log_hexdump X; \ } while (0) +#endif +#if !defined (ACE_RETURN) #define ACE_RETURN(Y) \ do { \ int __ace_error = ACE_Log_Msg::last_error_adapter (); \ @@ -53,6 +56,8 @@ ace___->msg_ostream (), ace___->msg_callback ()); \ return Y; \ } while (0) +#endif +#if !defined (ACE_ERROR_RETURN) #define ACE_ERROR_RETURN(X, Y) \ do { \ int __ace_error = ACE_Log_Msg::last_error_adapter (); \ @@ -61,6 +66,8 @@ ace___->log X; \ return Y; \ } while (0) +#endif +#if !defined (ACE_ERROR) #define ACE_ERROR(X) \ do { \ int __ace_error = ACE_Log_Msg::last_error_adapter (); \ @@ -68,6 +75,8 @@ ace___->conditional_set (__FILE__, __LINE__, -1, __ace_error); \ ace___->log X; \ } while (0) +#endif +#if !defined (ACE_DEBUG) #define ACE_DEBUG(X) \ do { \ int __ace_error = ACE_Log_Msg::last_error_adapter (); \ @@ -75,12 +84,17 @@ ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \ ace___->log X; \ } while (0) +#endif +#if !defined (ACE_ERROR_INIT) #define ACE_ERROR_INIT(VALUE, FLAGS) \ do { \ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->set_flags (FLAGS); ace___->op_status (VALUE); \ } while (0) +#endif +#if !defined (ACE_ERROR_BREAK) #define ACE_ERROR_BREAK(X) { ACE_ERROR (X); break; } +#endif #endif /* ACE_NLOGGING */ #include "ace/OS_Log_Msg_Attributes.h" diff --git a/ACE/ace/Task_Ex_T.h b/ACE/ace/Task_Ex_T.h index ba308193bd9..090ac7a18a0 100644 --- a/ACE/ace/Task_Ex_T.h +++ b/ACE/ace/Task_Ex_T.h @@ -125,7 +125,10 @@ public: // Should be protected: */ int put_next (ACE_MESSAGE_TYPE *msg, ACE_Time_Value *timeout = 0); - /// Tests whether we can enqueue a message without blocking. + /** + * Tests whether we can enqueue a message without blocking. + * @deprecated This method is deprecated and will go away in the future. + */ int can_put (ACE_MESSAGE_TYPE *); // = ACE_Task utility routines to identify names et al. diff --git a/ACE/ace/Task_Ex_T.inl b/ACE/ace/Task_Ex_T.inl index 3ce14b52224..ee0843978b3 100644 --- a/ACE/ace/Task_Ex_T.inl +++ b/ACE/ace/Task_Ex_T.inl @@ -2,8 +2,6 @@ // // $Id$ -#include "ace/os_include/os_assert.h" - ACE_BEGIN_VERSIONED_NAMESPACE_DECL template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE void @@ -28,8 +26,7 @@ template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::can_put (ACE_MESSAGE_TYPE *) { ACE_TRACE ("ACE_Task_Ex<ACE_SYNCH_USE,ACE_MESSAGE_TYPE>::can_put"); - assert (!"not implemented"); - return -1; + ACE_NOTSUP_RETURN (-1); } template <ACE_SYNCH_DECL, class ACE_MESSAGE_TYPE> ACE_INLINE int diff --git a/ACE/ace/Task_T.inl b/ACE/ace/Task_T.inl index 5b43e971ba9..c3ab9cdfe99 100644 --- a/ACE/ace/Task_T.inl +++ b/ACE/ace/Task_T.inl @@ -2,9 +2,6 @@ // // $Id$ -#include "ace/os_include/os_assert.h" -#include "ace/config-all.h" - ACE_BEGIN_VERSIONED_NAMESPACE_DECL template <ACE_SYNCH_DECL> ACE_INLINE void |