Index: source/common/ucnvmbcs.cpp |
diff --git a/source/common/ucnvmbcs.cpp b/source/common/ucnvmbcs.cpp |
index 4e4de8d2e9f124d33f4f3362261d810fc14b0d09..ffbb9af7c467da79e0a10839f650b6b61efec28b 100644 |
--- a/source/common/ucnvmbcs.cpp |
+++ b/source/common/ucnvmbcs.cpp |
@@ -1,7 +1,9 @@ |
+// Copyright (C) 2016 and later: Unicode, Inc. and others. |
+// License & terms of use: http://www.unicode.org/copyright.html |
/* |
****************************************************************************** |
* |
-* Copyright (C) 2000-2015, International Business Machines |
+* Copyright (C) 2000-2016, International Business Machines |
* Corporation and others. All Rights Reserved. |
* |
****************************************************************************** |
@@ -375,53 +377,55 @@ |
typedef UBool U_CALLCONV |
UConverterEnumToUCallback(const void *context, uint32_t value, UChar32 codePoints[32]); |
-static void |
+static void U_CALLCONV |
ucnv_MBCSLoad(UConverterSharedData *sharedData, |
UConverterLoadArgs *pArgs, |
const uint8_t *raw, |
UErrorCode *pErrorCode); |
-static void |
+static void U_CALLCONV |
ucnv_MBCSUnload(UConverterSharedData *sharedData); |
-static void |
+static void U_CALLCONV |
ucnv_MBCSOpen(UConverter *cnv, |
UConverterLoadArgs *pArgs, |
UErrorCode *pErrorCode); |
-static UChar32 |
+static UChar32 U_CALLCONV |
ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs, |
UErrorCode *pErrorCode); |
-static void |
+static void U_CALLCONV |
ucnv_MBCSGetStarters(const UConverter* cnv, |
UBool starters[256], |
UErrorCode *pErrorCode); |
-static const char * |
+U_CDECL_BEGIN |
+static const char* U_CALLCONV |
ucnv_MBCSGetName(const UConverter *cnv); |
+U_CDECL_END |
-static void |
+static void U_CALLCONV |
ucnv_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs, |
int32_t offsetIndex, |
UErrorCode *pErrorCode); |
-static UChar32 |
+static UChar32 U_CALLCONV |
ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs, |
UErrorCode *pErrorCode); |
-static void |
+static void U_CALLCONV |
ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, |
UConverterToUnicodeArgs *pToUArgs, |
UErrorCode *pErrorCode); |
-static void |
+static void U_CALLCONV |
ucnv_MBCSGetUnicodeSet(const UConverter *cnv, |
const USetAdder *sa, |
UConverterUnicodeSet which, |
UErrorCode *pErrorCode); |
-static void |
+static void U_CALLCONV |
ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, |
UConverterToUnicodeArgs *pToUArgs, |
UErrorCode *pErrorCode); |
@@ -503,7 +507,6 @@ static const UConverterImpl _MBCSImpl={ |
NULL |
}; |
- |
/* Static data is in tools/makeconv/ucnvstat.c for data-based |
* converters. Be sure to update it as well. |
*/ |
@@ -845,7 +848,7 @@ ucnv_MBCSEnumToUnicode(UConverterMBCSTable *mbcsTable, |
} |
} |
-U_CFUNC void |
+U_CFUNC void |
ucnv_MBCSGetFilteredUnicodeSetForUnicode(const UConverterSharedData *sharedData, |
const USetAdder *sa, |
UConverterUnicodeSet which, |
@@ -963,11 +966,14 @@ ucnv_MBCSGetFilteredUnicodeSetForUnicode(const UConverterSharedData *sharedData, |
switch(st3Multiplier) { |
case 4: |
b|=*stage3++; |
- case 3: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 3: |
b|=*stage3++; |
- case 2: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 2: |
b|=stage3[0]|stage3[1]; |
stage3+=2; |
+ U_FALLTHROUGH; |
default: |
break; |
} |
@@ -1064,7 +1070,7 @@ ucnv_MBCSGetUnicodeSetForUnicode(const UConverterSharedData *sharedData, |
pErrorCode); |
} |
-static void |
+static void U_CALLCONV |
ucnv_MBCSGetUnicodeSet(const UConverter *cnv, |
const USetAdder *sa, |
UConverterUnicodeSet which, |
@@ -1544,7 +1550,7 @@ reconstituteData(UConverterMBCSTable *mbcsTable, |
/* MBCS setup functions ----------------------------------------------------- */ |
-static void |
+static void U_CALLCONV |
ucnv_MBCSLoad(UConverterSharedData *sharedData, |
UConverterLoadArgs *pArgs, |
const uint8_t *raw, |
@@ -1869,7 +1875,7 @@ ucnv_MBCSLoad(UConverterSharedData *sharedData, |
} |
} |
-static void |
+static void U_CALLCONV |
ucnv_MBCSUnload(UConverterSharedData *sharedData) { |
UConverterMBCSTable *mbcsTable=&sharedData->mbcs; |
@@ -1887,7 +1893,7 @@ ucnv_MBCSUnload(UConverterSharedData *sharedData) { |
} |
} |
-static void |
+static void U_CALLCONV |
ucnv_MBCSOpen(UConverter *cnv, |
UConverterLoadArgs *pArgs, |
UErrorCode *pErrorCode) { |
@@ -1978,7 +1984,9 @@ ucnv_MBCSOpen(UConverter *cnv, |
#endif |
} |
-static const char * |
+U_CDECL_BEGIN |
+ |
+static const char* U_CALLCONV |
ucnv_MBCSGetName(const UConverter *cnv) { |
if((cnv->options&UCNV_OPTION_SWAP_LFNL)!=0 && cnv->sharedData->mbcs.swapLFNLName!=NULL) { |
return cnv->sharedData->mbcs.swapLFNLName; |
@@ -1986,10 +1994,12 @@ ucnv_MBCSGetName(const UConverter *cnv) { |
return cnv->sharedData->staticData->name; |
} |
} |
+U_CDECL_END |
+ |
/* MBCS-to-Unicode conversion functions ------------------------------------- */ |
-static UChar32 |
+static UChar32 U_CALLCONV |
ucnv_MBCSGetFallback(UConverterMBCSTable *mbcsTable, uint32_t offset) { |
const _MBCSToUFallback *toUFallbacks; |
uint32_t i, start, limit; |
@@ -2952,7 +2962,7 @@ ucnv_MBCSSingleGetNextUChar(UConverterToUnicodeArgs *pArgs, |
* |
* All normal mappings and errors are handled here. |
*/ |
-static UChar32 |
+static UChar32 U_CALLCONV |
ucnv_MBCSGetNextUChar(UConverterToUnicodeArgs *pArgs, |
UErrorCode *pErrorCode) { |
UConverter *cnv; |
@@ -4634,12 +4644,16 @@ unassigned: |
/* each branch falls through to the next one */ |
case 4: |
*target++=(uint8_t)(value>>24); |
- case 3: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 3: |
*target++=(uint8_t)(value>>16); |
- case 2: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 2: |
*target++=(uint8_t)(value>>8); |
- case 1: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 1: |
*target++=(uint8_t)value; |
+ U_FALLTHROUGH; |
default: |
/* will never occur */ |
break; |
@@ -4650,15 +4664,19 @@ unassigned: |
case 4: |
*target++=(uint8_t)(value>>24); |
*offsets++=sourceIndex; |
- case 3: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 3: |
*target++=(uint8_t)(value>>16); |
*offsets++=sourceIndex; |
- case 2: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 2: |
*target++=(uint8_t)(value>>8); |
*offsets++=sourceIndex; |
- case 1: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 1: |
*target++=(uint8_t)value; |
*offsets++=sourceIndex; |
+ U_FALLTHROUGH; |
default: |
/* will never occur */ |
break; |
@@ -4681,10 +4699,13 @@ unassigned: |
/* each branch falls through to the next one */ |
case 3: |
*charErrorBuffer++=(uint8_t)(value>>16); |
- case 2: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 2: |
*charErrorBuffer++=(uint8_t)(value>>8); |
- case 1: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 1: |
*charErrorBuffer=(uint8_t)value; |
+ U_FALLTHROUGH; |
default: |
/* will never occur */ |
break; |
@@ -4700,16 +4721,19 @@ unassigned: |
if(offsets!=NULL) { |
*offsets++=sourceIndex; |
} |
- case 2: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 2: |
*target++=(uint8_t)(value>>8); |
if(offsets!=NULL) { |
*offsets++=sourceIndex; |
} |
- case 1: /*fall through*/ |
+ U_FALLTHROUGH; |
+ case 1: |
*target++=(uint8_t)value; |
if(offsets!=NULL) { |
*offsets++=sourceIndex; |
} |
+ U_FALLTHROUGH; |
default: |
/* will never occur */ |
break; |
@@ -4995,7 +5019,7 @@ utf8_minLegal[5]={ 0, 0, 0x80, 0x800, 0x10000 }; |
static const UChar32 |
utf8_offsets[7]={ 0, 0, 0x3080, 0xE2080, 0x3C82080 }; |
-static void |
+static void U_CALLCONV |
ucnv_SBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, |
UConverterToUnicodeArgs *pToUArgs, |
UErrorCode *pErrorCode) { |
@@ -5301,7 +5325,7 @@ moreBytes: |
pFromUArgs->target=(char *)target; |
} |
-static void |
+static void U_CALLCONV |
ucnv_DBCSFromUTF8(UConverterFromUnicodeArgs *pFromUArgs, |
UConverterToUnicodeArgs *pToUArgs, |
UErrorCode *pErrorCode) { |
@@ -5613,7 +5637,7 @@ unassigned: |
/* miscellaneous ------------------------------------------------------------ */ |
-static void |
+static void U_CALLCONV |
ucnv_MBCSGetStarters(const UConverter* cnv, |
UBool starters[256], |
UErrorCode *) { |
@@ -5636,7 +5660,7 @@ ucnv_MBCSIsLeadByte(UConverterSharedData *sharedData, char byte) { |
return (UBool)MBCS_ENTRY_IS_TRANSITION(sharedData->mbcs.stateTable[0][(uint8_t)byte]); |
} |
-static void |
+static void U_CALLCONV |
ucnv_MBCSWriteSub(UConverterFromUnicodeArgs *pArgs, |
int32_t offsetIndex, |
UErrorCode *pErrorCode) { |