X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/b75a7d8f3b4adbae880cab104ce2c6a50eee4db2..2ca993e82fb37b597a3c73ecd1586a139a6579c5:/icuSources/samples/ustring/ustring.cpp diff --git a/icuSources/samples/ustring/ustring.cpp b/icuSources/samples/ustring/ustring.cpp index 52351e47..d0f91cd6 100644 --- a/icuSources/samples/ustring/ustring.cpp +++ b/icuSources/samples/ustring/ustring.cpp @@ -1,7 +1,7 @@ /* ******************************************************************************* * -* Copyright (C) 2000-2002, International Business Machines +* Copyright (C) 2000-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* @@ -25,8 +25,6 @@ #include "unicode/ucnv.h" #include "unicode/unistr.h" -#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0])) - // helper functions -------------------------------------------------------- *** // default converter for the platform encoding @@ -107,8 +105,8 @@ demo_utf_h_macros() { printf("\n* demo_utf_h_macros() -------------- ***\n\n"); - printUString("iterate forward through: ", input, LENGTHOF(input)); - for(i=0; i0; /* 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 @@ -214,57 +212,57 @@ static void demoCaseMapInC() { /* uppercase */ isError=FALSE; - for(i=j=0; j