diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-11-30 12:38:34 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2009-11-30 12:38:34 +0000 |
commit | 0e8881d58c062a70a59f711552294e7eae5849d4 (patch) | |
tree | 314aa0cb434902dee43d403c257273a78a687a1e | |
parent | 7496d43e70535c12ee1e37c98700c240cff85e74 (diff) | |
download | ATCD-0e8881d58c062a70a59f711552294e7eae5849d4.tar.gz |
Mon Nov 30 12:38:00 UTC 2009 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/config-win32-borland.h:
Started port to C++ Builder 2010, older versions of C++ Builder are
now deprecated
* ace/MMAP_Memory_Pool.cpp:
Layout change
* ace/OS_NS_sys_time.h:
* ace/OS_NS_sys_time.inl:
Removed workarounds for ancient wince versions
* ace/Process.cpp:
* ace/Process.h:
Use bool and size_t and removed some ugly casts
* ace/Trace.cpp:
* ace/Trace.h:
Use bool
-rw-r--r-- | ACE/ace/MMAP_Memory_Pool.cpp | 2 | ||||
-rw-r--r-- | ACE/ace/OS_NS_sys_time.h | 14 | ||||
-rw-r--r-- | ACE/ace/OS_NS_sys_time.inl | 14 | ||||
-rw-r--r-- | ACE/ace/Process.cpp | 39 | ||||
-rw-r--r-- | ACE/ace/Process.h | 14 | ||||
-rw-r--r-- | ACE/ace/Trace.cpp | 9 | ||||
-rw-r--r-- | ACE/ace/Trace.h | 6 | ||||
-rw-r--r-- | ACE/ace/config-win32-borland.h | 4 |
8 files changed, 36 insertions, 66 deletions
diff --git a/ACE/ace/MMAP_Memory_Pool.cpp b/ACE/ace/MMAP_Memory_Pool.cpp index c5acb9e9c53..841160808d9 100644 --- a/ACE/ace/MMAP_Memory_Pool.cpp +++ b/ACE/ace/MMAP_Memory_Pool.cpp @@ -44,7 +44,7 @@ ACE_MMAP_Memory_Pool::release (int destroy) #endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS == 1 */ if (destroy) - this->mmap_.remove (); + this->mmap_.remove (); else this->mmap_.close (); return 0; diff --git a/ACE/ace/OS_NS_sys_time.h b/ACE/ace/OS_NS_sys_time.h index 898c57f8155..54680c8e416 100644 --- a/ACE/ace/OS_NS_sys_time.h +++ b/ACE/ace/OS_NS_sys_time.h @@ -37,22 +37,8 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL namespace ACE_OS { -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - ACE_NAMESPACE_INLINE_FUNCTION ACE_Time_Value gettimeofday (void); - -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif } /* namespace ACE_OS */ ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/OS_NS_sys_time.inl b/ACE/ace/OS_NS_sys_time.inl index 604df97926d..9eaed9fea43 100644 --- a/ACE/ace/OS_NS_sys_time.inl +++ b/ACE/ace/OS_NS_sys_time.inl @@ -11,16 +11,6 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif - ACE_INLINE ACE_Time_Value ACE_OS::gettimeofday (void) { @@ -89,8 +79,4 @@ ACE_OS::gettimeofday (void) #endif // !defined (ACE_WIN32) } -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif - ACE_END_VERSIONED_NAMESPACE_DECL diff --git a/ACE/ace/Process.cpp b/ACE/ace/Process.cpp index b4121ad0c1a..90cccadb0ad 100644 --- a/ACE/ace/Process.cpp +++ b/ACE/ace/Process.cpp @@ -794,9 +794,9 @@ ACE_Process::convert_env_buffer (const char* env) const #endif ACE_Process_Options::ACE_Process_Options (bool inherit_environment, - int command_line_buf_len, - int env_buf_len, - int max_env_args) + size_t command_line_buf_len, + size_t env_buf_len, + size_t max_env_args) : #if !defined (ACE_HAS_WINCE) inherit_environment_ (inherit_environment), @@ -826,7 +826,7 @@ ACE_Process_Options::ACE_Process_Options (bool inherit_environment, max_environment_args_ (max_env_args), max_environ_argv_index_ (max_env_args - 1), #endif /* !ACE_HAS_WINCE */ - command_line_argv_calculated_ (0), + command_line_argv_calculated_ (false), command_line_buf_ (0), command_line_copy_ (0), command_line_buf_len_ (command_line_buf_len), @@ -1004,7 +1004,7 @@ ACE_Process_Options::setenv (const ACE_TCHAR *variable_name, // Add the rest of the varargs. size_t tmp_buflen = DEFAULT_COMMAND_LINE_BUF_LEN > buflen - ? static_cast<size_t> (DEFAULT_COMMAND_LINE_BUF_LEN) : buflen; + ? DEFAULT_COMMAND_LINE_BUF_LEN : buflen; int retval = 0; ACE_TCHAR *stack_buf = 0; @@ -1185,17 +1185,16 @@ ACE_Process_Options::command_line (const ACE_TCHAR *const argv[]) if (argv[i]) { ACE_OS::strcat (command_line_buf_, argv[i]); - + while (argv[++i]) { - // Check to see if the next argument will overflow the + // Check to see if the next argument will overflow the // command_line buffer. - int cur_len = - static_cast<int> ( - ACE_OS::strlen (command_line_buf_) - + ACE_OS:: strlen (argv[i]) - + 2); - + size_t const cur_len = + ACE_OS::strlen (command_line_buf_) + + ACE_OS::strlen (argv[i]) + + 2; + if (cur_len > command_line_buf_len_) { ACE_ERROR_RETURN ((LM_ERROR, @@ -1205,13 +1204,13 @@ ACE_Process_Options::command_line (const ACE_TCHAR *const argv[]) command_line_buf_len_), 1); } - + ACE_OS::strcat (command_line_buf_, ACE_TEXT (" ")); ACE_OS::strcat (command_line_buf_, argv[i]); } } - command_line_argv_calculated_ = 0; + command_line_argv_calculated_ = false; return 0; // Success. } @@ -1241,7 +1240,7 @@ ACE_Process_Options::command_line (const ACE_TCHAR *format, ...) // Useless macro. va_end (argp); - command_line_argv_calculated_ = 0; + command_line_argv_calculated_ = false; return 0; } @@ -1253,7 +1252,7 @@ ACE_Process_Options::command_line (const ACE_TCHAR *format, ...) int ACE_Process_Options::command_line (const ACE_ANTI_TCHAR *format, ...) { - ACE_ANTI_TCHAR *anti_clb; + ACE_ANTI_TCHAR *anti_clb = 0; ACE_NEW_RETURN (anti_clb, ACE_ANTI_TCHAR[this->command_line_buf_len_], -1); @@ -1275,7 +1274,7 @@ ACE_Process_Options::command_line (const ACE_ANTI_TCHAR *format, ...) delete [] anti_clb; - command_line_argv_calculated_ = 0; + command_line_argv_calculated_ = false; return 0; } #endif /* ACE_HAS_WCHAR && !ACE_HAS_WINCE */ @@ -1296,9 +1295,9 @@ ACE_Process_Options::env_buf (void) ACE_TCHAR * const * ACE_Process_Options::command_line_argv (void) { - if (command_line_argv_calculated_ == 0) + if (!command_line_argv_calculated_) { - command_line_argv_calculated_ = 1; + command_line_argv_calculated_ = true; // We need to free up any previous allocated memory first. ACE::strdelete (command_line_copy_); diff --git a/ACE/ace/Process.h b/ACE/ace/Process.h index 23af2012e3d..7cfae895844 100644 --- a/ACE/ace/Process.h +++ b/ACE/ace/Process.h @@ -82,9 +82,9 @@ public: * max strlen for command-line arguments. */ ACE_Process_Options (bool inherit_environment = true, - int command_line_buf_len = DEFAULT_COMMAND_LINE_BUF_LEN, - int env_buf_len = ENVIRONMENT_BUFFER, - int max_env_args = MAX_ENVIRONMENT_ARGS); + size_t command_line_buf_len = DEFAULT_COMMAND_LINE_BUF_LEN, + size_t env_buf_len = ENVIRONMENT_BUFFER, + size_t max_env_args = MAX_ENVIRONMENT_ARGS); /// Destructor. ~ACE_Process_Options (void); @@ -388,7 +388,7 @@ protected: size_t environment_buf_index_; /// Pointer to environment_argv_. - int environment_argv_index_; + size_t environment_argv_index_; /// Pointer to buffer of the environment settings. ACE_TCHAR *environment_buf_; @@ -400,7 +400,7 @@ protected: ACE_TCHAR **environment_argv_; /// Maximum number of environment variables. Configurable - int max_environment_args_; + size_t max_environment_args_; /// Maximum index of environment_argv_ buffer int max_environ_argv_index_; @@ -410,7 +410,7 @@ protected: #endif /* !ACE_HAS_WINCE */ /// Ensures command_line_argv is only calculated once. - int command_line_argv_calculated_; + bool command_line_argv_calculated_; /// Pointer to buffer of command-line arguments. E.g., "-f foo -b bar". ACE_TCHAR *command_line_buf_; @@ -420,7 +420,7 @@ protected: ACE_TCHAR *command_line_copy_; /// Max length of command_line_buf_ - int command_line_buf_len_; + size_t command_line_buf_len_; /// Argv-style command-line arguments. ACE_TCHAR *command_line_argv_[MAX_COMMAND_LINE_OPTIONS]; diff --git a/ACE/ace/Trace.cpp b/ACE/ace/Trace.cpp index f83e8e96511..c87d88a3f1f 100644 --- a/ACE/ace/Trace.cpp +++ b/ACE/ace/Trace.cpp @@ -1,6 +1,5 @@ // $Id$ - #include "ace/Trace.h" ACE_RCSID (ace, @@ -24,7 +23,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL int ACE_Trace::nesting_indent_ = ACE_Trace::DEFAULT_INDENT; // Is tracing enabled? -int ACE_Trace::enable_tracing_ = ACE_Trace::DEFAULT_TRACING; +bool ACE_Trace::enable_tracing_ = ACE_Trace::DEFAULT_TRACING; ACE_ALLOC_HOOK_DEFINE(ACE_Trace) @@ -37,7 +36,7 @@ ACE_Trace::dump (void) const // Determine whether or not tracing is enabled -int +bool ACE_Trace::is_tracing (void) { return ACE_Trace::enable_tracing_; @@ -48,7 +47,7 @@ ACE_Trace::is_tracing (void) void ACE_Trace::start_tracing (void) { - ACE_Trace::enable_tracing_ = 1; + ACE_Trace::enable_tracing_ = true; } // Disable the tracing facility. @@ -56,7 +55,7 @@ ACE_Trace::start_tracing (void) void ACE_Trace::stop_tracing (void) { - ACE_Trace::enable_tracing_ = 0; + ACE_Trace::enable_tracing_ = false; } // Change the nesting indentation level. diff --git a/ACE/ace/Trace.h b/ACE/ace/Trace.h index 4fdb86a3367..7c0c202c1c4 100644 --- a/ACE/ace/Trace.h +++ b/ACE/ace/Trace.h @@ -49,8 +49,8 @@ public: ~ACE_Trace (void); // = Control the tracing level. - /// Determine if tracing is enabled (return == 1) or not (== 0) - static int is_tracing(void); + /// Determine if tracing is enabled or not + static bool is_tracing(void); /// Enable the tracing facility. static void start_tracing (void); @@ -79,7 +79,7 @@ private: static int nesting_indent_; /// Is tracing enabled? - static int enable_tracing_; + static bool enable_tracing_; /// Default values. enum diff --git a/ACE/ace/config-win32-borland.h b/ACE/ace/config-win32-borland.h index 9242bf312e7..bb7a894994e 100644 --- a/ACE/ace/config-win32-borland.h +++ b/ACE/ace/config-win32-borland.h @@ -11,7 +11,7 @@ #error Use config-win32.h in config.h instead of this header #endif /* ACE_CONFIG_WIN32_H */ -#if (__BORLANDC__ != 0x613) +#if (__BORLANDC__ != 0x620) #error This version of CodeGear C++ is not supported. #endif @@ -140,10 +140,10 @@ #if (__BORLANDC__ < 0x620) # define ACE_LACKS_ISBLANK # define ACE_LACKS_ISWBLANK -# define ACE_LACKS_ISWCTYPE # define ACE_LACKS_PRAGMA_ONCE 1 #endif +#define ACE_LACKS_ISWCTYPE #define ACE_LACKS_ISCTYPE #if (__BORLANDC__ < 0x620) |