diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-28 04:16:28 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-01-28 04:16:28 +0000 |
commit | 1672df68c0bdb1181369c641b0482499c51734d2 (patch) | |
tree | 792936678e861d954bb4855821cb449b73549781 /ace | |
parent | a17f1a8eac42352bbc199ee1f615cddf8006ef48 (diff) | |
download | ATCD-1672df68c0bdb1181369c641b0482499c51734d2.tar.gz |
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r-- | ace/ACE.cpp | 4 | ||||
-rw-r--r-- | ace/Local_Name_Space_T.cpp | 31 | ||||
-rw-r--r-- | ace/Local_Tokens.cpp | 2 | ||||
-rw-r--r-- | ace/Log_Msg.cpp | 4 | ||||
-rw-r--r-- | ace/Memory_Pool.cpp | 5 | ||||
-rw-r--r-- | ace/Naming_Context.cpp | 12 | ||||
-rw-r--r-- | ace/OS.h | 18 | ||||
-rw-r--r-- | ace/Parse_Node.cpp | 4 | ||||
-rw-r--r-- | ace/Proactor.cpp | 4 | ||||
-rw-r--r-- | ace/Proactor.h | 4 | ||||
-rw-r--r-- | ace/Registry.cpp | 6 | ||||
-rw-r--r-- | ace/Registry_Name_Space.cpp | 2 | ||||
-rw-r--r-- | ace/Registry_Name_Space.h | 19 | ||||
-rw-r--r-- | ace/Thread_Manager.h | 12 |
14 files changed, 85 insertions, 42 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 6fee653c20c..6f1b3405e57 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -155,7 +155,7 @@ ACE::ldfind (const char filename[], char searchfilename[MAXPATHLEN]; // Create a copy of filename to work with. - if (ACE_OS::strlen (filename) + 1 > sizeof tempcopy) + if (ACE_OS::strlen (filename) + 1 > (sizeof tempcopy / sizeof char)) { errno = ENOMEM; return -1; @@ -207,7 +207,7 @@ ACE::ldfind (const char filename[], // Make sure we've got enough space in searchfilename. if (ACE_OS::strlen (searchfilename) + ACE_OS::strlen (ACE_DLL_PREFIX) + - got_suffix ? 0 : ACE_OS::strlen (ACE_DLL_SUFFIX) >= sizeof searchfilename) + got_suffix ? 0 : ACE_OS::strlen (ACE_DLL_SUFFIX) >= (sizeof searchfilename / sizeof char)) { errno = ENOMEM; return -1; diff --git a/ace/Local_Name_Space_T.cpp b/ace/Local_Name_Space_T.cpp index 8478c390fe8..6f314beb30e 100644 --- a/ace/Local_Name_Space_T.cpp +++ b/ace/Local_Name_Space_T.cpp @@ -364,10 +364,11 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, LOCK>::create_manager_i (void) ACE_TRACE ("ACE_Local_Name_Space::create_manager"); // Get directory name LPCTSTR dir = this->name_options_->namespace_dir (); + LPCTSTR database = this->name_options_->database (); // Use process name as the file name. size_t len = ACE_OS::strlen (dir); - len += ACE_OS::strlen (this->name_options_->database ()) + 1; + len += ACE_OS::strlen (database) + 1; if (len >= MAXNAMELEN) { @@ -377,20 +378,30 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, LOCK>::create_manager_i (void) ACE_OS::strcpy (this->context_file_, dir); ACE_OS::strcat (this->context_file_, ACE_DIRECTORY_SEPARATOR_STR); - ACE_OS::strcat (this->context_file_, this->name_options_->database ()); + ACE_OS::strcat (this->context_file_, database); ACE_MEM_POOL_OPTIONS options (this->name_options_->base_address ()); TCHAR lock_name_for_local_name_space [MAXNAMELEN]; TCHAR lock_name_for_backing_store [MAXNAMELEN]; - LPCTSTR prefix = ACE::basename (this->context_file_, - ACE_DIRECTORY_SEPARATOR_CHAR); - - ACE_OS::strcpy (lock_name_for_local_name_space , prefix); - ACE_OS::strcat (lock_name_for_local_name_space, "_name_space"); - - ACE_OS::strcpy (lock_name_for_backing_store, prefix); - ACE_OS::strcat (lock_name_for_backing_store, "_backing_store"); + LPCTSTR postfix = database; + + size_t length = 0; + length = sizeof lock_name_for_local_name_space / sizeof TCHAR; + ACE_OS::strncpy (lock_name_for_local_name_space, + __TEXT ("name_space_"), + length); + ACE_OS::strcat (lock_name_for_local_name_space, + postfix, + length - ACE_OS::strlen (__TEXT ("name_space_"))); + + length = sizeof lock_name_for_backing_store / sizeof TCHAR; + ACE_OS::strncpy (lock_name_for_local_backing_store, + __TEXT ("backing_store_"), + length); + ACE_OS::strcat (lock_name_for_backing_store, + postfix, + length - ACE_OS::strlen (__TEXT ("backing_store_"))); // Create the allocator with the appropriate options. ACE_NEW_RETURN (this->allocator_, diff --git a/ace/Local_Tokens.cpp b/ace/Local_Tokens.cpp index 713d37b3a2f..ca2b850e857 100644 --- a/ace/Local_Tokens.cpp +++ b/ace/Local_Tokens.cpp @@ -82,7 +82,7 @@ ACE_TPQ_Entry::ACE_TPQ_Entry (const ACE_Token_Proxy *new_proxy, { // Just make sure we have enough space. char host_name[MAXHOSTNAMELEN]; - char name[sizeof host_name + 256]; + char name[(sizeof host_name / sizeof char) + 256]; ACE_OS::hostname (host_name, sizeof host_name); ACE_OS::sprintf (name, diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index 40ddf18059b..66bf0ac039e 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -914,7 +914,7 @@ void ACE_Log_Msg::file (const char *s) { ACE_OS::strncpy (this->file_, s, - sizeof this->file_); + (sizeof this->file_ / sizeof char)); } char * @@ -927,7 +927,7 @@ void ACE_Log_Msg::msg (char *m) { ACE_OS::strncpy (this->msg_, m, - sizeof this->msg_); + (sizeof this->msg_ / sizeof char)); } ostream * diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp index 2392655b3d3..c9c2fd96241 100644 --- a/ace/Memory_Pool.cpp +++ b/ace/Memory_Pool.cpp @@ -125,8 +125,9 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool (LPCTSTR backing_store_name, // if the user didn't supply one... backing_store_name = ACE_DEFAULT_BACKING_STORE; // from "ace/OS.h" - ACE_OS::strncpy (this->backing_store_name_, backing_store_name, - sizeof this->backing_store_name_); + ACE_OS::strncpy (this->backing_store_name_, + backing_store_name, + (sizeof this->backing_store_name_ / sizeof TCHAR)); #if !defined (ACE_WIN32) if (this->signal_handler_.register_handler (SIGSEGV, this) == -1) diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp index b318dc3896a..5952148c320 100644 --- a/ace/Naming_Context.cpp +++ b/ace/Naming_Context.cpp @@ -57,7 +57,8 @@ int 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_); + ACE_OS::hostname (this->hostname_, + (sizeof this->hostname_ / sizeof char)); this->netnameserver_host_ = this->name_options_->nameserver_host (); this->netnameserver_port_ = this->name_options_->nameserver_port (); @@ -65,7 +66,7 @@ ACE_Naming_Context::open (Context_Scope_Type scope_in, int lite) // Perform factory operation to select appropriate type of // Name_Space subclass. -#if (defined (ACE_WIN32) && (defined (UNICODE))) +#if (defined (ACE_WIN32) && defined (UNICODE)) // This only works on Win32 platforms when UNICODE is turned on if (this->name_options_->use_registry ()) @@ -100,11 +101,14 @@ ACE_Naming_Context::close (void) ACE_TRACE ("ACE_Naming_Context::close"); delete this->name_space_; + this->name_space_ = 0; return 0; } ACE_Naming_Context::ACE_Naming_Context (void) + : name_space_ (0), + name_options_ (0) { ACE_TRACE ("ACE_Naming_Context::ACE_Naming_Context"); ACE_NEW (this->name_options_, ACE_Name_Options); @@ -112,6 +116,8 @@ ACE_Naming_Context::ACE_Naming_Context (void) ACE_Naming_Context::ACE_Naming_Context (Context_Scope_Type scope_in, int lite) + : name_space_ (0), + name_options_ (0) { ACE_TRACE ("ACE_Naming_Context::ACE_Naming_Context"); @@ -315,6 +321,7 @@ ACE_Naming_Context::~ACE_Naming_Context (void) { ACE_TRACE ("ACE_Naming_Context::~ACE_Naming_Context"); delete this->name_space_; + delete this->name_options_; } void @@ -336,7 +343,6 @@ int ACE_Naming_Context::fini (void) { ACE_DEBUG ((LM_DEBUG, "ACE_Naming_Context::fini\n")); - delete this->name_options_; return 0; } @@ -1300,8 +1300,10 @@ typedef void (*ACE_SignalHandlerV)(...); // The following 3 defines are used by the ACE Name Server... #define ACE_DEFAULT_NAMESPACE_DIR_W L"C:\\temp" #define ACE_DEFAULT_NAMESPACE_DIR_A "C:\\temp" -#define ACE_DEFAULT_LOCALNAME "\\localnames" -#define ACE_DEFAULT_GLOBALNAME "\\globalnames" +#define ACE_DEFAULT_LOCALNAME_A "\\localnames" +#define ACE_DEFAULT_LOCALNAME_W L"\\localnames" +#define ACE_DEFAULT_GLOBALNAME_A "\\globalnames" +#define ACE_DEFAULT_GLOBALNAME_W L"\\globalnames" // Used for ACE_MMAP_Memory_Pool #define ACE_DEFAULT_BACKING_STORE __TEXT ("C:\\temp\\ace-malloc-XXXXXX") @@ -1552,13 +1554,17 @@ typedef char TCHAR; // The following 3 defines are used by the ACE Name Server... #define ACE_DEFAULT_NAMESPACE_DIR_A "/tmp" +#define ACE_DEFAULT_LOCALNAME_A "/localnames" +#define ACE_DEFAULT_GLOBALNAME_A "/globalnames" #if defined (ACE_HAS_UNICODE) #define ACE_DEFAULT_NAMESPACE_DIR_W L"/tmp" +#define ACE_DEFAULT_LOCALNAME_W L"/localnames" +#define ACE_DEFAULT_GLOBALNAME_W L"/globalnames" #else #define ACE_DEFAULT_NAMESPACE_DIR_W "/tmp" +#define ACE_DEFAULT_LOCALNAME_W "/localnames" +#define ACE_DEFAULT_GLOBALNAME_W "/globalnames" #endif /* ACE_HAS_UNICODE */ -#define ACE_DEFAULT_LOCALNAME "/localnames" -#define ACE_DEFAULT_GLOBALNAME "/globalnames" // Used for ACE_MMAP_Memory_Pool #define ACE_DEFAULT_BACKING_STORE "/tmp/ace-malloc-XXXXXX" @@ -2783,6 +2789,8 @@ private: #if defined (UNICODE) #define ACE_DEFAULT_NAMESPACE_DIR ACE_DEFAULT_NAMESPACE_DIR_W +#define ACE_DEFAULT_LOCALNAME ACE_DEFAULT_LOCALNAME_W +#define ACE_DEFAULT_GLOBALNAME ACE_DEFAULT_GLOBALNAME_W #define ACE_DIRECTORY_SEPARATOR_STR ACE_DIRECTORY_SEPARATOR_STR_W #define ACE_DIRECTORY_SEPARATOR_CHAR ACE_DIRECTORY_SEPARATOR_CHAR_W @@ -2792,6 +2800,8 @@ private: #else #define ACE_DEFAULT_NAMESPACE_DIR ACE_DEFAULT_NAMESPACE_DIR_A +#define ACE_DEFAULT_LOCALNAME ACE_DEFAULT_LOCALNAME_A +#define ACE_DEFAULT_GLOBALNAME ACE_DEFAULT_GLOBALNAME_A #define ACE_DIRECTORY_SEPARATOR_STR ACE_DIRECTORY_SEPARATOR_STR_A #define ACE_DIRECTORY_SEPARATOR_CHAR ACE_DIRECTORY_SEPARATOR_CHAR_A diff --git a/ace/Parse_Node.cpp b/ace/Parse_Node.cpp index e22f2969944..01571406795 100644 --- a/ace/Parse_Node.cpp +++ b/ace/Parse_Node.cpp @@ -363,7 +363,9 @@ ACE_Location_Node::open_handle (void) // Transform the pathname into the appropriate dynamic link library // by searching the ACE_LD_SEARCH_PATH. - ACE::ldfind (this->pathname (), dl_pathname, sizeof dl_pathname); + ACE::ldfind (this->pathname (), + dl_pathname, + (sizeof dl_pathname / sizeof char)); this->handle (ACE_OS::dlopen (dl_pathname, RTLD_LAZY)); diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index ac33079a690..2770de84df1 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -471,7 +471,7 @@ ACE_Overlapped_File::ACE_Overlapped_File (void) { } -ACE_Overlapped_File::ACE_Overlapped_File (const char *file_name, +ACE_Overlapped_File::ACE_Overlapped_File (LPCTSTR file_name, int mode, int perms) : delete_handle_ (1) @@ -508,7 +508,7 @@ ACE_Overlapped_File::open (ACE_HANDLE handle) } int -ACE_Overlapped_File::open (const char *file_name, +ACE_Overlapped_File::open (LPCTSTR file_name, int access, int share, LPSECURITY_ATTRIBUTES security, diff --git a/ace/Proactor.h b/ace/Proactor.h index f34ca85f3f2..038d33a180a 100644 --- a/ace/Proactor.h +++ b/ace/Proactor.h @@ -210,13 +210,13 @@ public: ACE_Overlapped_File (const ACE_Overlapped_File &file); // Copy <file>. - ACE_Overlapped_File (const char *file_name, int mode, int perms = 0); + ACE_Overlapped_File (LPCTSTR file_name, int mode, int perms = 0); // Construction of an ACE_Overlapped_File. Calls open. ~ACE_Overlapped_File (void); // Destruction. Calls close. - int open (const char *file_name, + int open (LPCTSTR file_name, int access = GENERIC_READ, int share = FILE_SHARE_READ, LPSECURITY_ATTRIBUTES security = 0, diff --git a/ace/Registry.cpp b/ace/Registry.cpp index e45e0206ddc..251806a4926 100644 --- a/ace/Registry.cpp +++ b/ace/Registry.cpp @@ -907,7 +907,7 @@ ACE_Registry::Binding_Iterator::Object_Iteration::next_n (u_long how_many, while (how_many > 0) { TCHAR string [ACE_Registry::Naming_Context::MAX_CONTEXT_NAME_SIZE]; - u_long size = sizeof string; + u_long size = sizeof string / sizeof TCHAR; long result = ::RegEnumValue (this->parent_->naming_context (). key(), this->index_, string, @@ -977,7 +977,7 @@ ACE_Registry::Binding_Iterator::Context_Iteration::next_n (u_long how_many, while (how_many > 0) { TCHAR string [ACE_Registry::Naming_Context::MAX_CONTEXT_NAME_SIZE]; - u_long size = sizeof string; + u_long size = sizeof string / sizeof TCHAR; long result = ::RegEnumKeyEx (this->parent_->naming_context (). key (), this->index_, string, @@ -1082,7 +1082,7 @@ int ACE_Predefined_Naming_Contexts::is_local_host (LPCTSTR machine_name) { TCHAR local_host[MAXHOSTNAMELEN]; - int result = ACE_OS::hostname (local_host, sizeof (local_host)); + int result = ACE_OS::hostname (local_host, sizeof local_host / sizeof TCHAR); if (result == 0) result = !ACE_OS::strcmp (local_host, machine_name); else diff --git a/ace/Registry_Name_Space.cpp b/ace/Registry_Name_Space.cpp index aedceac0b93..4eb83101649 100644 --- a/ace/Registry_Name_Space.cpp +++ b/ace/Registry_Name_Space.cpp @@ -2,7 +2,7 @@ #include "ace/Registry_Name_Space.h" -#if (defined (ACE_WIN32) && (defined (UNICODE))) +#if (defined (ACE_WIN32) && defined (UNICODE)) // This only works on Win32 platforms when UNICODE is turned on ACE_Registry_Name_Space::ACE_Registry_Name_Space (void) diff --git a/ace/Registry_Name_Space.h b/ace/Registry_Name_Space.h index 81bf2431cc5..6d0fa7b9807 100644 --- a/ace/Registry_Name_Space.h +++ b/ace/Registry_Name_Space.h @@ -16,18 +16,25 @@ #if !defined (ACE_REGISTRY_NAME_SPACE_H) #define ACE_REGISTRY_NAME_SPACE_H -#if (defined (ACE_WIN32) && (defined (UNICODE))) +#include "ace/Registry.h" + +#if (defined (ACE_WIN32) && defined (UNICODE)) // This only works on Win32 platforms when UNICODE is turned on -#include "ace/Registry.h" #include "ace/Naming_Context.h" #include "ace/Name_Space.h" class ACE_Export ACE_Registry_Name_Space : public ACE_Name_Space -// = TITLE -// -// = DESCRIPTION -// + // = TITLE + // Interface to a Name Server Database which is maintained + // by the Win32 Registry. Allows to add, change, remove and + // resolve NameBindings. + // + // = DESCRIPTION + // Manages a Naming Service for a registry name space which includes + // bindings for all contexts. All strings are stored in wide character format. + // A Name Binding consists of a name (that's the key), a value + // string. There is no type string support in this Name Space. { public: diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h index 701115dbb9e..1570d1469d1 100644 --- a/ace/Thread_Manager.h +++ b/ace/Thread_Manager.h @@ -211,7 +211,10 @@ public: int set_grp (ACE_thread_t, int grp_id); int get_grp (ACE_thread_t, int &grp_id); - // = The following methods are new methods which resemble current methods in ACE_Thread Manager. For example, the new apply_task() method resembles the old apply_thr() method, and suspend_task() resembles suspend_thr(). + // = The following methods are new methods which resemble current + // methods in ACE_Thread Manager. For example, the new apply_task() + // method resembles the old apply_thr() method, and suspend_task() + // resembles suspend_thr(). int wait_task (ACE_Task_Base *task, const ACE_Time_Value *timeout = 0); @@ -233,7 +236,9 @@ public: int cancel_task (ACE_Task_Base *task); // Cancel all threads in an ACE_Task. - // = The following method provide new functionality. They do not follow the same design as current methods. They provide new functionality. + // = The following method provide new functionality. They do not + // follow the same design as current methods. They provide new + // functionality. int num_tasks_in_group (int grp_id); // Returns the number of ACE_Task in a group. @@ -313,7 +318,8 @@ private: void remove_thr (int i); // Remove thread from the table. - // = The following four methods implement a simple scheme for operating on a collection of threads atomically. + // = The following four methods implement a simple scheme for + // operating on a collection of threads atomically. typedef int (ACE_Thread_Manager::*THR_FUNC)(int, int); int check_state (ACE_Thread_State state, ACE_thread_t thread); |