summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-01-29 18:59:46 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-01-29 18:59:46 +0000
commita5bc5541df2b64b264ed9ca092e2a4f93e3a4dc3 (patch)
tree393499d55e67cf753c55157896005bc1094065f0
parent7dade281400dd1940d63ac6ad43d0f4664217728 (diff)
downloadATCD-a5bc5541df2b64b264ed9ca092e2a4f93e3a4dc3.tar.gz
Mon Jan 29 18:58:14 2007 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--ACE/ChangeLog33
-rw-r--r--ACE/ace/Argv_Type_Converter.cpp10
-rw-r--r--ACE/ace/Asynch_Pseudo_Task.cpp16
-rw-r--r--ACE/ace/Cached_Connect_Strategy_T.cpp6
-rw-r--r--ACE/ace/Countdown_Time.cpp30
-rw-r--r--ACE/ace/Countdown_Time.h19
-rw-r--r--ACE/ace/Dev_Poll_Reactor.h2
-rw-r--r--ACE/ace/OS_NS_pwd.inl5
-rw-r--r--ACE/ace/config-rtems.h28
-rw-r--r--ACE/ace/config-sco-5.0.0.h3
-rw-r--r--ACE/ace/config-vxworks6.4.h36
-rw-r--r--ACE/docs/ACE-guidelines.html4
12 files changed, 110 insertions, 82 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index eac65d27ca5..8c66559ad8b 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,36 @@
+Mon Jan 29 18:58:14 2007 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Argv_Type_Converter.cpp:
+ * ace/Asynch_Pseudo_Task.cpp:
+ * ace/Cached_Connect_Strategy_T.cpp:
+ Layout changes, result of experimenting with a code
+ beautifier
+
+ * ace/config-rtems.h:
+ Improved rtems port, added support for building with
+ threads=0
+
+ * ace/config-sco-5.0.0.h:
+ Removed commented out define
+
+ * ace/config-vxworks6.4.h:
+ putenv fails with VxWorks 6.4 with a pentium target
+
+ * ace/Countdown_Time.{h,cpp}:
+ Use bool, removed return value from most methods, it was
+ meaningless, removed destructor, not needed to update members
+ in a destructor
+
+ * ace/Dev_Poll_Reactor.h:
+ Export Token_Guard, fixes bugzilla 2786, thanks to
+ <sailzeng at tencent dot com> for reporting this
+
+ * OS_NS_pwd.inl (getpwnam_r):
+ Initialize pointer with 0, simplified this a little
+
+ * docs/ACE-guidelines.html:
+ Updated example with doxygen style of documentation
+
Sun Jan 28 19:59:14 2007 William R. Otte <wotte@dre.vanderbilt.edu>
* ACE version 5.5.6 released.
diff --git a/ACE/ace/Argv_Type_Converter.cpp b/ACE/ace/Argv_Type_Converter.cpp
index e12bda80ff3..2f18574a0a2 100644
--- a/ACE/ace/Argv_Type_Converter.cpp
+++ b/ACE/ace/Argv_Type_Converter.cpp
@@ -33,7 +33,7 @@ ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, wchar_t** argv)
#endif // ACE_USES_WCHAR
-ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, char** argv)
+ACE_Argv_Type_Converter::ACE_Argv_Type_Converter (int &argc, char **argv)
: saved_argc_(argc),
char_argv_(argv)
#if defined (ACE_USES_WCHAR)
@@ -71,7 +71,7 @@ ACE_Argv_Type_Converter::~ACE_Argv_Type_Converter (void)
else
{
// if original type is char
- if (this->wchar_passed_)
+ if (this->wchar_passed_)
this->align_char_with_wchar ();
for (int i = 0; i < this->before_pass_argc_; ++i)
@@ -87,7 +87,7 @@ void
ACE_Argv_Type_Converter::initialize (void)
{
if (this->original_type_)
- {
+ {
// Make a copy of argv in 'char'. type Create one more argv entry
// than original argc for the NULL.
ACE_NEW (char_argv_,
@@ -96,9 +96,9 @@ ACE_Argv_Type_Converter::initialize (void)
// always a NULL
}
else
- {
+ {
// make a copy of argv in 'wchar_t' type
- ACE_NEW (this->wchar_argv_,
+ ACE_NEW (this->wchar_argv_,
wchar_t*[this->saved_argc_ + 1]);
this->wchar_argv_[saved_argc_] = 0;
}
diff --git a/ACE/ace/Asynch_Pseudo_Task.cpp b/ACE/ace/Asynch_Pseudo_Task.cpp
index b3e25ef0298..b9dd61a1f5f 100644
--- a/ACE/ace/Asynch_Pseudo_Task.cpp
+++ b/ACE/ace/Asynch_Pseudo_Task.cpp
@@ -9,15 +9,15 @@ ACE_RCSID(ace, Asynch_Pseudo_Task, "$Id$")
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-ACE_Asynch_Pseudo_Task::ACE_Asynch_Pseudo_Task()
+ACE_Asynch_Pseudo_Task::ACE_Asynch_Pseudo_Task ()
: select_reactor_ (), // should be initialized before reactor_
reactor_ (&select_reactor_, 0) // don't delete implementation
{
}
-ACE_Asynch_Pseudo_Task::~ACE_Asynch_Pseudo_Task()
+ACE_Asynch_Pseudo_Task::~ACE_Asynch_Pseudo_Task ()
{
- this->stop();
+ this->stop ();
}
int
@@ -63,7 +63,7 @@ ACE_Asynch_Pseudo_Task::svc (void)
ACE_LIB_TEXT ("pthread_sigmask")));
#endif
- reactor_.owner (ACE_Thread::self());
+ reactor_.owner (ACE_Thread::self ());
reactor_.run_reactor_event_loop ();
return 0;
@@ -92,8 +92,7 @@ ACE_Asynch_Pseudo_Task::register_io_handler (ACE_HANDLE handle,
((LM_ERROR,
ACE_LIB_TEXT ("%N:%l:%p\n"),
ACE_LIB_TEXT ("register_io_handler (suspended)")));
- this->reactor_.remove_handler (handle,
- ACE_Event_Handler::ALL_EVENTS_MASK
+ this->reactor_.remove_handler (handle, ACE_Event_Handler::ALL_EVENTS_MASK
| ACE_Event_Handler::DONT_CALL);
return -1;
}
@@ -104,7 +103,7 @@ ACE_Asynch_Pseudo_Task::register_io_handler (ACE_HANDLE handle,
int
ACE_Asynch_Pseudo_Task::remove_io_handler (ACE_HANDLE handle)
{
- return this->reactor_.remove_handler (handle ,
+ return this->reactor_.remove_handler (handle,
ACE_Event_Handler::ALL_EVENTS_MASK
| ACE_Event_Handler::DONT_CALL);
}
@@ -112,8 +111,7 @@ ACE_Asynch_Pseudo_Task::remove_io_handler (ACE_HANDLE handle)
int
ACE_Asynch_Pseudo_Task::remove_io_handler (ACE_Handle_Set &set)
{
- return this->reactor_.remove_handler (set,
- ACE_Event_Handler::ALL_EVENTS_MASK
+ return this->reactor_.remove_handler (set, ACE_Event_Handler::ALL_EVENTS_MASK
| ACE_Event_Handler::DONT_CALL);
}
diff --git a/ACE/ace/Cached_Connect_Strategy_T.cpp b/ACE/ace/Cached_Connect_Strategy_T.cpp
index f9c1cb6a3a2..9906cd0a2f5 100644
--- a/ACE/ace/Cached_Connect_Strategy_T.cpp
+++ b/ACE/ace/Cached_Connect_Strategy_T.cpp
@@ -67,7 +67,8 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::check_hint_i
found = 0;
// Get the recycling act for the svc_handler
- CONNECTION_CACHE_ENTRY *possible_entry = (CONNECTION_CACHE_ENTRY *) sh->recycling_act ();
+ CONNECTION_CACHE_ENTRY *possible_entry =
+ (CONNECTION_CACHE_ENTRY *) sh->recycling_act ();
// Check to see if the hint svc_handler has been closed down
if (possible_entry->ext_id_.recycle_state () == ACE_RECYCLABLE_CLOSED)
@@ -529,8 +530,7 @@ ACE_Cached_Connect_Strategy_Ex<ACE_T2>::cleanup (void)
ACE_GUARD (MUTEX, ace_mon, *this->lock_);
// Close down all cached service handlers.
- typename CONNECTION_CACHE::ITERATOR iter =
- this->connection_cache_.begin ();
+ typename CONNECTION_CACHE::ITERATOR iter = this->connection_cache_.begin ();
while (iter != this->connection_cache_.end ())
{
if ((*iter).second () != 0)
diff --git a/ACE/ace/Countdown_Time.cpp b/ACE/ace/Countdown_Time.cpp
index fb03f0465e0..818be8b92bc 100644
--- a/ACE/ace/Countdown_Time.cpp
+++ b/ACE/ace/Countdown_Time.cpp
@@ -9,58 +9,54 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_Countdown_Time::ACE_Countdown_Time (ACE_Time_Value *max_wait_time)
: max_wait_time_ (max_wait_time),
- stopped_ (0)
+ stopped_ (false)
{
this->start ();
}
-ACE_Countdown_Time::~ACE_Countdown_Time (void)
-{
- this->stop ();
-}
-
-int
+void
ACE_Countdown_Time::start (void)
{
if (this->max_wait_time_ != 0)
{
this->start_time_ = ACE_OS::gettimeofday ();
- this->stopped_ = 0;
+ this->stopped_ = false;
}
- return 0;
}
-int
+bool
ACE_Countdown_Time::stopped (void) const
{
return stopped_;
}
-int
+void
ACE_Countdown_Time::stop (void)
{
- if (this->max_wait_time_ != 0 && this->stopped_ == 0)
+ if (this->max_wait_time_ != 0 && this->stopped_ == false)
{
ACE_Time_Value elapsed_time =
ACE_OS::gettimeofday () - this->start_time_;
if (*this->max_wait_time_ > elapsed_time)
- *this->max_wait_time_ -= elapsed_time;
+ {
+ *this->max_wait_time_ -= elapsed_time;
+ }
else
{
// Used all of timeout.
*this->max_wait_time_ = ACE_Time_Value::zero;
// errno = ETIME;
}
- this->stopped_ = 1;
+ this->stopped_ = true;
}
- return 0;
}
-int
+void
ACE_Countdown_Time::update (void)
{
- return this->stop () == 0 && this->start ();
+ this->stop ();
+ this->start ();
}
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Countdown_Time.h b/ACE/ace/Countdown_Time.h
index bb7dff364d7..d3d504690a5 100644
--- a/ACE/ace/Countdown_Time.h
+++ b/ACE/ace/Countdown_Time.h
@@ -30,7 +30,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
*
* @brief Keeps track of the amount of elapsed time.
*
- * This class has a side-effect on the <max_wait_time> -- every
+ * This class has a side-effect on the @c max_wait_time -- every
* time the <stop> method is called the <max_wait_time> is
* updated.
*/
@@ -38,25 +38,22 @@ class ACE_Export ACE_Countdown_Time
{
public:
// = Initialization and termination methods.
- /// Cache the <max_wait_time> and call <start>.
+ /// Cache the @a max_wait_time and call @c start().
ACE_Countdown_Time (ACE_Time_Value *max_wait_time);
- /// Call <stop>.
- ~ACE_Countdown_Time (void);
-
/// Cache the current time and enter a start state.
- int start (void);
+ void start (void);
/// Subtract the elapsed time from max_wait_time_ and enter a stopped
/// state.
- int stop (void);
+ void stop (void);
/// Calls stop and then start. max_wait_time_ is modified by the
/// call to stop.
- int update (void);
+ void update (void);
- /// Returns 1 if we've already been stopped, else 0.
- int stopped (void) const;
+ /// Returns true if we've already been stopped, else false.
+ bool stopped (void) const;
private:
/// Maximum time we were willing to wait.
@@ -66,7 +63,7 @@ private:
ACE_Time_Value start_time_;
/// Keeps track of whether we've already been stopped.
- int stopped_;
+ bool stopped_;
// Prevent copying
ACE_Countdown_Time (const ACE_Countdown_Time &);
diff --git a/ACE/ace/Dev_Poll_Reactor.h b/ACE/ace/Dev_Poll_Reactor.h
index 41132201f01..933de62dd94 100644
--- a/ACE/ace/Dev_Poll_Reactor.h
+++ b/ACE/ace/Dev_Poll_Reactor.h
@@ -1171,7 +1171,7 @@ protected:
* @brief A helper class that helps grabbing, releasing and waiting
* on tokens for a thread that needs access to the reactor's token.
*/
- class Token_Guard
+ class ACE_Export Token_Guard
{
public:
diff --git a/ACE/ace/OS_NS_pwd.inl b/ACE/ace/OS_NS_pwd.inl
index c0a3d61d3ae..0c05d61d23f 100644
--- a/ACE/ace/OS_NS_pwd.inl
+++ b/ACE/ace/OS_NS_pwd.inl
@@ -42,10 +42,9 @@ ACE_OS::getpwnam_r (const char *name, struct passwd *pwent,
char *buffer, int buflen)
{
#if defined (ACE_HAS_POSIX_GETPWNAM_R)
- struct passwd *result;
- int status;
+ struct passwd *result = 0;
- status = ::getpwnam_r (name, pwent, buffer, buflen, &result);
+ int const status = ::getpwnam_r (name, pwent, buffer, buflen, &result);
if (status != 0)
{
diff --git a/ACE/ace/config-rtems.h b/ACE/ace/config-rtems.h
index f55c688e090..225b3eb2012 100644
--- a/ACE/ace/config-rtems.h
+++ b/ACE/ace/config-rtems.h
@@ -63,19 +63,22 @@
// rtems 4.6.6.
#define ACE_LACKS_WCHAR_H
-// Yes, we do have threads.
-#define ACE_HAS_THREADS
-// And they're even POSIX pthreads (MIT implementation)
-#define ACE_HAS_PTHREADS
-// ... and the final standard even!
-#define ACE_HAS_PTHREADS_STD
-#define ACE_HAS_THREAD_SPECIFIC_STORAGE
-#define ACE_HAS_PTHREAD_SCHEDPARAM
-#define ACE_LACKS_THREAD_PROCESS_SCOPING
-
-// XXX thread defines go here
+#if !defined (ACE_MT_SAFE)
#define ACE_MT_SAFE 1
-#define ACE_PAGE_SIZE 4096
+#endif
+
+#if ACE_MT_SAFE
+# define ACE_HAS_THREADS
+# define ACE_HAS_PTHREADS
+# define ACE_HAS_PTHREADS_STD
+# define ACE_HAS_THREAD_SPECIFIC_STORAGE
+# define ACE_HAS_PTHREAD_SCHEDPARAM
+# define ACE_LACKS_THREAD_PROCESS_SCOPING
+#else
+# define ACE_HAS_POSIX_GETPWNAM_R
+# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+#endif
+
#define ACE_HAS_ALT_CUSERID
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
#define ACE_HAS_3_PARAM_READDIR_R
@@ -86,6 +89,7 @@
#define ACE_HAS_MSG
#define ACE_HAS_MT_SAFE_MKTIME
#define ACE_HAS_NONCONST_READV
+#define ACE_HAS_GETPAGESIZE
#define ACE_HAS_POSIX_SEM
#define ACE_HAS_POSIX_TIME
#define ACE_HAS_REENTRANT_FUNCTIONS
diff --git a/ACE/ace/config-sco-5.0.0.h b/ACE/ace/config-sco-5.0.0.h
index c155651a29a..519b74a2ead 100644
--- a/ACE/ace/config-sco-5.0.0.h
+++ b/ACE/ace/config-sco-5.0.0.h
@@ -25,9 +25,6 @@
#define ACE_DEFAULT_CLOSE_ALL_HANDLES 0
-// Compiler doesn't support static data member templates.
-//#define ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES
-
// Platform supports System V IPC (most versions of UNIX, but not Win32)
#define ACE_HAS_SYSV_IPC
#define ACE_HAS_NONCONST_MSGSND
diff --git a/ACE/ace/config-vxworks6.4.h b/ACE/ace/config-vxworks6.4.h
index fbc957b9b85..c1372dd1fcf 100644
--- a/ACE/ace/config-vxworks6.4.h
+++ b/ACE/ace/config-vxworks6.4.h
@@ -54,6 +54,22 @@
# endif /* __cplusplus */
#endif /* ! __GNUG__ && ! ghs */
+// Needed include to get all VxWorks CPU types
+#include "types/vxCpu.h"
+#if defined __RTP__
+ #if defined (_VX_CPU) && (_VX_CPU == _VX_PENTIUM || _VX_CPU == _VX_PENTIUM2 || _VX_CPU == _VX_PENTIUM3 || _VX_CPU == _VX_PENTIUM4)
+ // If running an Intel Pentium the
+ // ACE_OS::gethrtime () can use the RDTSC instruction.
+ # define ACE_HAS_PENTIUM
+ #endif
+#else
+ #if defined (CPU) && (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4)
+ // If running an Intel Pentium the
+ // ACE_OS::gethrtime () can use the RDTSC instruction.
+ # define ACE_HAS_PENTIUM
+ #endif
+#endif
+
// OS-specific configuration
#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG
#define ACE_HAS_3_PARAM_READDIR_R
@@ -174,6 +190,10 @@
#define ACE_HAS_SVR4_DYNAMIC_LINKING
#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
#define ACE_LACKS_REGEX_H
+ #if defined ACE_HAS_PENTIUM
+ // Bug to workaround VxWorks 6.4 x86
+ # define ACE_LACKS_PUTENV
+ #endif
#define ACE_HAS_SETENV
#define ACE_HAS_3_PARAM_WCSTOK
#define ACE_HAS_WCHAR
@@ -272,22 +292,6 @@
# define ACE_MT_SAFE 1
#endif
-// Needed include to get all VxWorks CPU types
-#include "types/vxCpu.h"
-#if defined __RTP__
- #if defined (_VX_CPU) && (_VX_CPU == _VX_PENTIUM || _VX_CPU == _VX_PENTIUM2 || _VX_CPU == _VX_PENTIUM3 || _VX_CPU == _VX_PENTIUM4)
- // If running an Intel Pentium the
- // ACE_OS::gethrtime () can use the RDTSC instruction.
- # define ACE_HAS_PENTIUM
- #endif
-#else
- #if defined (CPU) && (CPU == PENTIUM || CPU == PENTIUM2 || CPU == PENTIUM3 || CPU == PENTIUM4)
- // If running an Intel Pentium the
- // ACE_OS::gethrtime () can use the RDTSC instruction.
- # define ACE_HAS_PENTIUM
- #endif
-#endif
-
// VxWorks defines the CPU define MAP, undef it to prevent problems with
// application code
#if defined (MAP)
diff --git a/ACE/docs/ACE-guidelines.html b/ACE/docs/ACE-guidelines.html
index f54c5f76707..c4c226c279e 100644
--- a/ACE/docs/ACE-guidelines.html
+++ b/ACE/docs/ACE-guidelines.html
@@ -569,11 +569,11 @@ Foo::bar ()
<li>Mutators and accessors should be of this form:<p>
<pre>
+ /// Sets @c object_addr_ cache from @c host and @c port.
void object_addr (const ACE_INET_Addr &);
- // Sets &lt;object_addr_&gt; cache from &lt;host&gt; and &lt;port&gt;.
+ /// Returns the ACE_INET_Addr for this profile.
const ACE_INET_Addr &object_addr const (void);
- // Returns the &lt;ACE_INET_Addr&gt; for this profile.
</pre><p>
instead of the "set_" and "get_" form.<p>