summaryrefslogtreecommitdiff
path: root/TAO/tests/CodeSets
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-08-06 19:15:30 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-08-06 19:15:30 +0000
commit6789fb9b2125734c81a0af23ad92d0eacbc1c77b (patch)
tree63c6cb3b02032eb01e29268e38fa1d15f74281ae /TAO/tests/CodeSets
parent31dcb2555ee59add8f24128a5637c5b34ffbf33c (diff)
downloadATCD-6789fb9b2125734c81a0af23ad92d0eacbc1c77b.tar.gz
ChangeLogTag: Wed Aug 6 19:08:39 UTC 2008 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO/tests/CodeSets')
-rw-r--r--TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp23
-rw-r--r--TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp19
2 files changed, 27 insertions, 15 deletions
diff --git a/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp b/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp
index 51bba525e67..f63c6e541d3 100644
--- a/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp
+++ b/TAO/tests/CodeSets/libs/UCS4_UTF16/WUCS4_UTF16.cpp
@@ -500,24 +500,31 @@ WUCS4_UTF16::write_wstring (ACE_OutputCDR & cdr,
ACE_UTF16_T bom = ACE_UNICODE_BOM_CORRECT;
ACE_CDR::ULong length = len + count_potential_surrogates (x, len);
ACE_CDR::ULong l = length * ACE_UTF16_CODEPOINT_SIZE;
+
if (this->write_4 (cdr, &l) && x != 0)
{
- this->write_2 (cdr,&bom);
+ this->write_2 (cdr, &bom);
return this->write_measured_wchar_array (cdr, x, len, length);
}
}
else
{
ACE_CDR::ULong l = len + 1;
+
if (this->write_4 (cdr, &l))
- if (x != 0)
- return this->write_wchar_array (cdr, x, len + 1);
- else
- {
- ACE_UTF16_T s = 0;
- return this->write_2 (cdr,&s);
- }
+ {
+ if (x != 0)
+ {
+ return this->write_wchar_array (cdr, x, len + 1);
+ }
+ else
+ {
+ ACE_UTF16_T s = 0;
+ return this->write_2 (cdr, &s);
+ }
+ }
}
+
return 0;
}
diff --git a/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp b/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp
index da5e1522c7d..63fd91f1acb 100644
--- a/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp
+++ b/TAO/tests/CodeSets/libs/UTF16_UCS2/UTF16_UCS2_Translator.cpp
@@ -276,14 +276,19 @@ UTF16_UCS2_Translator::write_wstring (ACE_OutputCDR & cdr,
{
// pre GIOP 1.2: include null terminator in length
ACE_CDR::ULong l = len + 1;
+
if (this->write_4 (cdr, &l))
- if (x != 0)
- return this->write_wchar_array_i (cdr, x, len + 1);
- else
- {
- ACE_UTF16_T s = 0;
- return this->write_2 (cdr, &s);
- }
+ {
+ if (x != 0)
+ {
+ return this->write_wchar_array_i (cdr, x, len + 1);
+ }
+ else
+ {
+ ACE_UTF16_T s = 0;
+ return this->write_2 (cdr, &s);
+ }
+ }
}
return 0;