X-Git-Url: https://git.saurik.com/apple/icu.git/blobdiff_plain/57a6839dcb3bba09e8228b822b290604668416fe..ef6cf650f4a75c3f97de06b51fa104f2069b9ea2:/icuSources/common/ustrtrns.cpp diff --git a/icuSources/common/ustrtrns.cpp b/icuSources/common/ustrtrns.cpp index fbb7b46f..00a0bfd5 100644 --- a/icuSources/common/ustrtrns.cpp +++ b/icuSources/common/ustrtrns.cpp @@ -1,7 +1,7 @@ /* ****************************************************************************** * -* Copyright (C) 2001-2013, International Business Machines +* Copyright (C) 2001-2016, International Business Machines * Corporation and others. All Rights Reserved. * ****************************************************************************** @@ -34,8 +34,6 @@ #include "ustr_imp.h" #include "uassert.h" -#define LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0])) - U_CAPI UChar* U_EXPORT2 u_strFromUTF32WithSub(UChar *dest, int32_t destCapacity, @@ -293,7 +291,8 @@ utf8_nextCharSafeBodyTerminated(const uint8_t **ps, UChar32 c) { illegal=1; break; } - case 2: /*fall through*/ + U_FALLTHROUGH; + case 2: trail=(uint8_t)(*s++ - 0x80); if(trail>0x3f) { /* not a trail byte */ @@ -301,7 +300,8 @@ utf8_nextCharSafeBodyTerminated(const uint8_t **ps, UChar32 c) { break; } c=(c<<6)|trail; - case 1: /*fall through*/ + U_FALLTHROUGH; + case 1: trail=(uint8_t)(*s++ - 0x80); if(trail>0x3f) { /* not a trail byte */ @@ -364,11 +364,13 @@ utf8_nextCharSafeBodyPointer(const uint8_t **ps, const uint8_t *limit, UChar32 c illegal=1; break; } - case 2: /*fall through*/ + U_FALLTHROUGH; + case 2: trail=*s++; c=(c<<6)|(trail&0x3f); illegal|=(trail&0xc0)^0x80; - case 1: /*fall through*/ + U_FALLTHROUGH; + case 1: trail=*s++; c=(c<<6)|(trail&0x3f); illegal|=(trail&0xc0)^0x80; @@ -383,7 +385,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