]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/unistr_cnv.cpp
ICU-59173.0.1.tar.gz
[apple/icu.git] / icuSources / common / unistr_cnv.cpp
index 1626b8843f28ea67b283fa0fd6899a6e9c8f5c54..64d3c16801ccb861300cb57cd0631db53ea1c25b 100644 (file)
@@ -1,12 +1,14 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /*
 *******************************************************************************
 *
-*   Copyright (C) 1999-2010, International Business Machines
+*   Copyright (C) 1999-2014, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 *
 *******************************************************************************
 *   file name:  unistr_cnv.cpp
-*   encoding:   US-ASCII
+*   encoding:   UTF-8
 *   tab size:   8 (not used)
 *   indentation:2
 *
@@ -39,20 +41,16 @@ U_NAMESPACE_BEGIN
 
 #if !U_CHARSET_IS_UTF8
 
-UnicodeString::UnicodeString(const char *codepageData)
-  : fShortLength(0),
-    fFlags(kShortString)
-{
+UnicodeString::UnicodeString(const char *codepageData) {
+    fUnion.fFields.fLengthAndFlags = kShortString;
     if(codepageData != 0) {
         doCodepageCreate(codepageData, (int32_t)uprv_strlen(codepageData), 0);
     }
 }
 
 UnicodeString::UnicodeString(const char *codepageData,
-                             int32_t dataLength)
-  : fShortLength(0),
-    fFlags(kShortString)
-{
+                             int32_t dataLength) {
+    fUnion.fFields.fLengthAndFlags = kShortString;
     if(codepageData != 0) {
         doCodepageCreate(codepageData, dataLength, 0);
     }
@@ -62,10 +60,8 @@ UnicodeString::UnicodeString(const char *codepageData,
 #endif
 
 UnicodeString::UnicodeString(const char *codepageData,
-                             const char *codepage)
-  : fShortLength(0),
-    fFlags(kShortString)
-{
+                             const char *codepage) {
+    fUnion.fFields.fLengthAndFlags = kShortString;
     if(codepageData != 0) {
         doCodepageCreate(codepageData, (int32_t)uprv_strlen(codepageData), codepage);
     }
@@ -73,10 +69,8 @@ UnicodeString::UnicodeString(const char *codepageData,
 
 UnicodeString::UnicodeString(const char *codepageData,
                              int32_t dataLength,
-                             const char *codepage)
-  : fShortLength(0),
-    fFlags(kShortString)
-{
+                             const char *codepage) {
+    fUnion.fFields.fLengthAndFlags = kShortString;
     if(codepageData != 0) {
         doCodepageCreate(codepageData, dataLength, codepage);
     }
@@ -84,10 +78,8 @@ UnicodeString::UnicodeString(const char *codepageData,
 
 UnicodeString::UnicodeString(const char *src, int32_t srcLength,
                              UConverter *cnv,
-                             UErrorCode &errorCode)
-  : fShortLength(0),
-    fFlags(kShortString)
-{
+                             UErrorCode &errorCode) {
+    fUnion.fFields.fLengthAndFlags = kShortString;
     if(U_SUCCESS(errorCode)) {
         // check arguments
         if(src==NULL) {