]> granicus.if.org Git - icu/commitdiff
ICU-7653 changed uprv_lengthof to UPRV_LENGTHOF, also added apidoc
authorSteven R. Loomis <srl@icu-project.org>
Thu, 28 Aug 2014 22:13:45 +0000 (22:13 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Thu, 28 Aug 2014 22:13:45 +0000 (22:13 +0000)
X-SVN-Rev: 36275

116 files changed:
icu4c/source/common/cmemory.h
icu4c/source/common/dictbe.cpp
icu4c/source/common/listformatter.cpp
icu4c/source/common/putil.cpp
icu4c/source/common/rbbiscan.cpp
icu4c/source/common/simplepatternformatter.cpp
icu4c/source/common/ucnv2022.cpp
icu4c/source/common/udata.cpp
icu4c/source/common/uloc_tag.c
icu4c/source/common/unames.cpp
icu4c/source/common/uprops.cpp
icu4c/source/common/uresdata.c
icu4c/source/common/uscript_props.cpp
icu4c/source/common/ushape.cpp
icu4c/source/common/ustrcase.cpp
icu4c/source/common/ustrtrns.cpp
icu4c/source/common/utrie2_builder.cpp
icu4c/source/common/uts46.cpp
icu4c/source/extra/uconv/uconv.cpp
icu4c/source/extra/uconv/uwmsg.c
icu4c/source/i18n/coll.cpp
icu4c/source/i18n/collationbuilder.cpp
icu4c/source/i18n/collationdatareader.cpp
icu4c/source/i18n/collationruleparser.cpp
icu4c/source/i18n/compactdecimalformat.cpp
icu4c/source/i18n/dtptngen.cpp
icu4c/source/i18n/identifier_info.cpp
icu4c/source/i18n/measfmt.cpp
icu4c/source/i18n/measunit.cpp
icu4c/source/i18n/quantityformatter.cpp
icu4c/source/i18n/rulebasedcollator.cpp
icu4c/source/i18n/scriptset.cpp
icu4c/source/i18n/ucol_res.cpp
icu4c/source/i18n/ucoleitr.cpp
icu4c/source/i18n/zonemeta.cpp
icu4c/source/samples/numfmt/main.cpp
icu4c/source/samples/uciter8/uciter8.c
icu4c/source/samples/ustring/ustring.cpp
icu4c/source/test/cintltst/bocu1tst.c
icu4c/source/test/cintltst/capitst.c
icu4c/source/test/cintltst/cbiditst.c
icu4c/source/test/cintltst/ccapitst.c
icu4c/source/test/cintltst/cg7coll.c
icu4c/source/test/cintltst/cgendtst.c
icu4c/source/test/cintltst/cloctst.c
icu4c/source/test/cintltst/cmsgtst.c
icu4c/source/test/cintltst/cnormtst.c
icu4c/source/test/cintltst/crestst.c
icu4c/source/test/cintltst/cstrcase.c
icu4c/source/test/cintltst/cstrtest.c
icu4c/source/test/cintltst/cucdapi.c
icu4c/source/test/cintltst/cucdtst.c
icu4c/source/test/cintltst/custrtrn.c
icu4c/source/test/cintltst/custrtst.c
icu4c/source/test/cintltst/idnatest.c
icu4c/source/test/cintltst/ncnvtst.c
icu4c/source/test/cintltst/nfsprep.c
icu4c/source/test/cintltst/nucnvtst.c
icu4c/source/test/cintltst/sorttest.c
icu4c/source/test/cintltst/spreptst.c
icu4c/source/test/cintltst/trie2test.c
icu4c/source/test/cintltst/ucnvseltst.c
icu4c/source/test/cintltst/udatatst.c
icu4c/source/test/cintltst/usettest.c
icu4c/source/test/cintltst/utf16tst.c
icu4c/source/test/cintltst/utf8tst.c
icu4c/source/test/cintltst/utmstest.c
icu4c/source/test/intltest/alphaindextst.cpp
icu4c/source/test/intltest/apicoll.cpp
icu4c/source/test/intltest/bytestrietest.cpp
icu4c/source/test/intltest/citrtest.cpp
icu4c/source/test/intltest/collationtest.cpp
icu4c/source/test/intltest/compactdecimalformattest.cpp
icu4c/source/test/intltest/convtest.cpp
icu4c/source/test/intltest/dcfmapts.cpp
icu4c/source/test/intltest/dtfmttst.cpp
icu4c/source/test/intltest/g7coll.cpp
icu4c/source/test/intltest/genderinfotest.cpp
icu4c/source/test/intltest/itspoof.cpp
icu4c/source/test/intltest/measfmttest.cpp
icu4c/source/test/intltest/numfmtst.cpp
icu4c/source/test/intltest/plurults.cpp
icu4c/source/test/intltest/regextst.cpp
icu4c/source/test/intltest/regiontst.cpp
icu4c/source/test/intltest/reldatefmttest.cpp
icu4c/source/test/intltest/selfmts.cpp
icu4c/source/test/intltest/simplepatternformattertest.cpp
icu4c/source/test/intltest/strcase.cpp
icu4c/source/test/intltest/tfsmalls.cpp
icu4c/source/test/intltest/tmsgfmt.cpp
icu4c/source/test/intltest/tsmthred.cpp
icu4c/source/test/intltest/tstnorm.cpp
icu4c/source/test/intltest/tufmtts.cpp
icu4c/source/test/intltest/tztest.cpp
icu4c/source/test/intltest/ucdtest.cpp
icu4c/source/test/intltest/ucharstrietest.cpp
icu4c/source/test/intltest/usettest.cpp
icu4c/source/test/intltest/ustrtest.cpp
icu4c/source/test/intltest/uts46test.cpp
icu4c/source/test/perf/convperf/convperf.cpp
icu4c/source/test/perf/convperf/convperf.h
icu4c/source/test/perf/dicttrieperf/dicttrieperf.cpp
icu4c/source/test/perf/normperf/normperf.cpp
icu4c/source/test/perf/unisetperf/draft/bitset.cpp
icu4c/source/test/perf/unisetperf/unisetperf.cpp
icu4c/source/test/perf/utfperf/utfperf.cpp
icu4c/source/tools/gennorm2/gennorm2.cpp
icu4c/source/tools/gennorm2/n2builder.cpp
icu4c/source/tools/icupkg/icupkg.cpp
icu4c/source/tools/icuswap/icuswap.cpp
icu4c/source/tools/makeconv/gencnvex.c
icu4c/source/tools/makeconv/makeconv.c
icu4c/source/tools/toolutil/package.cpp
icu4c/source/tools/toolutil/pkg_icu.cpp
icu4c/source/tools/toolutil/ppucd.cpp
icu4c/source/tools/toolutil/swapimpl.cpp

index ea57d5fabbe6cd6670265ff93d3c00a7779cf427..ed29b63e8f9f736aa278760809fed571e51dd4e7 100644 (file)
@@ -59,7 +59,14 @@ U_CAPI void uprv_checkValidMemory(const void *p, size_t n);
 
 #endif  /* U_DEBUG */
 
-#define uprv_lengthof(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
+/**
+ * \def UPRV_LENGTHOF
+ * Convenience macro to determine the length of a fixed array at compile-time.
+ * @param array A fixed length array
+ * @return The length of the array, in elements
+ * @internal
+ */
+#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
 #define uprv_memset(buffer, mark, size) U_STANDARD_CPP_NAMESPACE memset(buffer, mark, size)
 #define uprv_memcmp(buffer1, buffer2, size) U_STANDARD_CPP_NAMESPACE memcmp(buffer1, buffer2,size)
 
index c58a4f1c52854112b3577d276a278e760964609a..b88f6db32fa0fb7094236d53ac5857902bda612a 100644 (file)
@@ -156,7 +156,7 @@ int32_t PossibleWord::candidates( UText *text, DictionaryMatcher *dict, int32_t
     int32_t start = (int32_t)utext_getNativeIndex(text);
     if (start != offset) {
         offset = start;
-        count = dict->matches(text, rangeEnd-start, uprv_lengthof(cuLengths), cuLengths, cpLengths, NULL, &prefix);
+        count = dict->matches(text, rangeEnd-start, UPRV_LENGTHOF(cuLengths), cuLengths, cpLengths, NULL, &prefix);
         // Dictionary leaves text after longest prefix, not longest word. Back up.
         if (count <= 0) {
             utext_setNativeIndex(text, start);
index 9dc4b9fd6aefa345d51247d4518cabb5e893b64c..cfbd08bdce3cf31fea0b2376d6d5ce423fc602a3 100644 (file)
@@ -271,10 +271,10 @@ static void joinStrings(
     int32_t offsets[2];
     pat.format(
             params,
-            uprv_lengthof(params),
+            UPRV_LENGTHOF(params),
             result,
             offsets,
-            uprv_lengthof(offsets),
+            UPRV_LENGTHOF(offsets),
             errorCode);
     if (U_FAILURE(errorCode)) {
         return;
index 4f320d534caf38edd9159929143a4fc92b34992f..a6c3f1cc751eb0a867e0f06e9d89c3d035cca3ef 100644 (file)
@@ -814,7 +814,7 @@ static const char* remapShortTimeZone(const char *stdID, const char *dstID, int3
 #ifdef DEBUG_TZNAME
     fprintf(stderr, "TZ=%s std=%s dst=%s daylight=%d offset=%d\n", getenv("TZ"), stdID, dstID, daylightType, offset);
 #endif
-    for (idx = 0; idx < uprv_lengthof(OFFSET_ZONE_MAPPINGS); idx++)
+    for (idx = 0; idx < UPRV_LENGTHOF(OFFSET_ZONE_MAPPINGS); idx++)
     {
         if (offset == OFFSET_ZONE_MAPPINGS[idx].offsetSeconds
             && daylightType == OFFSET_ZONE_MAPPINGS[idx].daylightType
index 0ca7ede39239343ce8c2be003c6ee1faf2fd8d90..d5c6306d97a53e4c44b2ac2ce6e7af9da36eb149 100644 (file)
@@ -991,7 +991,7 @@ void RBBIRuleScanner::parse() {
             if (tableEl->fCharClass >= 128 && tableEl->fCharClass < 240 &&   // Table specs a char class &&
                 fC.fEscaped == FALSE &&                                      //   char is not escaped &&
                 fC.fChar != (UChar32)-1) {                                   //   char is not EOF
-                U_ASSERT((tableEl->fCharClass-128) < uprv_lengthof(fRuleSets));
+                U_ASSERT((tableEl->fCharClass-128) < UPRV_LENGTHOF(fRuleSets));
                 if (fRuleSets[tableEl->fCharClass-128].contains(fC.fChar)) {
                     // Table row specified a character class, or set of characters,
                     //   and the current char matches it.
index ed8d55aa02bcb4b5bc3ac8357e1da18d8303e68d..30390f4150c013824df7235647f39f7f75c8ea8f 100644 (file)
@@ -189,7 +189,7 @@ UnicodeString& SimplePatternFormatter::format(
     const UnicodeString *params[] = {&arg0};
     return format(
             params,
-            uprv_lengthof(params),
+            UPRV_LENGTHOF(params),
             appendTo,
             NULL,
             0,
@@ -204,7 +204,7 @@ UnicodeString& SimplePatternFormatter::format(
     const UnicodeString *params[] = {&arg0, &arg1};
     return format(
             params,
-            uprv_lengthof(params),
+            UPRV_LENGTHOF(params),
             appendTo,
             NULL,
             0,
@@ -220,7 +220,7 @@ UnicodeString& SimplePatternFormatter::format(
     const UnicodeString *params[] = {&arg0, &arg1, &arg2};
     return format(
             params,
-            uprv_lengthof(params),
+            UPRV_LENGTHOF(params),
             appendTo,
             NULL,
             0,
index cdde4b04e1c980756a81232c7899dd1a3609407a..9556dd2c096fc22e0e8977796730a7c47efd1e45 100644 (file)
@@ -1717,7 +1717,7 @@ getTrail:
                 }
 
                 /* try all the other possible charsets */
-                for(i = 0; i < uprv_lengthof(jpCharsetPref); ++i) {
+                for(i = 0; i < UPRV_LENGTHOF(jpCharsetPref); ++i) {
                     cs = (int8_t)jpCharsetPref[i];
                     if(CSM(cs) & csm) {
                         choices[choiceCount++] = cs;
index e195191655b567e5f45f2eb94371e410f5c7e3bc..d2d113ad52f146afd9f35292d535ea97817996c3 100644 (file)
@@ -120,7 +120,7 @@ udata_cleanup(void)
     }
     gCommonDataCacheInitOnce.reset();
 
-    for (i = 0; i < uprv_lengthof(gCommonICUDataArray) && gCommonICUDataArray[i] != NULL; ++i) {
+    for (i = 0; i < UPRV_LENGTHOF(gCommonICUDataArray) && gCommonICUDataArray[i] != NULL; ++i) {
         udata_close(gCommonICUDataArray[i]);
         gCommonICUDataArray[i] = NULL;
     }
@@ -139,7 +139,7 @@ findCommonICUDataByName(const char *inBasename)
     if (pData == NULL)
         return FALSE;
 
-    for (i = 0; i < uprv_lengthof(gCommonICUDataArray); ++i) {
+    for (i = 0; i < UPRV_LENGTHOF(gCommonICUDataArray); ++i) {
         if ((gCommonICUDataArray[i] != NULL) && (gCommonICUDataArray[i]->pHeader == pData->pHeader)) {
             /* The data pointer is already in the array. */
             found = TRUE;
@@ -173,7 +173,7 @@ setCommonICUData(UDataMemory *pData,     /*  The new common data.  Belongs to ca
     /*    their locals.                                                              */
     UDatamemory_assign(newCommonData, pData);
     umtx_lock(NULL);
-    for (i = 0; i < uprv_lengthof(gCommonICUDataArray); ++i) {
+    for (i = 0; i < UPRV_LENGTHOF(gCommonICUDataArray); ++i) {
         if (gCommonICUDataArray[i] == NULL) {
             gCommonICUDataArray[i] = newCommonData;
             didUpdate = TRUE;
@@ -185,7 +185,7 @@ setCommonICUData(UDataMemory *pData,     /*  The new common data.  Belongs to ca
     }
     umtx_unlock(NULL);
 
-    if (i == uprv_lengthof(gCommonICUDataArray) && warn) {
+    if (i == UPRV_LENGTHOF(gCommonICUDataArray) && warn) {
         *pErr = U_USING_DEFAULT_WARNING;
     }
     if (didUpdate) {
@@ -660,7 +660,7 @@ openCommonData(const char *path,          /*  Path from OpenChoice?          */
     /* ??????? TODO revisit this */ 
     if (commonDataIndex >= 0) {
         /* "mini-cache" for common ICU data */
-        if(commonDataIndex >= uprv_lengthof(gCommonICUDataArray)) {
+        if(commonDataIndex >= UPRV_LENGTHOF(gCommonICUDataArray)) {
             return NULL;
         }
         if(gCommonICUDataArray[commonDataIndex] == NULL) {
index 27b9329a660bfc30d7be950efbbf850c8d02f47d..3725955b3612b9d07677156a2009318bd53507f8 100644 (file)
@@ -1058,7 +1058,7 @@ _appendLanguageToLanguageTag(const char* localeID, char* appendAt, int32_t capac
         reslen += LANG_UND_LEN;
     } else {
         /* resolve deprecated */
-        for (i = 0; i < uprv_lengthof(DEPRECATEDLANGS); i += 2) {
+        for (i = 0; i < UPRV_LENGTHOF(DEPRECATEDLANGS); i += 2) {
             if (uprv_compareInvCharsAsAscii(buf, DEPRECATEDLANGS[i]) == 0) {
                 uprv_strcpy(buf, DEPRECATEDLANGS[i + 1]);
                 len = (int32_t)uprv_strlen(buf);
index 57ca87e6b56f0a201b731f28bacf8bb9207bfb88..e6fa30f3bd9c7184de92b00bacdae1c2f69fd1c4 100644 (file)
@@ -436,7 +436,7 @@ static const char *getCharCatName(UChar32 cp) {
     /* Return unknown if the table of names above is not up to
        date. */
 
-    if (cat >= uprv_lengthof(charCatNames)) {
+    if (cat >= UPRV_LENGTHOF(charCatNames)) {
         return "unknown";
     } else {
         return charCatNames[cat];
@@ -1275,7 +1275,7 @@ static int32_t
 calcExtNameSetsLengths(int32_t maxNameLength) {
     int32_t i, length;
 
-    for(i=0; i<uprv_lengthof(charCatNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(charCatNames); ++i) {
         /*
          * for each category, count the length of the category name
          * plus 9=
@@ -1582,7 +1582,7 @@ u_charFromName(UCharNameChoice nameChoice,
                        We could use a binary search, or a trie, if
                        we really wanted to. */
 
-                    for (lower[i] = 0, cIdx = 0; cIdx < uprv_lengthof(charCatNames); ++cIdx) {
+                    for (lower[i] = 0, cIdx = 0; cIdx < UPRV_LENGTHOF(charCatNames); ++cIdx) {
 
                         if (!uprv_strcmp(lower + 1, charCatNames[cIdx])) {
                             if (getCharCat(cp) == cIdx) {
index 0055341901342a1670ae6337c894674d8b809cce..32871be45c87996218e9c327c7ea4b97fbf2df6d 100644 (file)
@@ -133,7 +133,7 @@ static UBool changesWhenCasefolded(const BinaryProperty &/*prop*/, UChar32 c, UP
         /* guess some large but stack-friendly capacity */
         UChar dest[2*UCASE_MAX_STRING_LENGTH];
         int32_t destLength;
-        destLength=u_strFoldCase(dest, uprv_lengthof(dest),
+        destLength=u_strFoldCase(dest, UPRV_LENGTHOF(dest),
                                   nfd.getBuffer(), nfd.length(),
                                   U_FOLD_CASE_DEFAULT, &errorCode);
         return (UBool)(U_SUCCESS(errorCode) &&
@@ -379,7 +379,7 @@ static const UHangulSyllableType gcbToHst[]={
 static int32_t getHangulSyllableType(const IntProperty &/*prop*/, UChar32 c, UProperty /*which*/) {
     /* see comments on gcbToHst[] above */
     int32_t gcb=(int32_t)(u_getUnicodeProperties(c, 2)&UPROPS_GCB_MASK)>>UPROPS_GCB_SHIFT;
-    if(gcb<uprv_lengthof(gcbToHst)) {
+    if(gcb<UPRV_LENGTHOF(gcbToHst)) {
         return gcbToHst[gcb];
     } else {
         return U_HST_NOT_APPLICABLE;
index bc37c240043783c0480c77b95c873ca07a6248fc..a007377762e5d96c10e25c2b60d9e85e1d88498e 100644 (file)
@@ -747,7 +747,7 @@ ures_swapResource(const UDataSwapper *ds,
             (key!=gUnknownKey ?
                 /* its table key string is "%%CollationBin" */
                 0==ds->compareInvChars(ds, key, -1,
-                                       gCollationBinKey, uprv_lengthof(gCollationBinKey)-1) :
+                                       gCollationBinKey, UPRV_LENGTHOF(gCollationBinKey)-1) :
                 /* its table key string is unknown but it looks like a collation binary */
                 ucol_looksLikeCollationBinary(ds, p+1, count))
         ) {
index 2d3c98110e8aa805a2615f87b41b7d636529edfb..f4a8e5a7f47a17bb6c40798b48a035b7111f90c2 100644 (file)
@@ -213,7 +213,7 @@ const int32_t SCRIPT_PROPS[] = {
 };
 
 int32_t getScriptProps(UScriptCode script) {
-    if (0 <= script && script < uprv_lengthof(SCRIPT_PROPS)) {
+    if (0 <= script && script < UPRV_LENGTHOF(SCRIPT_PROPS)) {
         return SCRIPT_PROPS[script];
     } else {
         return 0;
index 8ec310cac075f988476cdda445e0897f2ec28a9e..eeae57f3d4370ec9489776caed09363d75ac8666 100644 (file)
@@ -1558,8 +1558,8 @@ u_shapeArabic(const UChar *source, int32_t sourceLength,
         }
 
         /* Start of Arabic letter shaping part */
-        if(outputSize<=uprv_lengthof(buffer)) {
-            outputSize=uprv_lengthof(buffer);
+        if(outputSize<=UPRV_LENGTHOF(buffer)) {
+            outputSize=UPRV_LENGTHOF(buffer);
             tempbuffer=buffer;
         } else {
             tempbuffer = (UChar *)uprv_malloc(outputSize*U_SIZEOF_UCHAR);
index b5b9b8274c2f3bca6b28f275da4386e572aefcd4..e687267df868c723c8f8670523fa36f733d59aab 100644 (file)
@@ -397,7 +397,7 @@ ustrcase_map(const UCaseMap *csm,
          (dest>=src && dest<(src+srcLength)))
     ) {
         /* overlap: provide a temporary destination buffer and later copy the result */
-        if(destCapacity<=uprv_lengthof(buffer)) {
+        if(destCapacity<=UPRV_LENGTHOF(buffer)) {
             /* the stack buffer is large enough */
             temp=buffer;
         } else {
index a51fb56019b5346a23086ecf17f23314399c6ef6..5ec22f7a8aa09bec21965e847136093f896bd6bc 100644 (file)
@@ -381,7 +381,7 @@ utf8_nextCharSafeBodyPointer(const uint8_t **ps, const uint8_t *limit, UChar32 c
 
     /* correct sequence - all trail bytes have (b7..b6)==(10)? */
     /* illegal is also set if count>=4 */
-    U_ASSERT(illegal || count<uprv_lengthof(utf8_minLegal));
+    U_ASSERT(illegal || count<UPRV_LENGTHOF(utf8_minLegal));
     if(illegal || c<utf8_minLegal[count] || U_IS_SURROGATE(c)) {
         /* error handling */
         /* don't go beyond this sequence */
index 41e862d4e4d2ada73a39f494e7e8e6a417303223..0815822c5035f708e26e23848de8d1103b177124 100644 (file)
@@ -474,7 +474,7 @@ allocIndex2Block(UNewTrie2 *trie) {
 
     newBlock=trie->index2Length;
     newTop=newBlock+UTRIE2_INDEX_2_BLOCK_LENGTH;
-    if(newTop>uprv_lengthof(trie->index2)) {
+    if(newTop>UPRV_LENGTHOF(trie->index2)) {
         /*
          * Should never occur.
          * Either UTRIE2_MAX_BUILD_TIME_INDEX_LENGTH is incorrect,
index ac9f5b71ce7a37eaac32258bc24c442219986315..11d5dc5d2bf88560abbaffeb03a6bd44676e24cc 100644 (file)
@@ -433,7 +433,7 @@ UTS46::processUTF8(const StringPiece &src,
         char stackArray[256];
         int32_t destCapacity;
         char *destArray=dest.GetAppendBuffer(srcLength, srcLength+20,
-                                             stackArray, uprv_lengthof(stackArray), &destCapacity);
+                                             stackArray, UPRV_LENGTHOF(stackArray), &destCapacity);
         UBool disallowNonLDHDot=(options&UIDNA_USE_STD3_RULES)!=0;
         int32_t i;
         for(i=0;; ++i) {
index 258a1bca425657d347092b7ef04b805710116dda..1fd2565831d77796038290805b99d1d474442318 100644 (file)
@@ -944,7 +944,7 @@ ConvertFile::convertFile(const char *pname,
                     int8_t i, length, errorLength;
 
                     UErrorCode localError = U_ZERO_ERROR;
-                    errorLength = (int8_t)uprv_lengthof(errorUChars);
+                    errorLength = (int8_t)UPRV_LENGTHOF(errorUChars);
                     ucnv_getInvalidUChars(convto, errorUChars, &errorLength, &localError);
                     if (U_FAILURE(localError) || errorLength == 0) {
                         // need at least 1 so that we don't access beyond the length of fromoffsets[]
index dcd9c1e7f625927433eae9d76c63ab192e402cac..a182a719a67d1acd73d5da782b388edc833259a6 100644 (file)
@@ -125,7 +125,7 @@ U_CFUNC int u_wmsg(FILE *fp, const char *tag, ... )
     va_list ap;
 #endif
     UChar   result[4096];
-    int32_t resultLength = uprv_lengthof(result);
+    int32_t resultLength = UPRV_LENGTHOF(result);
 
     if(gBundle == NULL)
     {
@@ -144,7 +144,7 @@ U_CFUNC int u_wmsg(FILE *fp, const char *tag, ... )
 
 #if UCONFIG_NO_FORMATTING
     resultLength = sizeof(gNoFormatting) / U_SIZEOF_UCHAR;
-    if((msgLen + resultLength) <= uprv_lengthof(result)) {
+    if((msgLen + resultLength) <= UPRV_LENGTHOF(result)) {
         memcpy(result, msg, msgLen * U_SIZEOF_UCHAR);
         memcpy(result + msgLen, gNoFormatting, resultLength);
         resultLength += msgLen;
index f61ea40f37041c87bfa5374897f10bb0940d0f17..c4845f2b1f9e62e77fbe9336abe01a1d700bafff 100644 (file)
@@ -294,7 +294,7 @@ static const char *collReorderCodes[UCOL_REORDER_CODE_LIMIT - UCOL_REORDER_CODE_
 };
 
 int32_t getReorderCode(const char *s) {
-    for (int32_t i = 0; i < uprv_lengthof(collReorderCodes); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(collReorderCodes); ++i) {
         if (uprv_stricmp(s, collReorderCodes[i]) == 0) {
             return UCOL_REORDER_CODE_FIRST + i;
         }
@@ -324,7 +324,7 @@ void setAttributesFromKeywords(const Locale &loc, Collator &coll, UErrorCode &er
     char value[1024];  // The reordering value could be long.
     // Check for collation keywords that were already deprecated
     // before any were supported in createInstance() (except for "collation").
-    int32_t length = loc.getKeywordValue("colHiraganaQuaternary", value, uprv_lengthof(value), errorCode);
+    int32_t length = loc.getKeywordValue("colHiraganaQuaternary", value, UPRV_LENGTHOF(value), errorCode);
     if (U_FAILURE(errorCode)) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return;
@@ -333,7 +333,7 @@ void setAttributesFromKeywords(const Locale &loc, Collator &coll, UErrorCode &er
         errorCode = U_UNSUPPORTED_ERROR;
         return;
     }
-    length = loc.getKeywordValue("variableTop", value, uprv_lengthof(value), errorCode);
+    length = loc.getKeywordValue("variableTop", value, UPRV_LENGTHOF(value), errorCode);
     if (U_FAILURE(errorCode)) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return;
@@ -346,15 +346,15 @@ void setAttributesFromKeywords(const Locale &loc, Collator &coll, UErrorCode &er
     if (errorCode == U_STRING_NOT_TERMINATED_WARNING) {
         errorCode = U_ZERO_ERROR;
     }
-    for (int32_t i = 0; i < uprv_lengthof(collAttributes); ++i) {
-        length = loc.getKeywordValue(collAttributes[i].name, value, uprv_lengthof(value), errorCode);
+    for (int32_t i = 0; i < UPRV_LENGTHOF(collAttributes); ++i) {
+        length = loc.getKeywordValue(collAttributes[i].name, value, UPRV_LENGTHOF(value), errorCode);
         if (U_FAILURE(errorCode) || errorCode == U_STRING_NOT_TERMINATED_WARNING) {
             errorCode = U_ILLEGAL_ARGUMENT_ERROR;
             return;
         }
         if (length == 0) { continue; }
         for (int32_t j = 0;; ++j) {
-            if (j == uprv_lengthof(collAttributeValues)) {
+            if (j == UPRV_LENGTHOF(collAttributeValues)) {
                 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
                 return;
             }
@@ -364,7 +364,7 @@ void setAttributesFromKeywords(const Locale &loc, Collator &coll, UErrorCode &er
             }
         }
     }
-    length = loc.getKeywordValue("colReorder", value, uprv_lengthof(value), errorCode);
+    length = loc.getKeywordValue("colReorder", value, UPRV_LENGTHOF(value), errorCode);
     if (U_FAILURE(errorCode) || errorCode == U_STRING_NOT_TERMINATED_WARNING) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return;
@@ -374,7 +374,7 @@ void setAttributesFromKeywords(const Locale &loc, Collator &coll, UErrorCode &er
         int32_t codesLength = 0;
         char *scriptName = value;
         for (;;) {
-            if (codesLength == uprv_lengthof(codes)) {
+            if (codesLength == UPRV_LENGTHOF(codes)) {
                 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
                 return;
             }
@@ -399,7 +399,7 @@ void setAttributesFromKeywords(const Locale &loc, Collator &coll, UErrorCode &er
         }
         coll.setReorderCodes(codes, codesLength, errorCode);
     }
-    length = loc.getKeywordValue("kv", value, uprv_lengthof(value), errorCode);
+    length = loc.getKeywordValue("kv", value, UPRV_LENGTHOF(value), errorCode);
     if (U_FAILURE(errorCode) || errorCode == U_STRING_NOT_TERMINATED_WARNING) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return;
index b2d838dc1a1e3bf186c9edce1e2551ba4c0c04b7..37f701ce775cc9a6cf6a8a842d35ed3381700ab6 100644 (file)
@@ -274,7 +274,7 @@ CollationBuilder::parseAndBuild(const UnicodeString &ruleString,
     if(U_FAILURE(errorCode)) { return NULL; }
     ownedSettings.fastLatinOptions = CollationFastLatin::getOptions(
         tailoring->data, ownedSettings,
-        ownedSettings.fastLatinPrimaries, uprv_lengthof(ownedSettings.fastLatinPrimaries));
+        ownedSettings.fastLatinPrimaries, UPRV_LENGTHOF(ownedSettings.fastLatinPrimaries));
     tailoring->rules = ruleString;
     tailoring->rules.getTerminatedBuffer();  // ensure NUL-termination
     tailoring->setVersion(base->version, rulesVersion);
index 905f3327cf9e8474b6d4af81743faacd1368eb26..519b5422ef6588dfc237323592245912d6955012 100644 (file)
@@ -368,7 +368,7 @@ CollationDataReader::read(const CollationTailoring *base, const uint8_t *inBytes
     int32_t options = inIndexes[IX_OPTIONS] & 0xffff;
     uint16_t fastLatinPrimaries[CollationFastLatin::LATIN_LIMIT];
     int32_t fastLatinOptions = CollationFastLatin::getOptions(
-            tailoring.data, ts, fastLatinPrimaries, uprv_lengthof(fastLatinPrimaries));
+            tailoring.data, ts, fastLatinPrimaries, UPRV_LENGTHOF(fastLatinPrimaries));
     if(options == ts.options && ts.variableTop != 0 &&
             reorderCodesLength == ts.reorderCodesLength &&
             uprv_memcmp(reorderCodes, ts.reorderCodes, reorderCodesLength * 4) == 0 &&
@@ -407,7 +407,7 @@ CollationDataReader::read(const CollationTailoring *base, const uint8_t *inBytes
 
     settings->fastLatinOptions = CollationFastLatin::getOptions(
         tailoring.data, *settings,
-        settings->fastLatinPrimaries, uprv_lengthof(settings->fastLatinPrimaries));
+        settings->fastLatinPrimaries, UPRV_LENGTHOF(settings->fastLatinPrimaries));
 }
 
 UBool U_CALLCONV
index f090b1070124c5a0e2ba80cd4a1b5ed3a5229b5a..ac413a2a64cd0145bde39ebb37fe05ca8a285dd2 100644 (file)
@@ -461,7 +461,7 @@ CollationRuleParser::parseSpecialPosition(int32_t i, UnicodeString &str, UErrorC
     int32_t j = readWords(i + 1, raw);
     if(j > i && rules->charAt(j) == 0x5d && !raw.isEmpty()) {  // words end with ]
         ++j;
-        for(int32_t pos = 0; pos < uprv_lengthof(positions); ++pos) {
+        for(int32_t pos = 0; pos < UPRV_LENGTHOF(positions); ++pos) {
             if(raw == UnicodeString(positions[pos], -1, US_INV)) {
                 str.setTo((UChar)POS_LEAD).append((UChar)(POS_BASE + pos));
                 return j;
@@ -725,7 +725,7 @@ static const char *const gSpecialReorderCodes[] = {
 
 int32_t
 CollationRuleParser::getReorderCode(const char *word) {
-    for(int32_t i = 0; i < uprv_lengthof(gSpecialReorderCodes); ++i) {
+    for(int32_t i = 0; i < UPRV_LENGTHOF(gSpecialReorderCodes); ++i) {
         if(uprv_stricmp(word, gSpecialReorderCodes[i]) == 0) {
             return UCOL_REORDER_CODE_FIRST + i;
         }
index 6bdfca1245b741f8aca276da7299d3b39a3e59d1..74d9c04191c5360ecaad5066797a5117b8ab0e91 100644 (file)
@@ -766,13 +766,13 @@ static int32_t populatePrefixSuffix(
   if (U_FAILURE(status)) {
     return 0;
   }
-  int32_t firstIdx = formatStr.indexOf(kZero, uprv_lengthof(kZero), 0);
+  int32_t firstIdx = formatStr.indexOf(kZero, UPRV_LENGTHOF(kZero), 0);
   // We must have 0's in format string.
   if (firstIdx == -1) {
     status = U_INTERNAL_PROGRAM_ERROR;
     return 0;
   }
-  int32_t lastIdx = formatStr.lastIndexOf(kZero, uprv_lengthof(kZero), firstIdx);
+  int32_t lastIdx = formatStr.lastIndexOf(kZero, UPRV_LENGTHOF(kZero), firstIdx);
   CDFUnit* unit = createCDFUnit(variant, log10Value, result, status);
   if (U_FAILURE(status)) {
     return 0;
index 679cee89e3ccc3d40cf4abd4888dc56aeeb3529e..fe1f5a150f6359eb5399b0b408309e38389a3448 100644 (file)
@@ -508,7 +508,7 @@ DateTimePatternGenerator::addCLDRData(const Locale& locale, UErrorCode& err) {
     const char *key=NULL;
     int32_t i;
 
-    UnicodeString defaultItemFormat(TRUE, UDATPG_ItemFormat, uprv_lengthof(UDATPG_ItemFormat)-1);  // Read-only alias.
+    UnicodeString defaultItemFormat(TRUE, UDATPG_ItemFormat, UPRV_LENGTHOF(UDATPG_ItemFormat)-1);  // Read-only alias.
 
     err = U_ZERO_ERROR;
     
index a420213cc1d13e22d0d9ffa7ca65547c33915061..d4e167c98f18e68b57df5c88485dbb2d89d2c812 100644 (file)
@@ -135,7 +135,7 @@ IdentifierInfo &IdentifierInfo::setIdentifier(const UnicodeString &identifier, U
             fNumerics->add(cp - (UChar32)u_getNumericValue(cp));
         }
         UScriptCode extensions[500];
-        int32_t extensionsCount = uscript_getScriptExtensions(cp, extensions, uprv_lengthof(extensions), &status);
+        int32_t extensionsCount = uscript_getScriptExtensions(cp, extensions, UPRV_LENGTHOF(extensions), &status);
         if (U_FAILURE(status)) {
             return *this;
         }
index f364dd100f0afbe5686a35a12b2b70963fcc6064..f0a2f031bdfaa239c7d88a0f42c7161a63f83172 100644 (file)
@@ -111,7 +111,7 @@ private:
 };
 
 MeasureFormatCacheData::MeasureFormatCacheData() {
-    for (int32_t i = 0; i < uprv_lengthof(currencyFormats); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(currencyFormats); ++i) {
         currencyFormats[i] = NULL;
     }
     integerFormat = NULL;
@@ -119,7 +119,7 @@ MeasureFormatCacheData::MeasureFormatCacheData() {
 }
 
 MeasureFormatCacheData::~MeasureFormatCacheData() {
-    for (int32_t i = 0; i < uprv_lengthof(currencyFormats); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(currencyFormats); ++i) {
         delete currencyFormats[i];
     }
     delete integerFormat;
index b2a3e3fd1414dc4f0cf8efafd673338f304e7951..67eb21481f32c0f194b6408736866b2e114db72a 100644 (file)
@@ -639,20 +639,20 @@ int32_t MeasureUnit::getAvailable(
     if (U_FAILURE(errorCode)) {
         return 0;
     }
-    if (destCapacity < uprv_lengthof(gSubTypes)) {
+    if (destCapacity < UPRV_LENGTHOF(gSubTypes)) {
         errorCode = U_BUFFER_OVERFLOW_ERROR;
-        return uprv_lengthof(gSubTypes);
+        return UPRV_LENGTHOF(gSubTypes);
     }
     int32_t idx = 0;
-    for (int32_t typeIdx = 0; typeIdx < uprv_lengthof(gTypes); ++typeIdx) {
+    for (int32_t typeIdx = 0; typeIdx < UPRV_LENGTHOF(gTypes); ++typeIdx) {
         int32_t len = gOffsets[typeIdx + 1] - gOffsets[typeIdx];
         for (int32_t subTypeIdx = 0; subTypeIdx < len; ++subTypeIdx) {
             dest[idx].setTo(typeIdx, subTypeIdx);
             ++idx;
         }
     }
-    U_ASSERT(idx == uprv_lengthof(gSubTypes));
-    return uprv_lengthof(gSubTypes);
+    U_ASSERT(idx == UPRV_LENGTHOF(gSubTypes));
+    return UPRV_LENGTHOF(gSubTypes);
 }
 
 int32_t MeasureUnit::getAvailable(
@@ -663,7 +663,7 @@ int32_t MeasureUnit::getAvailable(
     if (U_FAILURE(errorCode)) {
         return 0;
     }
-    int32_t typeIdx = binarySearch(gTypes, 0, uprv_lengthof(gTypes), type);
+    int32_t typeIdx = binarySearch(gTypes, 0, UPRV_LENGTHOF(gTypes), type);
     if (typeIdx == -1) {
         return 0;
     }
@@ -680,7 +680,7 @@ int32_t MeasureUnit::getAvailable(
 
 StringEnumeration* MeasureUnit::getAvailableTypes(UErrorCode &errorCode) {
     UEnumeration *uenum = uenum_openCharStringsEnumeration(
-            gTypes, uprv_lengthof(gTypes), &errorCode);
+            gTypes, UPRV_LENGTHOF(gTypes), &errorCode);
     if (U_FAILURE(errorCode)) {
         uenum_close(uenum);
         return NULL;
@@ -695,7 +695,7 @@ StringEnumeration* MeasureUnit::getAvailableTypes(UErrorCode &errorCode) {
 }
 
 int32_t MeasureUnit::getIndexCount() {
-    return gIndexes[uprv_lengthof(gIndexes) - 1];
+    return gIndexes[UPRV_LENGTHOF(gIndexes) - 1];
 }
 
 MeasureUnit *MeasureUnit::create(int typeId, int subTypeId, UErrorCode &status) {
@@ -710,7 +710,7 @@ MeasureUnit *MeasureUnit::create(int typeId, int subTypeId, UErrorCode &status)
 }
 
 void MeasureUnit::initTime(const char *timeId) {
-    int32_t result = binarySearch(gTypes, 0, uprv_lengthof(gTypes), "duration");
+    int32_t result = binarySearch(gTypes, 0, UPRV_LENGTHOF(gTypes), "duration");
     U_ASSERT(result != -1);
     fTypeId = result;
     result = binarySearch(gSubTypes, gOffsets[fTypeId], gOffsets[fTypeId + 1], timeId);
@@ -719,7 +719,7 @@ void MeasureUnit::initTime(const char *timeId) {
 }
 
 void MeasureUnit::initCurrency(const char *isoCurrency) {
-    int32_t result = binarySearch(gTypes, 0, uprv_lengthof(gTypes), "currency");
+    int32_t result = binarySearch(gTypes, 0, UPRV_LENGTHOF(gTypes), "currency");
     U_ASSERT(result != -1);
     fTypeId = result;
     result = binarySearch(
@@ -727,7 +727,7 @@ void MeasureUnit::initCurrency(const char *isoCurrency) {
     if (result != -1) {
         fSubTypeId = result - gOffsets[fTypeId];
     } else {
-        uprv_strncpy(fCurrency, isoCurrency, uprv_lengthof(fCurrency));
+        uprv_strncpy(fCurrency, isoCurrency, UPRV_LENGTHOF(fCurrency));
     }
 }
 
index ae3cf5887ae38fff5285380f61d795dfc4463a17..8bec7a9734668b91eef427cc5ff42fe630e1ede6 100644 (file)
@@ -26,7 +26,7 @@ static const char * const gPluralForms[] = {
         "other", "zero", "one", "two", "few", "many"};
 
 static int32_t getPluralIndex(const char *pluralForm) {
-    int32_t len = uprv_lengthof(gPluralForms);
+    int32_t len = UPRV_LENGTHOF(gPluralForms);
     for (int32_t i = 0; i < len; ++i) {
         if (uprv_strcmp(pluralForm, gPluralForms[i]) == 0) {
             return i;
@@ -36,13 +36,13 @@ static int32_t getPluralIndex(const char *pluralForm) {
 }
 
 QuantityFormatter::QuantityFormatter() {
-    for (int32_t i = 0; i < uprv_lengthof(formatters); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) {
         formatters[i] = NULL;
     }
 }
 
 QuantityFormatter::QuantityFormatter(const QuantityFormatter &other) {
-    for (int32_t i = 0; i < uprv_lengthof(formatters); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) {
         if (other.formatters[i] == NULL) {
             formatters[i] = NULL;
         } else {
@@ -56,7 +56,7 @@ QuantityFormatter &QuantityFormatter::operator=(
     if (this == &other) {
         return *this;
     }
-    for (int32_t i = 0; i < uprv_lengthof(formatters); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) {
         delete formatters[i];
         if (other.formatters[i] == NULL) {
             formatters[i] = NULL;
@@ -68,13 +68,13 @@ QuantityFormatter &QuantityFormatter::operator=(
 }
 
 QuantityFormatter::~QuantityFormatter() {
-    for (int32_t i = 0; i < uprv_lengthof(formatters); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) {
         delete formatters[i];
     }
 }
 
 void QuantityFormatter::reset() {
-    for (int32_t i = 0; i < uprv_lengthof(formatters); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(formatters); ++i) {
         delete formatters[i];
         formatters[i] = NULL;
     }
@@ -164,7 +164,7 @@ UnicodeString &QuantityFormatter::format(
     fmt.format(quantity, formattedNumber, fpos, status);
     const UnicodeString *params[1] = {&formattedNumber};
     int32_t offsets[1];
-    pattern->format(params, uprv_lengthof(params), appendTo, offsets, uprv_lengthof(offsets), status);
+    pattern->format(params, UPRV_LENGTHOF(params), appendTo, offsets, UPRV_LENGTHOF(offsets), status);
     if (offsets[0] != -1) {
         if (fpos.getBeginIndex() != 0 || fpos.getEndIndex() != 0) {
             pos.setBeginIndex(fpos.getBeginIndex() + offsets[0]);
index 5b2185415cc21f2dda847dede91c938f66c2d9a0..48c6adb2a4ccf0ab0ef9981499b28fdf11a53303 100644 (file)
@@ -703,7 +703,7 @@ void
 RuleBasedCollator::setFastLatinOptions(CollationSettings &ownedSettings) const {
     ownedSettings.fastLatinOptions = CollationFastLatin::getOptions(
             data, ownedSettings,
-            ownedSettings.fastLatinPrimaries, uprv_lengthof(ownedSettings.fastLatinPrimaries));
+            ownedSettings.fastLatinPrimaries, UPRV_LENGTHOF(ownedSettings.fastLatinPrimaries));
 }
 
 UCollationResult
@@ -1592,21 +1592,21 @@ RuleBasedCollator::internalGetShortDefinitionString(const char *locale,
         appendAttribute(result, 'F', getAttribute(UCOL_FRENCH_COLLATION, errorCode), errorCode);
     }
     // Note: UCOL_HIRAGANA_QUATERNARY_MODE is deprecated and never changes away from default.
-    length = uloc_getKeywordValue(resultLocale, "collation", subtag, uprv_lengthof(subtag), &errorCode);
+    length = uloc_getKeywordValue(resultLocale, "collation", subtag, UPRV_LENGTHOF(subtag), &errorCode);
     appendSubtag(result, 'K', subtag, length, errorCode);
-    length = uloc_getLanguage(resultLocale, subtag, uprv_lengthof(subtag), &errorCode);
+    length = uloc_getLanguage(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
     appendSubtag(result, 'L', subtag, length, errorCode);
     if(attributeHasBeenSetExplicitly(UCOL_NORMALIZATION_MODE)) {
         appendAttribute(result, 'N', getAttribute(UCOL_NORMALIZATION_MODE, errorCode), errorCode);
     }
-    length = uloc_getCountry(resultLocale, subtag, uprv_lengthof(subtag), &errorCode);
+    length = uloc_getCountry(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
     appendSubtag(result, 'R', subtag, length, errorCode);
     if(attributeHasBeenSetExplicitly(UCOL_STRENGTH)) {
         appendAttribute(result, 'S', getAttribute(UCOL_STRENGTH, errorCode), errorCode);
     }
-    length = uloc_getVariant(resultLocale, subtag, uprv_lengthof(subtag), &errorCode);
+    length = uloc_getVariant(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
     appendSubtag(result, 'V', subtag, length, errorCode);
-    length = uloc_getScript(resultLocale, subtag, uprv_lengthof(subtag), &errorCode);
+    length = uloc_getScript(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
     appendSubtag(result, 'Z', subtag, length, errorCode);
 
     if(U_FAILURE(errorCode)) { return 0; }
index 753518ff2cc52ddd53ae8ac57a6376445a78a172..9be244e0bbfebf4ab34b45fec7bffea6f68a0385 100644 (file)
@@ -27,7 +27,7 @@ U_NAMESPACE_BEGIN
 //
 //----------------------------------------------------------------------------
 ScriptSet::ScriptSet() {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         bits[i] = 0;
     }
 }
@@ -41,7 +41,7 @@ ScriptSet::ScriptSet(const ScriptSet &other) {
     
 
 ScriptSet & ScriptSet::operator =(const ScriptSet &other) {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         bits[i] = other.bits[i];
     }
     return *this;
@@ -49,7 +49,7 @@ ScriptSet & ScriptSet::operator =(const ScriptSet &other) {
 
 
 UBool ScriptSet::operator == (const ScriptSet &other) const {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         if (bits[i] != other.bits[i]) {
             return FALSE;
         }
@@ -102,14 +102,14 @@ ScriptSet &ScriptSet::reset(UScriptCode script, UErrorCode &status) {
 
 
 ScriptSet &ScriptSet::Union(const ScriptSet &other) {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         bits[i] |= other.bits[i];
     }
     return *this;
 }
 
 ScriptSet &ScriptSet::intersect(const ScriptSet &other) {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         bits[i] &= other.bits[i];
     }
     return *this;
@@ -125,7 +125,7 @@ ScriptSet &ScriptSet::intersect(UScriptCode script, UErrorCode &status) {
 }
     
 UBool ScriptSet::intersects(const ScriptSet &other) const {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         if ((bits[i] & other.bits[i]) != 0) {
             return true;
         }
@@ -141,7 +141,7 @@ UBool ScriptSet::contains(const ScriptSet &other) const {
 
 
 ScriptSet &ScriptSet::setAll() {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         bits[i] = 0xffffffffu;
     }
     return *this;
@@ -149,7 +149,7 @@ ScriptSet &ScriptSet::setAll() {
 
 
 ScriptSet &ScriptSet::resetAll() {
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         bits[i] = 0;
     }
     return *this;
@@ -159,7 +159,7 @@ int32_t ScriptSet::countMembers() const {
     // This bit counter is good for sparse numbers of '1's, which is
     //  very much the case that we will usually have.
     int32_t count = 0;
-    for (uint32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         uint32_t x = bits[i];
         while (x > 0) {
             count++;
@@ -171,7 +171,7 @@ int32_t ScriptSet::countMembers() const {
 
 int32_t ScriptSet::hashCode() const {
     int32_t hash = 0;
-    for (int32_t i=0; i<uprv_lengthof(bits); i++) {
+    for (int32_t i=0; i<UPRV_LENGTHOF(bits); i++) {
         hash ^= bits[i];
     }
     return hash;
index c26bd4c67311fc7b9ad1bfbe18611ec5866dbff1..4558468d006732cadf58cfff24d30e373ddaa7d0 100644 (file)
@@ -107,7 +107,7 @@ CollationLoader::loadRules(const char *localeID, const char *collationType,
     // Copy the type for lowercasing.
     char type[16];
     int32_t typeLength = uprv_strlen(collationType);
-    if(typeLength >= uprv_lengthof(type)) {
+    if(typeLength >= UPRV_LENGTHOF(type)) {
         errorCode = U_ILLEGAL_ARGUMENT_ERROR;
         return;
     }
@@ -177,7 +177,7 @@ CollationLoader::CollationLoader(const CollationCacheEntry *re, const Locale &re
 
         // Fetch the collation type from the locale ID.
         int32_t typeLength = requested.getKeywordValue("collation",
-                type, uprv_lengthof(type) - 1, errorCode);
+                type, UPRV_LENGTHOF(type) - 1, errorCode);
         if(U_FAILURE(errorCode)) {
             errorCode = U_ILLEGAL_ARGUMENT_ERROR;
             return;
@@ -266,7 +266,7 @@ CollationLoader::loadFromBundle(UErrorCode &errorCode) {
                 ures_getByKeyWithFallback(collations, "default", NULL, &internalErrorCode));
         int32_t length;
         const UChar *s = ures_getString(def.getAlias(), &length, &internalErrorCode);
-        if(U_SUCCESS(internalErrorCode) && 0 < length && length < uprv_lengthof(defaultType)) {
+        if(U_SUCCESS(internalErrorCode) && 0 < length && length < UPRV_LENGTHOF(defaultType)) {
             u_UCharsToChars(s, defaultType, length + 1);
         } else {
             uprv_strcpy(defaultType, "standard");
@@ -424,7 +424,7 @@ CollationLoader::loadFromData(UErrorCode &errorCode) {
                                           &internalErrorCode));
         int32_t length;
         const UChar *s = ures_getString(def.getAlias(), &length, &internalErrorCode);
-        if(U_SUCCESS(internalErrorCode) && length < uprv_lengthof(defaultType)) {
+        if(U_SUCCESS(internalErrorCode) && length < UPRV_LENGTHOF(defaultType)) {
             u_UCharsToChars(s, defaultType, length + 1);
         } else {
             uprv_strcpy(defaultType, "standard");
@@ -579,7 +579,7 @@ static const char RESOURCE_NAME[] = "collations";
 
 static const char* const KEYWORDS[] = { "collation" };
 
-#define KEYWORD_COUNT uprv_lengthof(KEYWORDS)
+#define KEYWORD_COUNT UPRV_LENGTHOF(KEYWORDS)
 
 U_CAPI UEnumeration* U_EXPORT2
 ucol_getKeywords(UErrorCode *status) {
index 7849bb9527d63453d89f551c80d02a6ad0bdc31b..e10c366a8f2d0d4809f19f4b9dd5b15f88100d3a 100644 (file)
@@ -72,7 +72,7 @@ RCEBuffer::RCEBuffer()
 {
     buffer = defaultBuffer;
     bufferIndex = 0;
-    bufferSize = uprv_lengthof(defaultBuffer);
+    bufferSize = UPRV_LENGTHOF(defaultBuffer);
 }
 
 RCEBuffer::~RCEBuffer()
@@ -122,7 +122,7 @@ PCEBuffer::PCEBuffer()
 {
     buffer = defaultBuffer;
     bufferIndex = 0;
-    bufferSize = uprv_lengthof(defaultBuffer);
+    bufferSize = UPRV_LENGTHOF(defaultBuffer);
 }
 
 PCEBuffer::~PCEBuffer()
index 4f53b4dc761f197547639a1a3c883b1fcfbfb017..e2c75e5577b503499895a78c50e0e2c079f01970 100644 (file)
@@ -267,7 +267,7 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) {
     // If not, resolve CLDR canonical ID with resource data
     UBool isInputCanonical = FALSE;
     char id[ZID_KEY_MAX + 1];
-    tzid.extract(0, 0x7fffffff, id, uprv_lengthof(id), US_INV);
+    tzid.extract(0, 0x7fffffff, id, UPRV_LENGTHOF(id), US_INV);
 
     // replace '/' with ':'
     char *p = id;
index 018970ee9e319cf1a0ff245f2475555ca60fd21c..ee375ff72b9123e9b79396004de00ad4d72e6f7c 100644 (file)
@@ -151,12 +151,12 @@ setNumberFormatCurrency_2_4(NumberFormat &nf, const char *currency, UErrorCode &
 
     int32_t i;
 
-    for(i=0; i<uprv_lengthof(currencyMap); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(currencyMap); ++i) {
         if(strcmp(currency, currencyMap[i].currency)==0) {
             break;
         }
     }
-    if(i==uprv_lengthof(currencyMap)) {
+    if(i==UPRV_LENGTHOF(currencyMap)) {
         // a more specific error code would be useful in a real application
         errorCode=U_UNSUPPORTED_ERROR;
         return;
@@ -233,7 +233,7 @@ showCurrencyFormatting(UBool useICU26API) {
     // TODO: Using printf() here assumes that the runtime encoding is ASCII-friendly
     // and can therefore be mixed with UTF-8
 
-    for(i=0; i<uprv_lengthof(sampleLocaleIDs); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(sampleLocaleIDs); ++i) {
         printf("show currency formatting (method for %s) in the locale \"%s\"\n",
                 useICU26API ? "ICU 2.6" : "before ICU 2.6",
                 sampleLocaleIDs[i]);
@@ -247,7 +247,7 @@ showCurrencyFormatting(UBool useICU26API) {
             continue;
         }
 
-        for(j=0; j<uprv_lengthof(sampleCurrencies); ++j) {
+        for(j=0; j<UPRV_LENGTHOF(sampleCurrencies); ++j) {
             printf("  - format currency \"%s\": ", sampleCurrencies[j]);
 
             // set the actual currency to be formatted
index 847fdce54d601ea5e9620438440ec43f58660873..85fe78618ae90ef604a2a92b590c303ad001d385 100644 (file)
@@ -318,7 +318,7 @@ TestLenient8Iterator() {
     compareIterators(&iter1, "UTF16Iterator", &iter2, "Lenient8Iterator_1");
 
     /* test get/set state */
-    length=uprv_lengthof(text)-1;
+    length=UPRV_LENGTHOF(text)-1;
     uiter_setLenient8(&iter1, (const char*)bytes, -1);
     testIteratorState(&iter1, &iter2, "Lenient8IteratorState", length/2);
     testIteratorState(&iter1, &iter2, "Lenient8IteratorStatePlus1", length/2+1);
index 1bee2173837a9efabe567a16a9f87cc4054b33bd..d0f91cd690f5bdadd77bb5e1a05f528caa9cacde 100644 (file)
@@ -105,8 +105,8 @@ demo_utf_h_macros() {
 
     printf("\n* demo_utf_h_macros() -------------- ***\n\n");
 
-    printUString("iterate forward through: ", input, uprv_lengthof(input));
-    for(i=0; i<uprv_lengthof(input); /* U16_NEXT post-increments */) {
+    printUString("iterate forward through: ", input, UPRV_LENGTHOF(input));
+    for(i=0; i<UPRV_LENGTHOF(input); /* U16_NEXT post-increments */) {
         /* Iterating forwards 
            Codepoint at offset 0: U+0061
            Codepoint at offset 1: U+10000
@@ -114,7 +114,7 @@ demo_utf_h_macros() {
            Codepoint at offset 5: U+0062
         */
         printf("Codepoint at offset %d: U+", i);
-        U16_NEXT(input, i, uprv_lengthof(input), c);
+        U16_NEXT(input, i, UPRV_LENGTHOF(input), c);
         printf("%04x\n", c); 
     }
 
@@ -122,10 +122,10 @@ demo_utf_h_macros() {
 
     isError=FALSE;
     i=1; /* write position, gets post-incremented so needs to be in an l-value */
-    U16_APPEND(input, i, uprv_lengthof(input), 0x0062, isError);
+    U16_APPEND(input, i, UPRV_LENGTHOF(input), 0x0062, isError);
 
-    printUString("iterate backward through: ", input, uprv_lengthof(input));
-    for(i=uprv_lengthof(input); i>0; /* U16_PREV pre-decrements */) {
+    printUString("iterate backward through: ", input, UPRV_LENGTHOF(input));
+    for(i=UPRV_LENGTHOF(input); i>0; /* U16_PREV pre-decrements */) {
         U16_PREV(input, 0, i, c);
         /* Iterating backwards
            Codepoint at offset 5: U+0062
@@ -212,57 +212,57 @@ static void demoCaseMapInC() {
 
     /* uppercase */
     isError=FALSE;
-    for(i=j=0; j<uprv_lengthof(buffer) && !isError; /* U16_NEXT post-increments */) {
+    for(i=j=0; j<UPRV_LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
         U16_NEXT(input, i, INT32_MAX, c); /* without length because NUL-terminated */
         if(c==0) {
             break; /* stop at terminating NUL, no need to terminate buffer */
         }
         c=u_toupper(c);
-        U16_APPEND(buffer, j, uprv_lengthof(buffer), c, isError);
+        U16_APPEND(buffer, j, UPRV_LENGTHOF(buffer), c, isError);
     }
     printUString("simple-uppercased: ", buffer, j);
     /* lowercase */
     isError=FALSE;
-    for(i=j=0; j<uprv_lengthof(buffer) && !isError; /* U16_NEXT post-increments */) {
+    for(i=j=0; j<UPRV_LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
         U16_NEXT(input, i, INT32_MAX, c); /* without length because NUL-terminated */
         if(c==0) {
             break; /* stop at terminating NUL, no need to terminate buffer */
         }
         c=u_tolower(c);
-        U16_APPEND(buffer, j, uprv_lengthof(buffer), c, isError);
+        U16_APPEND(buffer, j, UPRV_LENGTHOF(buffer), c, isError);
     }
     printUString("simple-lowercased: ", buffer, j);
     /* titlecase */
     isError=FALSE;
-    for(i=j=0; j<uprv_lengthof(buffer) && !isError; /* U16_NEXT post-increments */) {
+    for(i=j=0; j<UPRV_LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
         U16_NEXT(input, i, INT32_MAX, c); /* without length because NUL-terminated */
         if(c==0) {
             break; /* stop at terminating NUL, no need to terminate buffer */
         }
         c=u_totitle(c);
-        U16_APPEND(buffer, j, uprv_lengthof(buffer), c, isError);
+        U16_APPEND(buffer, j, UPRV_LENGTHOF(buffer), c, isError);
     }
     printUString("simple-titlecased: ", buffer, j);
     /* case-fold/default */
     isError=FALSE;
-    for(i=j=0; j<uprv_lengthof(buffer) && !isError; /* U16_NEXT post-increments */) {
+    for(i=j=0; j<UPRV_LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
         U16_NEXT(input, i, INT32_MAX, c); /* without length because NUL-terminated */
         if(c==0) {
             break; /* stop at terminating NUL, no need to terminate buffer */
         }
         c=u_foldCase(c, U_FOLD_CASE_DEFAULT);
-        U16_APPEND(buffer, j, uprv_lengthof(buffer), c, isError);
+        U16_APPEND(buffer, j, UPRV_LENGTHOF(buffer), c, isError);
     }
     printUString("simple-case-folded/default: ", buffer, j);
     /* case-fold/Turkic */
     isError=FALSE;
-    for(i=j=0; j<uprv_lengthof(buffer) && !isError; /* U16_NEXT post-increments */) {
+    for(i=j=0; j<UPRV_LENGTHOF(buffer) && !isError; /* U16_NEXT post-increments */) {
         U16_NEXT(input, i, INT32_MAX, c); /* without length because NUL-terminated */
         if(c==0) {
             break; /* stop at terminating NUL, no need to terminate buffer */
         }
         c=u_foldCase(c, U_FOLD_CASE_EXCLUDE_SPECIAL_I);
-        U16_APPEND(buffer, j, uprv_lengthof(buffer), c, isError);
+        U16_APPEND(buffer, j, UPRV_LENGTHOF(buffer), c, isError);
     }
     printUString("simple-case-folded/Turkic: ", buffer, j);
 
@@ -283,7 +283,7 @@ static void demoCaseMapInC() {
 
     /* lowercase/English */
     errorCode=U_ZERO_ERROR;
-    length=u_strToLower(buffer, uprv_lengthof(buffer), input, -1, "en", &errorCode);
+    length=u_strToLower(buffer, UPRV_LENGTHOF(buffer), input, -1, "en", &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-lowercased/en: ", buffer, length);
     } else {
@@ -291,7 +291,7 @@ static void demoCaseMapInC() {
     }
     /* lowercase/Turkish */
     errorCode=U_ZERO_ERROR;
-    length=u_strToLower(buffer, uprv_lengthof(buffer), input, -1, "tr", &errorCode);
+    length=u_strToLower(buffer, UPRV_LENGTHOF(buffer), input, -1, "tr", &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-lowercased/tr: ", buffer, length);
     } else {
@@ -299,7 +299,7 @@ static void demoCaseMapInC() {
     }
     /* uppercase/English */
     errorCode=U_ZERO_ERROR;
-    length=u_strToUpper(buffer, uprv_lengthof(buffer), input, -1, "en", &errorCode);
+    length=u_strToUpper(buffer, UPRV_LENGTHOF(buffer), input, -1, "en", &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-uppercased/en: ", buffer, length);
     } else {
@@ -307,7 +307,7 @@ static void demoCaseMapInC() {
     }
     /* uppercase/Turkish */
     errorCode=U_ZERO_ERROR;
-    length=u_strToUpper(buffer, uprv_lengthof(buffer), input, -1, "tr", &errorCode);
+    length=u_strToUpper(buffer, UPRV_LENGTHOF(buffer), input, -1, "tr", &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-uppercased/tr: ", buffer, length);
     } else {
@@ -315,7 +315,7 @@ static void demoCaseMapInC() {
     }
     /* titlecase/English */
     errorCode=U_ZERO_ERROR;
-    length=u_strToTitle(buffer, uprv_lengthof(buffer), input, -1, NULL, "en", &errorCode);
+    length=u_strToTitle(buffer, UPRV_LENGTHOF(buffer), input, -1, NULL, "en", &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-titlecased/en: ", buffer, length);
     } else {
@@ -323,7 +323,7 @@ static void demoCaseMapInC() {
     }
     /* titlecase/Turkish */
     errorCode=U_ZERO_ERROR;
-    length=u_strToTitle(buffer, uprv_lengthof(buffer), input, -1, NULL, "tr", &errorCode);
+    length=u_strToTitle(buffer, UPRV_LENGTHOF(buffer), input, -1, NULL, "tr", &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-titlecased/tr: ", buffer, length);
     } else {
@@ -331,7 +331,7 @@ static void demoCaseMapInC() {
     }
     /* case-fold/default */
     errorCode=U_ZERO_ERROR;
-    length=u_strFoldCase(buffer, uprv_lengthof(buffer), input, -1, U_FOLD_CASE_DEFAULT, &errorCode);
+    length=u_strFoldCase(buffer, UPRV_LENGTHOF(buffer), input, -1, U_FOLD_CASE_DEFAULT, &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-case-folded/default: ", buffer, length);
     } else {
@@ -339,7 +339,7 @@ static void demoCaseMapInC() {
     }
     /* case-fold/Turkic */
     errorCode=U_ZERO_ERROR;
-    length=u_strFoldCase(buffer, uprv_lengthof(buffer), input, -1, U_FOLD_CASE_EXCLUDE_SPECIAL_I, &errorCode);
+    length=u_strFoldCase(buffer, UPRV_LENGTHOF(buffer), input, -1, U_FOLD_CASE_EXCLUDE_SPECIAL_I, &errorCode);
     if(U_SUCCESS(errorCode)) {
         printUString("full-case-folded/Turkic: ", buffer, length);
     } else {
@@ -426,11 +426,11 @@ demoUnicodeStringStorage() {
     printf("length of short string copy: %d\n", two.length());
     // set "one" to contain the 3 UChars from readonly
     // this setTo() variant copies the characters
-    one.setTo(readonly, uprv_lengthof(readonly));
+    one.setTo(readonly, UPRV_LENGTHOF(readonly));
 
     // * UnicodeString with allocated contents
     // build a longer string that will not fit into the object's buffer
-    one+=UnicodeString(writeable, uprv_lengthof(writeable));
+    one+=UnicodeString(writeable, UPRV_LENGTHOF(writeable));
     one+=one;
     one+=one;
     printf("length of longer string: %d\n", one.length());
@@ -441,7 +441,7 @@ demoUnicodeStringStorage() {
 
     // * UnicodeString using readonly-alias to a const UChar array
     // construct a string that aliases a readonly buffer
-    UnicodeString three(FALSE, readonly, uprv_lengthof(readonly));
+    UnicodeString three(FALSE, readonly, UPRV_LENGTHOF(readonly));
     printUnicodeString("readonly-alias string: ", three);
     // copy-on-write: any modification to the string results in
     // a copy to either the internal buffer or to a newly allocated one
@@ -453,7 +453,7 @@ demoUnicodeStringStorage() {
                i, readonly[i]);
     }
     // setTo() readonly alias
-    one.setTo(FALSE, writeable, uprv_lengthof(writeable));
+    one.setTo(FALSE, writeable, UPRV_LENGTHOF(writeable));
     // copying the readonly-alias object with fastCopyFrom() (new in ICU 2.4)
     // will readonly-alias the same buffer
     two.fastCopyFrom(one);
@@ -466,7 +466,7 @@ demoUnicodeStringStorage() {
         one.getBuffer()==two.getBuffer());
 
     // * UnicodeString using writeable-alias to a non-const UChar array
-    UnicodeString four(writeable, uprv_lengthof(writeable), uprv_lengthof(writeable));
+    UnicodeString four(writeable, UPRV_LENGTHOF(writeable), UPRV_LENGTHOF(writeable));
     printUnicodeString("writeable-alias string: ", four);
     // a modification writes through to the buffer
     four.setCharAt(1, 0x39);
@@ -483,7 +483,7 @@ demoUnicodeStringStorage() {
                "modification of string copy\n", i, writeable[i]);
     }
     // setTo() writeable alias, capacity==length
-    one.setTo(writeable, uprv_lengthof(writeable), uprv_lengthof(writeable));
+    one.setTo(writeable, UPRV_LENGTHOF(writeable), UPRV_LENGTHOF(writeable));
     // grow the string - it will not fit into the backing buffer any more
     // and will get copied before modification
     one.append((UChar)0x40);
@@ -497,13 +497,13 @@ demoUnicodeStringStorage() {
     // if we need it in the original buffer, then extract() to it
     // extract() does not do anything if the string aliases that same buffer
     // i=min(one.length(), length of array)
-    if(one.length()<uprv_lengthof(writeable)) {
+    if(one.length()<UPRV_LENGTHOF(writeable)) {
         i=one.length();
     } else {
-        i=uprv_lengthof(writeable);
+        i=UPRV_LENGTHOF(writeable);
     }
     one.extract(0, i, writeable);
-    for(i=0; i<uprv_lengthof(writeable); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(writeable); ++i) {
         printf("writeable-alias backing buffer[%d]=0x%lx after re-extract\n",
                i, writeable[i]);
     }
@@ -566,7 +566,7 @@ demoUnicodeStringInit() {
     int32_t length;
     length=u_unescape(
         "Sch\\u00f6nes Auto: \\u20ac 11240.\\fPrivates Zeichen: \\U00102345\\n",
-        buffer, uprv_lengthof(buffer));
+        buffer, UPRV_LENGTHOF(buffer));
     printf("german C Unicode string from char * unescaping: (length %d)\n    ", length);
     printUnicodeString("", UnicodeString(buffer));
 }
index 9fabe7ea7e96f17a41a26d1439e5b579f985fd76..aeb9a35aba9254cb68ee383ce544d0c8425769e8 100644 (file)
@@ -949,21 +949,21 @@ static const struct {
     const UChar *s;
     int32_t length;
 } strings[]={
-    { feff,         uprv_lengthof(feff) },
-    { ascii,        uprv_lengthof(ascii) },
-    { crlf,         uprv_lengthof(crlf) },
-    { nul,          uprv_lengthof(nul) },
-    { latin,        uprv_lengthof(latin) },
-    { devanagari,   uprv_lengthof(devanagari) },
-    { hiragana,     uprv_lengthof(hiragana) },
-    { unihan,       uprv_lengthof(unihan) },
-    { hangul,       uprv_lengthof(hangul) },
-    { surrogates,   uprv_lengthof(surrogates) },
-    { plane1,       uprv_lengthof(plane1) },
-    { plane2,       uprv_lengthof(plane2) },
-    { plane15,      uprv_lengthof(plane15) },
-    { plane16,      uprv_lengthof(plane16) },
-    { c0,           uprv_lengthof(c0) }
+    { feff,         UPRV_LENGTHOF(feff) },
+    { ascii,        UPRV_LENGTHOF(ascii) },
+    { crlf,         UPRV_LENGTHOF(crlf) },
+    { nul,          UPRV_LENGTHOF(nul) },
+    { latin,        UPRV_LENGTHOF(latin) },
+    { devanagari,   UPRV_LENGTHOF(devanagari) },
+    { hiragana,     UPRV_LENGTHOF(hiragana) },
+    { unihan,       UPRV_LENGTHOF(unihan) },
+    { hangul,       UPRV_LENGTHOF(hangul) },
+    { surrogates,   UPRV_LENGTHOF(surrogates) },
+    { plane1,       UPRV_LENGTHOF(plane1) },
+    { plane2,       UPRV_LENGTHOF(plane2) },
+    { plane15,      UPRV_LENGTHOF(plane15) },
+    { plane16,      UPRV_LENGTHOF(plane16) },
+    { c0,           UPRV_LENGTHOF(c0) }
 };
 
 /*
@@ -991,7 +991,7 @@ TestBOCU1(void) {
 
     /* text 1: each of strings[] once */
     length=0;
-    for(i=0; i<uprv_lengthof(strings); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(strings); ++i) {
         u_memcpy(text+length, strings[i].s, strings[i].length);
         length+=strings[i].length;
     }
@@ -999,7 +999,7 @@ TestBOCU1(void) {
 
     /* text 2: each of strings[] twice */
     length=0;
-    for(i=0; i<uprv_lengthof(strings); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(strings); ++i) {
         u_memcpy(text+length, strings[i].s, strings[i].length);
         length+=strings[i].length;
         u_memcpy(text+length, strings[i].s, strings[i].length);
@@ -1010,8 +1010,8 @@ TestBOCU1(void) {
     /* text 3: each of strings[] many times (set step vs. |strings| so that all strings are used) */
     length=0;
     for(i=1; length<5000; i+=7) {
-        if(i>=uprv_lengthof(strings)) {
-            i-=uprv_lengthof(strings);
+        if(i>=UPRV_LENGTHOF(strings)) {
+            i-=UPRV_LENGTHOF(strings);
         }
         u_memcpy(text+length, strings[i].s, strings[i].length);
         length+=strings[i].length;
index 64ead15c00c112ddabedae0f1d97cdfe38061376..2759411c174e7768bf08c100ab81c90193af6835 100644 (file)
@@ -1858,7 +1858,7 @@ void TestGetTailoredSet() {
   int32_t buffLen = 0;
   USet *set = NULL;
 
-  for(i = 0; i < uprv_lengthof(setTest); i++) {
+  for(i = 0; i < UPRV_LENGTHOF(setTest); i++) {
     buffLen = u_unescape(setTest[i].rules, buff, 1024);
     coll = ucol_openRules(buff, buffLen, UCOL_DEFAULT, UCOL_DEFAULT, &pError, &status);
     if(U_SUCCESS(status)) {
@@ -2126,9 +2126,9 @@ doSetsTest(const char *locale, const USet *ref, USet *set, const char* inSet, co
     if(!uset_containsAll(ref, set)) {
         log_err("%s: Some stuff from %s is not present in the set\n", locale, inSet);
         uset_removeAll(set, ref);
-        bufLen = uset_toPattern(set, buffer, uprv_lengthof(buffer), TRUE, status);
+        bufLen = uset_toPattern(set, buffer, UPRV_LENGTHOF(buffer), TRUE, status);
         log_info("    missing: %s\n", aescstrdup(buffer, bufLen));
-        bufLen = uset_toPattern(ref, buffer, uprv_lengthof(buffer), TRUE, status);
+        bufLen = uset_toPattern(ref, buffer, UPRV_LENGTHOF(buffer), TRUE, status);
         log_info("    total: size=%i  %s\n", uset_getItemCount(ref), aescstrdup(buffer, bufLen));
     }
 
@@ -2425,7 +2425,7 @@ static void TestGetKeywordValuesForLocale(void) {
     const char *locale = NULL, *value = NULL;
     UBool errorOccurred = FALSE;
 
-    for (i = 0; i < uprv_lengthof(PREFERRED) && !errorOccurred; i++) {
+    for (i = 0; i < UPRV_LENGTHOF(PREFERRED) && !errorOccurred; i++) {
         locale = PREFERRED[i][0];
         value = NULL;
         valueLength = 0;
index 0788977dd75e6be2f259052b4a79c168e05d093d..c6252360c709749b4017dd91ecd525665d16ab12 100644 (file)
@@ -729,7 +729,7 @@ testReorder(void) {
 
     log_verbose("\nEntering TestReorder\n\n");
 
-    for(i=0;i<uprv_lengthof(logicalOrder);i++){
+    for(i=0;i<UPRV_LENGTHOF(logicalOrder);i++){
         int32_t srcSize = (int32_t)strlen(logicalOrder[i]);
         int32_t destSize = srcSize*2;
         UChar src[MAXLEN];
@@ -764,7 +764,7 @@ testReorder(void) {
         checkWhatYouCan(bidi, logicalOrder[i], chars);
     }
 
-    for(i=0;i<uprv_lengthof(logicalOrder);i++){
+    for(i=0;i<UPRV_LENGTHOF(logicalOrder);i++){
         int32_t srcSize = (int32_t)strlen(logicalOrder[i]);
         int32_t destSize = srcSize*2;
         UChar src[MAXLEN];
@@ -798,7 +798,7 @@ testReorder(void) {
         }
     }
 
-    for(i=0;i<uprv_lengthof(logicalOrder);i++){
+    for(i=0;i<UPRV_LENGTHOF(logicalOrder);i++){
         int32_t srcSize = (int32_t)strlen(logicalOrder[i]);
         int32_t destSize = srcSize*2;
         UChar src[MAXLEN];
@@ -829,7 +829,7 @@ testReorder(void) {
         }
     }
         /* Max Explicit level */
-    for(i=0;i<uprv_lengthof(logicalOrder);i++){
+    for(i=0;i<UPRV_LENGTHOF(logicalOrder);i++){
         int32_t srcSize = (int32_t)strlen(logicalOrder[i]);
         int32_t destSize = srcSize*2;
         UChar src[MAXLEN];
@@ -863,7 +863,7 @@ testReorder(void) {
                     logicalOrder[i],visualOrder3[i],chars,formatLevels(bidi, formatChars),i);
         }
     }
-    for(i=0;i<uprv_lengthof(logicalOrder);i++){
+    for(i=0;i<UPRV_LENGTHOF(logicalOrder);i++){
         int32_t srcSize = (int32_t)strlen(logicalOrder[i]);
         int32_t destSize = srcSize*2;
         UChar src[MAXLEN];
@@ -991,7 +991,7 @@ testReorderArabicMathSymbols(void) {
 
     log_verbose("\nEntering TestReorderArabicMathSymbols\n\n");
 
-    for(i=0;i<uprv_lengthof(logicalOrder);i++){
+    for(i=0;i<UPRV_LENGTHOF(logicalOrder);i++){
         int32_t srcSize = u_strlen(logicalOrder[i]);
         int32_t destSize = srcSize*2;
         UChar dest[MAXLEN];
@@ -1283,7 +1283,7 @@ _testReordering(UBiDi *pBiDi, int testNumber) {
         return;     \
     }               \
 
-#define STRING_TEST_CASE(s) { (s), uprv_lengthof(s) }
+#define STRING_TEST_CASE(s) { (s), UPRV_LENGTHOF(s) }
 
 static void testGetBaseDirection(void) {
     UBiDiDirection dir;
@@ -1353,9 +1353,9 @@ static void testGetBaseDirection(void) {
     };
 
     log_verbose("testGetBaseDirection() with %u test cases ---\n",
-    uprv_lengthof(testCases));
+    UPRV_LENGTHOF(testCases));
 /* Run Tests */
-     for(i=0; i<uprv_lengthof(testCases); ++i) {
+     for(i=0; i<UPRV_LENGTHOF(testCases); ++i) {
         dir = ubidi_getBaseDirection(testCases[i].s, testCases[i].length );
         log_verbose("Testing case %d\tReceived dir %d\n", i, dir);
         if (dir != expectedDir[i])
@@ -2130,7 +2130,7 @@ testMultipleParagraphs(void) {
      */
     pBidi = ubidi_open();
     errorCode = U_ZERO_ERROR;
-    ubidi_setPara(pBidi, multiparaTestString, uprv_lengthof(multiparaTestString),
+    ubidi_setPara(pBidi, multiparaTestString, UPRV_LENGTHOF(multiparaTestString),
                   UBIDI_DEFAULT_LTR, NULL, &errorCode);
     if (U_FAILURE(errorCode)) {
         log_err("ubidi_setPara failed for multiparaTestString\n");
@@ -2143,7 +2143,7 @@ testMultipleParagraphs(void) {
         ubidi_close(pBidi);
         return;
     }
-    for (i = 0; i < uprv_lengthof(multiparaTestString); i++) {
+    for (i = 0; i < UPRV_LENGTHOF(multiparaTestString); i++) {
         if (gotLevels[i] != multiparaTestLevels[i]) {
             log_err("Error on level for multiparaTestString at index %d, "
                     "expected=%d, actual=%d\n",
@@ -2159,7 +2159,7 @@ testMultipleParagraphs(void) {
 
 static int countRoundtrips=0, countNonRoundtrips=0;
 
-#define STRING_TEST_CASE(s) { (s), uprv_lengthof(s) }
+#define STRING_TEST_CASE(s) { (s), UPRV_LENGTHOF(s) }
 
 static void
 testInverse(void) {
@@ -2192,15 +2192,15 @@ testInverse(void) {
         return;
     }
 
-    log_verbose("inverse Bidi: testInverse(L) with %u test cases ---\n", uprv_lengthof(testCases));
-     for(i=0; i<uprv_lengthof(testCases); ++i) {
+    log_verbose("inverse Bidi: testInverse(L) with %u test cases ---\n", UPRV_LENGTHOF(testCases));
+     for(i=0; i<UPRV_LENGTHOF(testCases); ++i) {
         log_verbose("Testing case %d\n", i);
         errorCode=U_ZERO_ERROR;
         _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 0, &errorCode);
     }
 
-    log_verbose("inverse Bidi: testInverse(R) with %u test cases ---\n", uprv_lengthof(testCases));
-    for(i=0; i<uprv_lengthof(testCases); ++i) {
+    log_verbose("inverse Bidi: testInverse(R) with %u test cases ---\n", UPRV_LENGTHOF(testCases));
+    for(i=0; i<UPRV_LENGTHOF(testCases); ++i) {
         log_verbose("Testing case %d\n", i);
         errorCode=U_ZERO_ERROR;
         _testInverseBidi(pBiDi, testCases[i].s, testCases[i].length, 1, &errorCode);
@@ -2277,7 +2277,7 @@ _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
         if (src != ubidi_getText(pBiDi)) {
             log_err("Wrong value returned by ubidi_getText\n");
         }
-        logicalLength=ubidi_writeReordered(pBiDi, logicalDest, uprv_lengthof(logicalDest),
+        logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest),
                                            UBIDI_DO_MIRRORING|UBIDI_INSERT_LRM_FOR_NUMERIC, pErrorCode);
         log_verbose("  v ");
         printUnicode(src, srcLength, ubidi_getLevels(pBiDi, pErrorCode));
@@ -2289,13 +2289,13 @@ _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
             log_err("Error while doing ubidi_setInverse(FALSE)\n");
         }
         ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode);
-        visualLength=ubidi_writeReordered(pBiDi, visualDest, uprv_lengthof(visualDest),
+        visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest),
                                           UBIDI_DO_MIRRORING|UBIDI_REMOVE_BIDI_CONTROLS, pErrorCode);
     } else {
         log_verbose("inverse Bidi: testInverse(R)\n");
 
         /* reverse visual from RTL to LTR */
-        ltrLength=ubidi_writeReverse(src, srcLength, visualLTR, uprv_lengthof(visualLTR), 0, pErrorCode);
+        ltrLength=ubidi_writeReverse(src, srcLength, visualLTR, UPRV_LENGTHOF(visualLTR), 0, pErrorCode);
         log_verbose("  vr");
         printUnicode(src, srcLength, NULL);
         log_verbose("\n");
@@ -2303,7 +2303,7 @@ _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
         /* convert visual RTL to logical */
         ubidi_setInverse(pBiDi, TRUE);
         ubidi_setPara(pBiDi, visualLTR, ltrLength, 0, NULL, pErrorCode);
-        logicalLength=ubidi_writeReordered(pBiDi, logicalDest, uprv_lengthof(logicalDest),
+        logicalLength=ubidi_writeReordered(pBiDi, logicalDest, UPRV_LENGTHOF(logicalDest),
                                            UBIDI_DO_MIRRORING|UBIDI_INSERT_LRM_FOR_NUMERIC, pErrorCode);
         log_verbose("  vl");
         printUnicode(visualLTR, ltrLength, ubidi_getLevels(pBiDi, pErrorCode));
@@ -2312,7 +2312,7 @@ _testInverseBidi(UBiDi *pBiDi, const UChar *src, int32_t srcLength,
         /* convert back to visual RTL */
         ubidi_setInverse(pBiDi, FALSE);
         ubidi_setPara(pBiDi, logicalDest, logicalLength, 0, NULL, pErrorCode);
-        visualLength=ubidi_writeReordered(pBiDi, visualDest, uprv_lengthof(visualDest),
+        visualLength=ubidi_writeReordered(pBiDi, visualDest, UPRV_LENGTHOF(visualDest),
                                           UBIDI_DO_MIRRORING|UBIDI_REMOVE_BIDI_CONTROLS|UBIDI_OUTPUT_REVERSE, pErrorCode);
     }
     log_verbose("  l ");
@@ -2353,25 +2353,25 @@ _testWriteReverse(void) {
 
     /* test ubidi_writeReverse() with "interesting" options */
     errorCode=U_ZERO_ERROR;
-    length=ubidi_writeReverse(forward, uprv_lengthof(forward),
-                              reverse, uprv_lengthof(reverse),
+    length=ubidi_writeReverse(forward, UPRV_LENGTHOF(forward),
+                              reverse, UPRV_LENGTHOF(reverse),
                               UBIDI_KEEP_BASE_COMBINING,
                               &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(reverseKeepCombining) || memcmp(reverse, reverseKeepCombining, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(reverseKeepCombining) || memcmp(reverse, reverseKeepCombining, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in ubidi_writeReverse(UBIDI_KEEP_BASE_COMBINING): length=%d (should be %d), error code %s\n",
-                length, uprv_lengthof(reverseKeepCombining), u_errorName(errorCode));
+                length, UPRV_LENGTHOF(reverseKeepCombining), u_errorName(errorCode));
     }
 
-    memset(reverse, 0xa5, uprv_lengthof(reverse)*U_SIZEOF_UCHAR);
+    memset(reverse, 0xa5, UPRV_LENGTHOF(reverse)*U_SIZEOF_UCHAR);
     errorCode=U_ZERO_ERROR;
-    length=ubidi_writeReverse(forward, uprv_lengthof(forward),
-                              reverse, uprv_lengthof(reverse),
+    length=ubidi_writeReverse(forward, UPRV_LENGTHOF(forward),
+                              reverse, UPRV_LENGTHOF(reverse),
                               UBIDI_REMOVE_BIDI_CONTROLS|UBIDI_DO_MIRRORING|UBIDI_KEEP_BASE_COMBINING,
                               &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(reverseRemoveControlsKeepCombiningDoMirror) || memcmp(reverse, reverseRemoveControlsKeepCombiningDoMirror, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(reverseRemoveControlsKeepCombiningDoMirror) || memcmp(reverse, reverseRemoveControlsKeepCombiningDoMirror, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in ubidi_writeReverse(UBIDI_REMOVE_BIDI_CONTROLS|UBIDI_DO_MIRRORING|UBIDI_KEEP_BASE_COMBINING):\n"
                 "    length=%d (should be %d), error code %s\n",
-                length, uprv_lengthof(reverseRemoveControlsKeepCombiningDoMirror), u_errorName(errorCode));
+                length, UPRV_LENGTHOF(reverseRemoveControlsKeepCombiningDoMirror), u_errorName(errorCode));
     }
 }
 
@@ -2380,16 +2380,16 @@ static void _testManyAddedPoints(void) {
     UBiDi *bidi = ubidi_open();
     UChar text[90], dest[MAXLEN], expected[120];
     int destLen, i;
-    for (i = 0; i < uprv_lengthof(text); i+=3) {
+    for (i = 0; i < UPRV_LENGTHOF(text); i+=3) {
         text[i] = 0x0061; /* 'a' */
         text[i+1] = 0x05d0;
         text[i+2] = 0x0033; /* '3' */
     }
     ubidi_setReorderingMode(bidi, UBIDI_REORDER_INVERSE_LIKE_DIRECT);
     ubidi_setReorderingOptions(bidi, UBIDI_OPTION_INSERT_MARKS);
-    ubidi_setPara(bidi, text, uprv_lengthof(text), UBIDI_LTR, NULL, &errorCode);
+    ubidi_setPara(bidi, text, UPRV_LENGTHOF(text), UBIDI_LTR, NULL, &errorCode);
     destLen = ubidi_writeReordered(bidi, dest, MAXLEN, 0, &errorCode);
-    for (i = 0; i < uprv_lengthof(expected); i+=4) {
+    for (i = 0; i < UPRV_LENGTHOF(expected); i+=4) {
         expected[i] = 0x0061; /* 'a' */
         expected[i+1] = 0x05d0;
         expected[i+2] = 0x200e;
@@ -2398,7 +2398,7 @@ static void _testManyAddedPoints(void) {
     if (memcmp(dest, expected, destLen * sizeof(UChar))) {
         log_err("\nInvalid output with many added points, "
                 "expected '%s', got '%s'\n",
-                aescstrdup(expected, uprv_lengthof(expected)),
+                aescstrdup(expected, UPRV_LENGTHOF(expected)),
                 aescstrdup(dest, destLen));
     }
     ubidi_close(bidi);
@@ -2411,7 +2411,7 @@ static void _testMisc(void) {
     int destLen;
     ubidi_setInverse(bidi, TRUE);
     src[0] = src[1] = src[2] = 0x0020;
-    ubidi_setPara(bidi, src, uprv_lengthof(src), UBIDI_RTL, NULL, &errorCode);
+    ubidi_setPara(bidi, src, UPRV_LENGTHOF(src), UBIDI_RTL, NULL, &errorCode);
     destLen = ubidi_writeReordered(bidi, dest, MAXLEN,
               UBIDI_OUTPUT_REVERSE | UBIDI_INSERT_LRM_FOR_NUMERIC,
               &errorCode);
@@ -2419,7 +2419,7 @@ static void _testMisc(void) {
     if (memcmp(dest, expected, destLen * sizeof(UChar))) {
         log_err("\nInvalid output with RLM at both sides, "
                 "expected '%s', got '%s'\n",
-                aescstrdup(expected, uprv_lengthof(expected)),
+                aescstrdup(expected, UPRV_LENGTHOF(expected)),
                 aescstrdup(dest, destLen));
     }
     ubidi_close(bidi);
@@ -2461,18 +2461,18 @@ doArabicShapingTest(void) {
 
     /* european->arabic */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(source) || memcmp(dest, en2an, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(source) || memcmp(dest, en2an, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(en2an)\n");
     }
 
     /* arabic->european */
     errorCode=U_ZERO_ERROR;
     length=u_shapeArabic(source, -1,
-                         dest, uprv_lengthof(dest),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_AN2EN|U_SHAPE_DIGIT_TYPE_AN_EXTENDED,
                          &errorCode);
     if(U_FAILURE(errorCode) || length!=u_strlen(source) || memcmp(dest, an2en, length*U_SIZEOF_UCHAR)!=0) {
@@ -2481,78 +2481,78 @@ doArabicShapingTest(void) {
 
     /* european->arabic with context, logical order, initial state not AL */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_ALEN2AN_INIT_LR|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(source) || memcmp(dest, logical_alen2an_init_lr, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(source) || memcmp(dest, logical_alen2an_init_lr, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(logical_alen2an_init_lr)\n");
     }
 
     /* european->arabic with context, logical order, initial state AL */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_ALEN2AN_INIT_AL|U_SHAPE_DIGIT_TYPE_AN_EXTENDED,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(source) || memcmp(dest, logical_alen2an_init_al, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(source) || memcmp(dest, logical_alen2an_init_al, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(logical_alen2an_init_al)\n");
     }
 
     /* european->arabic with context, reverse order, initial state not AL */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_ALEN2AN_INIT_LR|U_SHAPE_DIGIT_TYPE_AN|U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(source) || memcmp(dest, reverse_alen2an_init_lr, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(source) || memcmp(dest, reverse_alen2an_init_lr, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(reverse_alen2an_init_lr)\n");
     }
 
     /* european->arabic with context, reverse order, initial state AL */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_ALEN2AN_INIT_AL|U_SHAPE_DIGIT_TYPE_AN_EXTENDED|U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(source) || memcmp(dest, reverse_alen2an_init_al, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(source) || memcmp(dest, reverse_alen2an_init_al, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(reverse_alen2an_init_al)\n");
     }
 
     /* test noop */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          0,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(source) || memcmp(dest, source, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(source) || memcmp(dest, source, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(noop)\n");
     }
 
     errorCode=U_ZERO_ERROR;
     length=u_shapeArabic(source, 0,
-                         dest, uprv_lengthof(dest),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
     if(U_FAILURE(errorCode) || length!=0) {
-        log_err("failure in u_shapeArabic(en2an, sourceLength=0), returned %d/%s\n", u_errorName(errorCode), uprv_lengthof(source));
+        log_err("failure in u_shapeArabic(en2an, sourceLength=0), returned %d/%s\n", u_errorName(errorCode), UPRV_LENGTHOF(source));
     }
 
     /* preflight digit shaping */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
                          NULL, 0,
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
-    if(errorCode!=U_BUFFER_OVERFLOW_ERROR || length!=uprv_lengthof(source)) {
+    if(errorCode!=U_BUFFER_OVERFLOW_ERROR || length!=UPRV_LENGTHOF(source)) {
         log_err("failure in u_shapeArabic(en2an preflighting), returned %d/%s instead of %d/U_BUFFER_OVERFLOW_ERROR\n",
-                length, u_errorName(errorCode), uprv_lengthof(source));
+                length, u_errorName(errorCode), UPRV_LENGTHOF(source));
     }
 
     /* test illegal arguments */
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(NULL, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(NULL, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
@@ -2561,7 +2561,7 @@ doArabicShapingTest(void) {
 
     errorCode=U_ZERO_ERROR;
     length=u_shapeArabic(source, -2,
-                         dest, uprv_lengthof(dest),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
@@ -2569,8 +2569,8 @@ doArabicShapingTest(void) {
     }
 
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         NULL, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         NULL, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
@@ -2578,7 +2578,7 @@ doArabicShapingTest(void) {
     }
 
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
                          dest, -1,
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
@@ -2587,8 +2587,8 @@ doArabicShapingTest(void) {
     }
 
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_RESERVED|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
@@ -2596,8 +2596,8 @@ doArabicShapingTest(void) {
     }
 
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_RESERVED,
                          &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
@@ -2605,8 +2605,8 @@ doArabicShapingTest(void) {
     }
 
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         (UChar *)(source+2), uprv_lengthof(dest), /* overlap source and destination */
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         (UChar *)(source+2), UPRV_LENGTHOF(dest), /* overlap source and destination */
                          U_SHAPE_DIGITS_EN2AN|U_SHAPE_DIGIT_TYPE_AN,
                          &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
@@ -2614,11 +2614,11 @@ doArabicShapingTest(void) {
     }
 
     errorCode=U_ZERO_ERROR;
-    length=u_shapeArabic(lamalef, uprv_lengthof(lamalef),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(lamalef, UPRV_LENGTHOF(lamalef),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_UNSHAPE | U_SHAPE_LENGTH_GROW_SHRINK | U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
-    if(U_FAILURE(errorCode) || length == uprv_lengthof(lamalef)) {
+    if(U_FAILURE(errorCode) || length == UPRV_LENGTHOF(lamalef)) {
         log_err("failure in u_shapeArabic(U_SHAPE_LETTERS_UNSHAPE | U_SHAPE_LENGTH_GROW_SHRINK | U_SHAPE_TEXT_DIRECTION_VISUAL_LTR)\n");
         log_err("returned %s instead of U_ZERO_ERROR or returned length %d instead of 3\n", u_errorName(errorCode), length);
     }
@@ -2678,44 +2678,44 @@ doLamAlefSpecialVLTRArabicShapingTest(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_LENGTH_FIXED_SPACES_NEAR|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_near) || memcmp(dest, shape_near, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_near) || memcmp(dest, shape_near, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(LAMALEF shape_near)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_LENGTH_FIXED_SPACES_AT_END|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_at_end) || memcmp(dest, shape_at_end, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_at_end) || memcmp(dest, shape_at_end, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(LAMALEF shape_at_end)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_at_begin) || memcmp(dest, shape_at_begin, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_at_begin) || memcmp(dest, shape_at_begin, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(LAMALEF shape_at_begin)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_LENGTH_GROW_SHRINK|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
@@ -2728,44 +2728,44 @@ doLamAlefSpecialVLTRArabicShapingTest(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED|U_SHAPE_LENGTH_FIXED_SPACES_NEAR|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_excepttashkeel_near) || memcmp(dest, shape_excepttashkeel_near, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_excepttashkeel_near) || memcmp(dest, shape_excepttashkeel_near, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(LAMALEF shape_excepttashkeel_near)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED|U_SHAPE_LENGTH_FIXED_SPACES_AT_END|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_excepttashkeel_at_end) || memcmp(dest,shape_excepttashkeel_at_end , length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_excepttashkeel_at_end) || memcmp(dest,shape_excepttashkeel_at_end , length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(LAMALEF shape_excepttashkeel_at_end)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED|U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_excepttashkeel_at_begin) || memcmp(dest, shape_excepttashkeel_at_begin, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_excepttashkeel_at_begin) || memcmp(dest, shape_excepttashkeel_at_begin, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(LAMALEF shape_excepttashkeel_at_begin)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED|U_SHAPE_LENGTH_GROW_SHRINK|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
@@ -2804,25 +2804,25 @@ doTashkeelSpecialVLTRArabicShapingTest(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_LENGTH_FIXED_SPACES_NEAR|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_near) || memcmp(dest, shape_near, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_near) || memcmp(dest, shape_near, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(TASHKEEL shape_near)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED|U_SHAPE_LENGTH_FIXED_SPACES_NEAR|
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(shape_excepttashkeel_near) || memcmp(dest, shape_excepttashkeel_near, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(shape_excepttashkeel_near) || memcmp(dest, shape_excepttashkeel_near, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(TASHKEEL shape_excepttashkeel_near)\n");
     }
 }
@@ -2858,44 +2858,44 @@ doLOGICALArabicDeShapingTest(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_UNSHAPE|U_SHAPE_LENGTH_FIXED_SPACES_NEAR|
                          U_SHAPE_TEXT_DIRECTION_LOGICAL,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(unshape_near) || memcmp(dest, unshape_near, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(unshape_near) || memcmp(dest, unshape_near, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(unshape_near)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_UNSHAPE|U_SHAPE_LENGTH_FIXED_SPACES_AT_END|
                          U_SHAPE_TEXT_DIRECTION_LOGICAL,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(unshape_at_end) || memcmp(dest, unshape_at_end, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(unshape_at_end) || memcmp(dest, unshape_at_end, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(unshape_at_end)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_UNSHAPE|U_SHAPE_LENGTH_FIXED_SPACES_AT_BEGINNING|
                          U_SHAPE_TEXT_DIRECTION_LOGICAL,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(unshape_at_begin) || memcmp(dest, unshape_at_begin, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(unshape_at_begin) || memcmp(dest, unshape_at_begin, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(unshape_at_begin)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(source, uprv_lengthof(source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(source, UPRV_LENGTHOF(source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_UNSHAPE|U_SHAPE_LENGTH_GROW_SHRINK|
                          U_SHAPE_TEXT_DIRECTION_LOGICAL,
                          &errorCode);
@@ -2919,13 +2919,13 @@ doTailTest(void) {
 
   log_verbose("Trying old tail\n");
   status = U_ZERO_ERROR;
-  length = u_shapeArabic(src, -1, dst, uprv_lengthof(dst),
+  length = u_shapeArabic(src, -1, dst, UPRV_LENGTHOF(dst),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_SEEN_TWOCELL_NEAR, &status);
   if(U_FAILURE(status)) {
     log_err("Fail: status %s\n", u_errorName(status));
   } else if(length!=2) {
     log_err("Fail: len %d expected 3\n", length);
-  } else if(u_strncmp(dst,dst_old,uprv_lengthof(dst))) {
+  } else if(u_strncmp(dst,dst_old,UPRV_LENGTHOF(dst))) {
     log_err("Fail: got U+%04X U+%04X expected U+%04X U+%04X\n",
             dst[0],dst[1],dst_old[0],dst_old[1]);
   } else {
@@ -2936,13 +2936,13 @@ doTailTest(void) {
 
   log_verbose("Trying new tail\n");
   status = U_ZERO_ERROR;
-  length = u_shapeArabic(src, -1, dst, uprv_lengthof(dst),
+  length = u_shapeArabic(src, -1, dst, UPRV_LENGTHOF(dst),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_SEEN_TWOCELL_NEAR|U_SHAPE_TAIL_NEW_UNICODE, &status);
   if(U_FAILURE(status)) {
     log_err("Fail: status %s\n", u_errorName(status));
   } else if(length!=2) {
     log_err("Fail: len %d expected 3\n", length);
-  } else if(u_strncmp(dst,dst_new,uprv_lengthof(dst))) {
+  } else if(u_strncmp(dst,dst_new,UPRV_LENGTHOF(dst))) {
     log_err("Fail: got U+%04X U+%04X expected U+%04X U+%04X\n",
             dst[0],dst[1],dst_new[0],dst_new[1]);
   } else {
@@ -2980,48 +2980,48 @@ doArabicShapingTestForBug5421(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(persian_letters_source, uprv_lengthof(persian_letters_source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(persian_letters_source, UPRV_LENGTHOF(persian_letters_source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(persian_letters) || memcmp(dest, persian_letters, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(persian_letters) || memcmp(dest, persian_letters, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(persian_letters)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(tashkeel_aggregation_source, uprv_lengthof(tashkeel_aggregation_source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(tashkeel_aggregation_source, UPRV_LENGTHOF(tashkeel_aggregation_source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_AGGREGATE_TASHKEEL|U_SHAPE_PRESERVE_PRESENTATION|
                          U_SHAPE_LETTERS_SHAPE_TASHKEEL_ISOLATED|U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(tashkeel_aggregation) || memcmp(dest, tashkeel_aggregation, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(tashkeel_aggregation) || memcmp(dest, tashkeel_aggregation, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(tashkeel_aggregation)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(untouched_presentation_source, uprv_lengthof(untouched_presentation_source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(untouched_presentation_source, UPRV_LENGTHOF(untouched_presentation_source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_PRESERVE_PRESENTATION|
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_TEXT_DIRECTION_VISUAL_LTR,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(untouched_presentation) || memcmp(dest, untouched_presentation, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(untouched_presentation) || memcmp(dest, untouched_presentation, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(untouched_presentation)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(untouched_presentation_r_source, uprv_lengthof(untouched_presentation_r_source),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(untouched_presentation_r_source, UPRV_LENGTHOF(untouched_presentation_r_source),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_PRESERVE_PRESENTATION|
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_TEXT_DIRECTION_LOGICAL,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(untouched_presentation_r) || memcmp(dest, untouched_presentation_r, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(untouched_presentation_r) || memcmp(dest, untouched_presentation_r, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(untouched_presentation_r)\n");
     }
 }
@@ -3069,89 +3069,89 @@ doArabicShapingTestForBug8703(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source1, uprv_lengthof(letters_source1),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source1, UPRV_LENGTHOF(letters_source1),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_BEGIN | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest1) || memcmp(dest, letters_dest1, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest1) || memcmp(dest, letters_dest1, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source1)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source2, uprv_lengthof(letters_source2),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source2, UPRV_LENGTHOF(letters_source2),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_END | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest2) || memcmp(dest, letters_dest2, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest2) || memcmp(dest, letters_dest2, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source2)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source3, uprv_lengthof(letters_source3),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source3, UPRV_LENGTHOF(letters_source3),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_RESIZE | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest3) || memcmp(dest, letters_dest3, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest3) || memcmp(dest, letters_dest3, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source3)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source4, uprv_lengthof(letters_source4),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source4, UPRV_LENGTHOF(letters_source4),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest4) || memcmp(dest, letters_dest4, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest4) || memcmp(dest, letters_dest4, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source4)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source5, uprv_lengthof(letters_source5),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source5, UPRV_LENGTHOF(letters_source5),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_BEGIN | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest5) || memcmp(dest, letters_dest5, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest5) || memcmp(dest, letters_dest5, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source5)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source6, uprv_lengthof(letters_source6),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source6, UPRV_LENGTHOF(letters_source6),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_END | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest6) || memcmp(dest, letters_dest6, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest6) || memcmp(dest, letters_dest6, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source6)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source7, uprv_lengthof(letters_source7),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source7, UPRV_LENGTHOF(letters_source7),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_RESIZE | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest7) || memcmp(dest, letters_dest7, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest7) || memcmp(dest, letters_dest7, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source7)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source8, uprv_lengthof(letters_source8),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source8, UPRV_LENGTHOF(letters_source8),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest8) || memcmp(dest, letters_dest8, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest8) || memcmp(dest, letters_dest8, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source8)\n");
     }
 }
@@ -3251,67 +3251,67 @@ doArabicShapingTestForBug9024(void) {
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source1, uprv_lengthof(letters_source1),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source1, UPRV_LENGTHOF(letters_source1),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_BEGIN | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest1) || memcmp(dest, letters_dest1, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest1) || memcmp(dest, letters_dest1, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source1)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source2, uprv_lengthof(letters_source2),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source2, UPRV_LENGTHOF(letters_source2),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_END | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest2) || memcmp(dest, letters_dest2, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest2) || memcmp(dest, letters_dest2, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source2)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source3, uprv_lengthof(letters_source3),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source3, UPRV_LENGTHOF(letters_source3),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_RESIZE | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest3) || memcmp(dest, letters_dest3, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest3) || memcmp(dest, letters_dest3, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source3)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source4, uprv_lengthof(letters_source4),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source4, UPRV_LENGTHOF(letters_source4),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_RTL | U_SHAPE_TASHKEEL_REPLACE_BY_TATWEEL | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest4) || memcmp(dest, letters_dest4, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest4) || memcmp(dest, letters_dest4, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source4)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source5, uprv_lengthof(letters_source5),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source5, UPRV_LENGTHOF(letters_source5),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_BEGIN | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest5) || memcmp(dest, letters_dest5, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest5) || memcmp(dest, letters_dest5, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source5)\n");
     }
 
     errorCode=U_ZERO_ERROR;
 
-    length=u_shapeArabic(letters_source6, uprv_lengthof(letters_source6),
-                         dest, uprv_lengthof(dest),
+    length=u_shapeArabic(letters_source6, UPRV_LENGTHOF(letters_source6),
+                         dest, UPRV_LENGTHOF(dest),
                          U_SHAPE_TEXT_DIRECTION_VISUAL_LTR | U_SHAPE_TASHKEEL_END | U_SHAPE_LETTERS_SHAPE,
                          &errorCode);
 
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(letters_dest6) || memcmp(dest, letters_dest6, length*U_SIZEOF_UCHAR)!=0) {
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(letters_dest6) || memcmp(dest, letters_dest6, length*U_SIZEOF_UCHAR)!=0) {
         log_err("failure in u_shapeArabic(letters_source6)\n");
     }
 
@@ -3550,7 +3550,7 @@ doArabicShapingTestForNewCharacters(void) {
     { 0x06D2, 0xFBAE, 0xFBAF, 0, 0, },           /* YEH BARREE */
     { 0x06D3, 0xFBB0, 0xFBB1, 0, 0, }};          /* YEH BARREE WITH HAMZA ABOVE */
   int32_t i;
-  for (i = 0; i < uprv_lengthof(letterForms); ++i) {
+  for (i = 0; i < UPRV_LENGTHOF(letterForms); ++i) {
     _testPresentationForms(letterForms[i]);
   }
 }
@@ -3667,10 +3667,10 @@ options[] = {
     { MAKE_ITEMS(0) }
 };
 
-#define TC_COUNT                uprv_lengthof(textIn)
-#define MODES_COUNT             uprv_lengthof(modes)
-#define OPTIONS_COUNT           uprv_lengthof(options)
-#define LEVELS_COUNT            uprv_lengthof(paraLevels)
+#define TC_COUNT                UPRV_LENGTHOF(textIn)
+#define MODES_COUNT             UPRV_LENGTHOF(modes)
+#define OPTIONS_COUNT           UPRV_LENGTHOF(options)
+#define LEVELS_COUNT            UPRV_LENGTHOF(paraLevels)
 
 static const char* const textIn[] = {
 /* (0) 123 */
@@ -4195,7 +4195,7 @@ testReorderRunsOnly(void) {
     for (option = 0; option < 2; option++) {
         ubidi_setReorderingOptions(pBiDi, option==0 ? UBIDI_OPTION_REMOVE_CONTROLS
                                                     : UBIDI_OPTION_INSERT_MARKS);
-        for (i = 0, nCases = uprv_lengthof(testCases); i < nCases; i++) {
+        for (i = 0, nCases = UPRV_LENGTHOF(testCases); i < nCases; i++) {
             srcLen = strlen(testCases[i].textIn);
             pseudoToU16(srcLen, testCases[i].textIn, src);
             for(j = 0; j < 2; j++) {
@@ -4434,7 +4434,7 @@ testStreaming(void) {
     int32_t srcLen, processedLen, chunk, len, nPortions;
     int i, j, levelIndex;
     UBiDiLevel level;
-    int nTests = uprv_lengthof(testData), nLevels = uprv_lengthof(paraLevels);
+    int nTests = UPRV_LENGTHOF(testData), nLevels = UPRV_LENGTHOF(paraLevels);
     UBool mismatch, testOK = TRUE;
    char processedLenStr[MAXPORTIONS * 5];
 
@@ -4524,7 +4524,7 @@ overrideBidiClass(const void *context, UChar32 c) {
           DEF,   DEF,   DEF,   DEF,   DEF,   DEF,   DEF,   DEF, /* 70-77 */
           DEF,   DEF,   DEF,   LRO,     B,   RLO,    BN,   DEF  /* 78-7F */
     };
-    static const int nEntries = uprv_lengthof(customClasses);
+    static const int nEntries = UPRV_LENGTHOF(customClasses);
     const char *dummy = context;        /* just to avoid a compiler warning */
     dummy++;
 
@@ -4812,7 +4812,7 @@ static const contextCase contextData[] = {
     /*24*/  {"x|G", ".-=", "", "=-.", UBIDI_DEFAULT_LTR},
     /*25*/  {"x|G", ".-=|-+*", "", "=-.|-+*", UBIDI_DEFAULT_LTR},
 };
-#define CONTEXT_COUNT       uprv_lengthof(contextData)
+#define CONTEXT_COUNT       UPRV_LENGTHOF(contextData)
 
 static void
 testContext(void) {
index 2927cc34f62e521f300f4407ff0e7206bd428d45..31661872b36b4267ccd181f3c108cef40bb2e32f 100644 (file)
@@ -1678,7 +1678,7 @@ static void TestConvertSafeClone()
     };
 
     /* store the actual sizes of each converter */
-    int32_t actualSizes[uprv_lengthof(names)];
+    int32_t actualSizes[UPRV_LENGTHOF(names)];
 
     static const int32_t bufferSizes[] = {
         U_CNV_SAFECLONE_BUFFERSIZE,
@@ -1792,8 +1792,8 @@ static void TestConvertSafeClone()
 
     /* Do these cloned converters work at all - shuffle UChars to chars & back again..*/
 
-    for(j = 0; j < uprv_lengthof(bufferSizes); ++j) {
-        for (idx = 0; idx < uprv_lengthof(names); idx++)
+    for(j = 0; j < UPRV_LENGTHOF(bufferSizes); ++j) {
+        for (idx = 0; idx < UPRV_LENGTHOF(names); idx++)
         {
             err = U_ZERO_ERROR;
             cnv = ucnv_open(names[idx], &err);
@@ -2517,7 +2517,7 @@ static void testFromTruncatedUTF8(UConverter *utf8Cnv, UConverter *cnv, const ch
 
     memcpy(utf8, charUTF8, charUTF8Length);
 
-    for(i=0; i<uprv_lengthof(badUTF8); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(badUTF8); ++i) {
         /* truncated sequence? */
         int32_t length=strlen(badUTF8[i]);
         if(length>=(1+U8_COUNT_TRAIL_BYTES(badUTF8[i][0]))) {
@@ -2536,7 +2536,7 @@ static void testFromTruncatedUTF8(UConverter *utf8Cnv, UConverter *cnv, const ch
         ucnv_convertEx(cnv, utf8Cnv,
                        &target, output+sizeof(output),
                        &source, utf8+utf8Length,
-                       pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer+uprv_lengthof(pivotBuffer),
+                       pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer+UPRV_LENGTHOF(pivotBuffer),
                        TRUE, TRUE, /* reset & flush */
                        &errorCode);
         outputLength=(int32_t)(target-output);
@@ -2581,7 +2581,7 @@ static void testFromBadUTF8(UConverter *utf8Cnv, UConverter *cnv, const char *co
     memcpy(expect, char0, char0Length);
     expectLength=char0Length;
 
-    for(i=0; i<uprv_lengthof(badUTF8); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(badUTF8); ++i) {
         int32_t length=strlen(badUTF8[i]);
         memcpy(utf8+utf8Length, badUTF8[i], length);
         utf8Length+=length;
@@ -2631,7 +2631,7 @@ static void TestConvertExFromUTF8() {
         return;
     }
 
-    for(i=0; i<uprv_lengthof(converterNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(converterNames); ++i) {
         errorCode=U_ZERO_ERROR;
         cnv=ucnv_open(converterNames[i], &errorCode);
         if(U_FAILURE(errorCode)) {
@@ -2690,7 +2690,7 @@ static void TestConvertExFromUTF8_C5F0() {
         return;
     }
 
-    for(i=0; i<uprv_lengthof(converterNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(converterNames); ++i) {
         errorCode=U_ZERO_ERROR;
         cnv=ucnv_open(converterNames[i], &errorCode);
         ucnv_setFromUCallBack(cnv, UCNV_FROM_U_CALLBACK_ESCAPE, UCNV_ESCAPE_XML_DEC,
@@ -2703,7 +2703,7 @@ static void TestConvertExFromUTF8_C5F0() {
         src=bad_utf8;
         target=dest;
         uprv_memset(dest, 9, sizeof(dest));
-        if(i==uprv_lengthof(converterNames)-1) {
+        if(i==UPRV_LENGTHOF(converterNames)-1) {
             /* conversion to UTF-8 yields two U+FFFD directly */
             expected=twoFFFD;
             expectedLength=6;
@@ -2720,7 +2720,7 @@ static void TestConvertExFromUTF8_C5F0() {
             cnv, utf8Cnv,
             &target, dest+expectedLength,
             &src, bad_utf8+sizeof(bad_utf8),
-            pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer+uprv_lengthof(pivotBuffer),
+            pivotBuffer, &pivotSource, &pivotTarget, pivotBuffer+UPRV_LENGTHOF(pivotBuffer),
             TRUE, TRUE, &errorCode);
         if( errorCode!=U_STRING_NOT_TERMINATED_WARNING || src!=bad_utf8+2 ||
             target!=dest+expectedLength || 0!=uprv_memcmp(dest, expected, expectedLength) ||
@@ -2911,7 +2911,7 @@ static void TestLMBCSMaxChar(void) {
     };
     int32_t idx;
 
-    for (idx = 0; idx < uprv_lengthof(converter); idx++) {
+    for (idx = 0; idx < UPRV_LENGTHOF(converter); idx++) {
         UErrorCode status = U_ZERO_ERROR;
         UConverter *cnv = cnv_open(converter[idx].name, &status);
         if (U_FAILURE(status)) {
@@ -3073,12 +3073,12 @@ testSwap(const char *name, UBool swap) {
     /* convert to EBCDIC */
     pcu=text;
     pc=normal;
-    ucnv_fromUnicode(cnv, &pc, normal+uprv_lengthof(normal), &pcu, text+uprv_lengthof(text), NULL, TRUE, &errorCode);
+    ucnv_fromUnicode(cnv, &pc, normal+UPRV_LENGTHOF(normal), &pcu, text+UPRV_LENGTHOF(text), NULL, TRUE, &errorCode);
     normalLength=(int32_t)(pc-normal);
 
     pcu=text;
     pc=swapped;
-    ucnv_fromUnicode(swapCnv, &pc, swapped+uprv_lengthof(swapped), &pcu, text+uprv_lengthof(text), NULL, TRUE, &errorCode);
+    ucnv_fromUnicode(swapCnv, &pc, swapped+UPRV_LENGTHOF(swapped), &pcu, text+UPRV_LENGTHOF(text), NULL, TRUE, &errorCode);
     swappedLength=(int32_t)(pc-swapped);
 
     if(U_FAILURE(errorCode)) {
@@ -3111,12 +3111,12 @@ testSwap(const char *name, UBool swap) {
     /* convert back to Unicode (may not roundtrip) */
     pc=normal;
     pu=uNormal;
-    ucnv_toUnicode(cnv, &pu, uNormal+uprv_lengthof(uNormal), (const char **)&pc, normal+normalLength, NULL, TRUE, &errorCode);
+    ucnv_toUnicode(cnv, &pu, uNormal+UPRV_LENGTHOF(uNormal), (const char **)&pc, normal+normalLength, NULL, TRUE, &errorCode);
     normalLength=(int32_t)(pu-uNormal);
 
     pc=normal;
     pu=uSwapped;
-    ucnv_toUnicode(swapCnv, &pu, uSwapped+uprv_lengthof(uSwapped), (const char **)&pc, normal+swappedLength, NULL, TRUE, &errorCode);
+    ucnv_toUnicode(swapCnv, &pu, uSwapped+UPRV_LENGTHOF(uSwapped), (const char **)&pc, normal+swappedLength, NULL, TRUE, &errorCode);
     swappedLength=(int32_t)(pu-uSwapped);
 
     if(U_FAILURE(errorCode)) {
@@ -3167,7 +3167,7 @@ TestEBCDICSwapLFNL() {
 
     int i;
 
-    for(i=0; i<uprv_lengthof(tests); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(tests); ++i) {
         testSwap(tests[i].name, tests[i].swap);
     }
 }
@@ -3198,7 +3198,7 @@ static void TestFromUCountPending(){
         log_data_err("Could not create converter for test3. Error: %s\n", u_errorName(status));
         return;
     }
-    for(i=0; i<uprv_lengthof(fromUnicodeTests); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(fromUnicodeTests); ++i) {
         char tgt[10];
         char* target = tgt;
         char* targetLimit = target + 10;
@@ -3304,7 +3304,7 @@ TestToUCountPending(){
         return;
     }
     ucnv_setToUCallBack(cnv, UCNV_TO_U_CALLBACK_STOP, NULL, oldToUAction, NULL, &status);
-    for(i=0; i<uprv_lengthof(toUnicodeTests); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(toUnicodeTests); ++i) {
         UChar tgt[20];
         UChar* target = tgt;
         UChar* targetLimit = target + 20;
@@ -3542,7 +3542,7 @@ TestSubstString() {
         log_data_err("ucnv_open(ISO-8859-1) failed - %s\n", u_errorName(errorCode));
         return;
     }
-    ucnv_setSubstString(cnv, sub, uprv_lengthof(sub), &errorCode);
+    ucnv_setSubstString(cnv, sub, UPRV_LENGTHOF(sub), &errorCode);
     if(U_FAILURE(errorCode)) {
         log_err("ucnv_setSubstString(ISO-8859-1, sub[5]) failed - %s\n", u_errorName(errorCode));
     } else {
@@ -3562,7 +3562,7 @@ TestSubstString() {
         log_data_err("ucnv_open(HZ) failed - %s\n", u_errorName(errorCode));
         return;
     }
-    ucnv_setSubstString(cnv, sub, uprv_lengthof(sub), &errorCode);
+    ucnv_setSubstString(cnv, sub, UPRV_LENGTHOF(sub), &errorCode);
     if(U_FAILURE(errorCode)) {
         log_err("ucnv_setSubstString(HZ, sub[5]) failed - %s\n", u_errorName(errorCode));
     } else {
@@ -3647,7 +3647,7 @@ static void TestGetName() {
         "x-UTF-16LE-BOM",           "UTF-16LE,version=1"
     };
     int32_t i;
-    for(i = 0; i < uprv_lengthof(names); i += 2) {
+    for(i = 0; i < UPRV_LENGTHOF(names); i += 2) {
         UErrorCode errorCode = U_ZERO_ERROR;
         UConverter *cnv = ucnv_open(names[i], &errorCode);
         if(U_SUCCESS(errorCode)) {
@@ -3690,7 +3690,7 @@ static void TestUTFBOM() {
     char bytes[10];
     int32_t i;
 
-    for(i = 0; i < uprv_lengthof(names); ++i) {
+    for(i = 0; i < UPRV_LENGTHOF(names); ++i) {
         UErrorCode errorCode = U_ZERO_ERROR;
         UConverter *cnv = ucnv_open(names[i], &errorCode);
         int32_t length = 0;
index 76a0e2235cdf027ff17bd888afb5115df3e56cf5..06bf9bd90352b39944137cac3252886162c174de 100644 (file)
@@ -140,7 +140,7 @@ static void TestG7Locales()
     const UChar *defRules;
     int32_t i, rlen, j, n;
     log_verbose("Testing  ucol_openRules for all the locales\n");
-    for (i = 0; i < uprv_lengthof(locales); i++)
+    for (i = 0; i < UPRV_LENGTHOF(locales); i++)
     {
         const char *locale = locales[i];
         status = U_ZERO_ERROR;
index d1f365ae698477844e7464e6dc527056b9562d8b..0e7d54445b16420c843ddcc84f75498afbec160c 100644 (file)
@@ -39,7 +39,7 @@ static void TestGenderInfo(void) {
     log_err_status(status, "Fail to create UGenderInfo - %s (Are you missing data?)", u_errorName(status));
     return;
   }
-  actual = ugender_getListGender(actual_gi, kAllFemale, uprv_lengthof(kAllFemale), &status);
+  actual = ugender_getListGender(actual_gi, kAllFemale, UPRV_LENGTHOF(kAllFemale), &status);
   if (U_FAILURE(status)) {
     log_err("Fail to get gender of list - %s\n", u_errorName(status));
     return;
index d1fc2fff53652a424b1ed702aacd2d640c6bf610..ea279165e94a866d5008fdcf7da67e4122891725 100644 (file)
@@ -667,7 +667,7 @@ static void TestDisplayNames()
 
     /* test that the default locale has a display name for its own language */
     errorCode=U_ZERO_ERROR;
-    length=uloc_getDisplayLanguage(NULL, NULL, buffer, uprv_lengthof(buffer), &errorCode);
+    length=uloc_getDisplayLanguage(NULL, NULL, buffer, UPRV_LENGTHOF(buffer), &errorCode);
     if(U_FAILURE(errorCode) || (length<=3 && buffer[0]<=0x7f)) {
         /* check <=3 to reject getting the language code as a display name */
         log_data_err("unable to get a display string for the language of the default locale - %s (Are you missing data?)\n", u_errorName(errorCode));
@@ -675,14 +675,14 @@ static void TestDisplayNames()
 
     /* test that we get the language code itself for an unknown language, and a default warning */
     errorCode=U_ZERO_ERROR;
-    length=uloc_getDisplayLanguage("qq", "rr", buffer, uprv_lengthof(buffer), &errorCode);
+    length=uloc_getDisplayLanguage("qq", "rr", buffer, UPRV_LENGTHOF(buffer), &errorCode);
     if(errorCode!=U_USING_DEFAULT_WARNING || length!=2 || buffer[0]!=0x71 || buffer[1]!=0x71) {
         log_err("error getting the display string for an unknown language - %s\n", u_errorName(errorCode));
     }
     
     /* test that we get a default warning for a display name where one component is unknown (4255) */
     errorCode=U_ZERO_ERROR;
-    length=uloc_getDisplayName("qq_US_POSIX", "en_US", buffer, uprv_lengthof(buffer), &errorCode);
+    length=uloc_getDisplayName("qq_US_POSIX", "en_US", buffer, UPRV_LENGTHOF(buffer), &errorCode);
     if(errorCode!=U_USING_DEFAULT_WARNING) {
         log_err("error getting the display name for a locale with an unknown language - %s\n", u_errorName(errorCode));
     }
@@ -700,9 +700,9 @@ static void TestDisplayNames()
             "\\u0399\\u03c3\\u03c0\\u03b1\\u03bd\\u03b9\\u03ba\\u03ac (\\u0397\\u03bc\\u03b5\\u03c1\\u03bf\\u03bb\\u03cc\\u03b3\\u03b9\\u03bf=\\u0399\\u03b1\\u03c0\\u03c9\\u03bd\\u03b9\\u03ba\\u03cc \\u03b7\\u03bc\\u03b5\\u03c1\\u03bf\\u03bb\\u03cc\\u03b3\\u03b9\\u03bf, \\u03a3\\u03b5\\u03b9\\u03c1\\u03ac \\u03c4\\u03b1\\u03be\\u03b9\\u03bd\\u03cc\\u03bc\\u03b7\\u03c3\\u03b7\\u03c2=\\u03a0\\u03b1\\u03c1\\u03b1\\u03b4\\u03bf\\u03c3\\u03b9\\u03b1\\u03ba\\u03ae \\u03c3\\u03b5\\u03b9\\u03c1\\u03ac \\u03c4\\u03b1\\u03be\\u03b9\\u03bd\\u03cc\\u03bc\\u03b7\\u03c3\\u03b7\\u03c2)" };
         UChar *expectBuffer;
 
-        for(i=0;i<uprv_lengthof(testL);i++) {
+        for(i=0;i<UPRV_LENGTHOF(testL);i++) {
             errorCode = U_ZERO_ERROR;
-            uloc_getDisplayName(aLocale, testL[i], buffer, uprv_lengthof(buffer), &errorCode);
+            uloc_getDisplayName(aLocale, testL[i], buffer, UPRV_LENGTHOF(buffer), &errorCode);
             if(U_FAILURE(errorCode)) {
                 log_err("FAIL in uloc_getDisplayName(%s,%s,..) -> %s\n", aLocale, testL[i], u_errorName(errorCode));
             } else {
@@ -734,7 +734,7 @@ static void TestDisplayNames()
         if(ec==U_BUFFER_OVERFLOW_ERROR) {
             ec=U_ZERO_ERROR;
         }
-        len=uloc_getDisplayName(locale, displayLocale, result, uprv_lengthof(result), &ec);
+        len=uloc_getDisplayName(locale, displayLocale, result, UPRV_LENGTHOF(result), &ec);
         if(U_FAILURE(ec)) {
             log_err("uloc_getDisplayName(%s, %s...) returned error: %s",
                     locale, displayLocale, u_errorName(ec));
@@ -2781,7 +2781,7 @@ static void TestCalendar() {
         log_err_status(status, "Could not open res_index.res. Exiting. Error: %s\n", u_errorName(status));
         return;
     }
-    for (i=0; i<uprv_lengthof(LOCALE_ALIAS); i++) {
+    for (i=0; i<UPRV_LENGTHOF(LOCALE_ALIAS); i++) {
         const char* oldLoc = LOCALE_ALIAS[i][0];
         const char* newLoc = LOCALE_ALIAS[i][1];
         UCalendar* c1 = NULL;
@@ -2817,7 +2817,7 @@ static void TestDateFormat() {
         log_err_status(status, "Could not open res_index.res. Exiting. Error: %s\n", u_errorName(status));
         return;
     }
-    for (i=0; i<uprv_lengthof(LOCALE_ALIAS); i++) {
+    for (i=0; i<UPRV_LENGTHOF(LOCALE_ALIAS); i++) {
         const char* oldLoc = LOCALE_ALIAS[i][0];
         const char* newLoc = LOCALE_ALIAS[i][1];
         UDateFormat* df1 = NULL;
@@ -2860,7 +2860,7 @@ static void TestCollation() {
         log_err_status(status, "Could not open res_index.res. Exiting. Error: %s\n", u_errorName(status));
         return;
     }
-    for (i=0; i<uprv_lengthof(LOCALE_ALIAS); i++) {
+    for (i=0; i<UPRV_LENGTHOF(LOCALE_ALIAS); i++) {
         const char* oldLoc = LOCALE_ALIAS[i][0];
         const char* newLoc = LOCALE_ALIAS[i][1];
         UCollator* c1 = NULL;
@@ -2984,7 +2984,7 @@ static void  TestULocale() {
         log_err_status(status, "Could not open res_index.res. Exiting. Error: %s\n", u_errorName(status));
         return;
     }
-    for (i=0; i<uprv_lengthof(LOCALE_ALIAS); i++) {
+    for (i=0; i<UPRV_LENGTHOF(LOCALE_ALIAS); i++) {
         const char* oldLoc = LOCALE_ALIAS[i][0];
         const char* newLoc = LOCALE_ALIAS[i][1];
         UChar name1[256], name2[256];
@@ -3030,7 +3030,7 @@ static void TestUResourceBundle() {
         return;
     }
     resIndex = ures_open(NULL,"res_index", &status);
-    for (i=0; i<uprv_lengthof(LOCALE_ALIAS); i++) {
+    for (i=0; i<UPRV_LENGTHOF(LOCALE_ALIAS); i++) {
 
         const char* oldLoc = LOCALE_ALIAS[i][0];
         const char* newLoc = LOCALE_ALIAS[i][1];
@@ -3075,7 +3075,7 @@ static void TestDisplayName() {
     int32_t capacity = 256;
     int i =0;
     int j=0;
-    for (i=0; i<uprv_lengthof(LOCALE_ALIAS); i++) {
+    for (i=0; i<UPRV_LENGTHOF(LOCALE_ALIAS); i++) {
         const char* oldLoc = LOCALE_ALIAS[i][0];
         const char* newLoc = LOCALE_ALIAS[i][1];
         UErrorCode status = U_ZERO_ERROR;
index 69c45335a5057b1cc279a8e34b509065ba420575..38fcf2c0220eeebf95a3019b25cea294abf12593 100644 (file)
@@ -1127,7 +1127,7 @@ static void TestMessageWithUnusedArgNumber() {
 
     U_STRING_INIT(pattern, "abc {1} def", 11);
     U_STRING_INIT(expected, "abc y def", 9);
-    length = u_formatMessage("en", pattern, -1, result, uprv_lengthof(result), &errorCode, x, y);
+    length = u_formatMessage("en", pattern, -1, result, UPRV_LENGTHOF(result), &errorCode, x, y);
     if (U_FAILURE(errorCode) || length != u_strlen(expected) || u_strcmp(result, expected) != 0) {
         log_err("u_formatMessage(pattern with only {1}, 2 args) failed: result length %d, UErrorCode %s \n",
                 (int)length, u_errorName(errorCode));
index 27b78f8be307576aab6ae321cfee7e0a06b0867e..1400218b863643e63f793221c9fdf20f2147d51e 100644 (file)
@@ -188,14 +188,14 @@ static void TestNormCases(UNormalizationMode mode,
         {
             status=U_ZERO_ERROR;
         }
-        length2=unorm_normalize(source, u_strlen(source), mode, 0, result, uprv_lengthof(result), &status); 
+        length2=unorm_normalize(source, u_strlen(source), mode, 0, result, UPRV_LENGTHOF(result), &status); 
         if(U_FAILURE(status) || neededLen!=length2) {
             log_data_err("ERROR in unorm_normalize(%s/NUL) at %s:  %s - (Are you missing data?)\n",
                          modeStrings[mode], austrdup(source), myErrorName(status));
         } else {
             assertEqual(result, cases[x][expIndex], x);
         }
-        length2=unorm_normalize(source, -1, mode, 0, result, uprv_lengthof(result), &status); 
+        length2=unorm_normalize(source, -1, mode, 0, result, UPRV_LENGTHOF(result), &status); 
         if(U_FAILURE(status) || neededLen!=length2) {
             log_data_err("ERROR in unorm_normalize(%s/srcLength) at %s:  %s - (Are you missing data?)\n",
                          modeStrings[mode], austrdup(source), myErrorName(status));
@@ -207,23 +207,23 @@ static void TestNormCases(UNormalizationMode mode,
 }
 
 void TestDecomp() {
-    TestNormCases(UNORM_NFD, canonTests, uprv_lengthof(canonTests));
+    TestNormCases(UNORM_NFD, canonTests, UPRV_LENGTHOF(canonTests));
 }
 
 void TestCompatDecomp() {
-    TestNormCases(UNORM_NFKD, compatTests, uprv_lengthof(compatTests));
+    TestNormCases(UNORM_NFKD, compatTests, UPRV_LENGTHOF(compatTests));
 }
 
 void TestCanonDecompCompose() {
-    TestNormCases(UNORM_NFC, canonTests, uprv_lengthof(canonTests));
+    TestNormCases(UNORM_NFC, canonTests, UPRV_LENGTHOF(canonTests));
 }
 
 void TestCompatDecompCompose() {
-    TestNormCases(UNORM_NFKC, compatTests, uprv_lengthof(compatTests));
+    TestNormCases(UNORM_NFKC, compatTests, UPRV_LENGTHOF(compatTests));
 }
 
 void TestFCD() {
-    TestNormCases(UNORM_FCD, fcdTests, uprv_lengthof(fcdTests));
+    TestNormCases(UNORM_FCD, fcdTests, UPRV_LENGTHOF(fcdTests));
 }
 
 static void assertEqual(const UChar* result, const char* expected, int32_t index)
@@ -473,7 +473,7 @@ static void TestQuickCheckStringResult()
   UChar *c = NULL;
   UErrorCode error = U_ZERO_ERROR;
 
-  for (count = 0; count < uprv_lengthof(canonTests); count ++)
+  for (count = 0; count < UPRV_LENGTHOF(canonTests); count ++)
   {
     d = CharsToUChars(canonTests[count][1]);
     c = CharsToUChars(canonTests[count][2]);
@@ -495,7 +495,7 @@ static void TestQuickCheckStringResult()
     free(c);
   }
 
-  for (count = 0; count < uprv_lengthof(compatTests); count ++)
+  for (count = 0; count < UPRV_LENGTHOF(compatTests); count ++)
   {
     d = CharsToUChars(compatTests[count][1]);
     c = CharsToUChars(compatTests[count][2]);
@@ -577,7 +577,7 @@ static void TestIsNormalized(void) {
     }
 
     /* specific cases */
-    for(i=0; i<uprv_lengthof(notNFC); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(notNFC); ++i) {
         errorCode=U_ZERO_ERROR;
         if(unorm_isNormalized(notNFC[i], -1, UNORM_NFC, &errorCode) || U_FAILURE(errorCode)) {
             log_data_err("error: isNormalized(notNFC[%d], NFC) is wrong (%s) - (Are you missing data?)\n", i, u_errorName(errorCode));
@@ -587,7 +587,7 @@ static void TestIsNormalized(void) {
             log_data_err("error: isNormalized(notNFC[%d], NFKC) is wrong (%s) - (Are you missing data?)\n", i, u_errorName(errorCode));
         }
     }
-    for(i=0; i<uprv_lengthof(notNFKC); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(notNFKC); ++i) {
         errorCode=U_ZERO_ERROR;
         if(unorm_isNormalized(notNFKC[i], -1, UNORM_NFKC, &errorCode) || U_FAILURE(errorCode)) {
             log_data_err("error: isNormalized(notNFKC[%d], NFKC) is wrong (%s) - (Are you missing data?)\n", i, u_errorName(errorCode));
@@ -1331,9 +1331,9 @@ TestFCNFKCClosure(void) {
     UErrorCode errorCode;
     int32_t i, length;
 
-    for(i=0; i<uprv_lengthof(tests); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(tests); ++i) {
         errorCode=U_ZERO_ERROR;
-        length=u_getFC_NFKC_Closure(tests[i].c, buffer, uprv_lengthof(buffer), &errorCode);
+        length=u_getFC_NFKC_Closure(tests[i].c, buffer, UPRV_LENGTHOF(buffer), &errorCode);
         if(U_FAILURE(errorCode) || length!=u_strlen(buffer) || 0!=u_strcmp(tests[i].s, buffer)) {
             log_data_err("u_getFC_NFKC_Closure(U+%04lx) is wrong (%s) - (Are you missing data?)\n", tests[i].c, u_errorName(errorCode));
         }
@@ -1341,12 +1341,12 @@ TestFCNFKCClosure(void) {
 
     /* error handling */
     errorCode=U_ZERO_ERROR;
-    length=u_getFC_NFKC_Closure(0x5c, NULL, uprv_lengthof(buffer), &errorCode);
+    length=u_getFC_NFKC_Closure(0x5c, NULL, UPRV_LENGTHOF(buffer), &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("u_getFC_NFKC_Closure(dest=NULL) is wrong (%s)\n", u_errorName(errorCode));
     }
 
-    length=u_getFC_NFKC_Closure(0x5c, buffer, uprv_lengthof(buffer), &errorCode);
+    length=u_getFC_NFKC_Closure(0x5c, buffer, UPRV_LENGTHOF(buffer), &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("u_getFC_NFKC_Closure(U_FAILURE) is wrong (%s)\n", u_errorName(errorCode));
     }
@@ -1405,7 +1405,7 @@ TestQuickCheckPerCP() {
             log_data_err("u_getIntPropertyValue(NFKD)=%d != %d=unorm_quickCheck(NFKD) for U+%04x - (Are you missing data?)\n", qc1, qc2, c);
         }
 
-        length=unorm_normalize(s, length, UNORM_NFD, 0, nfd, uprv_lengthof(nfd), &errorCode);
+        length=unorm_normalize(s, length, UNORM_NFD, 0, nfd, UPRV_LENGTHOF(nfd), &errorCode);
         /* length-length == 0 is used to get around a compiler warning. */
         U16_GET(nfd, 0, length-length, length, lead);
         U16_GET(nfd, 0, length-1, length, trail);
@@ -1455,12 +1455,12 @@ TestComposition(void) {
     UErrorCode errorCode;
     int32_t i, length;
 
-    for(i=0; i<uprv_lengthof(cases); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(cases); ++i) {
         errorCode=U_ZERO_ERROR;
         length=unorm_normalize(
                     cases[i].input, -1,
                     cases[i].mode, cases[i].options,
-                    output, uprv_lengthof(output),
+                    output, UPRV_LENGTHOF(output),
                     &errorCode);
         if( U_FAILURE(errorCode) ||
             length!=u_strlen(cases[i].expect) ||
@@ -1483,17 +1483,17 @@ TestGetDecomposition() {
         return;
     }
 
-    length=unorm2_getDecomposition(n2, 0x20, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getDecomposition(n2, 0x20, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length>=0) {
         log_err("unorm2_getDecomposition(fcc, space) failed\n");
     }
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getDecomposition(n2, 0xe4, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getDecomposition(n2, 0xe4, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || decomp[0]!=0x61 || decomp[1]!=0x308 || decomp[2]!=0) {
         log_err("unorm2_getDecomposition(fcc, a-umlaut) failed\n");
     }
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getDecomposition(n2, 0xac01, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getDecomposition(n2, 0xac01, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=3 || decomp[0]!=0x1100 || decomp[1]!=0x1161 || decomp[2]!=0x11a8 || decomp[3]!=0) {
         log_err("unorm2_getDecomposition(fcc, Hangul syllable U+AC01) failed\n");
     }
@@ -1530,35 +1530,35 @@ TestGetRawDecomposition() {
      * without recursive decomposition.
      */
 
-    length=unorm2_getRawDecomposition(n2, 0x20, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getRawDecomposition(n2, 0x20, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length>=0) {
         log_err("unorm2_getDecomposition(nfkc, space) failed\n");
     }
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getRawDecomposition(n2, 0xe4, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getRawDecomposition(n2, 0xe4, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || decomp[0]!=0x61 || decomp[1]!=0x308 || decomp[2]!=0) {
         log_err("unorm2_getDecomposition(nfkc, a-umlaut) failed\n");
     }
     /* U+1E08 LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE */
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getRawDecomposition(n2, 0x1e08, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getRawDecomposition(n2, 0x1e08, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || decomp[0]!=0xc7 || decomp[1]!=0x301 || decomp[2]!=0) {
         log_err("unorm2_getDecomposition(nfkc, c-cedilla-acute) failed\n");
     }
     /* U+212B ANGSTROM SIGN */
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getRawDecomposition(n2, 0x212b, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getRawDecomposition(n2, 0x212b, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=1 || decomp[0]!=0xc5 || decomp[1]!=0) {
         log_err("unorm2_getDecomposition(nfkc, angstrom sign) failed\n");
     }
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getRawDecomposition(n2, 0xac00, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getRawDecomposition(n2, 0xac00, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || decomp[0]!=0x1100 || decomp[1]!=0x1161 || decomp[2]!=0) {
         log_err("unorm2_getDecomposition(nfkc, Hangul syllable U+AC00) failed\n");
     }
     /* A Hangul LVT syllable has a raw decomposition of an LV syllable + T. */
     errorCode=U_ZERO_ERROR;
-    length=unorm2_getRawDecomposition(n2, 0xac01, decomp, uprv_lengthof(decomp), &errorCode);
+    length=unorm2_getRawDecomposition(n2, 0xac01, decomp, UPRV_LENGTHOF(decomp), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || decomp[0]!=0xac00 || decomp[1]!=0x11a8 || decomp[2]!=0) {
         log_err("unorm2_getDecomposition(nfkc, Hangul syllable U+AC01) failed\n");
     }
@@ -1599,7 +1599,7 @@ TestAppendRestoreMiddle() {
      * (Let it modify the destination buffer before reallocating internally.)
      */
     length=unorm2_append(n2, a, -1, 6, b, -1, &errorCode);
-    if(errorCode!=U_BUFFER_OVERFLOW_ERROR || length!=uprv_lengthof(expected)) {
+    if(errorCode!=U_BUFFER_OVERFLOW_ERROR || length!=UPRV_LENGTHOF(expected)) {
         log_err("unorm2_append(preflight) returned wrong length of %d\n", (int)length);
         return;
     }
@@ -1609,8 +1609,8 @@ TestAppendRestoreMiddle() {
         return;
     }
     errorCode=U_ZERO_ERROR;
-    length=unorm2_append(n2, a, -1, uprv_lengthof(a), b, -1, &errorCode);
-    if(U_FAILURE(errorCode) || length!=uprv_lengthof(expected) || 0!=u_memcmp(a, expected, length)) {
+    length=unorm2_append(n2, a, -1, UPRV_LENGTHOF(a), b, -1, &errorCode);
+    if(U_FAILURE(errorCode) || length!=UPRV_LENGTHOF(expected) || 0!=u_memcmp(a, expected, length)) {
         log_err("unorm2_append(real) failed - %s, length %d\n", u_errorName(errorCode), (int)length);
         return;
     }
@@ -1631,7 +1631,7 @@ TestGetEasyToUseInstance() {
         log_err_status(errorCode, "unorm2_getNFCInstance() failed: %s\n", u_errorName(errorCode));
         return;
     }
-    length=unorm2_normalize(n2, in, uprv_lengthof(in), out, uprv_lengthof(out), &errorCode);
+    length=unorm2_normalize(n2, in, UPRV_LENGTHOF(in), out, UPRV_LENGTHOF(out), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || out[0]!=0xa0 || out[1]!=0x1e08) {
         log_err("unorm2_getNFCInstance() did not return an NFC instance (normalized length=%d; %s)\n",
                 (int)length, u_errorName(errorCode));
@@ -1643,7 +1643,7 @@ TestGetEasyToUseInstance() {
         log_err_status(errorCode, "unorm2_getNFDInstance() failed: %s\n", u_errorName(errorCode));
         return;
     }
-    length=unorm2_normalize(n2, in, uprv_lengthof(in), out, uprv_lengthof(out), &errorCode);
+    length=unorm2_normalize(n2, in, UPRV_LENGTHOF(in), out, UPRV_LENGTHOF(out), &errorCode);
     if(U_FAILURE(errorCode) || length!=4 || out[0]!=0xa0 || out[1]!=0x43 || out[2]!=0x327 || out[3]!=0x301) {
         log_err("unorm2_getNFDInstance() did not return an NFD instance (normalized length=%d; %s)\n",
                 (int)length, u_errorName(errorCode));
@@ -1655,7 +1655,7 @@ TestGetEasyToUseInstance() {
         log_err_status(errorCode, "unorm2_getNFKCInstance() failed: %s\n", u_errorName(errorCode));
         return;
     }
-    length=unorm2_normalize(n2, in, uprv_lengthof(in), out, uprv_lengthof(out), &errorCode);
+    length=unorm2_normalize(n2, in, UPRV_LENGTHOF(in), out, UPRV_LENGTHOF(out), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || out[0]!=0x20 || out[1]!=0x1e08) {
         log_err("unorm2_getNFKCInstance() did not return an NFKC instance (normalized length=%d; %s)\n",
                 (int)length, u_errorName(errorCode));
@@ -1667,7 +1667,7 @@ TestGetEasyToUseInstance() {
         log_err_status(errorCode, "unorm2_getNFKDInstance() failed: %s\n", u_errorName(errorCode));
         return;
     }
-    length=unorm2_normalize(n2, in, uprv_lengthof(in), out, uprv_lengthof(out), &errorCode);
+    length=unorm2_normalize(n2, in, UPRV_LENGTHOF(in), out, UPRV_LENGTHOF(out), &errorCode);
     if(U_FAILURE(errorCode) || length!=4 || out[0]!=0x20 || out[1]!=0x43 || out[2]!=0x327 || out[3]!=0x301) {
         log_err("unorm2_getNFKDInstance() did not return an NFKD instance (normalized length=%d; %s)\n",
                 (int)length, u_errorName(errorCode));
@@ -1679,7 +1679,7 @@ TestGetEasyToUseInstance() {
         log_err_status(errorCode, "unorm2_getNFKCCasefoldInstance() failed: %s\n", u_errorName(errorCode));
         return;
     }
-    length=unorm2_normalize(n2, in, uprv_lengthof(in), out, uprv_lengthof(out), &errorCode);
+    length=unorm2_normalize(n2, in, UPRV_LENGTHOF(in), out, UPRV_LENGTHOF(out), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || out[0]!=0x20 || out[1]!=0x1e09) {
         log_err("unorm2_getNFKCCasefoldInstance() did not return an NFKC_Casefold instance (normalized length=%d; %s)\n",
                 (int)length, u_errorName(errorCode));
index 0e8fd482a9a77a48f7ce8902eb40f1fa14bd5f9e..52346f55087937574a921918dd6154c6b1d2f854 100644 (file)
@@ -712,7 +712,7 @@ TestTable32(void) {
     }
 
     /* search for some items by key */
-    for(i=0; i<uprv_lengthof(testcases); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testcases); ++i) {
         item=ures_getByKey(res, testcases[i].key, item, &errorCode);
         if(U_FAILURE(errorCode)) {
             log_err("unable to find the key \"%s\" in testdata/testtable32.res - %s\n",
index d618f7dd8d4708468a39914fde1d251febd52b57..4f6463012a3ad5fa4dbfea54d3b0348d5f378db6 100644 (file)
@@ -889,9 +889,9 @@ TestUCaseMapToTitle(void) {
     }
 
     /* Use default UBreakIterator: Word breaks. */
-    length=ucasemap_toTitle(csm, buffer, uprv_lengthof(buffer), beforeTitle, uprv_lengthof(beforeTitle), &errorCode);
+    length=ucasemap_toTitle(csm, buffer, UPRV_LENGTHOF(buffer), beforeTitle, UPRV_LENGTHOF(beforeTitle), &errorCode);
     if( U_FAILURE(errorCode) ||
-        length!=uprv_lengthof(titleWord) ||
+        length!=UPRV_LENGTHOF(titleWord) ||
         0!=u_memcmp(buffer, titleWord, length) ||
         buffer[length]!=0
     ) {
@@ -911,9 +911,9 @@ TestUCaseMapToTitle(void) {
         return;
     }
 
-    length=ucasemap_toTitle(csm, buffer, uprv_lengthof(buffer), beforeTitle, uprv_lengthof(beforeTitle), &errorCode);
+    length=ucasemap_toTitle(csm, buffer, UPRV_LENGTHOF(buffer), beforeTitle, UPRV_LENGTHOF(beforeTitle), &errorCode);
     if( U_FAILURE(errorCode) ||
-        length!=uprv_lengthof(titleWordNoAdjust) ||
+        length!=UPRV_LENGTHOF(titleWordNoAdjust) ||
         0!=u_memcmp(buffer, titleWordNoAdjust, length) ||
         buffer[length]!=0
     ) {
@@ -947,18 +947,18 @@ TestUCaseMapToTitle(void) {
     }
 
     /* Use the sentence break iterator with the option. Preflight first. */
-    length=ucasemap_toTitle(csm, NULL, 0, beforeTitle, uprv_lengthof(beforeTitle), &errorCode);
+    length=ucasemap_toTitle(csm, NULL, 0, beforeTitle, UPRV_LENGTHOF(beforeTitle), &errorCode);
     if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
-        length!=uprv_lengthof(titleSentNoLower)
+        length!=UPRV_LENGTHOF(titleSentNoLower)
     ) {
         log_err("ucasemap_toTitle(preflight sentence break iterator, no lowercasing)=%ld failed - %s\n", (long)length, u_errorName(errorCode));
     }
 
     errorCode=U_ZERO_ERROR;
     buffer[0]=0;
-    length=ucasemap_toTitle(csm, buffer, uprv_lengthof(buffer), beforeTitle, uprv_lengthof(beforeTitle), &errorCode);
+    length=ucasemap_toTitle(csm, buffer, UPRV_LENGTHOF(buffer), beforeTitle, UPRV_LENGTHOF(beforeTitle), &errorCode);
     if( U_FAILURE(errorCode) ||
-        length!=uprv_lengthof(titleSentNoLower) ||
+        length!=UPRV_LENGTHOF(titleSentNoLower) ||
         0!=u_memcmp(buffer, titleSentNoLower, length) ||
         buffer[length]!=0
     ) {
@@ -971,8 +971,8 @@ TestUCaseMapToTitle(void) {
         int32_t utf8BeforeTitleLength, utf8TitleSentNoLowerLength;
 
         errorCode=U_ZERO_ERROR;
-        u_strToUTF8(utf8BeforeTitle, (int32_t)sizeof(utf8BeforeTitle), &utf8BeforeTitleLength, beforeTitle, uprv_lengthof(beforeTitle), &errorCode);
-        u_strToUTF8(utf8TitleSentNoLower, (int32_t)sizeof(utf8TitleSentNoLower), &utf8TitleSentNoLowerLength, titleSentNoLower, uprv_lengthof(titleSentNoLower), &errorCode);
+        u_strToUTF8(utf8BeforeTitle, (int32_t)sizeof(utf8BeforeTitle), &utf8BeforeTitleLength, beforeTitle, UPRV_LENGTHOF(beforeTitle), &errorCode);
+        u_strToUTF8(utf8TitleSentNoLower, (int32_t)sizeof(utf8TitleSentNoLower), &utf8TitleSentNoLowerLength, titleSentNoLower, UPRV_LENGTHOF(titleSentNoLower), &errorCode);
 
         length=ucasemap_utf8ToTitle(csm, utf8, (int32_t)sizeof(utf8), utf8BeforeTitle, utf8BeforeTitleLength, &errorCode);
         if( U_FAILURE(errorCode) ||
index bdd5326e39a0907b61da42471ec9ccacd6e1bddd..5a7266406977e2f4e0523f2497853a88096f7518 100644 (file)
@@ -247,10 +247,10 @@ TestInvariant() {
             }
 
             errorCode=U_ZERO_ERROR;
-            length=ucnv_toUChars(cnv, us, uprv_lengthof(us), invariantChars, -1, &errorCode);
+            length=ucnv_toUChars(cnv, us, UPRV_LENGTHOF(us), invariantChars, -1, &errorCode);
             if(U_FAILURE(errorCode)) {
                 log_err("ucnv_toUChars(invariantChars) failed - %s\n", u_errorName(errorCode));
-            } else if(length!=uprv_lengthof(invariantUChars)-1 || u_strcmp(us, invariantUChars)!=0) {
+            } else if(length!=UPRV_LENGTHOF(invariantUChars)-1 || u_strcmp(us, invariantUChars)!=0) {
                 log_err("ucnv_toUChars(invariantChars) failed\n");
             }
 
@@ -278,7 +278,7 @@ TestInvariant() {
         }
     }
 
-    for(i=0; i<uprv_lengthof(nonASCIIUChars); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(nonASCIIUChars); ++i) {
         if(uprv_isInvariantUString(nonASCIIUChars+i, 1)) {
             log_err("uprv_isInvariantUString(nonASCIIUChars[%d]) failed\n", i);
         }
@@ -321,7 +321,7 @@ TestCompareInvEbcdicAsAscii() {
         { "\x81\x81\x82", "aab" }
     };
     int32_t i;
-    for(i=1; i<uprv_lengthof(invStrings); ++i) {
+    for(i=1; i<UPRV_LENGTHOF(invStrings); ++i) {
         int32_t diff1, diff2;
         /* compare previous vs. current */
         diff1=getSign(uprv_compareInvEbcdicAsAscii(invStrings[i-1][0], invStrings[i][0]));
index 159c38ca76476331f7eaa16c327d969ffa328e36..1d49a55a8ad5ce5834f47413e08c97994f4ab227 100644 (file)
@@ -240,7 +240,7 @@ void TestUScriptCodeAPI(){
         UErrorCode status = U_ZERO_ERROR;
         UBool passed = TRUE;
 
-        for(i=0; i<uprv_lengthof(codepoints); ++i){
+        for(i=0; i<UPRV_LENGTHOF(codepoints); ++i){
             code = uscript_getScript(codepoints[i],&status);
             if(U_SUCCESS(status)){
                 if( code != expected[i] ||
@@ -360,7 +360,7 @@ void TestUScriptCodeAPI(){
             "Ahom", "Hatr", "Modi", "Mult", "Pauc", "Sidd"
         };
         int32_t j = 0;
-        if(uprv_lengthof(expectedLong)!=(USCRIPT_CODE_LIMIT-USCRIPT_BALINESE)) {
+        if(UPRV_LENGTHOF(expectedLong)!=(USCRIPT_CODE_LIMIT-USCRIPT_BALINESE)) {
             log_err("need to add new script codes in cucdapi.c!\n");
             return;
         }
@@ -374,11 +374,11 @@ void TestUScriptCodeAPI(){
                 log_err("uscript_getShortName failed for code %i: %s!=%s\n", i, name, expectedShort[j]);
             }
         }
-        for(i=0; i<uprv_lengthof(expectedLong); i++){
+        for(i=0; i<UPRV_LENGTHOF(expectedLong); i++){
             UScriptCode fillIn[5] = {USCRIPT_INVALID_CODE};
             UErrorCode status = U_ZERO_ERROR;
             int32_t len = 0;
-            len = uscript_getCode(expectedShort[i], fillIn, uprv_lengthof(fillIn), &status);
+            len = uscript_getCode(expectedShort[i], fillIn, UPRV_LENGTHOF(fillIn), &status);
             if(U_FAILURE(status)){
                 log_err("uscript_getCode failed for script name %s. Error: %s\n",expectedShort[i], u_errorName(status));
             }
@@ -472,13 +472,13 @@ void TestGetScriptExtensions() {
 
     /* errors and overflows */
     errorCode=U_PARSE_ERROR;
-    length=uscript_getScriptExtensions(0x0640, scripts, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(0x0640, scripts, UPRV_LENGTHOF(scripts), &errorCode);
     if(errorCode!=U_PARSE_ERROR) {
         log_err("uscript_getScriptExtensions(U+0640, U_PARSE_ERROR) did not preserve the UErrorCode - %s\n",
               u_errorName(errorCode));
     }
     errorCode=U_ZERO_ERROR;
-    length=uscript_getScriptExtensions(0x0640, NULL, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(0x0640, NULL, UPRV_LENGTHOF(scripts), &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("uscript_getScriptExtensions(U+0640, NULL) did not set U_ILLEGAL_ARGUMENT_ERROR - %s\n",
               u_errorName(errorCode));
@@ -511,13 +511,13 @@ void TestGetScriptExtensions() {
 
     /* invalid code points */
     errorCode=U_ZERO_ERROR;
-    length=uscript_getScriptExtensions(-1, scripts, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(-1, scripts, UPRV_LENGTHOF(scripts), &errorCode);
     if(U_FAILURE(errorCode) || length!=1 || scripts[0]!=USCRIPT_UNKNOWN) {
         log_err("uscript_getScriptExtensions(-1)=%d does not return {UNKNOWN} - %s\n",
               (int)length, u_errorName(errorCode));
     }
     errorCode=U_ZERO_ERROR;
-    length=uscript_getScriptExtensions(0x110000, scripts, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(0x110000, scripts, UPRV_LENGTHOF(scripts), &errorCode);
     if(U_FAILURE(errorCode) || length!=1 || scripts[0]!=USCRIPT_UNKNOWN) {
         log_err("uscript_getScriptExtensions(0x110000)=%d does not return {UNKNOWN} - %s\n",
               (int)length, u_errorName(errorCode));
@@ -531,7 +531,7 @@ void TestGetScriptExtensions() {
               (int)length, u_errorName(errorCode));
     }
     errorCode=U_ZERO_ERROR;
-    length=uscript_getScriptExtensions(0x0640, scripts, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(0x0640, scripts, UPRV_LENGTHOF(scripts), &errorCode);
     if(U_FAILURE(errorCode) || length<3 ||
             !scriptsContain(scripts, length, USCRIPT_ARABIC) ||
             !scriptsContain(scripts, length, USCRIPT_SYRIAC) ||
@@ -540,13 +540,13 @@ void TestGetScriptExtensions() {
               (int)length, u_errorName(errorCode));
     }
     errorCode=U_ZERO_ERROR;
-    length=uscript_getScriptExtensions(0xfdf2, scripts, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(0xfdf2, scripts, UPRV_LENGTHOF(scripts), &errorCode);
     if(U_FAILURE(errorCode) || length!=2 || scripts[0]!=USCRIPT_ARABIC || scripts[1]!=USCRIPT_THAANA) {
         log_err("uscript_getScriptExtensions(U+FDF2)=%d failed - %s\n",
               (int)length, u_errorName(errorCode));
     }
     errorCode=U_ZERO_ERROR;
-    length=uscript_getScriptExtensions(0xff65, scripts, uprv_lengthof(scripts), &errorCode);
+    length=uscript_getScriptExtensions(0xff65, scripts, UPRV_LENGTHOF(scripts), &errorCode);
     if(U_FAILURE(errorCode) || length!=6 || scripts[0]!=USCRIPT_BOPOMOFO || scripts[5]!=USCRIPT_YI) {
         log_err("uscript_getScriptExtensions(U+FF65)=%d failed - %s\n",
               (int)length, u_errorName(errorCode));
@@ -558,7 +558,7 @@ void TestScriptMetadataAPI() {
     UErrorCode errorCode=U_ZERO_ERROR;
     UChar sample[8];
 
-    if(uscript_getSampleString(USCRIPT_LATIN, sample, uprv_lengthof(sample), &errorCode)!=1 ||
+    if(uscript_getSampleString(USCRIPT_LATIN, sample, UPRV_LENGTHOF(sample), &errorCode)!=1 ||
             U_FAILURE(errorCode) ||
             uscript_getScript(sample[0], &errorCode)!=USCRIPT_LATIN ||
             sample[1]!=0) {
@@ -571,7 +571,7 @@ void TestScriptMetadataAPI() {
         log_err("uscript_getSampleString(Latn, capacity=0) failed - %s\n", u_errorName(errorCode));
     }
     errorCode=U_ZERO_ERROR;
-    if(uscript_getSampleString(USCRIPT_INVALID_CODE, sample, uprv_lengthof(sample), &errorCode)!=0 ||
+    if(uscript_getSampleString(USCRIPT_INVALID_CODE, sample, UPRV_LENGTHOF(sample), &errorCode)!=0 ||
             U_FAILURE(errorCode) ||
             sample[0]!=0) {
         log_err("uscript_getSampleString(invalid) failed - %s\n", u_errorName(errorCode));
@@ -623,12 +623,12 @@ void TestBinaryValues() {
     static const char *const falseValues[]={ "N", "No", "F", "False" };
     static const char *const trueValues[]={ "Y", "Yes", "T", "True" };
     int32_t i;
-    for(i=0; i<uprv_lengthof(falseValues); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(falseValues); ++i) {
         if(FALSE!=u_getPropertyValueEnum(UCHAR_ALPHABETIC, falseValues[i])) {
             log_data_err("u_getPropertyValueEnum(UCHAR_ALPHABETIC, \"%s\")!=FALSE (Are you missing data?)\n", falseValues[i]);
         }
     }
-    for(i=0; i<uprv_lengthof(trueValues); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(trueValues); ++i) {
         if(TRUE!=u_getPropertyValueEnum(UCHAR_ALPHABETIC, trueValues[i])) {
             log_data_err("u_getPropertyValueEnum(UCHAR_ALPHABETIC, \"%s\")!=TRUE (Are you missing data?)\n", trueValues[i]);
         }
index 4fe2f9e185c42273004cc2b7d47f2baf0477f2ee..72feba8c5226d1f6e863249632fdb0c4f3074742 100644 (file)
@@ -558,31 +558,31 @@ static void TestMisc()
 
     memset(icuVersion, 0, U_MAX_VERSION_STRING_LENGTH);
 
-    testSampleCharProps(u_isspace, "u_isspace", sampleSpaces, uprv_lengthof(sampleSpaces), TRUE);
-    testSampleCharProps(u_isspace, "u_isspace", sampleNonSpaces, uprv_lengthof(sampleNonSpaces), FALSE);
+    testSampleCharProps(u_isspace, "u_isspace", sampleSpaces, UPRV_LENGTHOF(sampleSpaces), TRUE);
+    testSampleCharProps(u_isspace, "u_isspace", sampleNonSpaces, UPRV_LENGTHOF(sampleNonSpaces), FALSE);
 
     testSampleCharProps(u_isJavaSpaceChar, "u_isJavaSpaceChar",
-                        sampleSpaces, uprv_lengthof(sampleSpaces), TRUE);
+                        sampleSpaces, UPRV_LENGTHOF(sampleSpaces), TRUE);
     testSampleCharProps(u_isJavaSpaceChar, "u_isJavaSpaceChar",
-                        sampleNonSpaces, uprv_lengthof(sampleNonSpaces), FALSE);
+                        sampleNonSpaces, UPRV_LENGTHOF(sampleNonSpaces), FALSE);
 
     testSampleCharProps(u_isWhitespace, "u_isWhitespace",
-                        sampleWhiteSpaces, uprv_lengthof(sampleWhiteSpaces), TRUE);
+                        sampleWhiteSpaces, UPRV_LENGTHOF(sampleWhiteSpaces), TRUE);
     testSampleCharProps(u_isWhitespace, "u_isWhitespace",
-                        sampleNonWhiteSpaces, uprv_lengthof(sampleNonWhiteSpaces), FALSE);
+                        sampleNonWhiteSpaces, UPRV_LENGTHOF(sampleNonWhiteSpaces), FALSE);
 
     testSampleCharProps(u_isdefined, "u_isdefined",
-                        sampleDefined, uprv_lengthof(sampleDefined), TRUE);
+                        sampleDefined, UPRV_LENGTHOF(sampleDefined), TRUE);
     testSampleCharProps(u_isdefined, "u_isdefined",
-                        sampleUndefined, uprv_lengthof(sampleUndefined), FALSE);
+                        sampleUndefined, UPRV_LENGTHOF(sampleUndefined), FALSE);
 
-    testSampleCharProps(u_isbase, "u_isbase", sampleBase, uprv_lengthof(sampleBase), TRUE);
-    testSampleCharProps(u_isbase, "u_isbase", sampleNonBase, uprv_lengthof(sampleNonBase), FALSE);
+    testSampleCharProps(u_isbase, "u_isbase", sampleBase, UPRV_LENGTHOF(sampleBase), TRUE);
+    testSampleCharProps(u_isbase, "u_isbase", sampleNonBase, UPRV_LENGTHOF(sampleNonBase), FALSE);
 
-    testSampleCharProps(u_isdigit, "u_isdigit", sampleDigits, uprv_lengthof(sampleDigits), TRUE);
-    testSampleCharProps(u_isdigit, "u_isdigit", sampleNonDigits, uprv_lengthof(sampleNonDigits), FALSE);
+    testSampleCharProps(u_isdigit, "u_isdigit", sampleDigits, UPRV_LENGTHOF(sampleDigits), TRUE);
+    testSampleCharProps(u_isdigit, "u_isdigit", sampleNonDigits, UPRV_LENGTHOF(sampleNonDigits), FALSE);
 
-    for (i = 0; i < uprv_lengthof(sampleDigits); i++) {
+    for (i = 0; i < UPRV_LENGTHOF(sampleDigits); i++) {
         if (u_charDigitValue(sampleDigits[i]) != sampleDigitValues[i]) {
             log_err("error: u_charDigitValue(U+04x)=%d != %d\n",
                     sampleDigits[i], u_charDigitValue(sampleDigits[i]), sampleDigitValues[i]);
@@ -720,7 +720,7 @@ static void TestMisc()
             { 0xff3a, 37, -1 }
         };
 
-        for(i=0; i<uprv_lengthof(data); ++i) {
+        for(i=0; i<UPRV_LENGTHOF(data); ++i) {
             if(u_digit(data[i].c, data[i].radix)!=data[i].value) {
                 log_err("u_digit(U+%04x, %d)=%d expected %d\n",
                         data[i].c,
@@ -821,7 +821,7 @@ TestPOSIX() {
 
     mask=1;
     for(cl=0; cl<12; ++cl) {
-        for(i=0; i<uprv_lengthof(posixData); ++i) {
+        for(i=0; i<UPRV_LENGTHOF(posixData); ++i) {
             expect=(UBool)((posixData[i].posixResults&mask)!=0);
             if(posixClasses[cl].fn(posixData[i].c)!=expect) {
                 log_err("u_%s(U+%04x)=%s is wrong\n",
@@ -841,13 +841,13 @@ static void TestControlPrint()
     const UChar32 sampleNonPrintable[] = {0x200c, 0x009f, 0x001b};
     UChar32 c;
 
-    testSampleCharProps(u_iscntrl, "u_iscntrl", sampleControl, uprv_lengthof(sampleControl), TRUE);
-    testSampleCharProps(u_iscntrl, "u_iscntrl", sampleNonControl, uprv_lengthof(sampleNonControl), FALSE);
+    testSampleCharProps(u_iscntrl, "u_iscntrl", sampleControl, UPRV_LENGTHOF(sampleControl), TRUE);
+    testSampleCharProps(u_iscntrl, "u_iscntrl", sampleNonControl, UPRV_LENGTHOF(sampleNonControl), FALSE);
 
     testSampleCharProps(u_isprint, "u_isprint",
-                        samplePrintable, uprv_lengthof(samplePrintable), TRUE);
+                        samplePrintable, UPRV_LENGTHOF(samplePrintable), TRUE);
     testSampleCharProps(u_isprint, "u_isprint",
-                        sampleNonPrintable, uprv_lengthof(sampleNonPrintable), FALSE);
+                        sampleNonPrintable, UPRV_LENGTHOF(sampleNonPrintable), FALSE);
 
     /* test all ISO 8 controls */
     for(c=0; c<=0x9f; ++c) {
@@ -895,37 +895,37 @@ static void TestIdentifier()
     const UChar32 sampleNonIDIgnore[] = {0x0075, 0x00a3, 0x0061};
 
     testSampleCharProps(u_isJavaIDStart, "u_isJavaIDStart",
-                        sampleJavaIDStart, uprv_lengthof(sampleJavaIDStart), TRUE);
+                        sampleJavaIDStart, UPRV_LENGTHOF(sampleJavaIDStart), TRUE);
     testSampleCharProps(u_isJavaIDStart, "u_isJavaIDStart",
-                        sampleNonJavaIDStart, uprv_lengthof(sampleNonJavaIDStart), FALSE);
+                        sampleNonJavaIDStart, UPRV_LENGTHOF(sampleNonJavaIDStart), FALSE);
 
     testSampleCharProps(u_isJavaIDPart, "u_isJavaIDPart",
-                        sampleJavaIDPart, uprv_lengthof(sampleJavaIDPart), TRUE);
+                        sampleJavaIDPart, UPRV_LENGTHOF(sampleJavaIDPart), TRUE);
     testSampleCharProps(u_isJavaIDPart, "u_isJavaIDPart",
-                        sampleNonJavaIDPart, uprv_lengthof(sampleNonJavaIDPart), FALSE);
+                        sampleNonJavaIDPart, UPRV_LENGTHOF(sampleNonJavaIDPart), FALSE);
 
     /* IDPart should imply IDStart */
     testSampleCharProps(u_isJavaIDPart, "u_isJavaIDPart",
-                        sampleJavaIDStart, uprv_lengthof(sampleJavaIDStart), TRUE);
+                        sampleJavaIDStart, UPRV_LENGTHOF(sampleJavaIDStart), TRUE);
 
     testSampleCharProps(u_isIDStart, "u_isIDStart",
-                        sampleUnicodeIDStart, uprv_lengthof(sampleUnicodeIDStart), TRUE);
+                        sampleUnicodeIDStart, UPRV_LENGTHOF(sampleUnicodeIDStart), TRUE);
     testSampleCharProps(u_isIDStart, "u_isIDStart",
-                        sampleNonUnicodeIDStart, uprv_lengthof(sampleNonUnicodeIDStart), FALSE);
+                        sampleNonUnicodeIDStart, UPRV_LENGTHOF(sampleNonUnicodeIDStart), FALSE);
 
     testSampleCharProps(u_isIDPart, "u_isIDPart",
-                        sampleUnicodeIDPart, uprv_lengthof(sampleUnicodeIDPart), TRUE);
+                        sampleUnicodeIDPart, UPRV_LENGTHOF(sampleUnicodeIDPart), TRUE);
     testSampleCharProps(u_isIDPart, "u_isIDPart",
-                        sampleNonUnicodeIDPart, uprv_lengthof(sampleNonUnicodeIDPart), FALSE);
+                        sampleNonUnicodeIDPart, UPRV_LENGTHOF(sampleNonUnicodeIDPart), FALSE);
 
     /* IDPart should imply IDStart */
     testSampleCharProps(u_isIDPart, "u_isIDPart",
-                        sampleUnicodeIDStart, uprv_lengthof(sampleUnicodeIDStart), TRUE);
+                        sampleUnicodeIDStart, UPRV_LENGTHOF(sampleUnicodeIDStart), TRUE);
 
     testSampleCharProps(u_isIDIgnorable, "u_isIDIgnorable",
-                        sampleIDIgnore, uprv_lengthof(sampleIDIgnore), TRUE);
+                        sampleIDIgnore, UPRV_LENGTHOF(sampleIDIgnore), TRUE);
     testSampleCharProps(u_isIDIgnorable, "u_isIDIgnorable",
-                        sampleNonIDIgnore, uprv_lengthof(sampleNonIDIgnore), FALSE);
+                        sampleNonIDIgnore, UPRV_LENGTHOF(sampleNonIDIgnore), FALSE);
 }
 
 /* for each line of UnicodeData.txt, check some of the properties */
@@ -1187,7 +1187,7 @@ enumTypeRange(const void *context, UChar32 start, UChar32 limit, UCharCategory t
         return FALSE;
     }
 
-    count=uprv_lengthof(test);
+    count=UPRV_LENGTHOF(test);
     for(i=0; i<count; ++i) {
         if(start<=test[i][0] && test[i][0]<limit) {
             if(type!=(UCharCategory)test[i][1]) {
@@ -1276,7 +1276,7 @@ enumDefaultsRange(const void *context, UChar32 start, UChar32 limit, UCharCatego
     if(type==U_UNASSIGNED || type==U_PRIVATE_USE_CHAR) {
         /* enumerate the intersections of defaultBidi ranges with [start..limit[ */
         c=start;
-        for(i=0; i<uprv_lengthof(defaultBidi) && c<limit; ++i) {
+        for(i=0; i<UPRV_LENGTHOF(defaultBidi) && c<limit; ++i) {
             if((int32_t)c<defaultBidi[i][0]) {
                 while(c<limit && (int32_t)c<defaultBidi[i][0]) {
                     if(U_IS_UNICODE_NONCHAR(c) || u_hasBinaryProperty(c, UCHAR_DEFAULT_IGNORABLE_CODE_POINT)) {
@@ -2075,11 +2075,11 @@ TestUScriptRunAPI()
       const RunTestData *testData;
       int32_t nRuns;
     } testDataEntries[] = {
-        {testData1, uprv_lengthof(testData1)},
-        {testData2, uprv_lengthof(testData2)}
+        {testData1, UPRV_LENGTHOF(testData1)},
+        {testData2, UPRV_LENGTHOF(testData2)}
     };
     
-    static const int32_t nTestEntries = uprv_lengthof(testDataEntries);
+    static const int32_t nTestEntries = UPRV_LENGTHOF(testDataEntries);
     int32_t testEntry;
     
     for (testEntry = 0; testEntry < nTestEntries; testEntry += 1) {
@@ -2886,7 +2886,7 @@ TestNumericProperties(void) {
     UChar32 c;
     int32_t i, type;
 
-    for(i=0; i<uprv_lengthof(values); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(values); ++i) {
         c=values[i].c;
         type=u_getIntPropertyValue(c, UCHAR_NUMERIC_TYPE);
         nv=u_getNumericValue(c);
@@ -3333,7 +3333,7 @@ testFold(UChar32 c, int which,
         log_err("u_foldCase(U+%04lx, default)=U+%04lx != U+%04lx\n", (long)c, (long)c2, (long)simple);
     }
     if((which&CF_FULL)!=0) {
-        length2=u_strFoldCase(t, uprv_lengthof(t), s, length, 0, &errorCode);
+        length2=u_strFoldCase(t, UPRV_LENGTHOF(t), s, length, 0, &errorCode);
         if(length2!=fullLength || 0!=u_memcmp(t, full, fullLength)) {
             log_err("u_strFoldCase(U+%04lx, default) does not fold properly\n", (long)c);
         }
@@ -3343,7 +3343,7 @@ testFold(UChar32 c, int which,
             log_err("u_foldCase(U+%04lx, turkic)=U+%04lx != U+%04lx\n", (long)c, (long)c2, (long)simple);
         }
 
-        length2=u_strFoldCase(t, uprv_lengthof(t), s, length, U_FOLD_CASE_EXCLUDE_SPECIAL_I, &errorCode);
+        length2=u_strFoldCase(t, UPRV_LENGTHOF(t), s, length, U_FOLD_CASE_EXCLUDE_SPECIAL_I, &errorCode);
         if(length2!=turkicFullLength || 0!=u_memcmp(t, turkicFull, length2)) {
             log_err("u_strFoldCase(U+%04lx, turkic) does not fold properly\n", (long)c);
         }
index 0d2946b71cb12b0fff2680492a9b642b64ec4d43..cc6d060f1964dfab6e3756ddf63befc966841401 100644 (file)
@@ -147,20 +147,20 @@ static void Test_strToUTF32(void){
 
     /* first with length */
     u32DestLen = -2;
-    u_strToUTF32(u32Target, 0, &u32DestLen, src16, uprv_lengthof(src16),&err);
-    if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != uprv_lengthof(src32)) {
+    u_strToUTF32(u32Target, 0, &u32DestLen, src16, UPRV_LENGTHOF(src16),&err);
+    if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != UPRV_LENGTHOF(src32)) {
         log_err("u_strToUTF32(preflight with length): "
                 "length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
-                (long)u32DestLen, (long)uprv_lengthof(src32), u_errorName(err));
+                (long)u32DestLen, (long)UPRV_LENGTHOF(src32), u_errorName(err));
         return;
     }
     err = U_ZERO_ERROR; 
     u32DestLen = -2;
-    u_strToUTF32(u32Target, uprv_lengthof(src32)+1, &u32DestLen, src16, uprv_lengthof(src16),&err);
-    if(err != U_ZERO_ERROR || u32DestLen != uprv_lengthof(src32)) {
+    u_strToUTF32(u32Target, UPRV_LENGTHOF(src32)+1, &u32DestLen, src16, UPRV_LENGTHOF(src16),&err);
+    if(err != U_ZERO_ERROR || u32DestLen != UPRV_LENGTHOF(src32)) {
         log_err("u_strToUTF32(with length): "
                 "length %ld != %ld and %s != U_ZERO_ERROR\n",
-                (long)u32DestLen, (long)uprv_lengthof(src32), u_errorName(err));
+                (long)u32DestLen, (long)UPRV_LENGTHOF(src32), u_errorName(err));
         return;
     }
     /*for(i=0; i< u32DestLen; i++){
@@ -169,7 +169,7 @@ static void Test_strToUTF32(void){
             printf("\n");
         }
     }*/
-    for(i=0; i< uprv_lengthof(src32); i++){
+    for(i=0; i< UPRV_LENGTHOF(src32); i++){
         if(u32Target[i] != src32[i]){
             log_verbose("u_strToUTF32(with length) failed expected: %04X got: %04X at index: %i \n", src32[i], u32Target[i],i);
         }
@@ -181,23 +181,23 @@ static void Test_strToUTF32(void){
     /* now NUL-terminated */
     u32DestLen = -2;
     u_strToUTF32(NULL,0, &u32DestLen, src16, -1,&err);
-    if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != uprv_lengthof(src32)-1) {
+    if(err != U_BUFFER_OVERFLOW_ERROR || u32DestLen != UPRV_LENGTHOF(src32)-1) {
         log_err("u_strToUTF32(preflight with NUL-termination): "
                 "length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
-                (long)u32DestLen, (long)uprv_lengthof(src32)-1, u_errorName(err));
+                (long)u32DestLen, (long)UPRV_LENGTHOF(src32)-1, u_errorName(err));
         return;
     }
     err = U_ZERO_ERROR; 
     u32DestLen = -2;
-    u_strToUTF32(u32Target, uprv_lengthof(src32), &u32DestLen, src16, -1,&err);
-    if(err != U_ZERO_ERROR || u32DestLen != uprv_lengthof(src32)-1) {
+    u_strToUTF32(u32Target, UPRV_LENGTHOF(src32), &u32DestLen, src16, -1,&err);
+    if(err != U_ZERO_ERROR || u32DestLen != UPRV_LENGTHOF(src32)-1) {
         log_err("u_strToUTF32(with NUL-termination): "
                 "length %ld != %ld and %s != U_ZERO_ERROR\n",
-                (long)u32DestLen, (long)uprv_lengthof(src32)-1, u_errorName(err));
+                (long)u32DestLen, (long)UPRV_LENGTHOF(src32)-1, u_errorName(err));
         return;
     }
 
-    for(i=0; i< uprv_lengthof(src32); i++){
+    for(i=0; i< UPRV_LENGTHOF(src32); i++){
         if(u32Target[i] != src32[i]){
             log_verbose("u_strToUTF32(NUL-termination) failed expected: %04X got: %04X \n", src32[i], u32Target[i]);
         }
@@ -216,7 +216,7 @@ static void Test_strToUTF32_surrogates() {
     static const UChar32 expected[] = { 0x5a, 0x50000, 0x7a, 0 };
     static const UChar32 expected_FFFD[] = { 0x41, 0xfffd, 0x61, 0xfffd, 0x5a, 0x50000, 0x7a, 0 };
     static const UChar32 expected_12345[] = { 0x41, 0x12345, 0x61, 0x12345, 0x5a, 0x50000, 0x7a, 0 };
-    len16 = uprv_lengthof(surr16);
+    len16 = UPRV_LENGTHOF(surr16);
     for(i = 0; i < 4; ++i) {
         err = U_ZERO_ERROR;
         u_strToUTF32(u32Target, 0, &u32DestLen, surr16+i, len16-i, &err);
@@ -227,7 +227,7 @@ static void Test_strToUTF32_surrogates() {
         }
 
         err = U_ZERO_ERROR;
-        u_strToUTF32(u32Target, uprv_lengthof(u32Target), &u32DestLen, surr16+i, len16-i, &err);
+        u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+i, len16-i, &err);
         if(err != U_INVALID_CHAR_FOUND) {
             log_err("u_strToUTF32(surr16+%ld) sets %s != U_INVALID_CHAR_FOUND\n",
                     (long)i, u_errorName(err));
@@ -243,7 +243,7 @@ static void Test_strToUTF32_surrogates() {
         }
 
         err = U_ZERO_ERROR;
-        u_strToUTF32(u32Target, uprv_lengthof(u32Target), &u32DestLen, surr16+i, -1, &err);
+        u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+i, -1, &err);
         if(err != U_INVALID_CHAR_FOUND) {
             log_err("u_strToUTF32(surr16+%ld/NUL) sets %s != U_INVALID_CHAR_FOUND\n",
                     (long)i, u_errorName(err));
@@ -260,7 +260,7 @@ static void Test_strToUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strToUTF32(u32Target, uprv_lengthof(u32Target), &u32DestLen, surr16+4, len16-4-1, &err);
+    u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+4, len16-4-1, &err);
     if(err != U_ZERO_ERROR || u32DestLen != 3 || uprv_memcmp(u32Target, expected, 4*4)) {
         log_err("u_strToUTF32(surr16+4) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -276,7 +276,7 @@ static void Test_strToUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strToUTF32(u32Target, uprv_lengthof(u32Target), &u32DestLen, surr16+4, -1, &err);
+    u_strToUTF32(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16+4, -1, &err);
     if(err != U_ZERO_ERROR || u32DestLen != 3 || uprv_memcmp(u32Target, expected, 4*4)) {
         log_err("u_strToUTF32(surr16+4/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -294,7 +294,7 @@ static void Test_strToUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strToUTF32WithSub(u32Target, uprv_lengthof(u32Target), &u32DestLen, surr16, len16-1, 0xfffd, &numSubstitutions, &err);
+    u_strToUTF32WithSub(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16, len16-1, 0xfffd, &numSubstitutions, &err);
     if(err != U_ZERO_ERROR || u32DestLen != 7 || numSubstitutions != 2 || uprv_memcmp(u32Target, expected_FFFD, 8*4)) {
         log_err("u_strToUTF32WithSub(surr16) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -310,7 +310,7 @@ static void Test_strToUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strToUTF32WithSub(u32Target, uprv_lengthof(u32Target), &u32DestLen, surr16, -1, 0x12345, &numSubstitutions, &err);
+    u_strToUTF32WithSub(u32Target, UPRV_LENGTHOF(u32Target), &u32DestLen, surr16, -1, 0x12345, &numSubstitutions, &err);
     if(err != U_ZERO_ERROR || u32DestLen != 7 || numSubstitutions != 2 || uprv_memcmp(u32Target, expected_12345, 8*4)) {
         log_err("u_strToUTF32WithSub(surr16/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -326,20 +326,20 @@ static void Test_strFromUTF32(void){
 
     /* first with length */
     uDestLen = -2;
-    u_strFromUTF32(uTarget,0,&uDestLen,src32,uprv_lengthof(src32),&err);
-    if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != uprv_lengthof(src16)) {
+    u_strFromUTF32(uTarget,0,&uDestLen,src32,UPRV_LENGTHOF(src32),&err);
+    if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != UPRV_LENGTHOF(src16)) {
         log_err("u_strFromUTF32(preflight with length): "
                 "length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
-                (long)uDestLen, (long)uprv_lengthof(src16), u_errorName(err));
+                (long)uDestLen, (long)UPRV_LENGTHOF(src16), u_errorName(err));
         return;
     }
     err = U_ZERO_ERROR; 
     uDestLen = -2;
-    u_strFromUTF32(uTarget, uprv_lengthof(src16)+1,&uDestLen,src32,uprv_lengthof(src32),&err);
-    if(err != U_ZERO_ERROR || uDestLen != uprv_lengthof(src16)) {
+    u_strFromUTF32(uTarget, UPRV_LENGTHOF(src16)+1,&uDestLen,src32,UPRV_LENGTHOF(src32),&err);
+    if(err != U_ZERO_ERROR || uDestLen != UPRV_LENGTHOF(src16)) {
         log_err("u_strFromUTF32(with length): "
                 "length %ld != %ld and %s != U_ZERO_ERROR\n",
-                (long)uDestLen, (long)uprv_lengthof(src16), u_errorName(err));
+                (long)uDestLen, (long)UPRV_LENGTHOF(src16), u_errorName(err));
         return;
     }
     /*for(i=0; i< uDestLen; i++){
@@ -361,19 +361,19 @@ static void Test_strFromUTF32(void){
     /* now NUL-terminated */
     uDestLen = -2;
     u_strFromUTF32(NULL,0,&uDestLen,src32,-1,&err);
-    if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != uprv_lengthof(src16)-1) {
+    if(err != U_BUFFER_OVERFLOW_ERROR || uDestLen != UPRV_LENGTHOF(src16)-1) {
         log_err("u_strFromUTF32(preflight with NUL-termination): "
                 "length %ld != %ld and %s != U_BUFFER_OVERFLOW_ERROR\n",
-                (long)uDestLen, (long)uprv_lengthof(src16)-1, u_errorName(err));
+                (long)uDestLen, (long)UPRV_LENGTHOF(src16)-1, u_errorName(err));
         return;
     }
     err = U_ZERO_ERROR; 
     uDestLen = -2;
-    u_strFromUTF32(uTarget, uprv_lengthof(src16),&uDestLen,src32,-1,&err);
-    if(err != U_ZERO_ERROR || uDestLen != uprv_lengthof(src16)-1) {
+    u_strFromUTF32(uTarget, UPRV_LENGTHOF(src16),&uDestLen,src32,-1,&err);
+    if(err != U_ZERO_ERROR || uDestLen != UPRV_LENGTHOF(src16)-1) {
         log_err("u_strFromUTF32(with NUL-termination): "
                 "length %ld != %ld and %s != U_ZERO_ERROR\n",
-                (long)uDestLen, (long)uprv_lengthof(src16)-1, u_errorName(err));
+                (long)uDestLen, (long)UPRV_LENGTHOF(src16)-1, u_errorName(err));
         return;
     }
 
@@ -397,7 +397,7 @@ static void Test_strFromUTF32_surrogates() {
     static const UChar expected_FFFD[] = { 0x41, 0xfffd, 0x61, 0xfffd, 0xfffd, 0xfffd, 0x5a, 0xd900, 0xdc00, 0x7a, 0 };
     static const UChar expected_12345[] = { 0x41, 0xd808, 0xdf45, 0x61, 0xd808, 0xdf45, 0xd808, 0xdf45, 0xd808, 0xdf45,
                                             0x5a, 0xd900, 0xdc00, 0x7a, 0 };
-    len32 = uprv_lengthof(surr32);
+    len32 = UPRV_LENGTHOF(surr32);
     for(i = 0; i < 6; ++i) {
         err = U_ZERO_ERROR;
         u_strFromUTF32(uTarget, 0, &uDestLen, surr32+i, len32-i, &err);
@@ -408,7 +408,7 @@ static void Test_strFromUTF32_surrogates() {
         }
 
         err = U_ZERO_ERROR;
-        u_strFromUTF32(uTarget, uprv_lengthof(uTarget), &uDestLen, surr32+i, len32-i, &err);
+        u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+i, len32-i, &err);
         if(err != U_INVALID_CHAR_FOUND) {
             log_err("u_strFromUTF32(surr32+%ld) sets %s != U_INVALID_CHAR_FOUND\n",
                     (long)i, u_errorName(err));
@@ -424,7 +424,7 @@ static void Test_strFromUTF32_surrogates() {
         }
 
         err = U_ZERO_ERROR;
-        u_strFromUTF32(uTarget, uprv_lengthof(uTarget), &uDestLen, surr32+i, -1, &err);
+        u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+i, -1, &err);
         if(err != U_INVALID_CHAR_FOUND) {
             log_err("u_strFromUTF32(surr32+%ld/NUL) sets %s != U_INVALID_CHAR_FOUND\n",
                     (long)i, u_errorName(err));
@@ -441,7 +441,7 @@ static void Test_strFromUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strFromUTF32(uTarget, uprv_lengthof(uTarget), &uDestLen, surr32+6, len32-6-1, &err);
+    u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+6, len32-6-1, &err);
     if(err != U_ZERO_ERROR || uDestLen != 4 || u_memcmp(uTarget, expected, 5)) {
         log_err("u_strFromUTF32(surr32+6) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -457,7 +457,7 @@ static void Test_strFromUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strFromUTF32(uTarget, uprv_lengthof(uTarget), &uDestLen, surr32+6, -1, &err);
+    u_strFromUTF32(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32+6, -1, &err);
     if(err != U_ZERO_ERROR || uDestLen != 4 || u_memcmp(uTarget, expected, 5)) {
         log_err("u_strFromUTF32(surr32+6/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -475,7 +475,7 @@ static void Test_strFromUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strFromUTF32WithSub(uTarget, uprv_lengthof(uTarget), &uDestLen, surr32, len32-1, 0xfffd, &numSubstitutions, &err);
+    u_strFromUTF32WithSub(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32, len32-1, 0xfffd, &numSubstitutions, &err);
     if(err != U_ZERO_ERROR || uDestLen != 10 || numSubstitutions != 4 || u_memcmp(uTarget, expected_FFFD, 11)) {
         log_err("u_strFromUTF32WithSub(surr32) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -491,7 +491,7 @@ static void Test_strFromUTF32_surrogates() {
     }
 
     err = U_ZERO_ERROR;
-    u_strFromUTF32WithSub(uTarget, uprv_lengthof(uTarget), &uDestLen, surr32, -1, 0x12345, &numSubstitutions, &err);
+    u_strFromUTF32WithSub(uTarget, UPRV_LENGTHOF(uTarget), &uDestLen, surr32, -1, 0x12345, &numSubstitutions, &err);
     if(err != U_ZERO_ERROR || uDestLen != 14 || numSubstitutions != 4 || u_memcmp(uTarget, expected_12345, 15)) {
         log_err("u_strFromUTF32WithSub(surr32/NUL) sets %s != U_ZERO_ERROR or does not produce the expected string\n",
                 u_errorName(err));
@@ -683,10 +683,10 @@ static void Test_UChar_UTF8_API(void){
         char out8[10];
 
         if(
-            (err=U_ZERO_ERROR, u_strToUTF8(out8, uprv_lengthof(out8), NULL, withLead16, uprv_lengthof(withLead16), &err), err!=U_INVALID_CHAR_FOUND) ||
-            (err=U_ZERO_ERROR, u_strToUTF8(out8, uprv_lengthof(out8), NULL, withTrail16, -1, &err), err!=U_INVALID_CHAR_FOUND) ||
-            (err=U_ZERO_ERROR, u_strFromUTF8(out16, uprv_lengthof(out16), NULL, (const char *)withLead8, uprv_lengthof(withLead8), &err), err!=U_INVALID_CHAR_FOUND) ||
-            (err=U_ZERO_ERROR, u_strFromUTF8(out16, uprv_lengthof(out16), NULL, (const char *)withTrail8, -1, &err), err!=U_INVALID_CHAR_FOUND)
+            (err=U_ZERO_ERROR, u_strToUTF8(out8, UPRV_LENGTHOF(out8), NULL, withLead16, UPRV_LENGTHOF(withLead16), &err), err!=U_INVALID_CHAR_FOUND) ||
+            (err=U_ZERO_ERROR, u_strToUTF8(out8, UPRV_LENGTHOF(out8), NULL, withTrail16, -1, &err), err!=U_INVALID_CHAR_FOUND) ||
+            (err=U_ZERO_ERROR, u_strFromUTF8(out16, UPRV_LENGTHOF(out16), NULL, (const char *)withLead8, UPRV_LENGTHOF(withLead8), &err), err!=U_INVALID_CHAR_FOUND) ||
+            (err=U_ZERO_ERROR, u_strFromUTF8(out16, UPRV_LENGTHOF(out16), NULL, (const char *)withTrail8, -1, &err), err!=U_INVALID_CHAR_FOUND)
         ) {
             log_err("error: u_strTo/FromUTF8(string with single surrogate) fails to report error\n");
         }
@@ -698,7 +698,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out16[0]=0x55aa;
         uDestLen=0;
-        u_strFromUTF8WithSub(out16, uprv_lengthof(out16), &uDestLen,
+        u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
                              (const char *)withTrail8, uprv_strlen((const char *)withTrail8),
                              0x50005, &numSubstitutions,
                              &err);
@@ -713,7 +713,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out16[0]=0x55aa;
         uDestLen=0;
-        u_strFromUTF8WithSub(out16, uprv_lengthof(out16), &uDestLen,
+        u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
                              (const char *)withTrail8, -1,
                              0xfffd, &numSubstitutions,
                              &err);
@@ -741,7 +741,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out8[0]=(char)0xf5;
         u8DestLen=0;
-        u_strToUTF8WithSub(out8, uprv_lengthof(out8), &u8DestLen,
+        u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
                            withTrail16, u_strlen(withTrail16),
                            0xfffd, &numSubstitutions,
                            &err);
@@ -756,7 +756,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out8[0]=(char)0xf5;
         u8DestLen=0;
-        u_strToUTF8WithSub(out8, uprv_lengthof(out8), &u8DestLen,
+        u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
                            withTrail16, -1,
                            0x1a, &numSubstitutions,
                            &err);
@@ -787,7 +787,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out16[0]=0x55aa;
         uDestLen=0;
-        u_strFromUTF8WithSub(out16, uprv_lengthof(out16), &uDestLen,
+        u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
                              (const char *)withTrail8, 3,
                              0x50005, &numSubstitutions,
                              &err);
@@ -802,7 +802,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out8[0]=(char)0xf5;
         u8DestLen=0;
-        u_strToUTF8WithSub(out8, uprv_lengthof(out8), &u8DestLen,
+        u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
                            withTrail16, 1,
                            0xfffd, &numSubstitutions,
                            &err);
@@ -819,7 +819,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out16[0]=0x55aa;
         uDestLen=0;
-        u_strFromUTF8WithSub(out16, uprv_lengthof(out16), &uDestLen,
+        u_strFromUTF8WithSub(out16, UPRV_LENGTHOF(out16), &uDestLen,
                              (const char *)withTrail8, 3,
                              U_SENTINEL, &numSubstitutions,
                              &err);
@@ -834,7 +834,7 @@ static void Test_UChar_UTF8_API(void){
         numSubstitutions=-1;
         out8[0]=(char)0xf5;
         u8DestLen=0;
-        u_strToUTF8WithSub(out8, uprv_lengthof(out8), &u8DestLen,
+        u_strToUTF8WithSub(out8, UPRV_LENGTHOF(out8), &u8DestLen,
                            withTrail16, 1,
                            U_SENTINEL, &numSubstitutions,
                            &err);
@@ -852,7 +852,7 @@ static void Test_UChar_UTF8_API(void){
         static const char src[1]={ (char)0xf8 };
         UChar out16[10];
         err=U_ZERO_ERROR;
-        u_strFromUTF8(out16, uprv_lengthof(out16), NULL, src, 1, &err);
+        u_strFromUTF8(out16, UPRV_LENGTHOF(out16), NULL, src, 1, &err);
         if(err!=U_INVALID_CHAR_FOUND) {
             log_err("error: u_strFromUTF8(5-byte lead byte) failed\n");
         }
@@ -918,7 +918,7 @@ Test_FromUTF8(void) {
     errorCode=U_ZERO_ERROR;
     dest[0]=dest[1]=99;
     destLength=-99;
-    destPointer=u_strFromUTF8(dest, uprv_lengthof(dest), &destLength, (const char *)bytes, 3, &errorCode);
+    destPointer=u_strFromUTF8(dest, UPRV_LENGTHOF(dest), &destLength, (const char *)bytes, 3, &errorCode);
     if(U_FAILURE(errorCode) || destPointer!=dest || destLength!=1 || dest[0]!=0x95c || dest[1]!=0) {
         log_err("error: u_strFromUTF8(transform srcLength=3) fails: destLength=%ld - %s\n",
                 (long)destLength, u_errorName(errorCode));
@@ -1059,7 +1059,7 @@ Test_FromUTF8Lenient(void) {
         dest[0]=dest[destLength0]=0x1234;
         destLength=-1;
         errorCode=U_ZERO_ERROR;
-        pDest=u_strFromUTF8Lenient(dest, uprv_lengthof(dest), &destLength, pb, -1, &errorCode);
+        pDest=u_strFromUTF8Lenient(dest, UPRV_LENGTHOF(dest), &destLength, pb, -1, &errorCode);
         if (errorCode!=U_ZERO_ERROR ||
             pDest!=dest || dest[destLength0]!=0 ||
             destLength!=destLength0 || !equalAnyFFFD(dest, pu, destLength)
@@ -1107,7 +1107,7 @@ Test_FromUTF8Lenient(void) {
         dest[0]=dest[destLength0]=0x1234;
         destLength=-1;
         errorCode=U_ZERO_ERROR;
-        pDest=u_strFromUTF8Lenient(dest, uprv_lengthof(dest), &destLength, pb, srcLength, &errorCode);
+        pDest=u_strFromUTF8Lenient(dest, UPRV_LENGTHOF(dest), &destLength, pb, srcLength, &errorCode);
         if (errorCode!=U_ZERO_ERROR ||
             pDest!=dest || dest[destLength0]!=0 ||
             destLength!=destLength0 || !equalAnyFFFD(dest, pu, destLength)
@@ -1350,7 +1350,7 @@ static void Test_UChar_WCHART_API(void){
 
         err=U_ZERO_ERROR;
         buffer[3]=0x20ac;
-        wDestLen=u_terminateWChars(buffer, uprv_lengthof(buffer), 3, &err);
+        wDestLen=u_terminateWChars(buffer, UPRV_LENGTHOF(buffer), 3, &err);
         if(err!=U_ZERO_ERROR || wDestLen!=3 || buffer[3]!=0) {
             log_err("u_terminateWChars(buffer, all, 3, zero) failed: %s length %d [3]==U+%04x\n",
                     u_errorName(err), wDestLen, buffer[3]);
@@ -1366,7 +1366,7 @@ static void Test_UChar_WCHART_API(void){
 
         err=U_STRING_NOT_TERMINATED_WARNING;
         buffer[3]=0x20ac;
-        wDestLen=u_terminateWChars(buffer, uprv_lengthof(buffer), 3, &err);
+        wDestLen=u_terminateWChars(buffer, UPRV_LENGTHOF(buffer), 3, &err);
         if(err!=U_ZERO_ERROR || wDestLen!=3 || buffer[3]!=0) {
             log_err("u_terminateWChars(buffer, all, 3, not-terminated) failed: %s length %d [3]==U+%04x\n",
                     u_errorName(err), wDestLen, buffer[3]);
@@ -1556,9 +1556,9 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), &length,
-                              src, uprv_lengthof(src), &errorCode);
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(expected) || 0!=memcmp(dest, expected, length) ||
+        length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
         dest[length]!=0
     ) {
         log_err("u_strToJavaModifiedUTF8(normal) failed - %s\n", u_errorName(errorCode));
@@ -1567,20 +1567,20 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), NULL,
-                              src, uprv_lengthof(src), &errorCode);
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        0!=memcmp(dest, expected, uprv_lengthof(expected)) ||
-        dest[uprv_lengthof(expected)]!=0
+        0!=memcmp(dest, expected, UPRV_LENGTHOF(expected)) ||
+        dest[UPRV_LENGTHOF(expected)]!=0
     ) {
         log_err("u_strToJavaModifiedUTF8(normal, pLength=NULL) failed - %s\n", u_errorName(errorCode));
     }
     memset(dest, 0xff, sizeof(dest));
     errorCode=U_ZERO_ERROR;
     length=-5;
-    p=u_strToJavaModifiedUTF8(dest, uprv_lengthof(expected), &length,
-                              src, uprv_lengthof(src), &errorCode);
+    p=u_strToJavaModifiedUTF8(dest, UPRV_LENGTHOF(expected), &length,
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if( errorCode!=U_STRING_NOT_TERMINATED_WARNING || p!=dest ||
-        length!=uprv_lengthof(expected) || 0!=memcmp(dest, expected, length) ||
+        length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
         dest[length]!=(char)0xff
     ) {
         log_err("u_strToJavaModifiedUTF8(tight) failed - %s\n", u_errorName(errorCode));
@@ -1608,10 +1608,10 @@ static void Test_strToJavaModifiedUTF8() {
     memset(dest, 0xff, sizeof(dest));
     errorCode=U_ZERO_ERROR;
     length=-5;
-    p=u_strToJavaModifiedUTF8(dest, uprv_lengthof(expected)/2, &length,
-                              src, uprv_lengthof(src), &errorCode);
+    p=u_strToJavaModifiedUTF8(dest, UPRV_LENGTHOF(expected)/2, &length,
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
-        length!=uprv_lengthof(expected) || dest[uprv_lengthof(expected)/2]!=(char)0xff
+        length!=UPRV_LENGTHOF(expected) || dest[UPRV_LENGTHOF(expected)/2]!=(char)0xff
     ) {
         log_err("u_strToJavaModifiedUTF8(overflow) failed - %s\n", u_errorName(errorCode));
     }
@@ -1619,9 +1619,9 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(NULL, 0, &length,
-                              src, uprv_lengthof(src), &errorCode);
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
-        length!=uprv_lengthof(expected) || dest[0]!=(char)0xff
+        length!=UPRV_LENGTHOF(expected) || dest[0]!=(char)0xff
     ) {
         log_err("u_strToJavaModifiedUTF8(pure preflighting) failed - %s\n", u_errorName(errorCode));
     }
@@ -1629,9 +1629,9 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), &length,
-                              shortSrc, uprv_lengthof(shortSrc), &errorCode);
+                              shortSrc, UPRV_LENGTHOF(shortSrc), &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
+        length!=UPRV_LENGTHOF(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
         dest[length]!=0
     ) {
         log_err("u_strToJavaModifiedUTF8(short) failed - %s\n", u_errorName(errorCode));
@@ -1642,7 +1642,7 @@ static void Test_strToJavaModifiedUTF8() {
     p=u_strToJavaModifiedUTF8(dest, (int32_t)sizeof(dest), &length,
                               asciiNul, -1, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
+        length!=UPRV_LENGTHOF(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
         dest[length]!=0
     ) {
         log_err("u_strToJavaModifiedUTF8(asciiNul) failed - %s\n", u_errorName(errorCode));
@@ -1663,7 +1663,7 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(NULL, sizeof(dest), &length,
-                              src, uprv_lengthof(src), &errorCode);
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=(char)0xff) {
         log_err("u_strToJavaModifiedUTF8(dest=NULL) failed - %s\n", u_errorName(errorCode));
     }
@@ -1671,7 +1671,7 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(dest, -1, &length,
-                              src, uprv_lengthof(src), &errorCode);
+                              src, UPRV_LENGTHOF(src), &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=(char)0xff) {
         log_err("u_strToJavaModifiedUTF8(destCapacity<0) failed - %s\n", u_errorName(errorCode));
     }
@@ -1679,7 +1679,7 @@ static void Test_strToJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=-5;
     p=u_strToJavaModifiedUTF8(dest, sizeof(dest), &length,
-                              NULL, uprv_lengthof(src), &errorCode);
+                              NULL, UPRV_LENGTHOF(src), &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=(char)0xff) {
         log_err("u_strToJavaModifiedUTF8(src=NULL) failed - %s\n", u_errorName(errorCode));
     }
@@ -1747,12 +1747,12 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(expected) || 0!=memcmp(dest, expected, length) ||
+        length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
         dest[length]!=0 ||
-        numSubstitutions!=uprv_lengthof(invalidExpectedFFFD)
+        numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(normal) failed - %s\n", u_errorName(errorCode));
     }
@@ -1760,12 +1760,12 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), NULL,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        0!=memcmp(dest, expected, uprv_lengthof(expected)) ||
-        dest[uprv_lengthof(expected)]!=0 ||
-        numSubstitutions!=uprv_lengthof(invalidExpectedFFFD)
+        0!=memcmp(dest, expected, UPRV_LENGTHOF(expected)) ||
+        dest[UPRV_LENGTHOF(expected)]!=0 ||
+        numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(normal, pLength=NULL) failed - %s\n", u_errorName(errorCode));
     }
@@ -1773,10 +1773,10 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, NULL, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(expected) || 0!=memcmp(dest, expected, length) ||
+        length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
         dest[length]!=0
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(normal, pNumSubstitutions=NULL) failed - %s\n", u_errorName(errorCode));
@@ -1784,13 +1784,13 @@ static void Test_strFromJavaModifiedUTF8() {
     memset(dest, 0xff, sizeof(dest));
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
-    p=u_strFromJavaModifiedUTF8WithSub(dest, uprv_lengthof(expected), &length,
-                                       (const char *)src, uprv_lengthof(src),
+    p=u_strFromJavaModifiedUTF8WithSub(dest, UPRV_LENGTHOF(expected), &length,
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( errorCode!=U_STRING_NOT_TERMINATED_WARNING || p!=dest ||
-        length!=uprv_lengthof(expected) || 0!=memcmp(dest, expected, length) ||
+        length!=UPRV_LENGTHOF(expected) || 0!=memcmp(dest, expected, length) ||
         dest[length]!=0xffff ||
-        numSubstitutions!=uprv_lengthof(invalidExpectedFFFD)
+        numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(tight) failed - %s\n", u_errorName(errorCode));
     }
@@ -1835,11 +1835,11 @@ static void Test_strFromJavaModifiedUTF8() {
     memset(dest, 0xff, sizeof(dest));
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
-    p=u_strFromJavaModifiedUTF8WithSub(dest, uprv_lengthof(expected)/2, &length,
-                                       (const char *)src, uprv_lengthof(src),
+    p=u_strFromJavaModifiedUTF8WithSub(dest, UPRV_LENGTHOF(expected)/2, &length,
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
-        length!=uprv_lengthof(expected) || dest[uprv_lengthof(expected)/2]!=0xffff
+        length!=UPRV_LENGTHOF(expected) || dest[UPRV_LENGTHOF(expected)/2]!=0xffff
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(overflow) failed - %s\n", u_errorName(errorCode));
     }
@@ -1847,10 +1847,10 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(NULL, 0, &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( errorCode!=U_BUFFER_OVERFLOW_ERROR ||
-        length!=uprv_lengthof(expected) || dest[0]!=0xffff
+        length!=UPRV_LENGTHOF(expected) || dest[0]!=0xffff
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(pure preflighting) failed - %s\n", u_errorName(errorCode));
     }
@@ -1858,10 +1858,10 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)shortSrc, uprv_lengthof(shortSrc),
+                                       (const char *)shortSrc, UPRV_LENGTHOF(shortSrc),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
+        length!=UPRV_LENGTHOF(shortExpected) || 0!=memcmp(dest, shortExpected, length) ||
         dest[length]!=0 ||
         numSubstitutions!=0
     ) {
@@ -1874,7 +1874,7 @@ static void Test_strFromJavaModifiedUTF8() {
                                        (const char *)asciiNul, -1,
                                        0xfffd, &numSubstitutions, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
+        length!=UPRV_LENGTHOF(asciiNulExpected) || 0!=memcmp(dest, asciiNulExpected, length) ||
         dest[length]!=0 ||
         numSubstitutions!=0
     ) {
@@ -1895,12 +1895,12 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)invalid, uprv_lengthof(invalid),
+                                       (const char *)invalid, UPRV_LENGTHOF(invalid),
                                        0xfffd, &numSubstitutions, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(invalidExpectedFFFD) || 0!=memcmp(dest, invalidExpectedFFFD, length) ||
+        length!=UPRV_LENGTHOF(invalidExpectedFFFD) || 0!=memcmp(dest, invalidExpectedFFFD, length) ||
         dest[length]!=0 ||
-        numSubstitutions!=uprv_lengthof(invalidExpectedFFFD)
+        numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(invalid->fffd) failed - %s\n", u_errorName(errorCode));
     }
@@ -1908,12 +1908,12 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)invalid, uprv_lengthof(invalid),
+                                       (const char *)invalid, UPRV_LENGTHOF(invalid),
                                        0x50000, &numSubstitutions, &errorCode);
     if( U_FAILURE(errorCode) || p!=dest ||
-        length!=uprv_lengthof(invalidExpected50000) || 0!=memcmp(dest, invalidExpected50000, length) ||
+        length!=UPRV_LENGTHOF(invalidExpected50000) || 0!=memcmp(dest, invalidExpected50000, length) ||
         dest[length]!=0 ||
-        numSubstitutions!=uprv_lengthof(invalidExpectedFFFD)  /* not ...50000 */
+        numSubstitutions!=UPRV_LENGTHOF(invalidExpectedFFFD)  /* not ...50000 */
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(invalid->50000) failed - %s\n", u_errorName(errorCode));
     }
@@ -1921,7 +1921,7 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)invalid, uprv_lengthof(invalid),
+                                       (const char *)invalid, UPRV_LENGTHOF(invalid),
                                        U_SENTINEL, &numSubstitutions, &errorCode);
     if(errorCode!=U_INVALID_CHAR_FOUND || dest[0]!=0xffff || numSubstitutions!=0) {
         log_err("u_strFromJavaModifiedUTF8WithSub(invalid->error) failed - %s\n", u_errorName(errorCode));
@@ -1930,10 +1930,10 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, (int32_t)sizeof(dest), &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        U_SENTINEL, &numSubstitutions, &errorCode);
     if( errorCode!=U_INVALID_CHAR_FOUND ||
-        length>=uprv_lengthof(expected) || dest[uprv_lengthof(expected)-1]!=0xffff ||
+        length>=UPRV_LENGTHOF(expected) || dest[UPRV_LENGTHOF(expected)-1]!=0xffff ||
         numSubstitutions!=0
     ) {
         log_err("u_strFromJavaModifiedUTF8WithSub(normal->error) failed - %s\n", u_errorName(errorCode));
@@ -1944,7 +1944,7 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(NULL, sizeof(dest), &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
         log_err("u_strFromJavaModifiedUTF8WithSub(dest=NULL) failed - %s\n", u_errorName(errorCode));
@@ -1953,7 +1953,7 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, -1, &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
         log_err("u_strFromJavaModifiedUTF8WithSub(destCapacity<0) failed - %s\n", u_errorName(errorCode));
@@ -1962,7 +1962,7 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, sizeof(dest), &length,
-                                       NULL, uprv_lengthof(src),
+                                       NULL, UPRV_LENGTHOF(src),
                                        0xfffd, &numSubstitutions, &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
         log_err("u_strFromJavaModifiedUTF8WithSub(src=NULL) failed - %s\n", u_errorName(errorCode));
@@ -1979,7 +1979,7 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, sizeof(dest), &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0x110000, &numSubstitutions, &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
         log_err("u_strFromJavaModifiedUTF8WithSub(subchar=U_SENTINEL) failed - %s\n", u_errorName(errorCode));
@@ -1988,7 +1988,7 @@ static void Test_strFromJavaModifiedUTF8() {
     errorCode=U_ZERO_ERROR;
     length=numSubstitutions=-5;
     p=u_strFromJavaModifiedUTF8WithSub(dest, sizeof(dest), &length,
-                                       (const char *)src, uprv_lengthof(src),
+                                       (const char *)src, UPRV_LENGTHOF(src),
                                        0xdfff, &numSubstitutions, &errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || dest[0]!=0xffff) {
         log_err("u_strFromJavaModifiedUTF8WithSub(subchar is surrogate) failed - %s\n", u_errorName(errorCode));
@@ -2012,7 +2012,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromUTF8(dest16, uprv_lengthof(dest16), &length, NULL, 0, &errorCode);
+    u_strFromUTF8(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromUTF8(source=NULL, sourceLength=0) failed\n");
     }
@@ -2020,7 +2020,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromUTF8WithSub(dest16, uprv_lengthof(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+    u_strFromUTF8WithSub(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromUTF8WithSub(source=NULL, sourceLength=0) failed\n");
     }
@@ -2028,7 +2028,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromUTF8Lenient(dest16, uprv_lengthof(dest16), &length, NULL, 0, &errorCode);
+    u_strFromUTF8Lenient(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromUTF8Lenient(source=NULL, sourceLength=0) failed\n");
     }
@@ -2036,7 +2036,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromUTF32(dest16, uprv_lengthof(dest16), &length, NULL, 0, &errorCode);
+    u_strFromUTF32(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromUTF32(source=NULL, sourceLength=0) failed\n");
     }
@@ -2044,7 +2044,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromUTF32WithSub(dest16, uprv_lengthof(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+    u_strFromUTF32WithSub(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromUTF32WithSub(source=NULL, sourceLength=0) failed\n");
     }
@@ -2052,7 +2052,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromJavaModifiedUTF8WithSub(dest16, uprv_lengthof(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+    u_strFromJavaModifiedUTF8WithSub(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, 0xfffd, NULL, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromJavaModifiedUTF8WithSub(source=NULL, sourceLength=0) failed\n");
     }
@@ -2062,7 +2062,7 @@ static void TestNullEmptySource() {
     dest8[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strToUTF8(dest8, uprv_lengthof(dest8), &length, NULL, 0, &errorCode);
+    u_strToUTF8(dest8, UPRV_LENGTHOF(dest8), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest8[0]!=0 || dest8[1]!=3) {
         log_err("u_strToUTF8(source=NULL, sourceLength=0) failed\n");
     }
@@ -2070,7 +2070,7 @@ static void TestNullEmptySource() {
     dest8[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strToUTF8WithSub(dest8, uprv_lengthof(dest8), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+    u_strToUTF8WithSub(dest8, UPRV_LENGTHOF(dest8), &length, NULL, 0, 0xfffd, NULL, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest8[0]!=0 || dest8[1]!=3) {
         log_err("u_strToUTF8(source=NULL, sourceLength=0) failed\n");
     }
@@ -2078,7 +2078,7 @@ static void TestNullEmptySource() {
     dest32[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strToUTF32(dest32, uprv_lengthof(dest32), &length, NULL, 0, &errorCode);
+    u_strToUTF32(dest32, UPRV_LENGTHOF(dest32), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest32[0]!=0 || dest32[1]!=3) {
         log_err("u_strToUTF32(source=NULL, sourceLength=0) failed\n");
     }
@@ -2086,7 +2086,7 @@ static void TestNullEmptySource() {
     dest32[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strToUTF32WithSub(dest32, uprv_lengthof(dest32), &length, NULL, 0, 0xfffd, NULL, &errorCode);
+    u_strToUTF32WithSub(dest32, UPRV_LENGTHOF(dest32), &length, NULL, 0, 0xfffd, NULL, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest32[0]!=0 || dest32[1]!=3) {
         log_err("u_strToUTF32WithSub(source=NULL, sourceLength=0) failed\n");
     }
@@ -2094,7 +2094,7 @@ static void TestNullEmptySource() {
     dest8[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strToJavaModifiedUTF8(dest8, uprv_lengthof(dest8), &length, NULL, 0, &errorCode);
+    u_strToJavaModifiedUTF8(dest8, UPRV_LENGTHOF(dest8), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest8[0]!=0 || dest8[1]!=3) {
         log_err("u_strToJavaModifiedUTF8(source=NULL, sourceLength=0) failed\n");
     }
@@ -2104,7 +2104,7 @@ static void TestNullEmptySource() {
     dest16[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strFromWCS(dest16, uprv_lengthof(dest16), &length, NULL, 0, &errorCode);
+    u_strFromWCS(dest16, UPRV_LENGTHOF(dest16), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || dest16[0]!=0 || dest16[1]!=3) {
         log_err("u_strFromWCS(source=NULL, sourceLength=0) failed\n");
     }
@@ -2112,7 +2112,7 @@ static void TestNullEmptySource() {
     destW[0]=3;
     length=3;
     errorCode=U_ZERO_ERROR;
-    u_strToWCS(destW, uprv_lengthof(destW), &length, NULL, 0, &errorCode);
+    u_strToWCS(destW, UPRV_LENGTHOF(destW), &length, NULL, 0, &errorCode);
     if(errorCode!=U_ZERO_ERROR || length!=0 || destW[0]!=0 || destW[1]!=3) {
         log_err("u_strToWCS(source=NULL, sourceLength=0) failed\n");
     }
index 09265ca921d69ebf0f88d142dbc4faeb1d0b0ff2..fe84080afb0a09dd04f6dc4bf2b5e8f7333710b8 100644 (file)
@@ -718,12 +718,12 @@ TestSurrogateSearching() {
     if(
         first!=u_strchr(s, nul) ||
         first!=u_strchr32(s, nul) ||
-        first!=u_memchr(s, nul, uprv_lengthof(s)) ||
-        first!=u_memchr32(s, nul, uprv_lengthof(s)) ||
+        first!=u_memchr(s, nul, UPRV_LENGTHOF(s)) ||
+        first!=u_memchr32(s, nul, UPRV_LENGTHOF(s)) ||
         first!=u_strrchr(s, nul) ||
         first!=u_strrchr32(s, nul) ||
-        first!=u_memrchr(s, nul, uprv_lengthof(s)) ||
-        first!=u_memrchr32(s, nul, uprv_lengthof(s))
+        first!=u_memrchr(s, nul, UPRV_LENGTHOF(s)) ||
+        first!=u_memrchr32(s, nul, UPRV_LENGTHOF(s))
     ) {
         log_err("error: one of the u_str[|mem][r]chr[32](s, nul) does not find the terminator of s\n");
     }
@@ -733,13 +733,13 @@ TestSurrogateSearching() {
         s!=u_strstr(s, &nul) ||
         s!=u_strFindFirst(s, -1, &nul, -1) ||
         s!=u_strFindFirst(s, -1, &nul, 0) ||
-        s!=u_strFindFirst(s, uprv_lengthof(s), &nul, -1) ||
-        s!=u_strFindFirst(s, uprv_lengthof(s), &nul, 0) ||
+        s!=u_strFindFirst(s, UPRV_LENGTHOF(s), &nul, -1) ||
+        s!=u_strFindFirst(s, UPRV_LENGTHOF(s), &nul, 0) ||
         s!=u_strrstr(s, &nul) ||
         s!=u_strFindLast(s, -1, &nul, -1) ||
         s!=u_strFindLast(s, -1, &nul, 0) ||
-        s!=u_strFindLast(s, uprv_lengthof(s), &nul, -1) ||
-        s!=u_strFindLast(s, uprv_lengthof(s), &nul, 0)
+        s!=u_strFindLast(s, UPRV_LENGTHOF(s), &nul, -1) ||
+        s!=u_strFindLast(s, UPRV_LENGTHOF(s), &nul, 0)
     ) {
         log_err("error: one of the u_str[str etc](s, \"\") does not find s itself\n");
     }
@@ -1143,7 +1143,7 @@ TestCountChar32() {
     int32_t i, length, number;
 
     /* test u_strHasMoreChar32Than() with length>=0 */
-    length=uprv_lengthof(string);
+    length=UPRV_LENGTHOF(string);
     while(length>=0) {
         for(i=0; i<=length; ++i) {
             for(number=-1; number<=((length-i)+2); ++number) {
@@ -1154,7 +1154,7 @@ TestCountChar32() {
     }
 
     /* test u_strHasMoreChar32Than() with NUL-termination (length=-1) */
-    length=uprv_lengthof(string);
+    length=UPRV_LENGTHOF(string);
     u_memcpy(buffer, string, length);
     while(length>=0) {
         buffer[length]=0;
@@ -1453,7 +1453,7 @@ TestUCharIterator() {
     }
 
     /* test get/set state */
-    length=uprv_lengthof(text)-1;
+    length=UPRV_LENGTHOF(text)-1;
     uiter_setString(&iter1, text, -1);
     uiter_setString(&iter2, text, length);
     testIteratorState(&iter1, &iter2, "UTF16IteratorState", length/2);
@@ -1476,7 +1476,7 @@ TestUCharIterator() {
     compareIterators(&iter1, "UTF16Iterator", &iter2, "UTF8Iterator_1");
 
     /* test get/set state */
-    length=uprv_lengthof(text)-1;
+    length=UPRV_LENGTHOF(text)-1;
     uiter_setUTF8(&iter1, bytes, -1);
     testIteratorState(&iter1, &iter2, "UTF8IteratorState", length/2);
     testIteratorState(&iter1, &iter2, "UTF8IteratorStatePlus1", length/2+1);
index eb087193c58f1028fa0199cb6ae99dcacc7b01b2..b45819afcc9060f00107d93bb8b190ae5c039eac 100644 (file)
@@ -721,8 +721,8 @@ static void TestLength(){
                         0xFE0F, 0xFEFF, 0x0000
                       };
 
-        int32_t len1 = uprv_lengthof(ul1)-1/*remove the null termination*/;
-        int32_t destLen = uprv_lengthof(dest);
+        int32_t len1 = UPRV_LENGTHOF(ul1)-1/*remove the null termination*/;
+        int32_t destLen = UPRV_LENGTHOF(dest);
         UErrorCode status = U_ZERO_ERROR;
         UParseError ps;
         int32_t len = (int32_t)strlen(cl);
@@ -733,14 +733,14 @@ static void TestLength(){
         }
 
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len = -1;
         destLen = uidna_toUnicode(ul, len, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_ZERO_ERROR){
             log_err_status(status, "uidna_toUnicode failed with error %s.\n", u_errorName(status));
         }
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len = (int32_t)strlen(cl);
         destLen = uidna_toASCII(ul, len, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_IDNA_LABEL_TOO_LONG_ERROR){
@@ -748,7 +748,7 @@ static void TestLength(){
         }
         
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len = -1;
         destLen = uidna_toASCII(ul, len, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_IDNA_LABEL_TOO_LONG_ERROR){
@@ -756,14 +756,14 @@ static void TestLength(){
         }
 
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         destLen = uidna_toASCII(ul1, len1, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_ZERO_ERROR){
             log_err_status(status, "uidna_toASCII failed with error %s.\n", u_errorName(status));
         }
         
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len1 = -1;
         destLen = uidna_toASCII(ul1, len1, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_ZERO_ERROR){
@@ -774,7 +774,7 @@ static void TestLength(){
         static const char* cl = "my_very_very_long_and_incredibly_uncreative_domain_label.my_very_very_long_and_incredibly_uncreative_domain_label.my_very_very_long_and_incredibly_uncreative_domain_label.my_very_very_long_and_incredibly_uncreative_domain_label.my_very_very_long_and_incredibly_uncreative_domain_label.my_very_very_long_and_incredibly_uncreative_domain_label.ibm.com";
         UChar ul[400] = {'\0'};
         UChar dest[400] = {'\0'};
-        int32_t destLen = uprv_lengthof(dest);
+        int32_t destLen = UPRV_LENGTHOF(dest);
         UErrorCode status = U_ZERO_ERROR;
         UParseError ps;
         int32_t len = (int32_t)strlen(cl);
@@ -786,7 +786,7 @@ static void TestLength(){
         }
         
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len = -1;
         destLen = uidna_IDNToUnicode(ul, len, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR){
@@ -794,7 +794,7 @@ static void TestLength(){
         }
         
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len = (int32_t)strlen(cl);
         destLen = uidna_IDNToASCII(ul, len, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR){
@@ -802,7 +802,7 @@ static void TestLength(){
         }
         
         status = U_ZERO_ERROR;
-        destLen = uprv_lengthof(dest);
+        destLen = UPRV_LENGTHOF(dest);
         len = -1;
         destLen = uidna_IDNToASCII(ul, len, dest, destLen, UIDNA_DEFAULT, &ps, &status);
         if(status != U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR){
@@ -879,7 +879,7 @@ static void TestUTS46() {
 
     /* These calls should succeed. */
     length = uidna_labelToASCII(uts46, fA_sharps16, -1,
-                                dest16, uprv_lengthof(dest16), &info, &errorCode);
+                                dest16, UPRV_LENGTHOF(dest16), &info, &errorCode);
     if( U_FAILURE(errorCode) || length != 4 || 0 != u_memcmp(dest16, fass16, 5) ||
         !info.isTransitionalDifferent || info.errors != 0
     ) {
@@ -887,7 +887,7 @@ static void TestUTS46() {
     }
     errorCode = U_ZERO_ERROR;
     length = uidna_labelToUnicode(uts46, fA_sharps16, u_strlen(fA_sharps16),
-                                  dest16, uprv_lengthof(dest16), &info, &errorCode);
+                                  dest16, UPRV_LENGTHOF(dest16), &info, &errorCode);
     if( U_FAILURE(errorCode) || length != 3 || 0 != u_memcmp(dest16, fa_sharps16, 4) ||
         !info.isTransitionalDifferent || info.errors != 0
     ) {
@@ -914,7 +914,7 @@ static void TestUTS46() {
 
     errorCode = U_ZERO_ERROR;
     length = uidna_labelToASCII_UTF8(uts46, fA_sharps8, -1,
-                                     dest8, uprv_lengthof(dest8), &info, &errorCode);
+                                     dest8, UPRV_LENGTHOF(dest8), &info, &errorCode);
     if( U_FAILURE(errorCode) || length != 4 || 0 != memcmp(dest8, fass8, 5) ||
         !info.isTransitionalDifferent || info.errors != 0
     ) {
@@ -922,7 +922,7 @@ static void TestUTS46() {
     }
     errorCode = U_ZERO_ERROR;
     length = uidna_labelToUnicodeUTF8(uts46, fA_sharps8, strlen(fA_sharps8),
-                                      dest8, uprv_lengthof(dest8), &info, &errorCode);
+                                      dest8, UPRV_LENGTHOF(dest8), &info, &errorCode);
     if( U_FAILURE(errorCode) || length != 4 || 0 != memcmp(dest8, fa_sharps8, 5) ||
         !info.isTransitionalDifferent || info.errors != 0
     ) {
@@ -969,13 +969,13 @@ static void TestUTS46() {
     /* These calls should fail. */
     errorCode = U_USELESS_COLLATOR_ERROR;
     length = uidna_labelToASCII(uts46, fA_sharps16, -1,
-                                dest16, uprv_lengthof(dest16), &info, &errorCode);
+                                dest16, UPRV_LENGTHOF(dest16), &info, &errorCode);
     if(errorCode != U_USELESS_COLLATOR_ERROR) {
         log_err("uidna_labelToASCII(failure) failed: %s\n", u_errorName(errorCode));
     }
     errorCode = U_ZERO_ERROR;
     length = uidna_labelToUnicode(uts46, fA_sharps16, u_strlen(fA_sharps16),
-                                  dest16, uprv_lengthof(dest16), NULL, &errorCode);
+                                  dest16, UPRV_LENGTHOF(dest16), NULL, &errorCode);
     if(errorCode != U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("uidna_labelToUnicode(UIDNAInfo=NULL) failed: %s\n", u_errorName(errorCode));
     }
@@ -994,7 +994,7 @@ static void TestUTS46() {
 
     errorCode = U_ZERO_ERROR;
     length = uidna_labelToASCII_UTF8(uts46, fA_sharps8, -1,
-                                     NULL, uprv_lengthof(dest8), &info, &errorCode);
+                                     NULL, UPRV_LENGTHOF(dest8), &info, &errorCode);
     if(errorCode != U_ILLEGAL_ARGUMENT_ERROR) {
         log_err("uidna_labelToASCII_UTF8(dest=NULL) failed: %s\n", u_errorName(errorCode));
     }
index cb08a51e028160ef885d7a8c5745af817a84bc26..210784b4987c5ba9e0bfd349559d3251ef484c55 100644 (file)
@@ -1792,7 +1792,7 @@ doTestTruncated(const char *cnvName, const uint8_t *bytes, int32_t length) {
     source=(const char *)bytes;
     sourceLimit=source+length;
     target=buffer;
-    targetLimit=buffer+uprv_lengthof(buffer);
+    targetLimit=buffer+UPRV_LENGTHOF(buffer);
 
     /* 1. input bytes with flush=FALSE, then input nothing with flush=TRUE */
     ucnv_toUnicode(cnv, &target, targetLimit, &source, sourceLimit, NULL, FALSE, &errorCode);
@@ -1866,7 +1866,7 @@ TestTruncated() {
     };
     int32_t i;
 
-    for(i=0; i<uprv_lengthof(testCases); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testCases); ++i) {
         doTestTruncated(testCases[i].cnvName, testCases[i].bytes, testCases[i].length);
     }
 }
@@ -1961,7 +1961,7 @@ TestUnicodeSet() {
     }
 
     /* test converters that are known to convert all of Unicode (except maybe for surrogates) */
-    for(i=0; i<uprv_lengthof(completeSetNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(completeSetNames); ++i) {
         errorCode=U_ZERO_ERROR;
         name=completeSetNames[i];
         cnv=ucnv_open(name, &errorCode);
@@ -1985,7 +1985,7 @@ TestUnicodeSet() {
 
 #if !UCONFIG_NO_LEGACY_CONVERSION
     /* test LMBCS variants which convert all of Unicode except for U+F6xx */
-    for(i=0; i<uprv_lengthof(lmbcsNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(lmbcsNames); ++i) {
         errorCode=U_ZERO_ERROR;
         name=lmbcsNames[i];
         cnv=ucnv_open(name, &errorCode);
@@ -2009,7 +2009,7 @@ TestUnicodeSet() {
 #endif
 
     /* test specific sets */
-    for(i=0; i<uprv_lengthof(nameRanges); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(nameRanges); ++i) {
         errorCode=U_ZERO_ERROR;
         name=nameRanges[i].name;
         cnv=ucnv_open(name, &errorCode);
index adeb206ce34660074fc4a57365302876b299cb4d..b5b0d40d23f5024378b50653afa57cc8e0d96c24 100644 (file)
@@ -195,7 +195,7 @@ getPrefixSuffix(const char *src, int32_t srcLength,
     *prefixLen = i;
     *suffixLen = srcLength - i;
     /* special prefixes must not be followed by suffixes! */
-    if((findStringIndex(special_prefixes,uprv_lengthof(special_prefixes), *prefix, *prefixLen-1) != -1) && (*suffix != NULL)){
+    if((findStringIndex(special_prefixes,UPRV_LENGTHOF(special_prefixes), *prefix, *prefixLen-1) != -1) && (*suffix != NULL)){
         *status = U_PARSE_ERROR;
         return;
     }
index 579322890466c86f6bf88479c6fad09bb3988689..5398cdeda68de0eb16987ad3484c4850b8b0b474 100644 (file)
@@ -5573,7 +5573,7 @@ TestIsFixedWidth() {
             "UTF16"
     };
 
-    for (i = 0; i < uprv_lengthof(fixedWidth); i++) {
+    for (i = 0; i < UPRV_LENGTHOF(fixedWidth); i++) {
         cnv = ucnv_open(fixedWidth[i], &status);
         if (cnv == NULL || U_FAILURE(status)) {
             log_data_err("Error open converter: %s - %s \n", fixedWidth[i], u_errorName(status));
@@ -5586,7 +5586,7 @@ TestIsFixedWidth() {
         ucnv_close(cnv);
     }
 
-    for (i = 0; i < uprv_lengthof(notFixedWidth); i++) {
+    for (i = 0; i < UPRV_LENGTHOF(notFixedWidth); i++) {
         cnv = ucnv_open(notFixedWidth[i], &status);
         if (cnv == NULL || U_FAILURE(status)) {
             log_data_err("Error open converter: %s - %s \n", notFixedWidth[i], u_errorName(status));
index d8f6ab5258716785de8d530b71b1af0ae7d5f014..f25c2acb1f77b6b6e68047e592a19baa112d4a62 100644 (file)
@@ -37,12 +37,12 @@ SortTest() {
 
     /* sort small array (stable) */
     errorCode=U_ZERO_ERROR;
-    uprv_sortArray(small, uprv_lengthof(small), sizeof(small[0]), uprv_uint16Comparator, NULL, TRUE, &errorCode);
+    uprv_sortArray(small, UPRV_LENGTHOF(small), sizeof(small[0]), uprv_uint16Comparator, NULL, TRUE, &errorCode);
     if(U_FAILURE(errorCode)) {
         log_err("uprv_sortArray(small) failed - %s\n", u_errorName(errorCode));
         return;
     }
-    for(i=1; i<uprv_lengthof(small); ++i) {
+    for(i=1; i<UPRV_LENGTHOF(small); ++i) {
         if(small[i-1]>small[i]) {
             log_err("uprv_sortArray(small) mis-sorted [%d]=%u > [%d]=%u\n", i-1, small[i-1], i, small[i]);
             return;
@@ -50,17 +50,17 @@ SortTest() {
     }
 
     /* for medium, add bits that will not be compared, to test stability */
-    for(i=0; i<uprv_lengthof(medium); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(medium); ++i) {
         medium[i]=(medium[i]<<4)|i;
     }
 
     /* sort medium array (stable) */
-    uprv_sortArray(medium, uprv_lengthof(medium), sizeof(medium[0]), uprv_int32Comparator, NULL, TRUE, &errorCode);
+    uprv_sortArray(medium, UPRV_LENGTHOF(medium), sizeof(medium[0]), uprv_int32Comparator, NULL, TRUE, &errorCode);
     if(U_FAILURE(errorCode)) {
         log_err("uprv_sortArray(medium) failed - %s\n", u_errorName(errorCode));
         return;
     }
-    for(i=1; i<uprv_lengthof(medium); ++i) {
+    for(i=1; i<UPRV_LENGTHOF(medium); ++i) {
         if(medium[i-1]>=medium[i]) {
             log_err("uprv_sortArray(medium) mis-sorted [%d]=%u > [%d]=%u\n", i-1, medium[i-1], i, medium[i]);
             return;
@@ -69,12 +69,12 @@ SortTest() {
 
     /* sort large array (not stable) */
     errorCode=U_ZERO_ERROR;
-    uprv_sortArray(large, uprv_lengthof(large), sizeof(large[0]), uprv_uint32Comparator, NULL, FALSE, &errorCode);
+    uprv_sortArray(large, UPRV_LENGTHOF(large), sizeof(large[0]), uprv_uint32Comparator, NULL, FALSE, &errorCode);
     if(U_FAILURE(errorCode)) {
         log_err("uprv_sortArray(large) failed - %s\n", u_errorName(errorCode));
         return;
     }
-    for(i=1; i<uprv_lengthof(large); ++i) {
+    for(i=1; i<UPRV_LENGTHOF(large); ++i) {
         if(large[i-1]>large[i]) {
             log_err("uprv_sortArray(large) mis-sorted [%d]=%u > [%d]=%u\n", i-1, large[i-1], i, large[i]);
             return;
index 9bd6f1dc0c62eb1e5918e1431239b5d7c6ddf5bd..92d483809aa5571d9168b1521fc18428948320cb 100644 (file)
@@ -441,7 +441,7 @@ Test_nfs4_mixed_prep(void){
         char src[MAX_BUFFER_SIZE];
         int32_t srcLen;
 
-        for(i=0; i< uprv_lengthof(mixed_prep_data); i++){
+        for(i=0; i< UPRV_LENGTHOF(mixed_prep_data); i++){
             int32_t destLen=0;
             char* dest = NULL;
             UErrorCode status = U_ZERO_ERROR;
@@ -758,7 +758,7 @@ static void TestStringPrepProfiles(void) {
     int32_t i, testNum = 0;
     UStringPrepProfile *sprep = NULL;
     
-    for (i = 0; i < uprv_lengthof(profile_test_case); i++) {
+    for (i = 0; i < UPRV_LENGTHOF(profile_test_case); i++) {
         if (uprv_strstr(profile_test_case[i], "RFC")) {
             if (sprep != NULL) {
                 usprep_close(sprep);
index 126892d9d5010fd3d1707b48553ed2ed7616a08b..f32e690f93475f969b2a45afef73b545c3ecfe15 100644 (file)
@@ -1032,32 +1032,32 @@ checkRangesSingleValue[]={
 static void
 TrieTest(void) {
     testTrieRanges("set1", FALSE,
-        setRanges1, uprv_lengthof(setRanges1),
-        checkRanges1, uprv_lengthof(checkRanges1));
+        setRanges1, UPRV_LENGTHOF(setRanges1),
+        checkRanges1, UPRV_LENGTHOF(checkRanges1));
     testTrieRanges("set2-overlap", FALSE,
-        setRanges2, uprv_lengthof(setRanges2),
-        checkRanges2, uprv_lengthof(checkRanges2));
+        setRanges2, UPRV_LENGTHOF(setRanges2),
+        checkRanges2, UPRV_LENGTHOF(checkRanges2));
     testTrieRanges("set3-initial-9", FALSE,
-        setRanges3, uprv_lengthof(setRanges3),
-        checkRanges3, uprv_lengthof(checkRanges3));
+        setRanges3, UPRV_LENGTHOF(setRanges3),
+        checkRanges3, UPRV_LENGTHOF(checkRanges3));
     testTrieRanges("set-empty", FALSE,
         setRangesEmpty, 0,
-        checkRangesEmpty, uprv_lengthof(checkRangesEmpty));
+        checkRangesEmpty, UPRV_LENGTHOF(checkRangesEmpty));
     testTrieRanges("set-single-value", FALSE,
-        setRangesSingleValue, uprv_lengthof(setRangesSingleValue),
-        checkRangesSingleValue, uprv_lengthof(checkRangesSingleValue));
+        setRangesSingleValue, UPRV_LENGTHOF(setRangesSingleValue),
+        checkRangesSingleValue, UPRV_LENGTHOF(checkRangesSingleValue));
 
     testTrieRanges("set2-overlap.withClone", TRUE,
-        setRanges2, uprv_lengthof(setRanges2),
-        checkRanges2, uprv_lengthof(checkRanges2));
+        setRanges2, UPRV_LENGTHOF(setRanges2),
+        checkRanges2, UPRV_LENGTHOF(checkRanges2));
 }
 
 static void
 EnumNewTrieForLeadSurrogateTest(void) {
     static const char *const testName="enum-for-lead";
     UTrie2 *trie=makeTrieWithRanges(testName, FALSE,
-                                    setRanges2, uprv_lengthof(setRanges2),
-                                    checkRanges2, uprv_lengthof(checkRanges2));
+                                    setRanges2, UPRV_LENGTHOF(setRanges2),
+                                    checkRanges2, UPRV_LENGTHOF(checkRanges2));
     while(trie!=NULL) {
         const CheckRange *checkRanges;
 
@@ -1128,7 +1128,7 @@ dummyTest(UTrie2ValueBits valueBits) {
         return;
     }
 
-    testFrozenTrie(testName, trie, valueBits, checkRanges, uprv_lengthof(checkRanges));
+    testFrozenTrie(testName, trie, valueBits, checkRanges, UPRV_LENGTHOF(checkRanges));
     utrie2_close(trie);
 }
 
@@ -1189,7 +1189,7 @@ FreeBlocksTest(void) {
     }
 
     trie=testTrieSerializeAllValueBits(testName, trie, FALSE,
-                                       checkRanges, uprv_lengthof(checkRanges));
+                                       checkRanges, UPRV_LENGTHOF(checkRanges));
     utrie2_close(trie);
 }
 
@@ -1247,7 +1247,7 @@ GrowDataArrayTest(void) {
     }
 
     trie=testTrieSerializeAllValueBits(testName, trie, FALSE,
-                                          checkRanges, uprv_lengthof(checkRanges));
+                                          checkRanges, UPRV_LENGTHOF(checkRanges));
     utrie2_close(trie);
 }
 
@@ -1409,8 +1409,8 @@ testTrie2FromTrie1(const char *testName,
 static void
 Trie12ConversionTest(void) {
     testTrie2FromTrie1("trie1->trie2",
-                       setRanges2, uprv_lengthof(setRanges2),
-                       checkRanges2, uprv_lengthof(checkRanges2));
+                       setRanges2, UPRV_LENGTHOF(setRanges2),
+                       checkRanges2, UPRV_LENGTHOF(checkRanges2));
 }
 
 void
index 75025695ee1ffffca8f46c787519a78c1ba555d8..01135f5bbfa267769bf1024e20e69b5bef849c90 100644 (file)
@@ -391,7 +391,7 @@ static void TestSelector()
     excluded_sets[i] = uset_open(i*30, i*30+500);
   }
 
-  for(testCaseIdx = 0; testCaseIdx < uprv_lengthof(getEncodingsFns); testCaseIdx++)
+  for(testCaseIdx = 0; testCaseIdx < UPRV_LENGTHOF(getEncodingsFns); testCaseIdx++)
   {
     int32_t excluded_set_id;
     int32_t num_encodings;
@@ -409,7 +409,7 @@ static void TestSelector()
      * The handling of the exclusion set is independent of the
      * set of encodings, so there is no need to test every combination.
      */
-    excluded_set_id = testCaseIdx % uprv_lengthof(excluded_sets);
+    excluded_set_id = testCaseIdx % UPRV_LENGTHOF(excluded_sets);
     {
       UConverterSelector *sel_rt, *sel_fb;
       char *buffer_fb = NULL;
@@ -467,7 +467,7 @@ static void TestSelector()
         verifyResult(ucnvsel_selectForUTF8(sel_rt, s, -1, &status), manual_rt);
         verifyResult(ucnvsel_selectForUTF8(sel_fb, s, -1, &status), manual_fb);
 
-        u_strFromUTF8(utf16, uprv_lengthof(utf16), &length16, s, length8, &status);
+        u_strFromUTF8(utf16, UPRV_LENGTHOF(utf16), &length16, s, length8, &status);
         if (U_FAILURE(status)) {
           log_err("error converting the test text (string %ld) to UTF-16 - %s\n",
                   (long)text.number, u_errorName(status));
index 7bc537369776d18119e52b1de7da66e85e4fa742..6dfb840c94d27e17e99cc38965dff6f287d1e483 100644 (file)
@@ -1686,7 +1686,7 @@ TestSwapData() {
     errorCode=U_ZERO_ERROR;
 #endif
 
-    for(i=0; i<uprv_lengthof(swapCases); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(swapCases); ++i) {
         /* build the name for logging */
         errorCode=U_ZERO_ERROR;
         if(swapCases[i].name[0]=='*') {
index 0cd897eb139e1d38fd007bfc567dc8b4fff569d8..32623a4c9018bb706ea81f8b51fab2d3d399fb77 100644 (file)
@@ -491,7 +491,7 @@ TestSerialized() {
         return;
     }
 
-    length=uset_serialize(set, buffer, uprv_lengthof(buffer), &errorCode);
+    length=uset_serialize(set, buffer, UPRV_LENGTHOF(buffer), &errorCode);
     if(U_FAILURE(errorCode)) {
         log_err("unable to uset_serialize([:Cf:]) - %s\n", u_errorName(errorCode));
         uset_close(set);
index b57d24bc2ca7b35a716d943b31321943e3ecb573..2aa13b98b7ef534dc4f476e3e57d44b6b55a556a 100644 (file)
@@ -740,7 +740,7 @@ static void TestAppend() {
     UBool isError, expectIsError, wrongIsError;
 
     length=0;
-    for(i=0; i<uprv_lengthof(codePoints); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(codePoints); ++i) {
         c=codePoints[i];
         if(c<0 || 0x10ffff<c) {
             continue; /* skip non-code points for U16_APPEND_UNSAFE */
@@ -748,24 +748,24 @@ static void TestAppend() {
 
         U16_APPEND_UNSAFE(buffer, length, c);
     }
-    if(length!=uprv_lengthof(expectUnsafe) || 0!=memcmp(buffer, expectUnsafe, length*U_SIZEOF_UCHAR)) {
+    if(length!=UPRV_LENGTHOF(expectUnsafe) || 0!=memcmp(buffer, expectUnsafe, length*U_SIZEOF_UCHAR)) {
         log_err("U16_APPEND_UNSAFE did not generate the expected output\n");
     }
 
     length=0;
     wrongIsError=FALSE;
-    for(i=0; i<uprv_lengthof(codePoints); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(codePoints); ++i) {
         c=codePoints[i];
         expectIsError= c<0 || 0x10ffff<c; /* || U_IS_SURROGATE(c); */ /* surrogates in UTF-32 shouldn't be used, but it's okay to pass them around internally. */
         isError=FALSE;
 
-        U16_APPEND(buffer, length, uprv_lengthof(buffer), c, isError);
+        U16_APPEND(buffer, length, UPRV_LENGTHOF(buffer), c, isError);
         wrongIsError|= isError!=expectIsError;
     }
     if(wrongIsError) {
         log_err("U16_APPEND did not set isError correctly\n");
     }
-    if(length!=uprv_lengthof(expectSafe) || 0!=memcmp(buffer, expectSafe, length*U_SIZEOF_UCHAR)) {
+    if(length!=UPRV_LENGTHOF(expectSafe) || 0!=memcmp(buffer, expectSafe, length*U_SIZEOF_UCHAR)) {
         log_err("U16_APPEND did not generate the expected output\n");
     }
 }
index 228f4307af260521b511e3a007df50973d620bd2..987715ae650048390f9c0da6c9cb376e5cb62b18 100644 (file)
@@ -99,7 +99,7 @@ static void TestCodeUnitValues()
     static const uint8_t codeunit[]={0x00, 0x65, 0x7e, 0x7f, 0xc0, 0xc4, 0xf0, 0xfd, 0x80, 0x81, 0xbc, 0xbe,};
 
     int16_t i;
-    for(i=0; i<uprv_lengthof(codeunit); i++){
+    for(i=0; i<UPRV_LENGTHOF(codeunit); i++){
         uint8_t c=codeunit[i];
         log_verbose("Testing code unit value of %x\n", c);
         if(i<4){
@@ -142,7 +142,7 @@ static void TestCharLength()
 
     int16_t i;
     UBool multiple;
-    for(i=0; i<uprv_lengthof(codepoint); i=(int16_t)(i+2)){
+    for(i=0; i<UPRV_LENGTHOF(codepoint); i=(int16_t)(i+2)){
         UChar32 c=codepoint[i+1];
         if(UTF8_CHAR_LENGTH(c) != (uint16_t)codepoint[i] || U8_LENGTH(c) != (uint16_t)codepoint[i]){
               log_err("The no: of code units for %lx:- Expected: %d Got: %d\n", c, codepoint[i], UTF8_CHAR_LENGTH(c));
@@ -540,14 +540,14 @@ static void TestNextPrevCharUnsafe() {
         }
     }
 
-    for(i=uprv_lengthof(codePoints)-1, offset=sizeof(input); offset > 0; --i){
+    for(i=UPRV_LENGTHOF(codePoints)-1, offset=sizeof(input); offset > 0; --i){
          UTF8_PREV_CHAR_UNSAFE(input, offset, c);
          if(c != codePoints[i]){
              log_err("ERROR: UTF8_PREV_CHAR_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n",
                      offset, codePoints[i], c);
          }
     }
-    for(i=uprv_lengthof(codePoints)-1, offset=sizeof(input); offset > 0; --i){
+    for(i=UPRV_LENGTHOF(codePoints)-1, offset=sizeof(input); offset > 0; --i){
          U8_PREV_UNSAFE(input, offset, c);
          if(c != codePoints[i]){
              log_err("ERROR: U8_PREV_UNSAFE failed for offset=%ld. Expected:%lx Got:%lx\n",
@@ -606,7 +606,7 @@ static void TestFwdBack() {
     }
 
     offsafe=0;
-    for(i=0; i<uprv_lengthof(Nvalue); i++){
+    for(i=0; i<UPRV_LENGTHOF(Nvalue); i++){
         UTF8_FWD_N_SAFE(input, offsafe, sizeof(input), Nvalue[i]);
         if(offsafe != fwd_N_safe[i]){
             log_err("ERROR: Forward_N_safe offset=%d expected:%d, Got:%d\n", i, fwd_N_safe[i], offsafe);
@@ -615,7 +615,7 @@ static void TestFwdBack() {
     }
 
     offsafe=0;
-    for(i=0; i<uprv_lengthof(Nvalue); i++){
+    for(i=0; i<UPRV_LENGTHOF(Nvalue); i++){
         U8_FWD_N(input, offsafe, sizeof(input), Nvalue[i]);
         if(offsafe != fwd_N_safe[i]){
             log_err("ERROR: U8_FWD_N offset=%d expected:%d, Got:%d\n", i, fwd_N_safe[i], offsafe);
@@ -624,7 +624,7 @@ static void TestFwdBack() {
     }
 
     offsafe=sizeof(input);
-    for(i=0; i<uprv_lengthof(Nvalue); i++){
+    for(i=0; i<UPRV_LENGTHOF(Nvalue); i++){
         UTF8_BACK_N_SAFE(input, 0, offsafe, Nvalue[i]);
         if(offsafe != back_N_safe[i]){
             log_err("ERROR: backward_N_safe offset=%d expected:%d, Got:%ld\n", i, back_N_safe[i], offsafe);
@@ -632,7 +632,7 @@ static void TestFwdBack() {
     }
 
     offsafe=sizeof(input);
-    for(i=0; i<uprv_lengthof(Nvalue); i++){
+    for(i=0; i<UPRV_LENGTHOF(Nvalue); i++){
         U8_BACK_N(input, 0, offsafe, Nvalue[i]);
         if(offsafe != back_N_safe[i]){
             log_err("ERROR: U8_BACK_N offset=%d expected:%d, Got:%ld\n", i, back_N_safe[i], offsafe);
@@ -658,40 +658,40 @@ static void TestFwdBackUnsafe() {
 
     int32_t offset;
     int32_t i;
-    for(i=1, offset=0; offset<uprv_lengthof(input); ++i) {
+    for(i=1, offset=0; offset<UPRV_LENGTHOF(input); ++i) {
         UTF8_FWD_1_UNSAFE(input, offset);
         if(offset != boundaries[i]){
             log_err("ERROR: UTF8_FWD_1_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset);
         }
     }
-    for(i=1, offset=0; offset<uprv_lengthof(input); ++i) {
+    for(i=1, offset=0; offset<UPRV_LENGTHOF(input); ++i) {
         U8_FWD_1_UNSAFE(input, offset);
         if(offset != boundaries[i]){
             log_err("ERROR: U8_FWD_1_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset);
         }
     }
 
-    for(i=uprv_lengthof(boundaries)-2, offset=uprv_lengthof(input); offset>0; --i) {
+    for(i=UPRV_LENGTHOF(boundaries)-2, offset=UPRV_LENGTHOF(input); offset>0; --i) {
         UTF8_BACK_1_UNSAFE(input, offset);
         if(offset != boundaries[i]){
             log_err("ERROR: UTF8_BACK_1_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset);
         }
     }
-    for(i=uprv_lengthof(boundaries)-2, offset=uprv_lengthof(input); offset>0; --i) {
+    for(i=UPRV_LENGTHOF(boundaries)-2, offset=UPRV_LENGTHOF(input); offset>0; --i) {
         U8_BACK_1_UNSAFE(input, offset);
         if(offset != boundaries[i]){
             log_err("ERROR: U8_BACK_1_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset);
         }
     }
 
-    for(i=0; i<uprv_lengthof(boundaries); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(boundaries); ++i) {
         offset=0;
         UTF8_FWD_N_UNSAFE(input, offset, i);
         if(offset != boundaries[i]) {
             log_err("ERROR: UTF8_FWD_N_UNSAFE offset expected:%d, Got:%d\n", boundaries[i], offset);
         }
     }
-    for(i=0; i<uprv_lengthof(boundaries); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(boundaries); ++i) {
         offset=0;
         U8_FWD_N_UNSAFE(input, offset, i);
         if(offset != boundaries[i]) {
@@ -699,17 +699,17 @@ static void TestFwdBackUnsafe() {
         }
     }
 
-    for(i=0; i<uprv_lengthof(boundaries); ++i) {
-        int32_t j=uprv_lengthof(boundaries)-1-i;
-        offset=uprv_lengthof(input);
+    for(i=0; i<UPRV_LENGTHOF(boundaries); ++i) {
+        int32_t j=UPRV_LENGTHOF(boundaries)-1-i;
+        offset=UPRV_LENGTHOF(input);
         UTF8_BACK_N_UNSAFE(input, offset, i);
         if(offset != boundaries[j]) {
             log_err("ERROR: UTF8_BACK_N_UNSAFE offset expected:%d, Got:%d\n", boundaries[j], offset);
         }
     }
-    for(i=0; i<uprv_lengthof(boundaries); ++i) {
-        int32_t j=uprv_lengthof(boundaries)-1-i;
-        offset=uprv_lengthof(input);
+    for(i=0; i<UPRV_LENGTHOF(boundaries); ++i) {
+        int32_t j=UPRV_LENGTHOF(boundaries)-1-i;
+        offset=UPRV_LENGTHOF(input);
         U8_BACK_N_UNSAFE(input, offset, i);
         if(offset != boundaries[j]) {
             log_err("ERROR: U8_BACK_N_UNSAFE offset expected:%d, Got:%d\n", boundaries[j], offset);
@@ -727,8 +727,8 @@ static void TestSetChar() {
 
     uint32_t i=0;
     int32_t offset=0, setOffset=0;
-    for(offset=0; offset<=uprv_lengthof(input); offset++){
-        if (offset<uprv_lengthof(input)){
+    for(offset=0; offset<=UPRV_LENGTHOF(input); offset++){
+        if (offset<UPRV_LENGTHOF(input)){
             setOffset=offset;
             UTF8_SET_CHAR_START_SAFE(input, 0, setOffset);
             if(setOffset != start_safe[i]){
@@ -768,8 +768,8 @@ static void TestSetCharUnsafe() {
 
     uint32_t i=0;
     int32_t offset=0, setOffset=0;
-    for(offset=0; offset<=uprv_lengthof(input); offset++){
-        if (offset<uprv_lengthof(input)){
+    for(offset=0; offset<=UPRV_LENGTHOF(input); offset++){
+        if (offset<UPRV_LENGTHOF(input)){
             setOffset=offset;
             UTF8_SET_CHAR_START_UNSAFE(input, setOffset);
             if(setOffset != start_unsafe[i]){
@@ -909,8 +909,8 @@ static void TestAppendChar(){
     uint8_t str[12];
     uint32_t offset;
 /*    UChar32 c=0;*/
-    uint16_t size=uprv_lengthof(s);
-    for(i=0; i<uprv_lengthof(test); i=(uint16_t)(i+2)){
+    uint16_t size=UPRV_LENGTHOF(s);
+    for(i=0; i<UPRV_LENGTHOF(test); i=(uint16_t)(i+2)){
         uprv_memcpy(str, s, size);
         offset=test[i];
         if(count<13){
@@ -1001,7 +1001,7 @@ static void TestAppend() {
     UBool isError, expectIsError, wrongIsError;
 
     length=0;
-    for(i=0; i<uprv_lengthof(codePoints); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(codePoints); ++i) {
         c=codePoints[i];
         if(c<0 || 0x10ffff<c) {
             continue; /* skip non-code points for U8_APPEND_UNSAFE */
@@ -1009,24 +1009,24 @@ static void TestAppend() {
 
         U8_APPEND_UNSAFE(buffer, length, c);
     }
-    if(length!=uprv_lengthof(expectUnsafe) || 0!=memcmp(buffer, expectUnsafe, length)) {
+    if(length!=UPRV_LENGTHOF(expectUnsafe) || 0!=memcmp(buffer, expectUnsafe, length)) {
         log_err("U8_APPEND_UNSAFE did not generate the expected output\n");
     }
 
     length=0;
     wrongIsError=FALSE;
-    for(i=0; i<uprv_lengthof(codePoints); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(codePoints); ++i) {
         c=codePoints[i];
         expectIsError= c<0 || 0x10ffff<c || U_IS_SURROGATE(c);
         isError=FALSE;
 
-        U8_APPEND(buffer, length, uprv_lengthof(buffer), c, isError);
+        U8_APPEND(buffer, length, UPRV_LENGTHOF(buffer), c, isError);
         wrongIsError|= isError!=expectIsError;
     }
     if(wrongIsError) {
         log_err("U8_APPEND did not set isError correctly\n");
     }
-    if(length!=uprv_lengthof(expectSafe) || 0!=memcmp(buffer, expectSafe, length)) {
+    if(length!=UPRV_LENGTHOF(expectSafe) || 0!=memcmp(buffer, expectSafe, length)) {
         log_err("U8_APPEND did not generate the expected output\n");
     }
 }
@@ -1049,7 +1049,7 @@ TestSurrogates() {
     int32_t i, j, k, iu, is, il, length;
 
     k=0; /* index into cp[] */
-    length=uprv_lengthof(b);
+    length=UPRV_LENGTHOF(b);
     for(i=0; i<length;) {
         j=i;
         U8_NEXT_UNSAFE(b, j, cu);
index 5bee4f2c57e316bcaca9c1a28427d5b2565f632c..156c8e8ccef25317d6f412a93120c5b3e4d66acd 100644 (file)
@@ -460,7 +460,7 @@ TestDotNet() {
         ucal_close(cal);
         return;
     }
-    for(i = 0; i < uprv_lengthof(dotNetDateTimeTicks); ++i) {
+    for(i = 0; i < UPRV_LENGTHOF(dotNetDateTimeTicks); ++i) {
         /* Test conversion from .Net/Universal time to ICU time. */
         dt = dotNetDateTimeTicks + i;
         millis = utmscale_toInt64(dt->ticks, UDTS_ICU4C_TIME, &errorCode);
index 908e84db9478bbe7b21e7043b25563c88afdbbdd..847434704e0943b168047bda0ebe6fa68fc1a628 100644 (file)
@@ -316,7 +316,7 @@ void AlphabeticIndexTest::APITest() {
     // if Russian sorts Cyrillic first.
     int32_t reorderCodes[20];
     int32_t expectedLatinIndex = 0;
-    if (index->getCollator().getReorderCodes(reorderCodes, uprv_lengthof(reorderCodes), status) > 0) {
+    if (index->getCollator().getReorderCodes(reorderCodes, UPRV_LENGTHOF(reorderCodes), status) > 0) {
         expectedLatinIndex = index->getBucketCount(status) - 1;
     }
     n = index->getBucketIndex(adam, status);
@@ -532,7 +532,7 @@ static const char *localeAndIndexCharactersLists[][2] = {
 
 void AlphabeticIndexTest::TestIndexCharactersList() {
     UErrorCode status = U_ZERO_ERROR;
-    for (int32_t i = 0; i < uprv_lengthof(localeAndIndexCharactersLists); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(localeAndIndexCharactersLists); ++i) {
         const char *(&localeAndIndexCharacters)[2] = localeAndIndexCharactersLists[i];
         const char *locale = localeAndIndexCharacters[0];
         UnicodeString expectedIndexCharacters
@@ -561,7 +561,7 @@ void AlphabeticIndexTest::TestHaniFirst() {
         return;
     }
     int32_t reorderCodes[] = { USCRIPT_HAN };
-    coll->setReorderCodes(reorderCodes, uprv_lengthof(reorderCodes), status);
+    coll->setReorderCodes(reorderCodes, UPRV_LENGTHOF(reorderCodes), status);
     TEST_CHECK_STATUS; 
     AlphabeticIndex index(coll.orphan(), status);
     TEST_CHECK_STATUS; 
@@ -590,7 +590,7 @@ void AlphabeticIndexTest::TestPinyinFirst() {
         return;
     }
     int32_t reorderCodes[] = { USCRIPT_HAN };
-    coll->setReorderCodes(reorderCodes, uprv_lengthof(reorderCodes), status);
+    coll->setReorderCodes(reorderCodes, UPRV_LENGTHOF(reorderCodes), status);
     TEST_CHECK_STATUS;
     AlphabeticIndex index(coll.orphan(), status);
     TEST_CHECK_STATUS;
@@ -639,7 +639,7 @@ void AlphabeticIndexTest::TestSchSt() {
         { "Steiff", 22, "St" },
         { "Thomas", 23, "T" }
     };
-    for (int32_t i = 0; i < uprv_lengthof(testCases); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(testCases); ++i) {
         const TestCase &testCase = testCases[i];
         UnicodeString name = UnicodeString(testCase.name).unescape();
         UnicodeString label = UnicodeString(testCase.bucketLabel).unescape();
@@ -672,7 +672,7 @@ void AlphabeticIndexTest::TestNoLabels() {
 void AlphabeticIndexTest::TestChineseZhuyin() {
     UErrorCode status = U_ZERO_ERROR;
     char loc[100];
-    uloc_forLanguageTag("zh-u-co-zhuyin", loc, uprv_lengthof(loc), NULL, &status);
+    uloc_forLanguageTag("zh-u-co-zhuyin", loc, UPRV_LENGTHOF(loc), NULL, &status);
     AlphabeticIndex index(loc, status);
     LocalPointer<AlphabeticIndex::ImmutableIndex> immIndex(index.buildImmutableIndex(status));
     TEST_CHECK_STATUS; 
@@ -693,7 +693,7 @@ void AlphabeticIndexTest::TestJapaneseKanji() {
     // They should all go into the overflow bucket.
     static const UChar32 kanji[] = { 0x4E9C, 0x95C7, 0x4E00, 0x58F1 };
     int32_t overflowIndex = immIndex->getBucketCount() - 1;
-    for(int32_t i = 0; i < uprv_lengthof(kanji); ++i) {
+    for(int32_t i = 0; i < UPRV_LENGTHOF(kanji); ++i) {
         char msg[40];
         sprintf(msg, "kanji[%d]=U+%04lX in overflow bucket", (int)i, (long)kanji[i]);
         assertEquals(msg, overflowIndex, immIndex->getBucketIndex(UnicodeString(kanji[i]), status));
index 32a6c74d82691949a330c3eaf37d285f35cf6ac3..13745bd3c14d73d0259eb46c9546377acd752a2c 100644 (file)
@@ -1242,10 +1242,10 @@ void CollationAPITest::TestSortKeyOverflow() {
     // 2 bytes for the Cyrillic i, 1 byte for the primary-compression terminator,
     // 2 bytes for the Greek phi, and 1 byte for the NUL terminator.
     uint8_t sortKey[12];
-    int32_t length = col->getSortKey(i_and_phi, 2, sortKey, uprv_lengthof(sortKey));
+    int32_t length = col->getSortKey(i_and_phi, 2, sortKey, UPRV_LENGTHOF(sortKey));
     uint8_t sortKey2[12];
     for (int32_t capacity = 0; capacity < length; ++capacity) {
-        uprv_memset(sortKey2, 2, uprv_lengthof(sortKey2));
+        uprv_memset(sortKey2, 2, UPRV_LENGTHOF(sortKey2));
         int32_t length2 = col->getSortKey(i_and_phi, 2, sortKey2, capacity);
         if (length2 != length || 0 != uprv_memcmp(sortKey, sortKey2, capacity)) {
             errln("getSortKey(i_and_phi, capacity=%d) failed to write proper prefix", capacity);
@@ -1661,7 +1661,7 @@ void CollationAPITest::TestGetLocale() {
   u_unescape(rules, rlz, 256);
 
   /* test opening collators for different locales */
-  for(i = 0; i<(int32_t)uprv_lengthof(testStruct); i++) {
+  for(i = 0; i<(int32_t)UPRV_LENGTHOF(testStruct); i++) {
     status = U_ZERO_ERROR;
     coll = Collator::createInstance(testStruct[i].requestedLocale, status);
     if(U_FAILURE(status)) {
@@ -1919,7 +1919,7 @@ void CollationAPITest::TestGetTailoredSet()
   UnicodeString buff; 
   UnicodeSet *set = NULL;
 
-  for(i = 0; i < uprv_lengthof(setTest); i++) {
+  for(i = 0; i < UPRV_LENGTHOF(setTest); i++) {
     buff = UnicodeString(setTest[i].rules, -1, US_INV).unescape();
     RuleBasedCollator coll(buff, status);
     if(U_SUCCESS(status)) {
@@ -2370,7 +2370,7 @@ void CollationAPITest::TestCloneBinary() {
     UnicodeString ue = UNICODE_STRING_SIMPLE("ue");
     assertEquals("rbc/primary: u-umlaut==ue", UCOL_EQUAL, rbc->compare(uUmlaut, ue, errorCode));
     uint8_t bin[25000];
-    int32_t binLength = rbc->cloneBinary(bin, uprv_lengthof(bin), errorCode);
+    int32_t binLength = rbc->cloneBinary(bin, UPRV_LENGTHOF(bin), errorCode);
     if(errorCode.logDataIfFailureAndReset("rbc->cloneBinary()")) {
         return;
     }
@@ -2384,7 +2384,7 @@ void CollationAPITest::TestCloneBinary() {
     assertEquals("rbc2: u-umlaut==ue", UCOL_EQUAL, rbc2.compare(uUmlaut, ue, errorCode));
     assertTrue("rbc==rbc2", *rbc == rbc2);
     uint8_t bin2[25000];
-    int32_t bin2Length = rbc2.cloneBinary(bin2, uprv_lengthof(bin2), errorCode);
+    int32_t bin2Length = rbc2.cloneBinary(bin2, UPRV_LENGTHOF(bin2), errorCode);
     assertEquals("len(rbc binary)==len(rbc2 binary)", binLength, bin2Length);
     assertTrue("rbc binary==rbc2 binary", binLength == bin2Length && memcmp(bin, bin2, binLength) == 0);
 
index 82cefddc4527a88886b0115b0ca1cf16c4193a7b..f5ad2f3033376dc82b18200416010fe2ab062909 100644 (file)
@@ -128,14 +128,14 @@ void BytesTrieTest::TestEmpty() {
     static const StringAndValue data[]={
         { "", 0 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::Test_a() {
     static const StringAndValue data[]={
         { "a", 1 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::Test_a_ab() {
@@ -143,7 +143,7 @@ void BytesTrieTest::Test_a_ab() {
         { "a", 1 },
         { "ab", 100 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestShortestBranch() {
@@ -151,7 +151,7 @@ void BytesTrieTest::TestShortestBranch() {
         { "a", 1000 },
         { "b", 2000 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestBranches() {
@@ -171,7 +171,7 @@ void BytesTrieTest::TestBranches() {
         { "vv", 0x7fffffff },
         { "zz", (int32_t)0x80000000 }
     };
-    for(int32_t length=2; length<=uprv_lengthof(data); ++length) {
+    for(int32_t length=2; length<=UPRV_LENGTHOF(data); ++length) {
         logln("TestBranches length=%d", (int)length);
         checkData(data, length);
     }
@@ -190,7 +190,7 @@ void BytesTrieTest::TestLongSequence() {
           "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
           "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -3 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestLongBranch() {
@@ -218,7 +218,7 @@ void BytesTrieTest::TestLongBranch() {
         { "t234567890", 0x77777777 },
         { "z", (int32_t)0x80000001 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestValuesForState() {
@@ -232,7 +232,7 @@ void BytesTrieTest::TestValuesForState() {
         { "abcde", -5 },
         { "abcdef", -6 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestCompact() {
@@ -259,7 +259,7 @@ void BytesTrieTest::TestCompact() {
         { "xjuly", 7 },
         { "xjune", 6 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 BytesTrie *BytesTrieTest::buildMonthsTrie(UStringTrieBuildOption buildOption) {
@@ -299,7 +299,7 @@ BytesTrie *BytesTrieTest::buildMonthsTrie(UStringTrieBuildOption buildOption) {
         { "jun.", 6 },
         { "june", 6 }
     };
-    return buildTrie(data, uprv_lengthof(data), buildOption);
+    return buildTrie(data, UPRV_LENGTHOF(data), buildOption);
 }
 
 void BytesTrieTest::TestHasUniqueValue() {
@@ -344,7 +344,7 @@ void BytesTrieTest::TestGetNextBytes() {
         return;  // buildTrie() reported an error
     }
     char buffer[40];
-    CheckedArrayByteSink sink(buffer, uprv_lengthof(buffer));
+    CheckedArrayByteSink sink(buffer, UPRV_LENGTHOF(buffer));
     int32_t count=trie->getNextBytes(sink);
     if(count!=2 || sink.NumberOfBytesAppended()!=2 || buffer[0]!='a' || buffer[1]!='j') {
         errln("months getNextBytes()!=[aj] at root");
@@ -430,10 +430,10 @@ void BytesTrieTest::TestIteratorFromBranch() {
         { "uar", 1 },
         { "uary", 1 }
     };
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), data, uprv_lengthof(data));
+    checkIterator(iter.reset(), data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestIteratorFromLinearMatch() {
@@ -458,10 +458,10 @@ void BytesTrieTest::TestIteratorFromLinearMatch() {
         { "r", 1 },
         { "ry", 1 }
     };
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), data, uprv_lengthof(data));
+    checkIterator(iter.reset(), data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestTruncatingIteratorFromRoot() {
@@ -504,10 +504,10 @@ void BytesTrieTest::TestTruncatingIteratorFromRoot() {
         { "jun.", 6 },
         { "june", 6 }
     };
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), data, uprv_lengthof(data));
+    checkIterator(iter.reset(), data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::TestTruncatingIteratorFromLinearMatchShort() {
@@ -516,7 +516,7 @@ void BytesTrieTest::TestTruncatingIteratorFromLinearMatchShort() {
         { "abcdepq", 200 },
         { "abcdeyz", 3000 }
     };
-    LocalPointer<BytesTrie> trie(buildTrie(data, uprv_lengthof(data), USTRINGTRIE_BUILD_FAST));
+    LocalPointer<BytesTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
     if(trie.isNull()) {
         return;  // buildTrie() reported an error
     }
@@ -532,10 +532,10 @@ void BytesTrieTest::TestTruncatingIteratorFromLinearMatchShort() {
     static const StringAndValue expected[]={
         { "cd", -1 }
     };
-    checkIterator(iter, expected, uprv_lengthof(expected));
+    checkIterator(iter, expected, UPRV_LENGTHOF(expected));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), expected, uprv_lengthof(expected));
+    checkIterator(iter.reset(), expected, UPRV_LENGTHOF(expected));
 }
 
 void BytesTrieTest::TestTruncatingIteratorFromLinearMatchLong() {
@@ -544,7 +544,7 @@ void BytesTrieTest::TestTruncatingIteratorFromLinearMatchLong() {
         { "abcdepq", 200 },
         { "abcdeyz", 3000 }
     };
-    LocalPointer<BytesTrie> trie(buildTrie(data, uprv_lengthof(data), USTRINGTRIE_BUILD_FAST));
+    LocalPointer<BytesTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
     if(trie.isNull()) {
         return;  // buildTrie() reported an error
     }
@@ -563,10 +563,10 @@ void BytesTrieTest::TestTruncatingIteratorFromLinearMatchLong() {
         { "dep", -1 },
         { "dey", -1 }
     };
-    checkIterator(iter, expected, uprv_lengthof(expected));
+    checkIterator(iter, expected, UPRV_LENGTHOF(expected));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), expected, uprv_lengthof(expected));
+    checkIterator(iter.reset(), expected, UPRV_LENGTHOF(expected));
 }
 
 void BytesTrieTest::TestIteratorFromBytes() {
@@ -577,12 +577,12 @@ void BytesTrieTest::TestIteratorFromBytes() {
     };
     builder_->clear();
     IcuTestErrorCode errorCode(*this, "TestIteratorFromBytes()");
-    for(int32_t i=0; i<uprv_lengthof(data); ++i) {
+    for(int32_t i=0; i<UPRV_LENGTHOF(data); ++i) {
         builder_->add(data[i].s, data[i].value, errorCode);
     }
     StringPiece trieBytes=builder_->buildStringPiece(USTRINGTRIE_BUILD_FAST, errorCode);
     BytesTrie::Iterator iter(trieBytes.data(), 0, errorCode);
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
 }
 
 void BytesTrieTest::checkData(const StringAndValue data[], int32_t dataLength) {
index 08b76e3f156e8a329eb238cf5f75c9bcbebc4281..80a0cf71042edaf6db23de2dc0b27d9d67a6dd9d 100644 (file)
@@ -966,7 +966,7 @@ class SubCharIter : public CharacterIterator {
 public:
     // public default constructor, to get coverage of CharacterIterator()
     SubCharIter() : CharacterIterator() {
-        textLength=end=uprv_lengthof(s);
+        textLength=end=UPRV_LENGTHOF(s);
         s[0]=0x61;      // 'a'
         s[1]=0xd900;    // U+50400
         s[2]=0xdd00;
@@ -975,7 +975,7 @@ public:
 
     // useful stuff, mostly dummy but testing coverage and subclassability
     virtual UChar nextPostInc() {
-        if(pos<uprv_lengthof(s)) {
+        if(pos<UPRV_LENGTHOF(s)) {
             return s[pos++];
         } else {
             return DONE;
@@ -983,9 +983,9 @@ public:
     }
 
     virtual UChar32 next32PostInc() {
-        if(pos<uprv_lengthof(s)) {
+        if(pos<UPRV_LENGTHOF(s)) {
             UChar32 c;
-            U16_NEXT(s, pos, uprv_lengthof(s), c);
+            U16_NEXT(s, pos, UPRV_LENGTHOF(s), c);
             return c;
         } else {
             return DONE;
@@ -993,7 +993,7 @@ public:
     }
 
     virtual UBool hasNext() {
-        return pos<uprv_lengthof(s);
+        return pos<UPRV_LENGTHOF(s);
     }
 
     virtual UChar first() {
@@ -1004,15 +1004,15 @@ public:
     virtual UChar32 first32() {
         UChar32 c;
         pos=0;
-        U16_NEXT(s, pos, uprv_lengthof(s), c);
+        U16_NEXT(s, pos, UPRV_LENGTHOF(s), c);
         pos=0;
         return c;
     }
 
     virtual UChar setIndex(int32_t position) {
-        if(0<=position && position<=uprv_lengthof(s)) {
+        if(0<=position && position<=UPRV_LENGTHOF(s)) {
             pos=position;
-            if(pos<uprv_lengthof(s)) {
+            if(pos<UPRV_LENGTHOF(s)) {
                 return s[pos];
             }
         }
@@ -1020,11 +1020,11 @@ public:
     }
 
     virtual UChar32 setIndex32(int32_t position) {
-        if(0<=position && position<=uprv_lengthof(s)) {
+        if(0<=position && position<=UPRV_LENGTHOF(s)) {
             pos=position;
-            if(pos<uprv_lengthof(s)) {
+            if(pos<UPRV_LENGTHOF(s)) {
                 UChar32 c;
-                U16_GET(s, 0, pos, uprv_lengthof(s), c);
+                U16_GET(s, 0, pos, UPRV_LENGTHOF(s), c);
                 return c;
             }
         }
@@ -1032,7 +1032,7 @@ public:
     }
 
     virtual UChar current() const {
-        if(pos<uprv_lengthof(s)) {
+        if(pos<UPRV_LENGTHOF(s)) {
             return s[pos];
         } else {
             return DONE;
@@ -1040,9 +1040,9 @@ public:
     }
 
     virtual UChar32 current32() const {
-        if(pos<uprv_lengthof(s)) {
+        if(pos<UPRV_LENGTHOF(s)) {
             UChar32 c;
-            U16_GET(s, 0, pos, uprv_lengthof(s), c);
+            U16_GET(s, 0, pos, UPRV_LENGTHOF(s), c);
             return c;
         } else {
             return DONE;
@@ -1050,7 +1050,7 @@ public:
     }
 
     virtual UChar next() {
-        if(pos<uprv_lengthof(s) && ++pos<uprv_lengthof(s)) {
+        if(pos<UPRV_LENGTHOF(s) && ++pos<UPRV_LENGTHOF(s)) {
             return s[pos];
         } else {
             return DONE;
@@ -1058,13 +1058,13 @@ public:
     }
 
     virtual UChar32 next32() {
-        if(pos<uprv_lengthof(s)) {
-            U16_FWD_1(s, pos, uprv_lengthof(s));
+        if(pos<UPRV_LENGTHOF(s)) {
+            U16_FWD_1(s, pos, UPRV_LENGTHOF(s));
         }
-        if(pos<uprv_lengthof(s)) {
+        if(pos<UPRV_LENGTHOF(s)) {
             UChar32 c;
             int32_t i=pos;
-            U16_NEXT(s, i, uprv_lengthof(s), c);
+            U16_NEXT(s, i, UPRV_LENGTHOF(s), c);
             return c;
         } else {
             return DONE;
@@ -1076,7 +1076,7 @@ public:
     }
 
     virtual void getText(UnicodeString &result) {
-        result.setTo(s, uprv_lengthof(s));
+        result.setTo(s, UPRV_LENGTHOF(s));
     }
 
     // dummy implementations of other pure virtual base class functions
index a1e27670abd51d09d12cc66dbe182eba6ff4ad65..22a0d56f2a291b8474fc80e2e71fdefc3343f5e7 100644 (file)
@@ -228,7 +228,7 @@ void CollationTest::TestImplicits() {
     UChar32 prev = 0;
     uint32_t prevPrimary = 0;
     UTF16CollationIterator ci(cd, FALSE, NULL, NULL, NULL);
-    for(int32_t i = 0; i < uprv_lengthof(sets); ++i) {
+    for(int32_t i = 0; i < UPRV_LENGTHOF(sets); ++i) {
         LocalPointer<UnicodeSetIterator> iter(new UnicodeSetIterator(*sets[i]));
         while(iter->next()) {
             UChar32 c = iter->getCodepoint();
@@ -308,7 +308,7 @@ void CollationTest::TestIllegalUTF8() {
     };
 
     StringPiece fffd(strings[0]);
-    for(int32_t i = 1; i < uprv_lengthof(strings); ++i) {
+    for(int32_t i = 1; i < UPRV_LENGTHOF(strings); ++i) {
         StringPiece illegal(strings[i]);
         UCollationResult order = coll->compareUTF8(fffd, illegal, errorCode);
         if(order != UCOL_EQUAL) {
@@ -479,7 +479,7 @@ void CollationTest::TestFCD() {
     if(errorCode.logIfFailureAndReset("FCDUTF16CollationIterator constructor")) {
         return;
     }
-    CodePointIterator cpi(cp, uprv_lengthof(cp));
+    CodePointIterator cpi(cp, UPRV_LENGTHOF(cp));
     checkFCD("FCDUTF16CollationIterator", u16ci, cpi);
 
 #if U_HAVE_STD_STRING
@@ -496,7 +496,7 @@ void CollationTest::TestFCD() {
 
     cpi.resetToStart();
     UCharIterator iter;
-    uiter_setString(&iter, s, uprv_lengthof(s) - 1);  // -1: without the terminating NUL
+    uiter_setString(&iter, s, UPRV_LENGTHOF(s) - 1);  // -1: without the terminating NUL
     FCDUIterCollationIterator uici(data, FALSE, iter, 0);
     if(errorCode.logIfFailureAndReset("FCDUIterCollationIterator constructor")) {
         return;
@@ -1138,7 +1138,7 @@ void CollationTest::parseAndSetAttribute(IcuTestErrorCode &errorCode) {
 
     UColAttribute attr;
     for(int32_t i = 0;; ++i) {
-        if(i == uprv_lengthof(attributes)) {
+        if(i == UPRV_LENGTHOF(attributes)) {
             errln("invalid attribute name on line %d", (int)fileLineNumber);
             infoln(fileLine);
             errorCode.set(U_PARSE_ERROR);
@@ -1152,7 +1152,7 @@ void CollationTest::parseAndSetAttribute(IcuTestErrorCode &errorCode) {
 
     UColAttributeValue value;
     for(int32_t i = 0;; ++i) {
-        if(i == uprv_lengthof(attributeValues)) {
+        if(i == UPRV_LENGTHOF(attributeValues)) {
             errln("invalid attribute value name on line %d", (int)fileLineNumber);
             infoln(fileLine);
             errorCode.set(U_PARSE_ERROR);
@@ -1300,7 +1300,7 @@ UBool CollationTest::getSortKeyParts(const UChar *s, int32_t length,
                                      IcuTestErrorCode &errorCode) {
     if(errorCode.isFailure()) { return FALSE; }
     uint8_t part[32];
-    U_ASSERT(partSize <= uprv_lengthof(part));
+    U_ASSERT(partSize <= UPRV_LENGTHOF(part));
     UCharIterator iter;
     uiter_setString(&iter, s, length);
     uint32_t state[2] = { 0, 0 };
@@ -1438,7 +1438,7 @@ UBool CollationTest::getCollationKey(const char *norm, const UnicodeString &line
 
     // Check that internalNextSortKeyPart() makes the same key, with several part sizes.
     static const int32_t partSizes[] = { 32, 3, 1 };
-    for(int32_t psi = 0; psi < uprv_lengthof(partSizes); ++psi) {
+    for(int32_t psi = 0; psi < UPRV_LENGTHOF(partSizes); ++psi) {
         int32_t partSize = partSizes[psi];
         CharString parts;
         if(!getSortKeyParts(s, length, parts, 32, errorCode)) {
index 4988d3cbacdafd5cc338440ce557866f79d72065..b2c93a08bcbe70bdc0a998d82c01b041d9780dc7 100644 (file)
@@ -217,27 +217,27 @@ void CompactDecimalFormatTest::runIndexedTest(
 }
 
 void CompactDecimalFormatTest::TestEnglishShort() {
-  CheckLocale("en", UNUM_SHORT, kEnglishShort, uprv_lengthof(kEnglishShort));
+  CheckLocale("en", UNUM_SHORT, kEnglishShort, UPRV_LENGTHOF(kEnglishShort));
 }
 
 void CompactDecimalFormatTest::TestSerbianShort() {
-  CheckLocale("sr", UNUM_SHORT, kSerbianShort, uprv_lengthof(kSerbianShort));
+  CheckLocale("sr", UNUM_SHORT, kSerbianShort, UPRV_LENGTHOF(kSerbianShort));
 }
 
 void CompactDecimalFormatTest::TestSerbianLong() {
-  CheckLocale("sr", UNUM_LONG, kSerbianLong, uprv_lengthof(kSerbianLong));
+  CheckLocale("sr", UNUM_LONG, kSerbianLong, UPRV_LENGTHOF(kSerbianLong));
 }
 
 void CompactDecimalFormatTest::TestSerbianLongNegative() {
-  CheckLocale("sr", UNUM_LONG, kSerbianLongNegative, uprv_lengthof(kSerbianLongNegative));
+  CheckLocale("sr", UNUM_LONG, kSerbianLongNegative, UPRV_LENGTHOF(kSerbianLongNegative));
 }
 
 void CompactDecimalFormatTest::TestJapaneseShort() {
-  CheckLocale(Locale::getJapan(), UNUM_SHORT, kJapaneseShort, uprv_lengthof(kJapaneseShort));
+  CheckLocale(Locale::getJapan(), UNUM_SHORT, kJapaneseShort, UPRV_LENGTHOF(kJapaneseShort));
 }
 
 void CompactDecimalFormatTest::TestSwahiliShort() {
-  CheckLocale("sw", UNUM_SHORT, kSwahiliShort, uprv_lengthof(kSwahiliShort));
+  CheckLocale("sw", UNUM_SHORT, kSwahiliShort, UPRV_LENGTHOF(kSwahiliShort));
 }
 
 void CompactDecimalFormatTest::TestFieldPosition() {
@@ -258,7 +258,7 @@ void CompactDecimalFormatTest::TestFieldPosition() {
 }
 
 void CompactDecimalFormatTest::TestCsShort() {
-  CheckLocale("cs", UNUM_SHORT, kCsShort, uprv_lengthof(kCsShort));
+  CheckLocale("cs", UNUM_SHORT, kCsShort, UPRV_LENGTHOF(kCsShort));
 }
 
 void CompactDecimalFormatTest::TestSkLong() {
@@ -267,15 +267,15 @@ void CompactDecimalFormatTest::TestSkLong() {
   //   few{"0"}
   //   one{"0"}
   //   other{"0"}
-  CheckLocale("sk", UNUM_LONG, kSkLong, uprv_lengthof(kSkLong));
+  CheckLocale("sk", UNUM_LONG, kSkLong, UPRV_LENGTHOF(kSkLong));
 }
 
 void CompactDecimalFormatTest::TestSwahiliShortNegative() {
-  CheckLocale("sw", UNUM_SHORT, kSwahiliShortNegative, uprv_lengthof(kSwahiliShortNegative));
+  CheckLocale("sw", UNUM_SHORT, kSwahiliShortNegative, UPRV_LENGTHOF(kSwahiliShortNegative));
 }
 
 void CompactDecimalFormatTest::TestArabicLong() {
-  CheckLocale("ar", UNUM_LONG, kArabicLong, uprv_lengthof(kArabicLong));
+  CheckLocale("ar", UNUM_LONG, kArabicLong, UPRV_LENGTHOF(kArabicLong));
 }
 
 void CompactDecimalFormatTest::TestSignificantDigits() {
index 1654c9285b90cc2f33a343c2e6c877037a9ac639..400ea625ae4773fbf081963263b34e9fc41a79d1 100644 (file)
@@ -290,7 +290,7 @@ ConversionTest::TestFromUnicode() {
                     // read a substitution string, separated by an equal sign
                     p=s.getBuffer()+index+1;
                     length=s.length()-(index+1);
-                    if(length<0 || length>=uprv_lengthof(cc.subString)) {
+                    if(length<0 || length>=UPRV_LENGTHOF(cc.subString)) {
                         errorCode=U_ILLEGAL_ARGUMENT_ERROR;
                     } else {
                         u_memcpy(cc.subString, p, length);
@@ -444,7 +444,7 @@ ConversionTest::TestGetUnicodeSet() {
                 if(!diffSet.isEmpty()) {
                     diffSet.toPattern(s, TRUE);
                     if(s.length()>100) {
-                        s.replace(100, 0x7fffffff, ellipsis, uprv_lengthof(ellipsis));
+                        s.replace(100, 0x7fffffff, ellipsis, UPRV_LENGTHOF(ellipsis));
                     }
                     errln("error: ucnv_getUnicodeSet(\"%s\") is missing items - conversion/getUnicodeSet test case %d",
                             charset, i);
@@ -456,7 +456,7 @@ ConversionTest::TestGetUnicodeSet() {
                 if(!diffSet.isEmpty()) {
                     diffSet.toPattern(s, TRUE);
                     if(s.length()>100) {
-                        s.replace(100, 0x7fffffff, ellipsis, uprv_lengthof(ellipsis));
+                        s.replace(100, 0x7fffffff, ellipsis, UPRV_LENGTHOF(ellipsis));
                     }
                     errln("error: ucnv_getUnicodeSet(\"%s\") contains unexpected items - conversion/getUnicodeSet test case %d",
                             charset, i);
@@ -554,7 +554,7 @@ ConversionTest::TestGetUnicodeSet2() {
     LocalUConverterPointer cnv;
     char buffer[1024];
     int32_t i;
-    for(i=0; i<uprv_lengthof(cnvNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(cnvNames); ++i) {
         UErrorCode errorCode=U_ZERO_ERROR;
         cnv.adoptInstead(cnv_open(cnvNames[i], errorCode));
         if(U_FAILURE(errorCode)) {
@@ -624,7 +624,7 @@ ConversionTest::TestGetUnicodeSet2() {
                 if(!diffSet.isEmpty()) {
                     diffSet.toPattern(out, TRUE);
                     if(out.length()>100) {
-                        out.replace(100, 0x7fffffff, ellipsis, uprv_lengthof(ellipsis));
+                        out.replace(100, 0x7fffffff, ellipsis, UPRV_LENGTHOF(ellipsis));
                     }
                     errln("error: ucnv_getUnicodeSet(\"%s\") is missing items - which set: %d",
                             cnvNames[i], which);
@@ -636,7 +636,7 @@ ConversionTest::TestGetUnicodeSet2() {
                 if(!diffSet.isEmpty()) {
                     diffSet.toPattern(out, TRUE);
                     if(out.length()>100) {
-                        out.replace(100, 0x7fffffff, ellipsis, uprv_lengthof(ellipsis));
+                        out.replace(100, 0x7fffffff, ellipsis, UPRV_LENGTHOF(ellipsis));
                     }
                     errln("error: ucnv_getUnicodeSet(\"%s\") contains unexpected items - which set: %d",
                             cnvNames[i], which);
@@ -1029,7 +1029,7 @@ ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback
     int32_t i, step;
 
     ok=TRUE;
-    for(i=0; i<uprv_lengthof(steps) && ok; ++i) {
+    for(i=0; i<UPRV_LENGTHOF(steps) && ok; ++i) {
         step=steps[i].step;
         if(step<0 && !cc.finalFlush) {
             // skip ucnv_getNextUChar() if !finalFlush because
@@ -1041,12 +1041,12 @@ ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback
             cc.offsets=NULL;
         }
         else {
-            memset(resultOffsets, -1, uprv_lengthof(resultOffsets));
+            memset(resultOffsets, -1, UPRV_LENGTHOF(resultOffsets));
         }
-        memset(result, -1, uprv_lengthof(result));
+        memset(result, -1, UPRV_LENGTHOF(result));
         errorCode.reset();
         resultLength=stepToUnicode(cc, cnv.getAlias(),
-                                result, uprv_lengthof(result),
+                                result, UPRV_LENGTHOF(result),
                                 step==0 ? resultOffsets : NULL,
                                 step, errorCode);
         ok=checkToUnicode(
@@ -1076,7 +1076,7 @@ ConversionTest::ToUnicodeCase(ConversionCase &cc, UConverterToUCallback callback
 
         errorCode.reset();
         resultLength=ucnv_toUChars(cnv.getAlias(),
-                        result, uprv_lengthof(result),
+                        result, UPRV_LENGTHOF(result),
                         (const char *)cc.bytes, cc.bytesLength,
                         errorCode);
         ok=checkToUnicode(
@@ -1223,7 +1223,7 @@ stepFromUTF8(ConversionCase &cc,
         targetLimit=resultLimit;
         flush=cc.finalFlush;
 
-        pivotLimit=pivotBuffer+uprv_lengthof(pivotBuffer);
+        pivotLimit=pivotBuffer+UPRV_LENGTHOF(pivotBuffer);
     } else {
         // start with empty partial buffers
         sourceLimit=source;
@@ -1442,7 +1442,7 @@ ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback call
     // convert unicode to utf8
     char utf8[256];
     cc.utf8=utf8;
-    u_strToUTF8(utf8, uprv_lengthof(utf8), &cc.utf8Length,
+    u_strToUTF8(utf8, UPRV_LENGTHOF(utf8), &cc.utf8Length,
                 cc.unicode, cc.unicodeLength,
                 &errorCode);
     if(U_FAILURE(errorCode)) {
@@ -1469,13 +1469,13 @@ ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback call
     int32_t i, step;
 
     ok=TRUE;
-    for(i=0; i<uprv_lengthof(steps) && ok; ++i) {
+    for(i=0; i<UPRV_LENGTHOF(steps) && ok; ++i) {
         step=steps[i].step;
-        memset(resultOffsets, -1, uprv_lengthof(resultOffsets));
-        memset(result, -1, uprv_lengthof(result));
+        memset(resultOffsets, -1, UPRV_LENGTHOF(resultOffsets));
+        memset(result, -1, UPRV_LENGTHOF(result));
         errorCode=U_ZERO_ERROR;
         resultLength=stepFromUnicode(cc, cnv,
-                                result, uprv_lengthof(result),
+                                result, UPRV_LENGTHOF(result),
                                 step==0 ? resultOffsets : NULL,
                                 step, &errorCode);
         ok=checkFromUnicode(
@@ -1504,7 +1504,7 @@ ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback call
         if(cc.utf8Length>=0) {
             errorCode=U_ZERO_ERROR;
             resultLength=stepFromUTF8(cc, utf8Cnv, cnv,
-                                    result, uprv_lengthof(result),
+                                    result, UPRV_LENGTHOF(result),
                                     step, &errorCode);
             ok=checkFromUnicode(
                     cc, cnv, steps[i].utf8Name,
@@ -1527,7 +1527,7 @@ ConversionTest::FromUnicodeCase(ConversionCase &cc, UConverterFromUCallback call
 
         errorCode=U_ZERO_ERROR;
         resultLength=ucnv_fromUChars(cnv,
-                        result, uprv_lengthof(result),
+                        result, UPRV_LENGTHOF(result),
                         cc.unicode, cc.unicodeLength,
                         &errorCode);
         ok=checkFromUnicode(
@@ -1576,7 +1576,7 @@ ConversionTest::checkFromUnicode(ConversionCase &cc, UConverter *cnv, const char
     msg=NULL;
 
     errorCode=U_ZERO_ERROR;
-    resultInvalidLength=uprv_lengthof(resultInvalidUChars);
+    resultInvalidLength=UPRV_LENGTHOF(resultInvalidUChars);
     ucnv_getInvalidUChars(cnv, resultInvalidUChars, &resultInvalidLength, &errorCode);
     if(U_FAILURE(errorCode)) {
         errln("fromUnicode[%d](%s cb=\"%s\" fb=%d flush=%d %s) ucnv_getInvalidUChars() failed - %s",
index 5bafdf0f3e75f864a79659408a47d15926a3e7bc..0e651de50176fd87ae85f23e75cc44ca223f8a0d 100644 (file)
@@ -572,7 +572,7 @@ void IntlTestDecimalFormatAPI::TestScale()
     UnicodeString percentPattern("#,##0%");
     pat.setMaximumFractionDigits(4);
 
-    for(int32_t i=0; i < uprv_lengthof(testData); i++) {
+    for(int32_t i=0; i < UPRV_LENGTHOF(testData); i++) {
         if ( i > 2 ) {
             pat.applyPattern(percentPattern,status);
         }
index e03576da514fdfcde44cb5c0525dd2fa84bf8308..0e2cd4b59b0592830dafef008aa6a61beb47d912 100644 (file)
@@ -167,7 +167,7 @@ void DateFormatTest::TestPatterns() {
     };
 
     IcuTestErrorCode errorCode(*this, "TestPatterns()");
-    for (int32_t i = 0; i < uprv_lengthof(EXPECTED); i++) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(EXPECTED); i++) {
         // Verify that patterns have the correct values
         UnicodeString actualPattern(EXPECTED[i].actualPattern, -1, US_INV);
         UnicodeString expectedPattern(EXPECTED[i].expectedPattern, -1, US_INV);
@@ -4178,7 +4178,7 @@ void DateFormatTest::TestDotAndAtLeniency() {
     // Test for date/time parsing regression with CLDR 22.1/ICU 50 pattern strings.
     // For details see http://bugs.icu-project.org/trac/ticket/9789
     static const char *locales[] = { "en", "fr" };
-    for (int32_t i = 0; i < uprv_lengthof(locales); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(locales); ++i) {
         Locale locale(locales[i]);
 
         for (DateFormat::EStyle dateStyle = DateFormat::FULL; dateStyle <= DateFormat::SHORT;
index 53fc4f91b86948a68c5514ecb61b13740ec059f0..f660120663d5c9fc54adae869d83ffacddf4c2d7 100644 (file)
@@ -91,7 +91,7 @@ void G7CollationTest::TestG7Locales(/* char* par */)
         Locale("ja", "JP", "")
     };
 
-    for (i = 0; i < uprv_lengthof(locales); i++)
+    for (i = 0; i < UPRV_LENGTHOF(locales); i++)
     {
         UnicodeString dispName;
         UErrorCode status = U_ZERO_ERROR;
index 53fd987e3ef2bd582c91300f9690121151570159..740beebc4b0137e1264d818560a14ab58fd79ccc 100644 (file)
@@ -54,17 +54,17 @@ void GenderInfoTest::runIndexedTest(int32_t index, UBool exec, const char *&name
 
 void GenderInfoTest::TestGetListGender() {
     check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_OTHER, NULL, 0);
-    check(UGENDER_FEMALE, UGENDER_FEMALE, UGENDER_FEMALE, kSingleFemale, uprv_lengthof(kSingleFemale));
-    check(UGENDER_MALE, UGENDER_MALE, UGENDER_MALE, kSingleMale, uprv_lengthof(kSingleMale));
-    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_OTHER, kSingleOther, uprv_lengthof(kSingleOther));
+    check(UGENDER_FEMALE, UGENDER_FEMALE, UGENDER_FEMALE, kSingleFemale, UPRV_LENGTHOF(kSingleFemale));
+    check(UGENDER_MALE, UGENDER_MALE, UGENDER_MALE, kSingleMale, UPRV_LENGTHOF(kSingleMale));
+    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_OTHER, kSingleOther, UPRV_LENGTHOF(kSingleOther));
 
-    check(UGENDER_OTHER, UGENDER_FEMALE, UGENDER_FEMALE, kAllFemale, uprv_lengthof(kAllFemale));
-    check(UGENDER_OTHER, UGENDER_MALE, UGENDER_MALE, kAllMale, uprv_lengthof(kAllMale));
-    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kAllOther, uprv_lengthof(kAllOther));
+    check(UGENDER_OTHER, UGENDER_FEMALE, UGENDER_FEMALE, kAllFemale, UPRV_LENGTHOF(kAllFemale));
+    check(UGENDER_OTHER, UGENDER_MALE, UGENDER_MALE, kAllMale, UPRV_LENGTHOF(kAllMale));
+    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kAllOther, UPRV_LENGTHOF(kAllOther));
 
-    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kFemaleMale, uprv_lengthof(kFemaleMale));
-    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kFemaleOther, uprv_lengthof(kFemaleOther));
-    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kMaleOther, uprv_lengthof(kMaleOther));
+    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kFemaleMale, UPRV_LENGTHOF(kFemaleMale));
+    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kFemaleOther, UPRV_LENGTHOF(kFemaleOther));
+    check(UGENDER_OTHER, UGENDER_OTHER, UGENDER_MALE, kMaleOther, UPRV_LENGTHOF(kMaleOther));
 }
 
 void GenderInfoTest::TestFallback() {
index fb4532d3d58e81227be22745a47411ee6e595307..b5b90e27e4e31cea47b4bc0d038e9e608afab6f0 100644 (file)
@@ -509,7 +509,7 @@ void IntlTestSpoof::testIdentifierInfo() {
     };
 
     int testNum;
-    for (testNum = 0; testNum < uprv_lengthof(tests); testNum++) {
+    for (testNum = 0; testNum < UPRV_LENGTHOF(tests); testNum++) {
         char testNumStr[40];
         sprintf(testNumStr, "testNum = %d", testNum);
         Test &test = tests[testNum];
@@ -573,7 +573,7 @@ void IntlTestSpoof::testIdentifierInfo() {
 
     status = U_ZERO_ERROR;
     IdentifierInfo identifierInfo(status);
-    for (testNum=0; testNum<uprv_lengthof(scriptTests); testNum++) {
+    for (testNum=0; testNum<UPRV_LENGTHOF(scriptTests); testNum++) {
         ScriptTest &test = scriptTests[testNum];
         char msgBuf[100];
         sprintf(msgBuf, "testNum = %d ", testNum);
@@ -689,7 +689,7 @@ void IntlTestSpoof::testRestrictionLevel() {
     TEST_ASSERT_SUCCESS(status);
     idInfo.setIdentifierProfile(*uspoof_getRecommendedUnicodeSet(&status));
     TEST_ASSERT_SUCCESS(status);
-    for (int32_t testNum=0; testNum < uprv_lengthof(tests); testNum++) {
+    for (int32_t testNum=0; testNum < UPRV_LENGTHOF(tests); testNum++) {
         status = U_ZERO_ERROR;
         const Test &test = tests[testNum];
         UnicodeString testString = UnicodeString(test.fId).unescape();
@@ -698,7 +698,7 @@ void IntlTestSpoof::testRestrictionLevel() {
         sprintf(msgBuffer, "testNum = %d ", testNum);
         TEST_ASSERT_SUCCESS(status);
         TEST_ASSERT_MSG(expectedLevel == idInfo.getRestrictionLevel(status), msgBuffer);
-        for (int levelIndex=0; levelIndex<uprv_lengthof(restrictionLevels); levelIndex++) {
+        for (int levelIndex=0; levelIndex<UPRV_LENGTHOF(restrictionLevels); levelIndex++) {
             status = U_ZERO_ERROR;
             URestrictionLevel levelSetInSpoofChecker = restrictionLevels[levelIndex];
             USpoofChecker *sc = uspoof_open(&status);
@@ -749,7 +749,7 @@ void IntlTestSpoof::testMixedNumbers() {
     };
     UErrorCode status = U_ZERO_ERROR;
     IdentifierInfo idInfo(status);
-    for (int32_t testNum=0; testNum < uprv_lengthof(tests); testNum++) {
+    for (int32_t testNum=0; testNum < UPRV_LENGTHOF(tests); testNum++) {
         char msgBuf[100];
         sprintf(msgBuf, "testNum = %d ", testNum);
         Test &test = tests[testNum];
index 738de244da627baffca88c241bb39858bd522b9c..ad8acf23676d99c47185c4ccf11ba71185604524 100644 (file)
@@ -309,32 +309,32 @@ void MeasureFormatTest::TestExamplesInDocs() {
             "Feet and inches",
             fmtFrFull,
             feetAndInches,
-            uprv_lengthof(feetAndInches),
+            UPRV_LENGTHOF(feetAndInches),
             "70 pieds et 5,3 pouces");
     verifyFormatWithPrefix(
             "Feet and inches",
             fmtFrFull,
             "Prefix: ",
             feetAndInches,
-            uprv_lengthof(feetAndInches),
+            UPRV_LENGTHOF(feetAndInches),
             "Prefix: 70 pieds et 5,3 pouces");
     verifyFormat(
             "Foot and inch",
             fmtFrFull,
             footAndInch,
-            uprv_lengthof(footAndInch),
+            UPRV_LENGTHOF(footAndInch),
             "1 pied et 1 pouce");
     verifyFormat(
             "Foot and inch narrow",
             fmtFrNarrow,
             footAndInch,
-            uprv_lengthof(footAndInch),
+            UPRV_LENGTHOF(footAndInch),
             "1\\u2032 1\\u2033");
     verifyFormat(
             "Inch and feet",
             fmtEn,
             inchAndFeet,
-            uprv_lengthof(inchAndFeet),
+            UPRV_LENGTHOF(inchAndFeet),
             "1 inch, 2 feet");
 }
 
@@ -422,65 +422,65 @@ void MeasureFormatTest::TestFormatPeriodEn() {
     }
     
     ExpectedResult fullData[] = {
-            {t_1m_59_9996s, uprv_lengthof(t_1m_59_9996s), "1 minute, 59.9996 seconds"},
-            {t_19m, uprv_lengthof(t_19m), "19 minutes"},
-            {t_1h_23_5s, uprv_lengthof(t_1h_23_5s), "1 hour, 23.5 seconds"},
-            {t_1h_23_5m, uprv_lengthof(t_1h_23_5m), "1 hour, 23.5 minutes"},
-            {t_1h_0m_23s, uprv_lengthof(t_1h_0m_23s), "1 hour, 0 minutes, 23 seconds"},
-            {t_2y_5M_3w_4d, uprv_lengthof(t_2y_5M_3w_4d), "2 years, 5 months, 3 weeks, 4 days"}};
+            {t_1m_59_9996s, UPRV_LENGTHOF(t_1m_59_9996s), "1 minute, 59.9996 seconds"},
+            {t_19m, UPRV_LENGTHOF(t_19m), "19 minutes"},
+            {t_1h_23_5s, UPRV_LENGTHOF(t_1h_23_5s), "1 hour, 23.5 seconds"},
+            {t_1h_23_5m, UPRV_LENGTHOF(t_1h_23_5m), "1 hour, 23.5 minutes"},
+            {t_1h_0m_23s, UPRV_LENGTHOF(t_1h_0m_23s), "1 hour, 0 minutes, 23 seconds"},
+            {t_2y_5M_3w_4d, UPRV_LENGTHOF(t_2y_5M_3w_4d), "2 years, 5 months, 3 weeks, 4 days"}};
 
     ExpectedResult abbrevData[] = {
-            {t_1m_59_9996s, uprv_lengthof(t_1m_59_9996s), "1 min, 59.9996 secs"},
-            {t_19m, uprv_lengthof(t_19m), "19 mins"},
-            {t_1h_23_5s, uprv_lengthof(t_1h_23_5s), "1 hr, 23.5 secs"},
-            {t_1h_23_5m, uprv_lengthof(t_1h_23_5m), "1 hr, 23.5 mins"},
-            {t_1h_0m_23s, uprv_lengthof(t_1h_0m_23s), "1 hr, 0 mins, 23 secs"},
-            {t_2y_5M_3w_4d, uprv_lengthof(t_2y_5M_3w_4d), "2 yrs, 5 mths, 3 wks, 4 days"}};
+            {t_1m_59_9996s, UPRV_LENGTHOF(t_1m_59_9996s), "1 min, 59.9996 secs"},
+            {t_19m, UPRV_LENGTHOF(t_19m), "19 mins"},
+            {t_1h_23_5s, UPRV_LENGTHOF(t_1h_23_5s), "1 hr, 23.5 secs"},
+            {t_1h_23_5m, UPRV_LENGTHOF(t_1h_23_5m), "1 hr, 23.5 mins"},
+            {t_1h_0m_23s, UPRV_LENGTHOF(t_1h_0m_23s), "1 hr, 0 mins, 23 secs"},
+            {t_2y_5M_3w_4d, UPRV_LENGTHOF(t_2y_5M_3w_4d), "2 yrs, 5 mths, 3 wks, 4 days"}};
 
     ExpectedResult narrowData[] = {
-            {t_1m_59_9996s, uprv_lengthof(t_1m_59_9996s), "1m 59.9996s"},
-            {t_19m, uprv_lengthof(t_19m), "19m"},
-            {t_1h_23_5s, uprv_lengthof(t_1h_23_5s), "1h 23.5s"},
-            {t_1h_23_5m, uprv_lengthof(t_1h_23_5m), "1h 23.5m"},
-            {t_1h_0m_23s, uprv_lengthof(t_1h_0m_23s), "1h 0m 23s"},
-            {t_2y_5M_3w_4d, uprv_lengthof(t_2y_5M_3w_4d), "2y 5m 3w 4d"}};
+            {t_1m_59_9996s, UPRV_LENGTHOF(t_1m_59_9996s), "1m 59.9996s"},
+            {t_19m, UPRV_LENGTHOF(t_19m), "19m"},
+            {t_1h_23_5s, UPRV_LENGTHOF(t_1h_23_5s), "1h 23.5s"},
+            {t_1h_23_5m, UPRV_LENGTHOF(t_1h_23_5m), "1h 23.5m"},
+            {t_1h_0m_23s, UPRV_LENGTHOF(t_1h_0m_23s), "1h 0m 23s"},
+            {t_2y_5M_3w_4d, UPRV_LENGTHOF(t_2y_5M_3w_4d), "2y 5m 3w 4d"}};
 
     ExpectedResult numericData[] = {
-            {t_1m_59_9996s, uprv_lengthof(t_1m_59_9996s), "1:59.9996"},
-            {t_19m, uprv_lengthof(t_19m), "19m"},
-            {t_1h_23_5s, uprv_lengthof(t_1h_23_5s), "1:00:23.5"},
-            {t_1h_23_5m, uprv_lengthof(t_1h_23_5m), "1:23.5"},
-            {t_1h_0m_23s, uprv_lengthof(t_1h_0m_23s), "1:00:23"},
-            {t_5h_17m, uprv_lengthof(t_5h_17m), "5:17"},
-            {t_neg5h_17m, uprv_lengthof(t_neg5h_17m), "-5h 17m"},
-            {t_19m_28s, uprv_lengthof(t_19m_28s), "19:28"},
-            {t_2y_5M_3w_4d, uprv_lengthof(t_2y_5M_3w_4d), "2y 5m 3w 4d"},
-            {t_0h_0m_9s, uprv_lengthof(t_0h_0m_9s), "0:00:09"},
-            {t_6h_56_92m, uprv_lengthof(t_6h_56_92m), "6:56.92"},
-            {t_6_7h_56_92m, uprv_lengthof(t_6_7h_56_92m), "6:56.92"},
-            {t_3h_4s_5m, uprv_lengthof(t_3h_4s_5m), "3h 4s 5m"},
-            {t_3h_5h, uprv_lengthof(t_3h_5h), "3h 5h"}};
+            {t_1m_59_9996s, UPRV_LENGTHOF(t_1m_59_9996s), "1:59.9996"},
+            {t_19m, UPRV_LENGTHOF(t_19m), "19m"},
+            {t_1h_23_5s, UPRV_LENGTHOF(t_1h_23_5s), "1:00:23.5"},
+            {t_1h_23_5m, UPRV_LENGTHOF(t_1h_23_5m), "1:23.5"},
+            {t_1h_0m_23s, UPRV_LENGTHOF(t_1h_0m_23s), "1:00:23"},
+            {t_5h_17m, UPRV_LENGTHOF(t_5h_17m), "5:17"},
+            {t_neg5h_17m, UPRV_LENGTHOF(t_neg5h_17m), "-5h 17m"},
+            {t_19m_28s, UPRV_LENGTHOF(t_19m_28s), "19:28"},
+            {t_2y_5M_3w_4d, UPRV_LENGTHOF(t_2y_5M_3w_4d), "2y 5m 3w 4d"},
+            {t_0h_0m_9s, UPRV_LENGTHOF(t_0h_0m_9s), "0:00:09"},
+            {t_6h_56_92m, UPRV_LENGTHOF(t_6h_56_92m), "6:56.92"},
+            {t_6_7h_56_92m, UPRV_LENGTHOF(t_6_7h_56_92m), "6:56.92"},
+            {t_3h_4s_5m, UPRV_LENGTHOF(t_3h_4s_5m), "3h 4s 5m"},
+            {t_3h_5h, UPRV_LENGTHOF(t_3h_5h), "3h 5h"}};
 
     ExpectedResult fullDataDe[] = {
-            {t_1m_59_9996s, uprv_lengthof(t_1m_59_9996s), "1 Minute und 59,9996 Sekunden"},
-            {t_19m, uprv_lengthof(t_19m), "19 Minuten"},
-            {t_1h_23_5s, uprv_lengthof(t_1h_23_5s), "1 Stunde und 23,5 Sekunden"},
-            {t_1h_23_5m, uprv_lengthof(t_1h_23_5m), "1 Stunde und 23,5 Minuten"},
-            {t_1h_0m_23s, uprv_lengthof(t_1h_0m_23s), "1 Stunde, 0 Minuten und 23 Sekunden"},
-            {t_2y_5M_3w_4d, uprv_lengthof(t_2y_5M_3w_4d), "2 Jahre, 5 Monate, 3 Wochen und 4 Tage"}};
+            {t_1m_59_9996s, UPRV_LENGTHOF(t_1m_59_9996s), "1 Minute und 59,9996 Sekunden"},
+            {t_19m, UPRV_LENGTHOF(t_19m), "19 Minuten"},
+            {t_1h_23_5s, UPRV_LENGTHOF(t_1h_23_5s), "1 Stunde und 23,5 Sekunden"},
+            {t_1h_23_5m, UPRV_LENGTHOF(t_1h_23_5m), "1 Stunde und 23,5 Minuten"},
+            {t_1h_0m_23s, UPRV_LENGTHOF(t_1h_0m_23s), "1 Stunde, 0 Minuten und 23 Sekunden"},
+            {t_2y_5M_3w_4d, UPRV_LENGTHOF(t_2y_5M_3w_4d), "2 Jahre, 5 Monate, 3 Wochen und 4 Tage"}};
 
     ExpectedResult numericDataDe[] = {
-            {t_1m_59_9996s, uprv_lengthof(t_1m_59_9996s), "1:59,9996"},
-            {t_19m, uprv_lengthof(t_19m), "19 Min."},
-            {t_1h_23_5s, uprv_lengthof(t_1h_23_5s), "1:00:23,5"},
-            {t_1h_23_5m, uprv_lengthof(t_1h_23_5m), "1:23,5"},
-            {t_1h_0m_23s, uprv_lengthof(t_1h_0m_23s), "1:00:23"},
-            {t_5h_17m, uprv_lengthof(t_5h_17m), "5:17"},
-            {t_19m_28s, uprv_lengthof(t_19m_28s), "19:28"},
-            {t_2y_5M_3w_4d, uprv_lengthof(t_2y_5M_3w_4d), "2 J, 5 M, 3 W und 4 T"},
-            {t_0h_0m_17s, uprv_lengthof(t_0h_0m_17s), "0:00:17"},
-            {t_6h_56_92m, uprv_lengthof(t_6h_56_92m), "6:56,92"},
-            {t_3h_5h, uprv_lengthof(t_3h_5h), "3 Std., 5 Std."}};
+            {t_1m_59_9996s, UPRV_LENGTHOF(t_1m_59_9996s), "1:59,9996"},
+            {t_19m, UPRV_LENGTHOF(t_19m), "19 Min."},
+            {t_1h_23_5s, UPRV_LENGTHOF(t_1h_23_5s), "1:00:23,5"},
+            {t_1h_23_5m, UPRV_LENGTHOF(t_1h_23_5m), "1:23,5"},
+            {t_1h_0m_23s, UPRV_LENGTHOF(t_1h_0m_23s), "1:00:23"},
+            {t_5h_17m, UPRV_LENGTHOF(t_5h_17m), "5:17"},
+            {t_19m_28s, UPRV_LENGTHOF(t_19m_28s), "19:28"},
+            {t_2y_5M_3w_4d, UPRV_LENGTHOF(t_2y_5M_3w_4d), "2 J, 5 M, 3 W und 4 T"},
+            {t_0h_0m_17s, UPRV_LENGTHOF(t_0h_0m_17s), "0:00:17"},
+            {t_6h_56_92m, UPRV_LENGTHOF(t_6h_56_92m), "6:56,92"},
+            {t_3h_5h, UPRV_LENGTHOF(t_3h_5h), "3 Std., 5 Std."}};
 
     Locale en(Locale::getEnglish());
     LocalPointer<NumberFormat> nf(NumberFormat::createInstance(en, status));
@@ -493,34 +493,34 @@ void MeasureFormatTest::TestFormatPeriodEn() {
     if (!assertSuccess("Error creating measure format en WIDE", status)) {
         return;
     }
-    verifyFormat("en WIDE", mf, fullData, uprv_lengthof(fullData));
+    verifyFormat("en WIDE", mf, fullData, UPRV_LENGTHOF(fullData));
 
     // exercise copy constructor
     {
         MeasureFormat mf2(mf);
-        verifyFormat("en WIDE copy", mf2, fullData, uprv_lengthof(fullData));
+        verifyFormat("en WIDE copy", mf2, fullData, UPRV_LENGTHOF(fullData));
     }
     // exercise clone
     {
         MeasureFormat *mf3 = (MeasureFormat *) mf.clone();
-        verifyFormat("en WIDE copy", *mf3, fullData, uprv_lengthof(fullData));
+        verifyFormat("en WIDE copy", *mf3, fullData, UPRV_LENGTHOF(fullData));
         delete mf3;
     }
     mf = MeasureFormat(en, UMEASFMT_WIDTH_SHORT, (NumberFormat *) nf->clone(), status);
     if (!assertSuccess("Error creating measure format en SHORT", status)) {
         return;
     }
-    verifyFormat("en SHORT", mf, abbrevData, uprv_lengthof(abbrevData));
+    verifyFormat("en SHORT", mf, abbrevData, UPRV_LENGTHOF(abbrevData));
     mf = MeasureFormat(en, UMEASFMT_WIDTH_NARROW, (NumberFormat *) nf->clone(), status);
     if (!assertSuccess("Error creating measure format en NARROW", status)) {
         return;
     }
-    verifyFormat("en NARROW", mf, narrowData, uprv_lengthof(narrowData));
+    verifyFormat("en NARROW", mf, narrowData, UPRV_LENGTHOF(narrowData));
     mf = MeasureFormat(en, UMEASFMT_WIDTH_NUMERIC, (NumberFormat *) nf->clone(), status);
     if (!assertSuccess("Error creating measure format en NUMERIC", status)) {
         return;
     }
-    verifyFormat("en NUMERIC", mf, numericData, uprv_lengthof(numericData));
+    verifyFormat("en NUMERIC", mf, numericData, UPRV_LENGTHOF(numericData));
     
     Locale de(Locale::getGerman());
     nf.adoptInstead(NumberFormat::createInstance(de, status));
@@ -532,12 +532,12 @@ void MeasureFormatTest::TestFormatPeriodEn() {
     if (!assertSuccess("Error creating measure format de WIDE", status)) {
         return;
     }
-    verifyFormat("de WIDE", mf, fullDataDe, uprv_lengthof(fullDataDe));
+    verifyFormat("de WIDE", mf, fullDataDe, UPRV_LENGTHOF(fullDataDe));
     mf = MeasureFormat(de, UMEASFMT_WIDTH_NUMERIC, (NumberFormat *) nf->clone(), status);
     if (!assertSuccess("Error creating measure format de NUMERIC", status)) {
         return;
     }
-    verifyFormat("de NUMERIC", mf, numericDataDe, uprv_lengthof(numericDataDe));
+    verifyFormat("de NUMERIC", mf, numericDataDe, UPRV_LENGTHOF(numericDataDe));
 }
 
 void MeasureFormatTest::Test10219FractionalPlurals() {
@@ -548,8 +548,8 @@ void MeasureFormatTest::Test10219FractionalPlurals() {
             {"1 minute", "1.0 minutes", "1.01 minutes"}
     };
     UErrorCode status = U_ZERO_ERROR;
-    for (int j = 0; j < uprv_lengthof(values); j++) {
-        for (int i = 0; i < uprv_lengthof(expected[j]); i++) {
+    for (int j = 0; j < UPRV_LENGTHOF(values); j++) {
+        for (int i = 0; i < UPRV_LENGTHOF(expected[j]); i++) {
             DecimalFormat *df =
                 (DecimalFormat *) NumberFormat::createInstance(en, status);
             if (U_FAILURE(status)) {
@@ -655,10 +655,10 @@ void MeasureFormatTest::TestGreek() {
         "7 \\u03AD\\u03C4\\u03B7"};
 
     int32_t counter = 0;
-    for (int32_t locIndex = 0; locIndex < uprv_lengthof(locales); ++locIndex ) {
-        for( int32_t numIndex = 0; numIndex < uprv_lengthof(numbers); ++numIndex ) {
-            for ( int32_t styleIndex = 0; styleIndex < uprv_lengthof(styles); ++styleIndex ) {
-                for ( int32_t unitIndex = 0; unitIndex < uprv_lengthof(units); ++unitIndex ) {
+    for (int32_t locIndex = 0; locIndex < UPRV_LENGTHOF(locales); ++locIndex ) {
+        for( int32_t numIndex = 0; numIndex < UPRV_LENGTHOF(numbers); ++numIndex ) {
+            for ( int32_t styleIndex = 0; styleIndex < UPRV_LENGTHOF(styles); ++styleIndex ) {
+                for ( int32_t unitIndex = 0; unitIndex < UPRV_LENGTHOF(units); ++unitIndex ) {
                     Measure measure(numbers[numIndex], new MeasureUnit(units[unitIndex]), status);
                     if (!assertSuccess("Error creating Measure", status)) {
                         return;
@@ -732,7 +732,7 @@ void MeasureFormatTest::helperTestMultiples(
         return;
     }
     UnicodeString buffer;
-    fmt.formatMeasures(measures, uprv_lengthof(measures), buffer, pos, status);
+    fmt.formatMeasures(measures, UPRV_LENGTHOF(measures), buffer, pos, status);
     if (!assertSuccess("Error formatting measures", status)) {
         return;
     }
@@ -855,7 +855,7 @@ void MeasureFormatTest::TestFieldPositionMultiple() {
             fmt,
             prefix,
             first,
-            uprv_lengthof(first),
+            UPRV_LENGTHOF(first),
             NumberFormat::kIntegerField,
             8,
             11);
@@ -864,7 +864,7 @@ void MeasureFormatTest::TestFieldPositionMultiple() {
             fmt,
             prefix,
             second,
-            uprv_lengthof(second),
+            UPRV_LENGTHOF(second),
             NumberFormat::kDecimalSeparatorField,
             23,
             24);
@@ -873,7 +873,7 @@ void MeasureFormatTest::TestFieldPositionMultiple() {
             fmt,
             prefix,
             third,
-            uprv_lengthof(third),
+            UPRV_LENGTHOF(third),
             NumberFormat::kDecimalSeparatorField,
             0,
             0);
@@ -964,7 +964,7 @@ void MeasureFormatTest::TestDoubleZero() {
     }
     nf->setMinimumFractionDigits(2);
     nf->setMaximumFractionDigits(2);
-    fmt.formatMeasures(measures, uprv_lengthof(measures), appendTo, pos, status);
+    fmt.formatMeasures(measures, UPRV_LENGTHOF(measures), appendTo, pos, status);
     if (!assertSuccess("Error formatting", status)) {
         return;
     }
@@ -974,7 +974,7 @@ void MeasureFormatTest::TestDoubleZero() {
             appendTo);
     measures[0] = Measure(-4.7, MeasureUnit::createHour(status), status);
     appendTo.remove();
-    fmt.formatMeasures(measures, uprv_lengthof(measures), appendTo, pos, status);
+    fmt.formatMeasures(measures, UPRV_LENGTHOF(measures), appendTo, pos, status);
     if (!assertSuccess("Error formatting", status)) {
         return;
     }
index ba216fdacfba9173d3383e4f92d348d187a054d8..bf67e5238b691c50f19d9beaf94e101bd337e7d4 100644 (file)
@@ -3401,8 +3401,8 @@ NumberFormatTest::TestCurrencyIsoPluralFormat() {
         UNUM_CURRENCY_PLURAL
     };
 
-    for (int32_t i=0; i<uprv_lengthof(DATA); ++i) {
-      for (int32_t kIndex = 0; kIndex < uprv_lengthof(currencyStyles); ++kIndex) {
+    for (int32_t i=0; i<UPRV_LENGTHOF(DATA); ++i) {
+      for (int32_t kIndex = 0; kIndex < UPRV_LENGTHOF(currencyStyles); ++kIndex) {
         UNumberFormatStyle k = currencyStyles[kIndex];
         const char* localeString = DATA[i][0];
         double numberToBeFormat = atof(DATA[i][1]);
@@ -3510,7 +3510,7 @@ for (;;) {
     printf("loop: %d\n", deadloop++);
 #endif
     for (uint32_t i=0; i< sizeof(DATA)/sizeof(DATA[0]); ++i) {  /* i = test case #  - should be i=0*/
-      for (int32_t kIndex = 2; kIndex < uprv_lengthof(currencyStyles); ++kIndex) {
+      for (int32_t kIndex = 2; kIndex < UPRV_LENGTHOF(currencyStyles); ++kIndex) {
         UNumberFormatStyle k = currencyStyles[kIndex]; /* k = style */
         const char* localeString = DATA[i][0];
         double numberToBeFormat = atof(DATA[i][1]);
index 6715d35748d7910c63de8df7aded9c6ba2876214..14e24191946d9035616f8aa314e6b5e06dab775b 100644 (file)
@@ -219,7 +219,7 @@ void PluralRulesTest::testAPI(/*char *par*/)
     }
     double fData[] =     {-101, -100, -1,     -0.0,  0,     0.1,  1,     1.999,  2.0,   100,   100.001 };
     UBool isKeywordA[] = {TRUE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE,   FALSE, FALSE, TRUE };
-    for (int32_t i=0; i<uprv_lengthof(fData); i++) {
+    for (int32_t i=0; i<UPRV_LENGTHOF(fData); i++) {
         if ((newRules->select(fData[i])== KEYWORD_A) != isKeywordA[i]) {
              errln("File %s, Line %d, ERROR: plural rules for decimal fractions test failed!\n"
                    "  number = %g, expected %s", __FILE__, __LINE__, fData[i], isKeywordA[i]?"TRUE":"FALSE");
@@ -396,7 +396,7 @@ void PluralRulesTest::testGetSamples() {
     }
     const UnicodeString* keyword;
     while (NULL != (keyword = keywords->snext(status))) {
-      int32_t count = rules->getSamples(*keyword, values, uprv_lengthof(values), status);
+      int32_t count = rules->getSamples(*keyword, values, UPRV_LENGTHOF(values), status);
       if (U_FAILURE(status)) {
         errln(UNICODE_STRING_SIMPLE("getSamples() failed for locale ") +
               locales[i].getName() +
@@ -407,12 +407,12 @@ void PluralRulesTest::testGetSamples() {
         // TODO: Lots of these. 
         //   errln(UNICODE_STRING_SIMPLE("no samples for keyword ") + *keyword + UNICODE_STRING_SIMPLE(" in locale ") + locales[i].getName() );
       }
-      if (count > uprv_lengthof(values)) {
+      if (count > UPRV_LENGTHOF(values)) {
         errln(UNICODE_STRING_SIMPLE("getSamples()=") + count +
               UNICODE_STRING_SIMPLE(", too many values, for locale ") +
               locales[i].getName() +
               UNICODE_STRING_SIMPLE(", keyword ") + *keyword);
-        count = uprv_lengthof(values);
+        count = UPRV_LENGTHOF(values);
       }
       for (int32_t j = 0; j < count; ++j) {
         if (values[j] == UPLRULES_NO_UNIQUE_VALUE) {
@@ -937,7 +937,7 @@ void PluralRulesTest::testParseErrors() {
             "a: n % 37 ! in 3..4"
 
             };
-    for (int i=0; i<uprv_lengthof(testCases); i++) {
+    for (int i=0; i<UPRV_LENGTHOF(testCases); i++) {
         const char *rules = testCases[i];
         UErrorCode status = U_ZERO_ERROR;
         PluralRules *pr = PluralRules::createRules(UnicodeString(rules), status);
@@ -979,7 +979,7 @@ void PluralRulesTest::testFixedDecimal() {
         {100.0001234, 7, 1234}
     };
 
-    for (int i=0; i<uprv_lengthof(testCases); ++i) {
+    for (int i=0; i<UPRV_LENGTHOF(testCases); ++i) {
         DoubleTestCase &tc = testCases[i];
         int32_t numFractionDigits = FixedDecimal::decimals(tc.n);
         if (numFractionDigits != tc.fractionDigitCount) {
index c246495eaff5c2cdbd2db8d6b66cdd0ab59bef31..ca2fd21481a47d52695c9a36bc20a838b1f0f4ab 100644 (file)
@@ -5267,7 +5267,7 @@ void RegexTest::Bug10459() {
     //   It should set an U_REGEX_INVALID_STATE.
 
     UChar buf[100];
-    int32_t len = uregex_group(icu_re, 0, buf, uprv_lengthof(buf), &status);
+    int32_t len = uregex_group(icu_re, 0, buf, UPRV_LENGTHOF(buf), &status);
     REGEX_ASSERT(status == U_REGEX_INVALID_STATE);
     REGEX_ASSERT(len == 0);
 
index ecad29ed6e1088662f90cfda44c781978c468911..d2da87fec67c0ca515c374bc44b4f3697cc894ca 100644 (file)
@@ -362,7 +362,7 @@ RegionTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char*
 
 void RegionTest::TestKnownRegions() {
 
-    for (int32_t i = 0 ; i < uprv_lengthof(knownRegions) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(knownRegions) ; i++ ) {
         KnownRegion rd = knownRegions[i];
         UErrorCode status = U_ZERO_ERROR;
         const Region *r = Region::getInstance(rd.code,status);
@@ -423,7 +423,7 @@ void RegionTest::TestGetInstanceString() {
     }
 
 
-    for (int32_t i = 0 ; i < uprv_lengthof(testData) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(testData) ; i++ ) {
         TestData data = testData[i];
         status = U_ZERO_ERROR;
         r = Region::getInstance(data.inputID,status);
@@ -467,7 +467,7 @@ void RegionTest::TestGetInstanceInt() {
         errcheckln(status, "Calling Region::getInstance(-123) should have triggered an U_ILLEGAL_ARGUMENT_ERROR, but didn't. - %s", u_errorName(status));
     }
 
-    for (int32_t i = 0 ; i < uprv_lengthof(testData) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(testData) ; i++ ) {
         TestData data = testData[i];
         status = U_ZERO_ERROR;
         const Region *r = Region::getInstance(data.inputID,status);
@@ -490,7 +490,7 @@ void RegionTest::TestGetInstanceInt() {
 }
 
 void RegionTest::TestGetContainedRegions() {
-    for (int32_t i = 0 ; i < uprv_lengthof(knownRegions) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(knownRegions) ; i++ ) {
         KnownRegion rd = knownRegions[i];
         UErrorCode status = U_ZERO_ERROR;
 
@@ -517,7 +517,7 @@ void RegionTest::TestGetContainedRegions() {
 }
 
 void RegionTest::TestGetContainedRegionsWithType() {
-    for (int32_t i = 0 ; i < uprv_lengthof(knownRegions) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(knownRegions) ; i++ ) {
         KnownRegion rd = knownRegions[i];
         UErrorCode status = U_ZERO_ERROR;
 
@@ -544,7 +544,7 @@ void RegionTest::TestGetContainedRegionsWithType() {
 }
 
 void RegionTest::TestGetContainingRegion() {        
-    for (int32_t i = 0 ; i < uprv_lengthof(knownRegions) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(knownRegions) ; i++ ) {
         KnownRegion rd = knownRegions[i];
         UErrorCode status = U_ZERO_ERROR;
         const Region *r = Region::getInstance(rd.code,status);
@@ -568,7 +568,7 @@ void RegionTest::TestGetContainingRegion() {
 }
 
 void RegionTest::TestGetContainingRegionWithType() {        
-    for (int32_t i = 0 ; i < uprv_lengthof(knownRegions) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(knownRegions) ; i++ ) {
         KnownRegion rd = knownRegions[i];
         UErrorCode status = U_ZERO_ERROR;
 
@@ -630,7 +630,7 @@ void RegionTest::TestGetPreferredValues() {
 }
 
 void RegionTest::TestContains() {        
-    for (int32_t i = 0 ; i < uprv_lengthof(knownRegions) ; i++ ) {
+    for (int32_t i = 0 ; i < UPRV_LENGTHOF(knownRegions) ; i++ ) {
         KnownRegion rd = knownRegions[i];
         UErrorCode status = U_ZERO_ERROR;
 
index 0a06afa6b36c352529f5335018d8873cc3daf188..bd2c614bc9a3a2a656f3fae28b7d7ab6ad9fea20 100644 (file)
@@ -616,7 +616,7 @@ void RelativeDateTimeFormatterTest::runIndexedTest(
 }
 
 void RelativeDateTimeFormatterTest::TestEnglish() {
-    RunTest("en", kEnglish, uprv_lengthof(kEnglish));
+    RunTest("en", kEnglish, UPRV_LENGTHOF(kEnglish));
 }
 
 void RelativeDateTimeFormatterTest::TestEnglishCaps() {
@@ -637,27 +637,27 @@ void RelativeDateTimeFormatterTest::TestEnglishCaps() {
     RelativeDateTimeFormatter fmt2(fmt);
     fmt3 = fmt2;
     assertSuccess("", status);
-    RunTest(fmt3, kEnglishCaps, uprv_lengthof(kEnglishCaps), "en caps");
+    RunTest(fmt3, kEnglishCaps, UPRV_LENGTHOF(kEnglishCaps), "en caps");
 }
 
 void RelativeDateTimeFormatterTest::TestEnglishShort() {
-    RunTest("en", UDAT_STYLE_SHORT, kEnglishShort, uprv_lengthof(kEnglishShort));
+    RunTest("en", UDAT_STYLE_SHORT, kEnglishShort, UPRV_LENGTHOF(kEnglishShort));
 }
 
 void RelativeDateTimeFormatterTest::TestEnglishNarrow() {
-    RunTest("en", UDAT_STYLE_NARROW, kEnglishNarrow, uprv_lengthof(kEnglishNarrow));
+    RunTest("en", UDAT_STYLE_NARROW, kEnglishNarrow, UPRV_LENGTHOF(kEnglishNarrow));
 }
 
 void RelativeDateTimeFormatterTest::TestSerbian() {
-    RunTest("sr", kSerbian, uprv_lengthof(kSerbian));
+    RunTest("sr", kSerbian, UPRV_LENGTHOF(kSerbian));
 }
 
 void RelativeDateTimeFormatterTest::TestSerbianFallback() {
-    RunTest("sr", UDAT_STYLE_NARROW, kSerbian, uprv_lengthof(kSerbian));
+    RunTest("sr", UDAT_STYLE_NARROW, kSerbian, UPRV_LENGTHOF(kSerbian));
 }
 
 void RelativeDateTimeFormatterTest::TestEnglishNoQuantity() {
-    RunTest("en", kEnglishNoQuantity, uprv_lengthof(kEnglishNoQuantity));
+    RunTest("en", kEnglishNoQuantity, UPRV_LENGTHOF(kEnglishNoQuantity));
 }
 
 void RelativeDateTimeFormatterTest::TestEnglishNoQuantityCaps() {
@@ -674,7 +674,7 @@ void RelativeDateTimeFormatterTest::TestEnglishNoQuantityCaps() {
     RunTest(
             fmt,
             kEnglishNoQuantityCaps,
-            uprv_lengthof(kEnglishNoQuantityCaps),
+            UPRV_LENGTHOF(kEnglishNoQuantityCaps),
             "en caps no quantity");
 }
 
@@ -683,7 +683,7 @@ void RelativeDateTimeFormatterTest::TestEnglishNoQuantityShort() {
             "en",
             UDAT_STYLE_SHORT,
             kEnglishNoQuantityShort,
-            uprv_lengthof(kEnglishNoQuantityShort));
+            UPRV_LENGTHOF(kEnglishNoQuantityShort));
 }
 
 void RelativeDateTimeFormatterTest::TestEnglishNoQuantityNarrow() {
@@ -691,11 +691,11 @@ void RelativeDateTimeFormatterTest::TestEnglishNoQuantityNarrow() {
             "en",
             UDAT_STYLE_NARROW,
             kEnglishNoQuantityNarrow,
-            uprv_lengthof(kEnglishNoQuantityNarrow));
+            UPRV_LENGTHOF(kEnglishNoQuantityNarrow));
 }
 
 void RelativeDateTimeFormatterTest::TestSpanishNoQuantity() {
-    RunTest("es", kSpanishNoQuantity, uprv_lengthof(kSpanishNoQuantity));
+    RunTest("es", kSpanishNoQuantity, UPRV_LENGTHOF(kSpanishNoQuantity));
 }
 
 void RelativeDateTimeFormatterTest::TestFormatWithQuantityIllegalArgument() {
@@ -739,11 +739,11 @@ void RelativeDateTimeFormatterTest::TestCustomNumberFormat() {
 
     // Test copy constructor.
     RelativeDateTimeFormatter fmt2(fmt);
-    RunTest(fmt2, kEnglishDecimal, uprv_lengthof(kEnglishDecimal), "en decimal digits");
+    RunTest(fmt2, kEnglishDecimal, UPRV_LENGTHOF(kEnglishDecimal), "en decimal digits");
 
     // Test assignment
     fmt = RelativeDateTimeFormatter("es", status);
-    RunTest(fmt, kSpanishNoQuantity, uprv_lengthof(kSpanishNoQuantity), "assignment operator");
+    RunTest(fmt, kSpanishNoQuantity, UPRV_LENGTHOF(kSpanishNoQuantity), "assignment operator");
 
 }
 
index bae9efa02f8634a5f705beaea28df9eaa6ae2406..30bc28f91c7bb7bb97b886b28df69e4a26d75dd5 100644 (file)
@@ -181,7 +181,7 @@ void SelectFormatTest::selectFormatUnitTest(/*char *par*/)
     selFmt = NULL;
 
     selFmt = new SelectFormat( SIMPLE_PATTERN , status); 
-    for (int32_t i = 0; i < uprv_lengthof(keywords); i++ ){
+    for (int32_t i = 0; i < UPRV_LENGTHOF(keywords); i++ ){
         status = U_ZERO_ERROR;
         selFmt->format( keywords[i], result , ignore , status);
         if (!U_FAILURE(status)) {
index 3b0f2982101636a4b4e94c452d41ad94f021e757..c408d091ba07a0d8ef2c5f6e336da73c6396e418 100644 (file)
@@ -103,13 +103,13 @@ void SimplePatternFormatterTest::TestManyPlaceholders() {
             "Prefix: Templates frogtommy{0} and leg are out of order.",
             fmt.format(
                     params,
-                    uprv_lengthof(params),
+                    UPRV_LENGTHOF(params),
                     appendTo,
                     offsets,
-                    uprv_lengthof(offsets),
+                    UPRV_LENGTHOF(offsets),
                     status));
     assertSuccess("Status", status);
-    for (int32_t i = 0; i < uprv_lengthof(expectedOffsets); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(expectedOffsets); ++i) {
         if (expectedOffsets[i] != offsets[i]) {
             errln("Expected %d, got %d", expectedOffsets[i], offsets[i]);
         }
@@ -117,25 +117,25 @@ void SimplePatternFormatterTest::TestManyPlaceholders() {
     appendTo.remove();
     fmt.format(
             params,
-            uprv_lengthof(params) - 1,
+            UPRV_LENGTHOF(params) - 1,
             appendTo,
             offsets,
-            uprv_lengthof(offsets),
+            UPRV_LENGTHOF(offsets),
             status);
     if (status != U_ILLEGAL_ARGUMENT_ERROR) {
         errln("Expected U_ILLEGAL_ARGUMENT_ERROR");
     }
     status = U_ZERO_ERROR;
-    offsets[uprv_lengthof(offsets) - 1] = 289;
+    offsets[UPRV_LENGTHOF(offsets) - 1] = 289;
     appendTo.remove();
     fmt.format(
             params,
-            uprv_lengthof(params),
+            UPRV_LENGTHOF(params),
             appendTo,
             offsets,
-            uprv_lengthof(offsets) - 1,
+            UPRV_LENGTHOF(offsets) - 1,
             status);
-    assertEquals("Offsets buffer length", 289, offsets[uprv_lengthof(offsets) - 1]);
+    assertEquals("Offsets buffer length", 289, offsets[UPRV_LENGTHOF(offsets) - 1]);
 
     // Test assignment
     SimplePatternFormatter s;
@@ -146,7 +146,7 @@ void SimplePatternFormatterTest::TestManyPlaceholders() {
             "Templates frogtommy{0} and leg are out of order.",
             s.format(
                     params,
-                    uprv_lengthof(params),
+                    UPRV_LENGTHOF(params),
                     appendTo,
                     NULL,
                     0,
@@ -160,7 +160,7 @@ void SimplePatternFormatterTest::TestManyPlaceholders() {
             "Templates frogtommy{0} and leg are out of order.",
             r.format(
                     params,
-                    uprv_lengthof(params),
+                    UPRV_LENGTHOF(params),
                     appendTo,
                     NULL,
                     0,
@@ -210,13 +210,13 @@ void SimplePatternFormatterTest::TestOptimization() {
             "leg, freddy, frog and by",
             fmt.format(
                     params,
-                    uprv_lengthof(params),
+                    UPRV_LENGTHOF(params),
                     values[2],
                     offsets,
-                    uprv_lengthof(offsets),
+                    UPRV_LENGTHOF(offsets),
                     status));
     assertSuccess("Status", status);
-    for (int32_t i = 0; i < uprv_lengthof(expectedOffsets); ++i) {
+    for (int32_t i = 0; i < UPRV_LENGTHOF(expectedOffsets); ++i) {
         if (expectedOffsets[i] != offsets[i]) {
             errln("Expected %d, got %d", expectedOffsets[i], offsets[i]);
         }
index 17656b455769a95027c225b63dbcf6e2a168e35b..01d8db9bd1e4195e0b01ece9def20d2c33b2a581 100644 (file)
@@ -490,7 +490,7 @@ StringCaseTest::TestCasing() {
                         // or even just { 0 } as boundaries.
                         static const UChar rules[] = { 0x2e, 0x2a, 0x3b };  // ".*;"
                         UParseError parseError;
-                        iter.adoptInstead(ubrk_openRules(rules, uprv_lengthof(rules), NULL, 0, &parseError, &status));
+                        iter.adoptInstead(ubrk_openRules(rules, UPRV_LENGTHOF(rules), NULL, 0, &parseError, &status));
                     }
                 }
 #endif
index 3eeef5d645e507982232b3c8c68dae44679d3e8a..80bc1c578cfc390868d7acacab0a5461db7f43ff 100644 (file)
@@ -254,7 +254,7 @@ void test_Formattable( void )
         ucs,
         ucs_ptr
     };
-    const int32_t ft_cnt = uprv_lengthof(ftarray);
+    const int32_t ft_cnt = UPRV_LENGTHOF(ftarray);
     Formattable ft_arr( ftarray, ft_cnt );
     UnicodeString temp;
     if ((ft_arr[0].getType() == Formattable::kDate)   && (ft_arr[0].getDate()   == 1.0)
index 17be2b73115013a1d0541cc8ababc475bdd21307..939de8c627d39919e706e64c8e6e321e8ab3c44c 100644 (file)
@@ -1605,7 +1605,7 @@ void TestMessageFormat::TestApostropheMode() {
         "I don't know", "I don't know", "I don''t know",
         "I don't know", "I don''t know", "I don''t know"
     };
-    int32_t tuples_count = uprv_lengthof(tuples);
+    int32_t tuples_count = UPRV_LENGTHOF(tuples);
 
     for (int i = 0; i < tuples_count; i += 3) {
       UnicodeString& desired = tuples[i];
index 9bc3a77a051f546bf8f0ad592157a09657d92e34..0d7db526be0dece2359b09a1cba5f1462dfba4be 100644 (file)
@@ -276,7 +276,7 @@ private:
   IntlTest inteltst =  IntlTest();
  
   status = U_ZERO_ERROR;
-  length = u_shapeArabic(src, -1, dst, uprv_lengthof(dst),
+  length = u_shapeArabic(src, -1, dst, UPRV_LENGTHOF(dst),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_SEEN_TWOCELL_NEAR, &status);
   if(U_FAILURE(status)) {
           inteltst.errln("Fail: status %s\n", u_errorName(status)); 
@@ -284,7 +284,7 @@ private:
   } else if(length!=2) {
     inteltst.errln("Fail: len %d expected 3\n", length);
        return FALSE;
-  } else if(u_strncmp(dst,dst_old,uprv_lengthof(dst))) {
+  } else if(u_strncmp(dst,dst_old,UPRV_LENGTHOF(dst))) {
     inteltst.errln("Fail: got U+%04X U+%04X expected U+%04X U+%04X\n",
             dst[0],dst[1],dst_old[0],dst_old[1]);
        return FALSE;
@@ -293,7 +293,7 @@ private:
 
   //"Trying new tail
   status = U_ZERO_ERROR;
-  length = u_shapeArabic(src, -1, dst, uprv_lengthof(dst),
+  length = u_shapeArabic(src, -1, dst, UPRV_LENGTHOF(dst),
                          U_SHAPE_LETTERS_SHAPE|U_SHAPE_SEEN_TWOCELL_NEAR|U_SHAPE_TAIL_NEW_UNICODE, &status);
   if(U_FAILURE(status)) {
     inteltst.errln("Fail: status %s\n", u_errorName(status)); 
@@ -301,7 +301,7 @@ private:
   } else if(length!=2) {
     inteltst.errln("Fail: len %d expected 3\n", length);
        return FALSE;
-  } else if(u_strncmp(dst,dst_new,uprv_lengthof(dst))) {
+  } else if(u_strncmp(dst,dst_new,UPRV_LENGTHOF(dst))) {
     inteltst.errln("Fail: got U+%04X U+%04X expected U+%04X U+%04X\n",
             dst[0],dst[1],dst_new[0],dst_new[1]);
        return FALSE;
@@ -1777,9 +1777,9 @@ void MultithreadTest::TestUnifiedCache() {
     gFinishedThreads = 0;
     gObjectsCreated = 0;
 
-    UnifiedCacheThread *threads[CACHE_LOAD][uprv_lengthof(gCacheLocales)];
+    UnifiedCacheThread *threads[CACHE_LOAD][UPRV_LENGTHOF(gCacheLocales)];
     for (int32_t i=0; i<CACHE_LOAD; ++i) {
-        for (int32_t j=0; j<uprv_lengthof(gCacheLocales); ++j) {
+        for (int32_t j=0; j<UPRV_LENGTHOF(gCacheLocales); ++j) {
             threads[i][j] = new UnifiedCacheThread(gCacheLocales[j]);
             threads[i][j]->start();
         }
@@ -1787,15 +1787,15 @@ void MultithreadTest::TestUnifiedCache() {
     // Wait on all the threads to complete verify that LENGTHOF(gCacheLocales)
     // objects were created.
     umtx_lock(&gCTMutex);
-    while (gFinishedThreads < CACHE_LOAD*uprv_lengthof(gCacheLocales)) {
+    while (gFinishedThreads < CACHE_LOAD*UPRV_LENGTHOF(gCacheLocales)) {
         umtx_condWait(&gCTConditionVar, &gCTMutex);
     }
-    assertEquals("Objects created", uprv_lengthof(gCacheLocales), gObjectsCreated);
+    assertEquals("Objects created", UPRV_LENGTHOF(gCacheLocales), gObjectsCreated);
     umtx_unlock(&gCTMutex);
 
     // clean up threads
     for (int32_t i=0; i<CACHE_LOAD; ++i) {
-        for (int32_t j=0; j<uprv_lengthof(gCacheLocales); ++j) {
+        for (int32_t j=0; j<UPRV_LENGTHOF(gCacheLocales); ++j) {
             delete threads[i][j];
         }
     }
index 075b83b21d4b8eeffa45c6352fd72ff6fcbedc97..145d57443e274b7bcbcf2583472d9fe9d7229571 100644 (file)
@@ -19,7 +19,7 @@
 #include "normalizer2impl.h"
 #include "tstnorm.h"
 
-#define ARRAY_LENGTH(array) uprv_lengthof(array)
+#define ARRAY_LENGTH(array) UPRV_LENGTHOF(array)
 
 #define CASE(id,test) case id:                          \
                           name = #test;                 \
@@ -746,27 +746,27 @@ BasicNormalizerTest::TestPreviousNext() {
     // for both sets of test data
     static const char *const moves="0+0+0--0-0-+++0--+++++++0--------";
 
-    TestPreviousNext(src, uprv_lengthof(src),
-                     expect, uprv_lengthof(expect),
+    TestPreviousNext(src, UPRV_LENGTHOF(src),
+                     expect, UPRV_LENGTHOF(expect),
                      expectIndex,
                      SRC_MIDDLE, EXPECT_MIDDLE,
                      moves, UNORM_NFD, "basic");
 
-    TestPreviousNext(src_j2911, uprv_lengthof(src_j2911),
-                     expect_j2911, uprv_lengthof(expect_j2911),
+    TestPreviousNext(src_j2911, UPRV_LENGTHOF(src_j2911),
+                     expect_j2911, UPRV_LENGTHOF(expect_j2911),
                      expectIndex_j2911,
                      SRC_MIDDLE, EXPECT_MIDDLE,
                      moves, UNORM_NFKC, "j2911");
 
     // try again from different "middle" indexes
-    TestPreviousNext(src, uprv_lengthof(src),
-                     expect, uprv_lengthof(expect),
+    TestPreviousNext(src, UPRV_LENGTHOF(src),
+                     expect, UPRV_LENGTHOF(expect),
                      expectIndex,
                      SRC_MIDDLE_2, EXPECT_MIDDLE_2,
                      moves, UNORM_NFD, "basic_2");
 
-    TestPreviousNext(src_j2911, uprv_lengthof(src_j2911),
-                     expect_j2911, uprv_lengthof(expect_j2911),
+    TestPreviousNext(src_j2911, UPRV_LENGTHOF(src_j2911),
+                     expect_j2911, UPRV_LENGTHOF(expect_j2911),
                      expectIndex_j2911,
                      SRC_MIDDLE_2, EXPECT_MIDDLE_2,
                      moves, UNORM_NFKC, "j2911_2");
@@ -1063,7 +1063,7 @@ BasicNormalizerTest::TestCompare() {
         { UNORM_UNICODE_3_2<<UNORM_COMPARE_NORM_OPTIONS_SHIFT, "Unicode 3.2" }
     };
 
-    int32_t i, j, k, count=uprv_lengthof(strings);
+    int32_t i, j, k, count=UPRV_LENGTHOF(strings);
     int32_t result, refResult;
 
     UErrorCode errorCode;
@@ -1076,7 +1076,7 @@ BasicNormalizerTest::TestCompare() {
     // test them each with each other
     for(i=0; i<count; ++i) {
         for(j=i; j<count; ++j) {
-            for(k=0; k<uprv_lengthof(opt); ++k) {
+            for(k=0; k<UPRV_LENGTHOF(opt); ++k) {
                 // test Normalizer::compare
                 errorCode=U_ZERO_ERROR;
                 result=_norm_compare(s[i], s[j], opt[k].options, errorCode);
@@ -1116,7 +1116,7 @@ BasicNormalizerTest::TestCompare() {
     }
 
     // collect all sets into one for contiguous output
-    for(i=0; i<uprv_lengthof(iI); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(iI); ++i) {
         if(nfcImpl->getCanonStartSet(iI[i], iSet)) {
             set.addAll(iSet);
         }
@@ -1133,7 +1133,7 @@ BasicNormalizerTest::TestCompare() {
         }
 
         s1.setTo(c);
-        for(k=0; k<uprv_lengthof(opt); ++k) {
+        for(k=0; k<UPRV_LENGTHOF(opt); ++k) {
             // test Normalizer::compare
             errorCode=U_ZERO_ERROR;
             result=_norm_compare(s1, s2, opt[k].options, errorCode);
@@ -1437,7 +1437,7 @@ BasicNormalizerTest::TestCustomComp() {
     if(errorCode.logDataIfFailureAndReset("unable to load testdata/testnorm.nrm")) {
         return;
     }
-    for(int32_t i=0; i<uprv_lengthof(pairs); ++i) {
+    for(int32_t i=0; i<UPRV_LENGTHOF(pairs); ++i) {
         const StringPair &pair=pairs[i];
         UnicodeString input=UnicodeString(pair.input, -1, US_INV).unescape();
         UnicodeString expected=UnicodeString(pair.expected, -1, US_INV).unescape();
@@ -1469,7 +1469,7 @@ BasicNormalizerTest::TestCustomFCC() {
     if(errorCode.logDataIfFailureAndReset("unable to load testdata/testnorm.nrm")) {
         return;
     }
-    for(int32_t i=0; i<uprv_lengthof(pairs); ++i) {
+    for(int32_t i=0; i<UPRV_LENGTHOF(pairs); ++i) {
         const StringPair &pair=pairs[i];
         UnicodeString input=UnicodeString(pair.input, -1, US_INV).unescape();
         UnicodeString expected=UnicodeString(pair.expected, -1, US_INV).unescape();
index 9a1d2ccfcc954b6fbb15771f0d0a3a7d211b8476..796aa0ddd044822db9f7311156eaaca4c6ef99c0 100644 (file)
@@ -421,8 +421,8 @@ void TimeUnitTest::test10219Plurals() {
         dataerrln("generating NumberFormat Object failed: %s", u_errorName(status));
         return;
     }
-    for (int32_t j = 0; j < uprv_lengthof(values); ++j) {
-        for (int32_t i = 0; i < uprv_lengthof(expected[j]); ++i) {
+    for (int32_t j = 0; j < UPRV_LENGTHOF(values); ++j) {
+        for (int32_t i = 0; i < UPRV_LENGTHOF(expected[j]); ++i) {
             nf->setMinimumFractionDigits(i);
             nf->setMaximumFractionDigits(i);
             nf->setRoundingMode(DecimalFormat::kRoundDown);
index 192cc17b735a3f51c72dfc5a35790bf9bb925218..9979f76a06a2b5061db7e3ee14d95a1333c1ee32 100644 (file)
@@ -1905,9 +1905,9 @@ void TimeZoneTest::TestFebruary() {
     TimeZone *tz;
     UDate dt;
     int32_t t, i, raw, dst;
-    for (t = 0; t < uprv_lengthof(timezones); ++t) {
+    for (t = 0; t < UPRV_LENGTHOF(timezones); ++t) {
         tz = timezones[t];
-        for (i = 0; i < uprv_lengthof(data); ++i) {
+        for (i = 0; i < UPRV_LENGTHOF(data); ++i) {
             gc.set(data[i].year, data[i].month, data[i].day,
                    data[i].hour, data[i].minute, data[i].second);
             dt = gc.getTime(status);
index 181fa50bdaa49f36ef95763ae6a4b3f4c66852a5..a63e71291d56ba09a25fd919f907d6130b135f00 100644 (file)
@@ -38,7 +38,7 @@ UnicodeTest::UnicodeTest()
         unknownPropertyNames=NULL;
     }
     // Ignore some property names altogether.
-    for(int32_t i=0; i<uprv_lengthof(ignorePropNames); ++i) {
+    for(int32_t i=0; i<UPRV_LENGTHOF(ignorePropNames); ++i) {
         unknownPropertyNames->puti(UnicodeString(ignorePropNames[i], -1, US_INV), 1, errorCode);
     }
 }
@@ -148,7 +148,7 @@ derivedPropsIndex[]={
     UCHAR_CHANGES_WHEN_NFKC_CASEFOLDED
 };
 
-static int32_t numErrors[uprv_lengthof(derivedPropsIndex)]={ 0 };
+static int32_t numErrors[UPRV_LENGTHOF(derivedPropsIndex)]={ 0 };
 
 enum { MAX_ERRORS=50 };
 
@@ -168,7 +168,7 @@ derivedPropsLineFn(void *context,
     }
 
     /* parse derived binary property name, ignore unknown names */
-    i=getTokenIndex(derivedPropsNames, uprv_lengthof(derivedPropsNames), fields[1][0]);
+    i=getTokenIndex(derivedPropsNames, UPRV_LENGTHOF(derivedPropsNames), fields[1][0]);
     if(i<0) {
         UnicodeString propName(fields[1][0], (int32_t)(fields[1][1]-fields[1][0]));
         propName.trim();
@@ -186,13 +186,13 @@ derivedPropsLineFn(void *context,
 void UnicodeTest::TestAdditionalProperties() {
 #if !UCONFIG_NO_NORMALIZATION
     // test DerivedCoreProperties.txt and DerivedNormalizationProps.txt
-    if(uprv_lengthof(derivedProps)<uprv_lengthof(derivedPropsNames)) {
+    if(UPRV_LENGTHOF(derivedProps)<UPRV_LENGTHOF(derivedPropsNames)) {
         errln("error: UnicodeTest::derivedProps[] too short, need at least %d UnicodeSets\n",
-              uprv_lengthof(derivedPropsNames));
+              UPRV_LENGTHOF(derivedPropsNames));
         return;
     }
-    if(uprv_lengthof(derivedPropsIndex)!=uprv_lengthof(derivedPropsNames)) {
-        errln("error in ucdtest.cpp: uprv_lengthof(derivedPropsIndex)!=uprv_lengthof(derivedPropsNames)\n");
+    if(UPRV_LENGTHOF(derivedPropsIndex)!=UPRV_LENGTHOF(derivedPropsNames)) {
+        errln("error in ucdtest.cpp: UPRV_LENGTHOF(derivedPropsIndex)!=UPRV_LENGTHOF(derivedPropsNames)\n");
         return;
     }
 
@@ -226,7 +226,7 @@ void UnicodeTest::TestAdditionalProperties() {
     UChar32 start, end;
 
     // test all TRUE properties
-    for(i=0; i<uprv_lengthof(derivedPropsNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(derivedPropsNames); ++i) {
         rangeCount=derivedProps[i].getRangeCount();
         for(range=0; range<rangeCount && numErrors[i]<MAX_ERRORS; ++range) {
             start=derivedProps[i].getRangeStart(range);
@@ -244,12 +244,12 @@ void UnicodeTest::TestAdditionalProperties() {
     }
 
     // invert all properties
-    for(i=0; i<uprv_lengthof(derivedPropsNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(derivedPropsNames); ++i) {
         derivedProps[i].complement();
     }
 
     // test all FALSE properties
-    for(i=0; i<uprv_lengthof(derivedPropsNames); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(derivedPropsNames); ++i) {
         rangeCount=derivedProps[i].getRangeCount();
         for(range=0; range<rangeCount && numErrors[i]<MAX_ERRORS; ++range) {
             start=derivedProps[i].getRangeStart(range);
@@ -283,7 +283,7 @@ void UnicodeTest::TestBinaryValues() {
     static const char *const falseValues[]={ "N", "No", "F", "False" };
     static const char *const trueValues[]={ "Y", "Yes", "T", "True" };
     int32_t i;
-    for(i=0; i<uprv_lengthof(falseValues); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(falseValues); ++i) {
         UnicodeString pattern=UNICODE_STRING_SIMPLE("[:Alphabetic=:]");
         pattern.insert(pattern.length()-2, UnicodeString(falseValues[i], -1, US_INV));
         errorCode=U_ZERO_ERROR;
@@ -297,7 +297,7 @@ void UnicodeTest::TestBinaryValues() {
             errln("UnicodeSet([:Alphabetic=%s:]).complement()!=UnicodeSet([:Alphabetic:])\n", falseValues[i]);
         }
     }
-    for(i=0; i<uprv_lengthof(trueValues); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(trueValues); ++i) {
         UnicodeString pattern=UNICODE_STRING_SIMPLE("[:Alphabetic=:]");
         pattern.insert(pattern.length()-2, UnicodeString(trueValues[i], -1, US_INV));
         errorCode=U_ZERO_ERROR;
index 71672e383328fb31a6fea86b934b80b963113fca..fc24faab05785c3c57d13068564411ed5e0f85fd 100644 (file)
@@ -137,14 +137,14 @@ void UCharsTrieTest::TestEmpty() {
     static const StringAndValue data[]={
         { "", 0 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::Test_a() {
     static const StringAndValue data[]={
         { "a", 1 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::Test_a_ab() {
@@ -152,7 +152,7 @@ void UCharsTrieTest::Test_a_ab() {
         { "a", 1 },
         { "ab", 100 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestShortestBranch() {
@@ -160,7 +160,7 @@ void UCharsTrieTest::TestShortestBranch() {
         { "a", 1000 },
         { "b", 2000 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestBranches() {
@@ -180,7 +180,7 @@ void UCharsTrieTest::TestBranches() {
         { "vv", 0x7fffffff },
         { "zz", (int32_t)0x80000000 }
     };
-    for(int32_t length=2; length<=uprv_lengthof(data); ++length) {
+    for(int32_t length=2; length<=UPRV_LENGTHOF(data); ++length) {
         logln("TestBranches length=%d", (int)length);
         checkData(data, length);
     }
@@ -199,7 +199,7 @@ void UCharsTrieTest::TestLongSequence() {
           "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
           "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", -3 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestLongBranch() {
@@ -227,7 +227,7 @@ void UCharsTrieTest::TestLongBranch() {
         { "t234567890", 0x77777777 },
         { "z", (int32_t)0x80000001 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestValuesForState() {
@@ -241,7 +241,7 @@ void UCharsTrieTest::TestValuesForState() {
         { "abcde", -5 },
         { "abcdef", -6 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestCompact() {
@@ -268,7 +268,7 @@ void UCharsTrieTest::TestCompact() {
         { "xjuly", 7 },
         { "xjune", 6 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestFirstForCodePoint() {
@@ -283,7 +283,7 @@ void UCharsTrieTest::TestFirstForCodePoint() {
         { "\\U00050000xy", 8 },
         { "\\U00050000xyz", 9 }
     };
-    checkData(data, uprv_lengthof(data));
+    checkData(data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestNextForCodePoint() {
@@ -292,7 +292,7 @@ void UCharsTrieTest::TestNextForCodePoint() {
         { "\\u4dff\\U00010000\\u9999\\U00020002", 44444 },
         { "\\u4dff\\U000103ff", 99999 }
     };
-    LocalPointer<UCharsTrie> trie(buildTrie(data, uprv_lengthof(data), USTRINGTRIE_BUILD_FAST));
+    LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
     if(trie.isNull()) {
         return;  // buildTrie() reported an error
     }
@@ -456,7 +456,7 @@ UCharsTrie *UCharsTrieTest::buildMonthsTrie(UStringTrieBuildOption buildOption)
         { "jun.", 6 },
         { "june", 6 }
     };
-    return buildTrie(data, uprv_lengthof(data), buildOption);
+    return buildTrie(data, UPRV_LENGTHOF(data), buildOption);
 }
 
 void UCharsTrieTest::TestHasUniqueValue() {
@@ -588,10 +588,10 @@ void UCharsTrieTest::TestIteratorFromBranch() {
         { "uar", 1 },
         { "uary", 1 }
     };
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), data, uprv_lengthof(data));
+    checkIterator(iter.reset(), data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestIteratorFromLinearMatch() {
@@ -616,10 +616,10 @@ void UCharsTrieTest::TestIteratorFromLinearMatch() {
         { "r", 1 },
         { "ry", 1 }
     };
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), data, uprv_lengthof(data));
+    checkIterator(iter.reset(), data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestTruncatingIteratorFromRoot() {
@@ -662,10 +662,10 @@ void UCharsTrieTest::TestTruncatingIteratorFromRoot() {
         { "jun.", 6 },
         { "june", 6 }
     };
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), data, uprv_lengthof(data));
+    checkIterator(iter.reset(), data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::TestTruncatingIteratorFromLinearMatchShort() {
@@ -674,7 +674,7 @@ void UCharsTrieTest::TestTruncatingIteratorFromLinearMatchShort() {
         { "abcdepq", 200 },
         { "abcdeyz", 3000 }
     };
-    LocalPointer<UCharsTrie> trie(buildTrie(data, uprv_lengthof(data), USTRINGTRIE_BUILD_FAST));
+    LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
     if(trie.isNull()) {
         return;  // buildTrie() reported an error
     }
@@ -690,10 +690,10 @@ void UCharsTrieTest::TestTruncatingIteratorFromLinearMatchShort() {
     static const StringAndValue expected[]={
         { "cd", -1 }
     };
-    checkIterator(iter, expected, uprv_lengthof(expected));
+    checkIterator(iter, expected, UPRV_LENGTHOF(expected));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), expected, uprv_lengthof(expected));
+    checkIterator(iter.reset(), expected, UPRV_LENGTHOF(expected));
 }
 
 void UCharsTrieTest::TestTruncatingIteratorFromLinearMatchLong() {
@@ -702,7 +702,7 @@ void UCharsTrieTest::TestTruncatingIteratorFromLinearMatchLong() {
         { "abcdepq", 200 },
         { "abcdeyz", 3000 }
     };
-    LocalPointer<UCharsTrie> trie(buildTrie(data, uprv_lengthof(data), USTRINGTRIE_BUILD_FAST));
+    LocalPointer<UCharsTrie> trie(buildTrie(data, UPRV_LENGTHOF(data), USTRINGTRIE_BUILD_FAST));
     if(trie.isNull()) {
         return;  // buildTrie() reported an error
     }
@@ -721,10 +721,10 @@ void UCharsTrieTest::TestTruncatingIteratorFromLinearMatchLong() {
         { "dep", -1 },
         { "dey", -1 }
     };
-    checkIterator(iter, expected, uprv_lengthof(expected));
+    checkIterator(iter, expected, UPRV_LENGTHOF(expected));
     // Reset, and we should get the same result.
     logln("after iter.reset()");
-    checkIterator(iter.reset(), expected, uprv_lengthof(expected));
+    checkIterator(iter.reset(), expected, UPRV_LENGTHOF(expected));
 }
 
 void UCharsTrieTest::TestIteratorFromUChars() {
@@ -735,13 +735,13 @@ void UCharsTrieTest::TestIteratorFromUChars() {
     };
     builder_->clear();
     IcuTestErrorCode errorCode(*this, "TestIteratorFromUChars()");
-    for(int32_t i=0; i<uprv_lengthof(data); ++i) {
+    for(int32_t i=0; i<UPRV_LENGTHOF(data); ++i) {
         builder_->add(data[i].s, data[i].value, errorCode);
     }
     UnicodeString trieUChars;
     builder_->buildUnicodeString(USTRINGTRIE_BUILD_FAST, trieUChars, errorCode);
     UCharsTrie::Iterator iter(trieUChars.getBuffer(), 0, errorCode);
-    checkIterator(iter, data, uprv_lengthof(data));
+    checkIterator(iter, data, UPRV_LENGTHOF(data));
 }
 
 void UCharsTrieTest::checkData(const StringAndValue data[], int32_t dataLength) {
@@ -1034,7 +1034,7 @@ void UCharsTrieTest::checkIterator(UCharsTrie::Iterator &iter,
         if(iter.getString()!=expectedString) {
             char buffer[1000];
             UnicodeString invString(prettify(iter.getString()));
-            invString.extract(0, invString.length(), buffer, uprv_lengthof(buffer), US_INV);
+            invString.extract(0, invString.length(), buffer, UPRV_LENGTHOF(buffer), US_INV);
             errln("trie iterator next().getString()=%s but expected %s for item %d",
                   buffer, data[i].s, (int)i);
         }
index e4955ff363477661cc37987f987e135b81a4361f..3f1713d357ba783cb65e77c365a1bcb20dcc3133 100644 (file)
@@ -2320,7 +2320,7 @@ public:
             const UnicodeString *s;
             char *s8=utf8;
             int32_t length8, utf8Count=0;
-            while(iter.nextRange() && stringsLength<uprv_lengthof(strings)) {
+            while(iter.nextRange() && stringsLength<UPRV_LENGTHOF(strings)) {
                 if(iter.isString()) {
                     // Store the pointer to the set's string element
                     // which we happen to know is a stable pointer.
@@ -3074,7 +3074,7 @@ void UnicodeSetTest::testSpan(const UnicodeSetWithStrings *sets[4],
                                  s, length, isUTF16,
                                  whichSpans,
                                  type, typeName,
-                                 limits, uprv_lengthof(limits), expectCount);
+                                 limits, UPRV_LENGTHOF(limits), expectCount);
             if(typeName[0]==0) {
                 break; // All types tried.
             }
@@ -3083,9 +3083,9 @@ void UnicodeSetTest::testSpan(const UnicodeSetWithStrings *sets[4],
             }
             if(expectCount<0) {
                 expectCount=limitsCount;
-                if(limitsCount>uprv_lengthof(limits)) {
+                if(limitsCount>UPRV_LENGTHOF(limits)) {
                     errln("FAIL: %s[0x%lx].%s.%s span count=%ld > %ld capacity - too many spans",
-                          testName, (long)index, setNames[i], typeName, (long)limitsCount, (long)uprv_lengthof(limits));
+                          testName, (long)index, setNames[i], typeName, (long)limitsCount, (long)UPRV_LENGTHOF(limits));
                     return;
                 }
                 memcpy(expectLimits, limits, limitsCount*4);
@@ -3278,7 +3278,7 @@ void UnicodeSetTest::testSpanContents(const UnicodeSetWithStrings *sets[4], uint
 
     UChar32 c, first;
     for(first=c=0;; c=nextCodePoint(c)) {
-        if(c>0x10ffff || length>(uprv_lengthof(s)-U16_MAX_LENGTH)) {
+        if(c>0x10ffff || length>(UPRV_LENGTHOF(s)-U16_MAX_LENGTH)) {
             localWhichSpans=whichSpans;
             if(stringContainsUnpairedSurrogate(s, length) && inconsistentSurrogates) {
                 localWhichSpans&=~SPAN_UTF8;
@@ -3314,7 +3314,7 @@ void UnicodeSetTest::testSpanUTF16String(const UnicodeSetWithStrings *sets[4], u
         return;
     }
     testSpan(sets, s, -1, TRUE, (whichSpans&~SPAN_UTF8), testName, 0);
-    testSpan(sets, s, uprv_lengthof(s)-1, TRUE, (whichSpans&~SPAN_UTF8), testName, 1);
+    testSpan(sets, s, UPRV_LENGTHOF(s)-1, TRUE, (whichSpans&~SPAN_UTF8), testName, 1);
 }
 
 void UnicodeSetTest::testSpanUTF8String(const UnicodeSetWithStrings *sets[4], uint32_t whichSpans, const char *testName) {
@@ -3411,7 +3411,7 @@ void UnicodeSetTest::testSpanUTF8String(const UnicodeSetWithStrings *sets[4], ui
         return;
     }
     testSpan(sets, s, -1, FALSE, (whichSpans&~SPAN_UTF16), testName, 0);
-    testSpan(sets, s, uprv_lengthof(s)-1, FALSE, (whichSpans&~SPAN_UTF16), testName, 1);
+    testSpan(sets, s, UPRV_LENGTHOF(s)-1, FALSE, (whichSpans&~SPAN_UTF16), testName, 1);
 }
 
 // Take a set of span options and multiply them so that
@@ -3613,7 +3613,7 @@ void UnicodeSetTest::TestSpan() {
     char *testNameLimit=testName;
 
     int32_t i, j;
-    for(i=0; i<uprv_lengthof(testdata); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testdata); ++i) {
         const char *s=testdata[i];
         if(s[0]=='[') {
             // Create new test sets from this pattern.
index 200b8251650c0dc4b886b0d73d9ac03ec35dc83c..97151d956a250826255bdfeb6713c15fa96dd720 100644 (file)
@@ -197,9 +197,9 @@ UnicodeStringTest::TestBasicManipulation()
         }
 
         UChar buffer[10]={ 0x61, 0x62, 0x20ac, 0xd900, 0xdc05, 0,   0x62, 0xffff, 0xdbff, 0xdfff };
-        UnicodeString s, t(buffer, -1, uprv_lengthof(buffer));
+        UnicodeString s, t(buffer, -1, UPRV_LENGTHOF(buffer));
 
-        if(s.setTo(buffer, -1, uprv_lengthof(buffer)).length()!=u_strlen(buffer)) {
+        if(s.setTo(buffer, -1, UPRV_LENGTHOF(buffer)).length()!=u_strlen(buffer)) {
             errln("UnicodeString.setTo(buffer, length, capacity) does not work with length==-1");
         }
         if(t.length()!=u_strlen(buffer)) {
@@ -214,11 +214,11 @@ UnicodeStringTest::TestBasicManipulation()
         }
 
         buffer[u_strlen(buffer)]=0xe4;
-        UnicodeString u(buffer, -1, uprv_lengthof(buffer));
-        if(s.setTo(buffer, -1, uprv_lengthof(buffer)).length()!=uprv_lengthof(buffer)) {
+        UnicodeString u(buffer, -1, UPRV_LENGTHOF(buffer));
+        if(s.setTo(buffer, -1, UPRV_LENGTHOF(buffer)).length()!=UPRV_LENGTHOF(buffer)) {
             errln("UnicodeString.setTo(buffer without NUL, length, capacity) does not work with length==-1");
         }
-        if(u.length()!=uprv_lengthof(buffer)) {
+        if(u.length()!=UPRV_LENGTHOF(buffer)) {
             errln("UnicodeString(buffer without NUL, length, capacity) does not work with length==-1");
         }
 
@@ -241,7 +241,7 @@ UnicodeStringTest::TestBasicManipulation()
         static const UChar utf16[]={ 0x61, 0xE4, 0xDF, 0x4E00 };
         UnicodeString from8a = UnicodeString((const char *)utf8);
         UnicodeString from8b = UnicodeString((const char *)utf8, (int32_t)sizeof(utf8)-1);
-        UnicodeString from16(FALSE, utf16, uprv_lengthof(utf16));
+        UnicodeString from16(FALSE, utf16, UPRV_LENGTHOF(utf16));
         if(from8a != from16 || from8b != from16) {
             errln("UnicodeString(const char * U_CHARSET_IS_UTF8) failed");
         }
@@ -1408,7 +1408,7 @@ UnicodeStringTest::TestCountChar32(void) {
         0xd804, 0xdc04, 0xd805, 0xdc05,
         0x67
     };
-    UnicodeString string(str, uprv_lengthof(str));
+    UnicodeString string(str, UPRV_LENGTHOF(str));
     int32_t start, length, number;
 
     /* test hasMoreChar32Than() */
@@ -1662,11 +1662,11 @@ public:
     TestEnumeration() : i(0) {}
 
     virtual int32_t count(UErrorCode& /*status*/) const {
-        return uprv_lengthof(testEnumStrings);
+        return UPRV_LENGTHOF(testEnumStrings);
     }
 
     virtual const UnicodeString *snext(UErrorCode &status) {
-        if(U_SUCCESS(status) && i<uprv_lengthof(testEnumStrings)) {
+        if(U_SUCCESS(status) && i<UPRV_LENGTHOF(testEnumStrings)) {
             unistr=UnicodeString(testEnumStrings[i++], "");
             return &unistr;
         }
@@ -1704,7 +1704,7 @@ UnicodeStringTest::TestStringEnumeration() {
     const char *pc;
 
     // test the next() default implementation and ensureCharsCapacity()
-    for(i=0; i<uprv_lengthof(testEnumStrings); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testEnumStrings); ++i) {
         status=U_ZERO_ERROR;
         pc=ten.next(&length, status);
         s=UnicodeString(testEnumStrings[i], "");
@@ -1719,7 +1719,7 @@ UnicodeStringTest::TestStringEnumeration() {
 
     // test the unext() default implementation
     ten.reset(status);
-    for(i=0; i<uprv_lengthof(testEnumStrings); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testEnumStrings); ++i) {
         status=U_ZERO_ERROR;
         pu=ten.unext(&length, status);
         s=UnicodeString(testEnumStrings[i], "");
@@ -1748,7 +1748,7 @@ UnicodeStringTest::TestStringEnumeration() {
     }
     
     // test  uenum_next()
-    for(i=0; i<uprv_lengthof(testEnumStrings); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testEnumStrings); ++i) {
         status=U_ZERO_ERROR;
         pc=uenum_next(uten, &length, &status);
         if(U_FAILURE(status) || pc==NULL || strcmp(pc, testEnumStrings[i]) != 0) {
@@ -1762,7 +1762,7 @@ UnicodeStringTest::TestStringEnumeration() {
 
     // test the uenum_unext()
     uenum_reset(uten, &status);
-    for(i=0; i<uprv_lengthof(testEnumStrings); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testEnumStrings); ++i) {
         status=U_ZERO_ERROR;
         pu=uenum_unext(uten, &length, &status);
         s=UnicodeString(testEnumStrings[i], "");
@@ -1827,8 +1827,8 @@ UnicodeStringTest::TestUTF32() {
         0x41, 0xfffd, 0x61, 0xfffd, 0xfffd, 0xfffd, 0x5a, 0xd900, 0xdc00, 0x7a,
         0xd800, 0xdc00, 0xd840, 0xdc00, 0xdb40, 0xdc00, 0xdbff, 0xdfff
     };
-    UnicodeString from32 = UnicodeString::fromUTF32(utf32, uprv_lengthof(utf32));
-    UnicodeString expected(FALSE, expected_utf16, uprv_lengthof(expected_utf16));
+    UnicodeString from32 = UnicodeString::fromUTF32(utf32, UPRV_LENGTHOF(utf32));
+    UnicodeString expected(FALSE, expected_utf16, UPRV_LENGTHOF(expected_utf16));
     if(from32 != expected) {
         errln("UnicodeString::fromUTF32() did not create the expected string.");
     }
@@ -1842,9 +1842,9 @@ UnicodeStringTest::TestUTF32() {
     UChar32 result32[16];
     UErrorCode errorCode = U_ZERO_ERROR;
     int32_t length32 =
-        UnicodeString(FALSE, utf16, uprv_lengthof(utf16)).
-        toUTF32(result32, uprv_lengthof(result32), errorCode);
-    if( length32 != uprv_lengthof(expected_utf32) ||
+        UnicodeString(FALSE, utf16, UPRV_LENGTHOF(utf16)).
+        toUTF32(result32, UPRV_LENGTHOF(result32), errorCode);
+    if( length32 != UPRV_LENGTHOF(expected_utf32) ||
         0 != uprv_memcmp(result32, expected_utf32, length32*4) ||
         result32[length32] != 0
     ) {
@@ -1886,7 +1886,7 @@ UnicodeStringTest::TestUTF8() {
         0xdb40, 0xdc00, 0xdbff, 0xdfff
     };
     UnicodeString from8 = UnicodeString::fromUTF8(StringPiece((const char *)utf8, (int32_t)sizeof(utf8)));
-    UnicodeString expected(FALSE, expected_utf16, uprv_lengthof(expected_utf16));
+    UnicodeString expected(FALSE, expected_utf16, UPRV_LENGTHOF(expected_utf16));
 
     if(from8 != expected) {
         errln("UnicodeString::fromUTF8(StringPiece) did not create the expected string.");
@@ -1906,7 +1906,7 @@ UnicodeStringTest::TestUTF8() {
         0x41, 0xef, 0xbf, 0xbd, 0x61, 0xef, 0xbf, 0xbd, 0x5a, 0xf1, 0x90, 0x80, 0x80, 0x7a,
         0xf0, 0x90, 0x80, 0x80, 0xf4, 0x8f, 0xbf, 0xbf
     };
-    UnicodeString us(FALSE, utf16, uprv_lengthof(utf16));
+    UnicodeString us(FALSE, utf16, UPRV_LENGTHOF(utf16));
 
     char buffer[64];
     TestCheckedArrayByteSink sink(buffer, (int32_t)sizeof(buffer));
index 28563a71551246badd1f42f047001d2a50d88604..a1a9cbdba85a818f8c8cb4abc71199658e663919 100644 (file)
@@ -146,7 +146,7 @@ void UTS46Test::TestAPI() {
     }
     // UTF-8
     char buffer[100];
-    TestCheckedArrayByteSink sink(buffer, uprv_lengthof(buffer));
+    TestCheckedArrayByteSink sink(buffer, UPRV_LENGTHOF(buffer));
     errorCode=U_ZERO_ERROR;
     nontrans->labelToUnicodeUTF8(StringPiece(NULL, 5), sink, info, errorCode);
     if(errorCode!=U_ILLEGAL_ARGUMENT_ERROR || sink.NumberOfBytesWritten()!=0) {
@@ -213,7 +213,7 @@ void UTS46Test::TestNotSTD3() {
             UNICODE_STRING_SIMPLE("\\u0000a_2+2=4\\u000A.essen.net").unescape() ||
         info.hasErrors()
     ) {
-        prettify(result).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+        prettify(result).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
         errln("notSTD3.nameToUnicode(non-LDH ASCII) unexpected errors %04lx string %s",
               (long)info.getErrors(), buffer);
     }
@@ -227,7 +227,7 @@ void UTS46Test::TestNotSTD3() {
     input=UNICODE_STRING_SIMPLE("a\\u2260b\\u226Ec\\u226Fd").unescape();
     not3->nameToUnicode(input, result, info, errorCode);
     if(result!=input || info.hasErrors()) {
-        prettify(result).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+        prettify(result).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
         errln("notSTD3.nameToUnicode(equiv to non-LDH ASCII) unexpected errors %04lx string %s",
               (long)info.getErrors(), buffer);
     }
@@ -582,7 +582,7 @@ void UTS46Test::TestSomeCases() {
     IcuTestErrorCode errorCode(*this, "TestSomeCases");
     char buffer[400], buffer2[400];
     int32_t i;
-    for(i=0; i<uprv_lengthof(testCases); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(testCases); ++i) {
         const TestCase &testCase=testCases[i];
         UnicodeString input(ctou(testCase.s));
         UnicodeString expected(ctou(testCase.u));
@@ -611,7 +611,7 @@ void UTS46Test::TestSomeCases() {
                 continue;
             }
             if(uN!=expected) {
-                prettify(uN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+                prettify(uN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 errln("N.nameToUnicode([%d] %s) unexpected string %s",
                       (int)i, testCase.s, buffer);
                 continue;
@@ -629,7 +629,7 @@ void UTS46Test::TestSomeCases() {
                 continue;
             }
             if(uT!=expected) {
-                prettify(uT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+                prettify(uT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 errln("T.nameToUnicode([%d] %s) unexpected string %s",
                       (int)i, testCase.s, buffer);
                 continue;
@@ -642,24 +642,24 @@ void UTS46Test::TestSomeCases() {
         }
         // ToASCII is all-ASCII if no severe errors
         if((aNInfo.getErrors()&severeErrors)==0 && !isASCII(aN)) {
-            prettify(aN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+            prettify(aN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
             errln("N.nameToASCII([%d] %s) (errors %04lx) result is not ASCII %s",
                   (int)i, testCase.s, aNInfo.getErrors(), buffer);
             continue;
         }
         if((aTInfo.getErrors()&severeErrors)==0 && !isASCII(aT)) {
-            prettify(aT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+            prettify(aT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
             errln("T.nameToASCII([%d] %s) (errors %04lx) result is not ASCII %s",
                   (int)i, testCase.s, aTInfo.getErrors(), buffer);
             continue;
         }
         if(verbose) {
             char m= mode=='B' ? mode : 'N';
-            prettify(aN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+            prettify(aN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
             logln("%c.nameToASCII([%d] %s) (errors %04lx) result string: %s",
                   m, (int)i, testCase.s, aNInfo.getErrors(), buffer);
             if(mode!='B') {
-                prettify(aT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
+                prettify(aT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
                 logln("T.nameToASCII([%d] %s) (errors %04lx) result string: %s",
                       (int)i, testCase.s, aTInfo.getErrors(), buffer);
             }
@@ -677,32 +677,32 @@ void UTS46Test::TestSomeCases() {
             continue;
         }
         if(aN!=uNaN) {
-            prettify(aN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-            prettify(uNaN).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+            prettify(aN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+            prettify(uNaN).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
             errln("N.nameToASCII([%d] %s)!=N.nameToUnicode().N.nameToASCII() "
                   "(errors %04lx) %s vs. %s",
                   (int)i, testCase.s, aNInfo.getErrors(), buffer, buffer2);
             continue;
         }
         if(aT!=uTaN) {
-            prettify(aT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-            prettify(uTaN).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+            prettify(aT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+            prettify(uTaN).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
             errln("T.nameToASCII([%d] %s)!=T.nameToUnicode().N.nameToASCII() "
                   "(errors %04lx) %s vs. %s",
                   (int)i, testCase.s, aNInfo.getErrors(), buffer, buffer2);
             continue;
         }
         if(uN!=aNuN) {
-            prettify(uN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-            prettify(aNuN).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+            prettify(uN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+            prettify(aNuN).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
             errln("N.nameToUnicode([%d] %s)!=N.nameToASCII().N.nameToUnicode() "
                   "(errors %04lx) %s vs. %s",
                   (int)i, testCase.s, uNInfo.getErrors(), buffer, buffer2);
             continue;
         }
         if(uT!=aTuN) {
-            prettify(uT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-            prettify(aTuN).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+            prettify(uT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+            prettify(aTuN).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
             errln("T.nameToUnicode([%d] %s)!=T.nameToASCII().N.nameToUnicode() "
                   "(errors %04lx) %s vs. %s",
                   (int)i, testCase.s, uNInfo.getErrors(), buffer, buffer2);
@@ -722,8 +722,8 @@ void UTS46Test::TestSomeCases() {
         }
         if(aN.indexOf((UChar)0x2e)<0) {
             if(aN!=aNL || aNInfo.getErrors()!=aNLInfo.getErrors()) {
-                prettify(aN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-                prettify(aNL).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+                prettify(aN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+                prettify(aNL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
                 errln("N.nameToASCII([%d] %s)!=N.labelToASCII() "
                       "(errors %04lx vs %04lx) %s vs. %s",
                       (int)i, testCase.s, aNInfo.getErrors(), aNLInfo.getErrors(), buffer, buffer2);
@@ -738,8 +738,8 @@ void UTS46Test::TestSomeCases() {
         }
         if(aT.indexOf((UChar)0x2e)<0) {
             if(aT!=aTL || aTInfo.getErrors()!=aTLInfo.getErrors()) {
-                prettify(aT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-                prettify(aTL).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+                prettify(aT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+                prettify(aTL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
                 errln("T.nameToASCII([%d] %s)!=T.labelToASCII() "
                       "(errors %04lx vs %04lx) %s vs. %s",
                       (int)i, testCase.s, aTInfo.getErrors(), aTLInfo.getErrors(), buffer, buffer2);
@@ -754,8 +754,8 @@ void UTS46Test::TestSomeCases() {
         }
         if(uN.indexOf((UChar)0x2e)<0) {
             if(uN!=uNL || uNInfo.getErrors()!=uNLInfo.getErrors()) {
-                prettify(uN).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-                prettify(uNL).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+                prettify(uN).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+                prettify(uNL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
                 errln("N.nameToUnicode([%d] %s)!=N.labelToUnicode() "
                       "(errors %04lx vs %04lx) %s vs. %s",
                       (int)i, testCase.s, uNInfo.getErrors(), uNLInfo.getErrors(), buffer, buffer2);
@@ -770,8 +770,8 @@ void UTS46Test::TestSomeCases() {
         }
         if(uT.indexOf((UChar)0x2e)<0) {
             if(uT!=uTL || uTInfo.getErrors()!=uTLInfo.getErrors()) {
-                prettify(uT).extract(0, 0x7fffffff, buffer, uprv_lengthof(buffer));
-                prettify(uTL).extract(0, 0x7fffffff, buffer2, uprv_lengthof(buffer2));
+                prettify(uT).extract(0, 0x7fffffff, buffer, UPRV_LENGTHOF(buffer));
+                prettify(uTL).extract(0, 0x7fffffff, buffer2, UPRV_LENGTHOF(buffer2));
                 errln("T.nameToUnicode([%d] %s)!=T.labelToUnicode() "
                       "(errors %04lx vs %04lx) %s vs. %s",
                       (int)i, testCase.s, uTInfo.getErrors(), uTLInfo.getErrors(), buffer, buffer2);
index 73410c51e1511e23644d5bb9fa285a904534c436..c5548c10865e654ba6dbf8e8ec5d90679ca427d6 100644 (file)
@@ -139,7 +139,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_OpenAllConverters() {
 
 UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8",utf8_uniSource, uprv_lengthof(utf8_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("utf-8",utf8_uniSource, UPRV_LENGTHOF(utf8_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -148,7 +148,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_UTF8_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_UTF8_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("utf-8",(char*)utf8_encSource, uprv_lengthof(utf8_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("utf-8",(char*)utf8_encSource, UPRV_LENGTHOF(utf8_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -158,7 +158,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_UTF8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_UTF8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("utf-8",utf8_uniSource, uprv_lengthof(utf8_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("utf-8",utf8_uniSource, UPRV_LENGTHOF(utf8_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -167,7 +167,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_UTF8_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_UTF8_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("utf-8",(char*)utf8_encSource, uprv_lengthof(utf8_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("utf-8",(char*)utf8_encSource, UPRV_LENGTHOF(utf8_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -176,7 +176,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_UTF8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_UTF8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("utf-8",utf8_uniSource, uprv_lengthof(utf8_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("utf-8",utf8_uniSource, UPRV_LENGTHOF(utf8_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -185,7 +185,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_UTF8_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_UTF8_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("utf-8",(char*)utf8_encSource, uprv_lengthof(utf8_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("utf-8",(char*)utf8_encSource, UPRV_LENGTHOF(utf8_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -196,7 +196,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_UTF8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, uprv_lengthof(latin1_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, UPRV_LENGTHOF(latin1_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -205,7 +205,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_Latin1_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_Latin1_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, uprv_lengthof(latin1_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, UPRV_LENGTHOF(latin1_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -215,7 +215,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_Latin1_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin1_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-1",latin1_uniSource, uprv_lengthof(latin1_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-1",latin1_uniSource, UPRV_LENGTHOF(latin1_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -224,7 +224,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin1_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin1_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, uprv_lengthof(latin1_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, UPRV_LENGTHOF(latin1_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -233,7 +233,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin1_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin1_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, uprv_lengthof(latin1_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-1",latin1_uniSource, UPRV_LENGTHOF(latin1_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -242,7 +242,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin1_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin1_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, uprv_lengthof(latin1_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-1",(char*)latin1_encSource, UPRV_LENGTHOF(latin1_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -253,7 +253,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin1_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, uprv_lengthof(latin8_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, UPRV_LENGTHOF(latin8_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -262,7 +262,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_Latin8_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_Latin8_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, uprv_lengthof(latin8_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, UPRV_LENGTHOF(latin8_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -272,7 +272,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_Latin8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-8",latin8_uniSource, uprv_lengthof(latin8_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-8859-8",latin8_uniSource, UPRV_LENGTHOF(latin8_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -281,7 +281,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_Latin8_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin8_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, uprv_lengthof(latin8_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, UPRV_LENGTHOF(latin8_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -289,7 +289,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_Latin8_ToUnicode(){
 }
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin8_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, uprv_lengthof(latin8_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-8859-8",latin8_uniSource, UPRV_LENGTHOF(latin8_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -298,7 +298,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_Latin8_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin8_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, uprv_lengthof(latin8_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-8859-8",(char*)latin8_encSource, UPRV_LENGTHOF(latin8_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -310,7 +310,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_Latin8_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, uprv_lengthof(ebcdic_arabic_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, UPRV_LENGTHOF(ebcdic_arabic_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -319,7 +319,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_EBCDIC_Arabic_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_EBCDIC_Arabic_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, uprv_lengthof(ebcdic_arabic_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, UPRV_LENGTHOF(ebcdic_arabic_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -329,7 +329,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_EBCDIC_Arabic_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, uprv_lengthof(ebcdic_arabic_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, UPRV_LENGTHOF(ebcdic_arabic_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -338,7 +338,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_FromUnicode()
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, uprv_lengthof(ebcdic_arabic_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, UPRV_LENGTHOF(ebcdic_arabic_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -347,7 +347,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EBCDIC_Arabic_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, uprv_lengthof(ebcdic_arabic_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("x-EBCDIC-Arabic",ebcdic_arabic_uniSource, UPRV_LENGTHOF(ebcdic_arabic_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -356,7 +356,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_FromUnicode()
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, uprv_lengthof(ebcdic_arabic_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("x-EBCDIC-Arabic",(char*)ebcdic_arabic_encSource, UPRV_LENGTHOF(ebcdic_arabic_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -367,7 +367,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EBCDIC_Arabic_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis",sjis_uniSource, uprv_lengthof(sjis_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("sjis",sjis_uniSource, UPRV_LENGTHOF(sjis_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -376,7 +376,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_SJIS_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_SJIS_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("sjis",(char*)sjis_encSource, uprv_lengthof(sjis_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("sjis",(char*)sjis_encSource, UPRV_LENGTHOF(sjis_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -386,7 +386,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_SJIS_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_SJIS_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("sjis",sjis_uniSource, uprv_lengthof(sjis_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("sjis",sjis_uniSource, UPRV_LENGTHOF(sjis_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -395,7 +395,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_SJIS_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_SJIS_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("sjis",(char*)sjis_encSource, uprv_lengthof(sjis_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("sjis",(char*)sjis_encSource, UPRV_LENGTHOF(sjis_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -404,7 +404,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_SJIS_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_SJIS_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("sjis",sjis_uniSource, uprv_lengthof(sjis_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("sjis",sjis_uniSource, UPRV_LENGTHOF(sjis_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -413,7 +413,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_SJIS_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_SJIS_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("sjis",(char*)sjis_encSource, uprv_lengthof(sjis_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("sjis",(char*)sjis_encSource, UPRV_LENGTHOF(sjis_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -426,7 +426,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_SJIS_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp",eucjp_uniSource, uprv_lengthof(eucjp_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("euc-jp",eucjp_uniSource, UPRV_LENGTHOF(eucjp_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -435,7 +435,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_EUCJP_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_EUCJP_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, uprv_lengthof(eucjp_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, UPRV_LENGTHOF(eucjp_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -445,7 +445,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_EUCJP_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_EUCJP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("euc-jp",eucjp_uniSource, uprv_lengthof(eucjp_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("euc-jp",eucjp_uniSource, UPRV_LENGTHOF(eucjp_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -454,7 +454,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_EUCJP_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EUCJP_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, uprv_lengthof(eucjp_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, UPRV_LENGTHOF(eucjp_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -463,7 +463,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_EUCJP_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_EUCJP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("euc-jp",eucjp_uniSource, uprv_lengthof(eucjp_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("euc-jp",eucjp_uniSource, UPRV_LENGTHOF(eucjp_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -472,7 +472,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_EUCJP_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EUCJP_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, uprv_lengthof(eucjp_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("euc-jp",(char*)eucjp_encSource, UPRV_LENGTHOF(eucjp_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -485,7 +485,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_EUCJP_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312",gb2312_uniSource, uprv_lengthof(gb2312_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("gb2312",gb2312_uniSource, UPRV_LENGTHOF(gb2312_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -494,7 +494,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_GB2312_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_GB2312_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, uprv_lengthof(gb2312_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, UPRV_LENGTHOF(gb2312_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -504,7 +504,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_GB2312_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_GB2312_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("gb2312",gb2312_uniSource, uprv_lengthof(gb2312_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("gb2312",gb2312_uniSource, UPRV_LENGTHOF(gb2312_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -513,7 +513,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_GB2312_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_GB2312_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, uprv_lengthof(gb2312_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, UPRV_LENGTHOF(gb2312_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -522,7 +522,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_GB2312_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_GB2312_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("gb2312",gb2312_uniSource, uprv_lengthof(gb2312_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("gb2312",gb2312_uniSource, UPRV_LENGTHOF(gb2312_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -531,7 +531,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_GB2312_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_GB2312_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, uprv_lengthof(gb2312_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("gb2312",(char*)gb2312_encSource, UPRV_LENGTHOF(gb2312_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -543,7 +543,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_GB2312_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, uprv_lengthof(iso2022kr_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, UPRV_LENGTHOF(iso2022kr_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -552,7 +552,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022KR_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022KR_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, uprv_lengthof(iso2022kr_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, UPRV_LENGTHOF(iso2022kr_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -562,7 +562,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022KR_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022KR_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, uprv_lengthof(iso2022kr_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, UPRV_LENGTHOF(iso2022kr_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -571,7 +571,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022KR_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022KR_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, uprv_lengthof(iso2022kr_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, UPRV_LENGTHOF(iso2022kr_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -580,7 +580,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022KR_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022KR_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, uprv_lengthof(iso2022kr_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-kr",iso2022kr_uniSource, UPRV_LENGTHOF(iso2022kr_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -589,7 +589,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022KR_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022KR_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, uprv_lengthof(iso2022kr_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-kr",(char*)iso2022kr_encSource, UPRV_LENGTHOF(iso2022kr_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -600,7 +600,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022KR_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, uprv_lengthof(iso2022jp_uniSource), status);
+    ICUFromUnicodePerfFunction* pf = new ICUFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, UPRV_LENGTHOF(iso2022jp_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -609,7 +609,7 @@ UPerfFunction* ConverterPerformanceTest::TestICU_ISO2022JP_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022JP_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, uprv_lengthof(iso2022jp_encSource), status);
+    UPerfFunction* pf = new ICUToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, UPRV_LENGTHOF(iso2022jp_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -619,7 +619,7 @@ UPerfFunction*  ConverterPerformanceTest::TestICU_ISO2022JP_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022JP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, uprv_lengthof(iso2022jp_uniSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2FromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, UPRV_LENGTHOF(iso2022jp_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -628,7 +628,7 @@ UPerfFunction* ConverterPerformanceTest::TestWinIML2_ISO2022JP_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022JP_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, uprv_lengthof(iso2022jp_encSource), status);
+    UPerfFunction* pf = new WinIMultiLanguage2ToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, UPRV_LENGTHOF(iso2022jp_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -637,7 +637,7 @@ UPerfFunction*  ConverterPerformanceTest::TestWinIML2_ISO2022JP_ToUnicode(){
 
 UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022JP_FromUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, uprv_lengthof(iso2022jp_uniSource), status);
+    UPerfFunction* pf = new WinANSIFromUnicodePerfFunction("iso-2022-jp",iso2022jp_uniSource, UPRV_LENGTHOF(iso2022jp_uniSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
@@ -646,9 +646,9 @@ UPerfFunction* ConverterPerformanceTest::TestWinANSI_ISO2022JP_FromUnicode(){
 
 UPerfFunction*  ConverterPerformanceTest::TestWinANSI_ISO2022JP_ToUnicode(){
     UErrorCode status = U_ZERO_ERROR;
-    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, uprv_lengthof(iso2022jp_encSource), status);
+    UPerfFunction* pf = new WinANSIToUnicodePerfFunction("iso-2022-jp",(char*)iso2022jp_encSource, UPRV_LENGTHOF(iso2022jp_encSource), status);
     if(U_FAILURE(status)){
         return NULL;
     }
     return pf;
-}
\ No newline at end of file
+}
index a64972f05069f4bf37f1eb9db7940ce04d710b83..adf1aa1aae9d97090a4d2f5936ff4b7760353a3d 100644 (file)
@@ -158,7 +158,7 @@ public:
         name = cpName;
         src = pszIn;
         srcLen = szLen;
-        dstLen = uprv_lengthof(dest);
+        dstLen = UPRV_LENGTHOF(dest);
         unsigned short bEnc[30]={'\0'};
         const char* tenc=name;
         for(int i=0;*tenc!='\0';i++){
@@ -212,7 +212,7 @@ public:
         name = cpName;
         src = pszIn;
         srcLen = szLen;
-        dstLen = uprv_lengthof(dest);
+        dstLen = UPRV_LENGTHOF(dest);
         lpUsedDefaultChar=FALSE;
         unsigned short bEnc[30]={'\0'};
         const char* tenc=name;
@@ -307,7 +307,7 @@ public:
         getErr(err,status);
         src = source;
         srcLen = sourceLen;
-        dstLen = uprv_lengthof(dst);
+        dstLen = UPRV_LENGTHOF(dst);
         cpName = name;
     }
 
@@ -363,7 +363,7 @@ public:
         getErr(err,status);
         src = source;
         srcLen = sourceLen;
-        dstLen = uprv_lengthof(dst);
+        dstLen = UPRV_LENGTHOF(dst);
         cpName = name;
 
     }
@@ -403,7 +403,7 @@ public:
 
         src = source;
         srcLen = sourceLen;
-        dstLen = uprv_lengthof(dst);
+        dstLen = UPRV_LENGTHOF(dst);
         cpName = name;
         unsigned short bEnc[30]={'\0'};
         const char* tenc=name;
@@ -464,7 +464,7 @@ public:
         }
         src = source;
         srcLen = sourceLen;
-        dstLen = uprv_lengthof(dst);
+        dstLen = UPRV_LENGTHOF(dst);
         cpName = name;
         /* get the charset info */
         MIMECSETINFO mimeInfo;
index bc2d42f72a6f91b4698e4b1d7bb6ba199da0e43d..d34adb4450aee059e1ebd8f0e1e55098332ebc34 100644 (file)
@@ -447,7 +447,7 @@ public:
             utext_openUChars(&text, lines[i].name, lines[i].len, pErrorCode);
             int32_t count=0;
             ucharsTrieMatches(*trie, &text, lines[i].len,
-                              lengths, count, uprv_lengthof(lengths));
+                              lengths, count, UPRV_LENGTHOF(lengths));
             if(count==0 || lengths[count-1]!=lines[i].len) {
                 fprintf(stderr, "word %ld (0-based) not found\n", (long)i);
             }
@@ -596,7 +596,7 @@ public:
             utext_openUChars(&text, lines[i].name, lines[i].len, pErrorCode);
             int32_t count=0;
             bytesTrieMatches(*trie, &text, lines[i].len,
-                             lengths, count, uprv_lengthof(lengths));
+                             lengths, count, UPRV_LENGTHOF(lengths));
             if(count==0 || lengths[count-1]!=lines[i].len) {
                 fprintf(stderr, "word %ld (0-based) not found\n", (long)i);
             }
index d3c3cf2b281ede7c5cc450319b47b7f4eeb7e493..01d741c38ee9f82751b83f7cfc70d04c4709c1d3 100644 (file)
@@ -130,7 +130,7 @@ NormalizerPerformanceTest::NormalizerPerformanceTest(int32_t argc, const char* a
         return;
     }
 
-    _remainingArgc = u_parseArgs(_remainingArgc, (char **)argv, (int32_t)(uprv_lengthof(cmdLineOptions)), cmdLineOptions);
+    _remainingArgc = u_parseArgs(_remainingArgc, (char **)argv, (int32_t)(UPRV_LENGTHOF(cmdLineOptions)), cmdLineOptions);
     if(cmdLineOptions[0].doesOccur && cmdLineOptions[0].value!=NULL) {
         options=(int32_t)strtol(cmdLineOptions[0].value, NULL, 16);
     }
index 6ea79e4103ed3b8f4c14c7abeaecdf1f53dde2af..c594e1838eec60cc16f85cdd7cd154d103ce6e8e 100644 (file)
@@ -146,7 +146,7 @@ public:
             prevIndex=j;
         }
 
-        if(bitHash->countKeys()>uprv_lengthof(shortBits)) {
+        if(bitHash->countKeys()>UPRV_LENGTHOF(shortBits)) {
             bits=(int64_t *)uprv_malloc(bitHash->countKeys()*8);
         }
         if(bits!=NULL) {
index 67b1b59441aa307f2ed2c20d82fd5fbfeb87e83f..db46b1e70ce30932737b43210f9a22700c9ca533 100644 (file)
@@ -44,7 +44,7 @@ static const char *const unisetperf_usage =
 class UnicodeSetPerformanceTest : public UPerfTest {
 public:
     UnicodeSetPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status)
-            : UPerfTest(argc, argv, options, uprv_lengthof(options), unisetperf_usage, status),
+            : UPerfTest(argc, argv, options, UPRV_LENGTHOF(options), unisetperf_usage, status),
               utf8(NULL), utf8Length(0), countInputCodePoints(0), spanCount(0) {
         if (U_SUCCESS(status)) {
             UnicodeString pattern=UnicodeString(options[SET_PATTERN].value, -1, US_INV).unescape();
index e62db57e437248961b682701a2532b24362d21f1..98bc728248258b9f8c453ea435d924998060d258 100644 (file)
@@ -65,7 +65,7 @@ static const char *const utfperf_usage =
 class  UtfPerformanceTest : public UPerfTest{
 public:
     UtfPerformanceTest(int32_t argc, const char *argv[], UErrorCode &status)
-            : UPerfTest(argc, argv, options, uprv_lengthof(options), utfperf_usage, status) {
+            : UPerfTest(argc, argv, options, UPRV_LENGTHOF(options), utfperf_usage, status) {
         if (U_SUCCESS(status)) {
             charset = options[CHARSET].value;
 
index 2633385adcf839bc870801d84d5153351ccecfa0..5ca963fdfdfde0bd5bd8d26767c3d275cd90c70d 100644 (file)
@@ -237,7 +237,7 @@ void parseFile(FILE *f, Normalizer2DataBuilder &builder) {
         }
         if(*delimiter=='=' || *delimiter=='>') {
             UChar uchars[Normalizer2Impl::MAPPING_LENGTH_MASK];
-            int32_t length=u_parseString(delimiter+1, uchars, uprv_lengthof(uchars), NULL, errorCode);
+            int32_t length=u_parseString(delimiter+1, uchars, UPRV_LENGTHOF(uchars), NULL, errorCode);
             if(errorCode.isFailure()) {
                 fprintf(stderr, "gennorm2 error: parsing mapping string from %s\n", line);
                 exit(errorCode.reset());
index 187833c2de6d12e6f8ae1fb6fb7ffd5fa326678c..042694e4150f9a18659c5c5c995484ccc8f13fe9 100644 (file)
@@ -68,7 +68,7 @@ public:
 
     HangulIterator() : rangeIndex(0) {}
     const Range *nextRange() {
-        if(rangeIndex<uprv_lengthof(ranges)) {
+        if(rangeIndex<UPRV_LENGTHOF(ranges)) {
             return ranges+rangeIndex++;
         } else {
             return NULL;
index 89f8a063c9dd3c9028ed53e8c53b0b2f4c04da5f..056fc46faca5e70ea603e5ab99f552c0472f0901 100644 (file)
@@ -264,7 +264,7 @@ main(int argc, char *argv[]) {
     /* get the program basename */
     pname=findBasename(argv[0]);
 
-    argc=u_parseArgs(argc, argv, uprv_lengthof(options), options);
+    argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);
     isHelp=options[OPT_HELP_H].doesOccur || options[OPT_HELP_QUESTION_MARK].doesOccur;
     if(isHelp) {
         printUsage(pname, TRUE);
index b2b53947c15c8e2a847156fc2232b605baa0342f..2bc5a6cc2e31205b03e8d8ea0b339569f7d8ac7e 100644 (file)
@@ -129,7 +129,7 @@ main(int argc, char *argv[]) {
         pname=argv[0];
     }
 
-    argc=u_parseArgs(argc, argv, uprv_lengthof(options), options);
+    argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);
     ishelp=options[OPT_HELP_H].doesOccur || options[OPT_HELP_QUESTION_MARK].doesOccur;
     if(ishelp || argc!=3) {
         return printUsage(pname, ishelp);
index 88315a4917c5e42d788d0c43c3c9bfe9d3bd5ef8..6ea944186df2de86423cf8a8583d4ee0029c1975 100644 (file)
@@ -846,7 +846,7 @@ addFromUTrieEntry(CnvExtData *extData, UChar32 c, uint32_t value) {
 
         extData->stage1[i1]=(uint16_t)newBlock;
         extData->stage2Top=newBlock+MBCS_STAGE_2_BLOCK_SIZE;
-        if(extData->stage2Top>uprv_lengthof(extData->stage2)) {
+        if(extData->stage2Top>UPRV_LENGTHOF(extData->stage2)) {
             fprintf(stderr, "error: too many stage 2 entries at U+%04x\n", (int)c);
             exit(U_MEMORY_ALLOCATION_ERROR);
         }
@@ -868,7 +868,7 @@ addFromUTrieEntry(CnvExtData *extData, UChar32 c, uint32_t value) {
         extData->stage2[i2]=(uint16_t)(newBlock>>UCNV_EXT_STAGE_2_LEFT_SHIFT);
 
         extData->stage3Top=newBlock+MBCS_STAGE_3_BLOCK_SIZE;
-        if(extData->stage3Top>uprv_lengthof(extData->stage3)) {
+        if(extData->stage3Top>UPRV_LENGTHOF(extData->stage3)) {
             fprintf(stderr, "error: too many stage 3 entries at U+%04x\n", (int)c);
             exit(U_MEMORY_ALLOCATION_ERROR);
         }
@@ -912,7 +912,7 @@ addFromUTrieEntry(CnvExtData *extData, UChar32 c, uint32_t value) {
             }
         }
     } else {
-        if((i3b=extData->stage3bTop++)>=uprv_lengthof(extData->stage3b)) {
+        if((i3b=extData->stage3bTop++)>=UPRV_LENGTHOF(extData->stage3b)) {
             fprintf(stderr, "error: too many stage 3b entries at U+%04x\n", (int)c);
             exit(U_MEMORY_ALLOCATION_ERROR);
         }
index 8a9a9ec6616c0fca7084aadfbbcdac9f99558463..4eabcba51f5135a651a8511dc1dce478792ada37 100644 (file)
@@ -211,7 +211,7 @@ int main(int argc, char* argv[])
 
     /* preset then read command line options */
     options[OPT_DESTDIR].value=u_getDataDirectory();
-    argc=u_parseArgs(argc, argv, uprv_lengthof(options), options);
+    argc=u_parseArgs(argc, argv, UPRV_LENGTHOF(options), options);
 
     /* error handling, printing usage message */
     if(argc<0) {
index 624c6e498d81e8a386695986122909f5ac5ee486..658053912539a2e0af3360ca6cf8e1cfad4ce8e7 100644 (file)
@@ -592,7 +592,7 @@ Package::readPackage(const char *filename) {
                 exit(U_INVALID_FORMAT_ERROR);
             }
             prefixLength=(int32_t)(prefixLimit-s);
-            if(prefixLength==0 || prefixLength>=uprv_lengthof(pkgPrefix)) {
+            if(prefixLength==0 || prefixLength>=UPRV_LENGTHOF(pkgPrefix)) {
                 fprintf(stderr,
                         "icupkg: --auto_toc_prefix[_with_type] but "
                         "the prefix of the first entry \"%s\" is empty or too long\n",
index c452e3db6bd5945d211d9d4b9224f454150d8981..c2f3904878dc3a4c690de991fe9d3ec5ed754fd7 100644 (file)
@@ -35,7 +35,7 @@ isListTextFile(const char *listname) {
     const char *listNameEnd=strchr(listname, 0);
     const char *suffix;
     int32_t i, length;
-    for(i=0; i<uprv_lengthof(listFileSuffixes); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(listFileSuffixes); ++i) {
         suffix=listFileSuffixes[i].suffix;
         length=listFileSuffixes[i].length;
         if((listNameEnd-listname)>length && 0==memcmp(listNameEnd-length, suffix, length)) {
index 23b0f99ad14b53270226397489615515bd84f014..ed5229be786a600707be72fcd1f59cfdcbbeb6fa 100644 (file)
@@ -296,7 +296,7 @@ PreparsedUCD::parseProperty(UniProps &props, const char *field, UnicodeSet &newV
     int32_t prop=pnames->getPropertyEnum(p);
     if(prop<0) {
         for(int32_t i=0;; ++i) {
-            if(i==uprv_lengthof(ppucdProperties)) {
+            if(i==UPRV_LENGTHOF(ppucdProperties)) {
                 // Ignore unknown property names.
                 return TRUE;
             }
index 0f92e261aa3345d38ec2111619c223d817deaa96..dbeff2d7b8ac6c0c888bf29a7d351c317ce8a7e5 100644 (file)
@@ -790,7 +790,7 @@ udata_swap(const UDataSwapper *ds,
     }
 
     /* dispatch to the swap function for the dataFormat */
-    for(i=0; i<uprv_lengthof(swapFns); ++i) {
+    for(i=0; i<UPRV_LENGTHOF(swapFns); ++i) {
         if(0==memcmp(swapFns[i].dataFormat, pInfo->dataFormat, 4)) {
             swappedLength=swapFns[i].swapFn(ds, inData, length, outData, pErrorCode);