diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-20 15:43:12 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-03-20 15:43:12 +0000 |
commit | fa8227f430e53b789bc0ec2f393d9f69e4296fbd (patch) | |
tree | 484f65361ed7f9d04a575d08be0252615c6b41b6 | |
parent | 70a7db6dd3f1e0fe865b8749db3742b28a7e65ad (diff) | |
download | ATCD-fa8227f430e53b789bc0ec2f393d9f69e4296fbd.tar.gz |
changed CORBA::WChar from platform-dependent type to ACE_UINT16
-rw-r--r-- | TAO/TAO_IDL/ast/ast_generator.cpp | 6 | ||||
-rw-r--r-- | TAO/TAO_IDL/be/be_generator.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/corbacom.cpp | 38 | ||||
-rw-r--r-- | TAO/tao/corbacom.h | 6 | ||||
-rw-r--r-- | TAO/tao/encode.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/poa.cpp | 14 |
6 files changed, 16 insertions, 68 deletions
diff --git a/TAO/TAO_IDL/ast/ast_generator.cpp b/TAO/TAO_IDL/ast/ast_generator.cpp index 1725bf5cf3d..7ff63ee76fd 100644 --- a/TAO/TAO_IDL/ast/ast_generator.cpp +++ b/TAO/TAO_IDL/ast/ast_generator.cpp @@ -391,11 +391,7 @@ AST_Generator::create_string(AST_Expression *ms) AST_String * AST_Generator::create_wstring(AST_Expression *ms) { -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) - typedef short WChar; -#else /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - typedef wchar_t WChar; -#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ + typedef ACE_UINT16 WChar; return new AST_String(ms, sizeof(WChar)); } diff --git a/TAO/TAO_IDL/be/be_generator.cpp b/TAO/TAO_IDL/be/be_generator.cpp index cf505d91c1f..b0dc26b7dc4 100644 --- a/TAO/TAO_IDL/be/be_generator.cpp +++ b/TAO/TAO_IDL/be/be_generator.cpp @@ -390,11 +390,7 @@ be_generator::create_string(AST_Expression *v) AST_String * be_generator::create_wstring(AST_Expression *v) { -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) - typedef short WChar; -#else /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - typedef wchar_t WChar; -#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ + typedef ACE_UINT16 WChar; return (AST_String *) new be_string(v, sizeof(WChar)); } diff --git a/TAO/tao/corbacom.cpp b/TAO/tao/corbacom.cpp index 57a9e76b631..13ad500ec29 100644 --- a/TAO/tao/corbacom.cpp +++ b/TAO/tao/corbacom.cpp @@ -1,3 +1,5 @@ +// $Id$ + // @(#)corbacom.cpp 1.1 95/08/31 // Copyright 1994-1995 by Sun Microsystems Inc. // All Rights Reserved @@ -56,21 +58,18 @@ CORBA::String_var::operator= (const CORBA::String_var& r) return *this; } -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) -// NOTE: assuming that these don't exist unless they're declared in -// that header file ... +// Wide Character string utility support; this can need to be +// integrated with the ORB's own memory allocation subsystem. -extern "C" unsigned -wslen (const CORBA::WChar *str) +CORBA::WString +CORBA::wstring_alloc (CORBA::ULong len) { - u_int len = 0; - - while (*str++) - len++; - return len; + return new CORBA::WChar [(size_t) (len + 1)]; } -extern "C" CORBA::WChar * +static +inline +CORBA::WChar * wscpy (CORBA::WChar *dest, const CORBA::WChar *src) { @@ -80,16 +79,6 @@ wscpy (CORBA::WChar *dest, continue; return retval; } -#endif /* ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - -// Wide Character string utility support; this can need to be -// integrated with the ORB's own memory allocation subsystem. - -CORBA::WString -CORBA::wstring_alloc (CORBA::ULong len) -{ - return new CORBA::WChar [(size_t) (len + 1)]; -} CORBA::WString CORBA::wstring_copy (const CORBA::WChar *const str) @@ -97,13 +86,8 @@ CORBA::wstring_copy (const CORBA::WChar *const str) if (*str) return 0; -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) - CORBA::WString retval = CORBA::wstring_alloc (wslen (str)); + CORBA::WString retval = CORBA::wstring_alloc (ACE_WString::wstrlen (str)); return wscpy (retval, str); -#else /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - CORBA::WString retval = CORBA::wstring_alloc (ACE_OS::strlen (str)); - return ACE_OS::strcpy (retval, str); -#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ } void diff --git a/TAO/tao/corbacom.h b/TAO/tao/corbacom.h index 7eee1914986..0c755e8b7c7 100644 --- a/TAO/tao/corbacom.h +++ b/TAO/tao/corbacom.h @@ -422,11 +422,7 @@ public: // // NOTE: those are IDL extensions, not yet standard. -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) - typedef short WChar; -#else /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - typedef wchar_t WChar; -#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ + typedef ACE_UINT16 WChar; typedef WChar *WString; typedef WChar &WChar_out; // out type for WChar diff --git a/TAO/tao/encode.cpp b/TAO/tao/encode.cpp index a42814f25ba..c901ac09006 100644 --- a/TAO/tao/encode.cpp +++ b/TAO/tao/encode.cpp @@ -24,14 +24,6 @@ #include "tao/corba.h" -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) -extern "C" -{ - u_int wslen (const CORBA::WChar *); - CORBA::WChar *wscpy (CORBA::WChar *, const CORBA::WChar *); -} -#endif /* ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - extern CORBA::TypeCode TC_opaque; // Encode instances of arbitrary data types based only on typecode. @@ -1328,11 +1320,7 @@ TAO_Marshal_WString::encode (CORBA::TypeCode_ptr tc, if (env.exception () == 0) { // get the actual length of the string -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) - CORBA::ULong len = wslen ((CORBA::WChar *) str); -#else /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - CORBA::ULong len = ACE_OS::strlen (str); -#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ + CORBA::ULong len = ACE_WString::wstrlen ((CORBA::WChar *) str); // if it is an unbounded string or if the length is less than the // bounds for an unbounded string diff --git a/TAO/tao/poa.cpp b/TAO/tao/poa.cpp index 9c4fa7f8ff8..f7abea6f6b0 100644 --- a/TAO/tao/poa.cpp +++ b/TAO/tao/poa.cpp @@ -18,14 +18,6 @@ const int TAO_POA::max_space_required_for_ulong = 24; // This is the maximum space require to convert the ulong into a string const int TAO_Creation_Time::max_space_required_for_two_ulong_to_hex = 8 * 2; -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) -extern "C" -{ - u_int wslen (const CORBA::WChar *); - CORBA::WChar *wscpy (CORBA::WChar *, const CORBA::WChar *); -} -#endif /* ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - TAO_Thread_Policy::TAO_Thread_Policy (PortableServer::ThreadPolicyValue value, PortableServer::POA_ptr poa) : value_ (value), @@ -2924,11 +2916,7 @@ TAO_POA::wstring_to_ObjectId (const CORBA::WChar *string) // We DO NOT include the zero terminator, as this is simply an // artifact of the way strings are stored in C. // -#if defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) - CORBA::ULong string_length = wslen (string); -#else /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ - CORBA::ULong string_length = ACE_OS::strlen (string); -#endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ + CORBA::ULong string_length = ACE_WString::wstrlen (string); size_t buffer_size = string_length * sizeof (CORBA::WChar); |