X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/46f4442e9a5a4f3b98b7c1083586332f6a8a99a4..HEAD:/icuSources/samples/uciter8/uciter8.c?ds=sidebyside diff --git a/icuSources/samples/uciter8/uciter8.c b/icuSources/samples/uciter8/uciter8.c index 6c705538..dcd9aa0b 100644 --- a/icuSources/samples/uciter8/uciter8.c +++ b/icuSources/samples/uciter8/uciter8.c @@ -1,12 +1,18 @@ /* ******************************************************************************* * -* Copyright (C) 2003-2007, International Business Machines +* © 2016 and later: Unicode, Inc. and others. +* License & terms of use: http://www.unicode.org/copyright.html#License +* +******************************************************************************* +******************************************************************************* +* +* Copyright (C) 2003-2014, International Business Machines * Corporation and others. All Rights Reserved. * ******************************************************************************* * file name: uciter8.c -* encoding: US-ASCII +* encoding: UTF-8 * tab size: 8 (not used) * indentation:4 * @@ -24,7 +30,9 @@ #include "unicode/uiter.h" #include "uit_len8.h" -#define LENGTHOF(array) (sizeof(array)/sizeof((array)[0])) +#ifndef UPRV_LENGTHOF +#define UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) +#endif #define log_err printf @@ -320,7 +328,7 @@ TestLenient8Iterator() { compareIterators(&iter1, "UTF16Iterator", &iter2, "Lenient8Iterator_1"); /* test get/set state */ - length=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);