summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2003-04-17 15:24:43 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2003-04-17 15:24:43 +0000
commit693f358d28e680fe68e6be59c02bb9a10d02a598 (patch)
treea666b06dbf75e09c051da72ccf6930f3b84d4f7e /ace
parent5499803b9070a62e8eb35b95645313fa671c78a9 (diff)
downloadATCD-693f358d28e680fe68e6be59c02bb9a10d02a598.tar.gz
ChangeLogTag:Thu Apr 17 08:23:19 2003 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'ace')
-rw-r--r--ace/Local_Name_Space.cpp37
-rw-r--r--ace/Local_Name_Space.h12
-rw-r--r--ace/Local_Name_Space_T.cpp24
3 files changed, 37 insertions, 36 deletions
diff --git a/ace/Local_Name_Space.cpp b/ace/Local_Name_Space.cpp
index 958cc01b9dd..98cf501b8c0 100644
--- a/ace/Local_Name_Space.cpp
+++ b/ace/Local_Name_Space.cpp
@@ -1,14 +1,13 @@
-// Local_Name_Space.cpp
-// $Id$
-
-#if !defined (ACE_LOCAL_NAME_SPACE_C)
-#define ACE_LOCAL_NAME_SPACE_C
+#ifndef ACE_LOCAL_NAME_SPACE_CPP
+#define ACE_LOCAL_NAME_SPACE_CPP
#include "ace/ACE.h"
#include "ace/Local_Name_Space.h"
#include "ace/RW_Process_Mutex.h"
-ACE_RCSID(ace, Local_Name_Space, "$Id$")
+ACE_RCSID (ace,
+ Local_Name_Space,
+ "$Id$")
ACE_NS_String::~ACE_NS_String (void)
{
@@ -16,7 +15,7 @@ ACE_NS_String::~ACE_NS_String (void)
delete [] this->rep_;
}
-ACE_USHORT16 *
+ACE_WCHAR_T *
ACE_NS_String::fast_rep (void) const
{
ACE_TRACE ("ACE_NS_String::fast_rep");
@@ -27,7 +26,7 @@ ACE_NS_String::operator ACE_NS_WString () const
{
ACE_TRACE ("ACE_NS_String::operator ACE_NS_WString");
return ACE_NS_WString (this->rep_,
- (this->len_ / sizeof (ACE_USHORT16)) - 1);
+ (this->len_ / sizeof (ACE_WCHAR_T)) - 1);
}
size_t
@@ -42,7 +41,7 @@ ACE_NS_String::char_rep (void) const
{
ACE_TRACE ("ACE_NS_String::char_rep");
ACE_NS_WString w_string (this->rep_,
- (this->len_ / sizeof (ACE_USHORT16)) - 1);
+ (this->len_ / sizeof (ACE_WCHAR_T)) - 1);
return w_string.char_rep ();
}
@@ -55,8 +54,8 @@ ACE_NS_String::ACE_NS_String (void)
}
ACE_NS_String::ACE_NS_String (const ACE_NS_WString &s)
- : len_ ((s.length () + 1) * sizeof (ACE_USHORT16)),
- rep_ (s.ushort_rep ()),
+ : len_ ((s.length () + 1) * sizeof (ACE_WCHAR_T)),
+ rep_ (s.rep ()),
delete_rep_ (1)
{
ACE_TRACE ("ACE_NS_String::ACE_NS_String");
@@ -76,14 +75,14 @@ ACE_NS_String::strstr (const ACE_NS_String &s) const
else
{
// They're smaller than we are...
- size_t len = (this->len_ - s.len_) / sizeof (ACE_USHORT16);
- size_t pat_len = s.len_ / sizeof (ACE_USHORT16) - 1;
+ const size_t len = (this->len_ - s.len_) / sizeof (ACE_WCHAR_T);
+ const size_t pat_len = s.len_ / sizeof (ACE_WCHAR_T) - 1;
- for (size_t i = 0; i <= len; i++)
+ for (size_t i = 0; i <= len; ++i)
{
size_t j;
- for (j = 0; j < pat_len; j++)
+ for (j = 0; j < pat_len; ++j)
if (this->rep_[i + j] != s.rep_[j])
break;
@@ -112,8 +111,8 @@ ACE_NS_String::operator != (const ACE_NS_String &s) const
return !this->operator == (s);
}
-ACE_NS_String::ACE_NS_String (ACE_USHORT16 *dst,
- const ACE_USHORT16 *src,
+ACE_NS_String::ACE_NS_String (ACE_WCHAR_T *dst,
+ const ACE_WCHAR_T *src,
size_t bytes)
: len_ (bytes),
rep_ (dst),
@@ -127,7 +126,7 @@ u_long
ACE_NS_String::hash (void) const
{
return ACE::hash_pjw
- (ACE_reinterpret_cast (char *, ACE_const_cast (ACE_USHORT16 *,
+ (ACE_reinterpret_cast (char *, ACE_const_cast (ACE_WCHAR_T *,
this->rep_)),
this->len_);
}
@@ -216,4 +215,4 @@ template class ACE_Write_Guard<ACE_RW_Process_Mutex>;
#pragma instantiate ACE_Write_Guard<ACE_RW_Process_Mutex>
#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */
-#endif /* ACE_LOCAL_NAME_SPACE_C */
+#endif /* ACE_LOCAL_NAME_SPACE_CPP */
diff --git a/ace/Local_Name_Space.h b/ace/Local_Name_Space.h
index 50b1b921216..0779faab512 100644
--- a/ace/Local_Name_Space.h
+++ b/ace/Local_Name_Space.h
@@ -1,4 +1,4 @@
-/* -*- C++ -*- */
+// -*- C++ -*-
//=============================================================================
/**
@@ -14,6 +14,7 @@
#ifndef ACE_LOCAL_NAME_SPACE_H
#define ACE_LOCAL_NAME_SPACE_H
+
#include "ace/pre.h"
#include "ace/SString.h"
@@ -42,8 +43,8 @@ public:
ACE_NS_String (void);
/// Initialization method.
- ACE_NS_String (ACE_USHORT16 *dst,
- const ACE_USHORT16 *src,
+ ACE_NS_String (ACE_WCHAR_T *dst,
+ const ACE_WCHAR_T *src,
size_t len);
/// Converts an ACE_NS_WString to an ACE_NS_String;
@@ -71,7 +72,7 @@ public:
size_t len (void) const;
/// Returns the underlying representation.
- ACE_USHORT16 *fast_rep (void) const;
+ ACE_WCHAR_T *fast_rep (void) const;
/// Returns a hash value for this string.
u_long hash (void) const;
@@ -81,7 +82,7 @@ private:
size_t len_;
/// This actually points into shared/persistent memory.
- ACE_USHORT16 *rep_;
+ ACE_WCHAR_T *rep_;
/// Should rep_ be deleted when destructed (only used
/// for WString conversions)
@@ -124,4 +125,5 @@ private:
#include "ace/Local_Name_Space_T.h"
#include "ace/post.h"
+
#endif /* ACE_LOCAL_NAME_SPACE_H */
diff --git a/ace/Local_Name_Space_T.cpp b/ace/Local_Name_Space_T.cpp
index 71c267aa9dd..3cbde78bdb8 100644
--- a/ace/Local_Name_Space_T.cpp
+++ b/ace/Local_Name_Space_T.cpp
@@ -1,5 +1,5 @@
-#ifndef ACE_LOCAL_NAME_SPACE_T_C
-#define ACE_LOCAL_NAME_SPACE_T_C
+#ifndef ACE_LOCAL_NAME_SPACE_T_CPP
+#define ACE_LOCAL_NAME_SPACE_T_CPP
#include "ace/ACE.h"
@@ -136,10 +136,10 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (
{
ACE_TRACE ("ACE_Local_Name_Space::shared_bind_i");
- size_t name_len = (name.length () + 1) * sizeof (ACE_USHORT16);
- size_t value_len = (value.length () + 1) * sizeof (ACE_USHORT16);
- size_t type_len = ACE_OS::strlen (type) + 1;
- size_t total_len = name_len + value_len + type_len;
+ const size_t name_len = (name.length () + 1) * sizeof (ACE_WCHAR_T);
+ const size_t value_len = (value.length () + 1) * sizeof (ACE_WCHAR_T);
+ const size_t type_len = ACE_OS::strlen (type) + 1;
+ const size_t total_len = name_len + value_len + type_len;
char *ptr = (char *) this->allocator_->malloc (total_len);
if (ptr == 0)
@@ -148,12 +148,12 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::shared_bind_i (
{
// Note that the value_rep *must* come first to make sure we can
// retrieve this pointer later on in unbind().
- ACE_USHORT16 *value_rep = (ACE_USHORT16 *) (ptr);
- ACE_USHORT16 *name_rep = (ACE_USHORT16 *) (ptr + value_len);
+ ACE_WCHAR_T *value_rep = (ACE_WCHAR_T *) (ptr);
+ ACE_WCHAR_T *name_rep = (ACE_WCHAR_T *) (ptr + value_len);
char *new_type = (char *) (ptr + value_len + name_len);
- ACE_Auto_Basic_Array_Ptr<ACE_USHORT16> name_urep (name.ushort_rep ());
- ACE_Auto_Basic_Array_Ptr<ACE_USHORT16> value_urep (value.ushort_rep ());
+ ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> name_urep (name.rep ());
+ ACE_Auto_Basic_Array_Ptr<ACE_WCHAR_T> value_urep (value.rep ());
ACE_NS_String new_name (name_rep, name_urep.get (), name_len);
ACE_NS_String new_value (value_rep, value_urep.get (), value_len);
@@ -322,7 +322,7 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::resolve_i (
value = nbc_string;
// Gets type and then the actual reprsentation which is a
- // ACE_USHORT16
+ // ACE_WCHAR_T
const char *temp = ns_internal.type ();
size_t len = ACE_OS::strlen (ns_internal.type ());
@@ -960,4 +960,4 @@ ACE_Local_Name_Space<ACE_MEM_POOL_2, ACE_LOCK>::dump (void) const
}
}
-#endif /* ACE_LOCAL_NAME_SPACE_T_C */
+#endif /* ACE_LOCAL_NAME_SPACE_T_CPP */