]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/ucnv_u7.c
ICU-57131.0.1.tar.gz
[apple/icu.git] / icuSources / common / ucnv_u7.c
index d51bee47da2acb7e828c7e9490a5b86cfbc2ae1c..e11abcab0465ba57e706a5c4843903b448c7062b 100644 (file)
@@ -1,6 +1,6 @@
 /*  
 **********************************************************************
-*   Copyright (C) 2002-2015, International Business Machines
+*   Copyright (C) 2002-2016, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   file name:  ucnv_u7.c
@@ -18,6 +18,7 @@
 
 #if !UCONFIG_NO_CONVERSION && !UCONFIG_ONLY_HTML_CONVERSION
 
+#include "cmemory.h"
 #include "unicode/ucnv.h"
 #include "ucnv_bld.h"
 #include "ucnv_cnv.h"
@@ -487,7 +488,7 @@ _UTF7FromUnicodeWithOffsets(UConverterFromUnicodeArgs *pArgs,
         inDirectMode=(UBool)((status>>24)&1);
         base64Counter=(int8_t)(status>>16);
         bits=(uint8_t)status;
-        U_ASSERT(bits<=sizeof(toBase64)/sizeof(toBase64[0]));
+        U_ASSERT(bits<=UPRV_LENGTHOF(toBase64));
     }
 
     /* UTF-7 always encodes UTF-16 code units, therefore we need only a simple sourceIndex */
@@ -775,11 +776,8 @@ static const UConverterStaticData _UTF7StaticData={
     { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
 };
 
-const UConverterSharedData _UTF7Data={
-    sizeof(UConverterSharedData), ~((uint32_t)0),
-    NULL, NULL, &_UTF7StaticData, FALSE, &_UTF7Impl,
-    0
-};
+const UConverterSharedData _UTF7Data=
+        UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_UTF7StaticData, &_UTF7Impl);
 
 /* IMAP mailbox name encoding ----------------------------------------------- */
 
@@ -1475,10 +1473,7 @@ static const UConverterStaticData _IMAPStaticData={
     { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */
 };
 
-const UConverterSharedData _IMAPData={
-    sizeof(UConverterSharedData), ~((uint32_t)0),
-    NULL, NULL, &_IMAPStaticData, FALSE, &_IMAPImpl,
-    0
-};
+const UConverterSharedData _IMAPData=
+        UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_IMAPStaticData, &_IMAPImpl);
 
 #endif