Issue #1971 - Part 2: Update ICU source to 63.2.

This commit is contained in:
Job Bautista 2022-07-24 21:03:27 +08:00 committed by roytam1
commit 1e69214382
3160 changed files with 275815 additions and 234203 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
@ -8,7 +8,7 @@
*
*******************************************************************************
* file name: genmbcs.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -64,6 +64,7 @@ struct MBCSData {
};
/* prototypes */
U_CDECL_BEGIN
static void
MBCSClose(NewConverter *cnvData);
@ -101,6 +102,7 @@ MBCSAddTable(NewConverter *cnvData, UCMTable *table, UConverterStaticData *stati
static uint32_t
MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
UNewDataMemory *pData, int32_t tableType);
U_CDECL_END
/* helper ------------------------------------------------------------------- */
@ -127,6 +129,7 @@ printBytes(char *buffer, const uint8_t *bytes, int32_t length) {
static MBCSData gDummy;
U_CFUNC const MBCSData *
MBCSGetDummy() {
uprv_memset(&gDummy, 0, sizeof(MBCSData));
@ -160,7 +163,7 @@ MBCSInit(MBCSData *mbcsData, UCMFile *ucm) {
mbcsData->newConverter.write=MBCSWrite;
}
NewConverter *
U_CFUNC NewConverter *
MBCSOpen(UCMFile *ucm) {
MBCSData *mbcsData=(MBCSData *)uprv_malloc(sizeof(MBCSData));
if(mbcsData==NULL) {
@ -178,6 +181,7 @@ MBCSDestruct(MBCSData *mbcsData) {
uprv_free(mbcsData->fromUBytes);
}
U_CDECL_BEGIN
static void
MBCSClose(NewConverter *cnvData) {
MBCSData *mbcsData=(MBCSData *)cnvData;
@ -186,6 +190,7 @@ MBCSClose(NewConverter *cnvData) {
uprv_free(mbcsData);
}
}
U_CDECL_END
static UBool
MBCSStartMappings(MBCSData *mbcsData) {
@ -546,6 +551,7 @@ MBCSAddToUnicode(MBCSData *mbcsData,
}
}
U_CDECL_BEGIN
/* is this byte sequence valid? (this is almost the same as MBCSAddToUnicode()) */
static UBool
MBCSIsValid(NewConverter *cnvData,
@ -554,7 +560,7 @@ MBCSIsValid(NewConverter *cnvData,
return (UBool)(1==ucm_countChars(&mbcsData->ucm->states, bytes, length));
}
U_CDECL_END
static UBool
MBCSSingleAddFromUnicode(MBCSData *mbcsData,
const uint8_t *bytes, int32_t /*length*/,
@ -936,6 +942,7 @@ MBCSOkForBaseFromUnicode(const MBCSData *mbcsData,
return TRUE;
}
U_CDECL_BEGIN
/* we can assume that the table only contains 1:1 mappings with <=4 bytes each */
static UBool
MBCSAddTable(NewConverter *cnvData, UCMTable *table, UConverterStaticData *staticData) {
@ -1071,7 +1078,7 @@ MBCSAddTable(NewConverter *cnvData, UCMTable *table, UConverterStaticData *stati
return isOK;
}
U_CDECL_END
static UBool
transformEUC(MBCSData *mbcsData) {
uint8_t *p8;
@ -1410,6 +1417,7 @@ MBCSPostprocess(MBCSData *mbcsData, const UConverterStaticData * /*staticData*/)
}
}
U_CDECL_BEGIN
static uint32_t
MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
UNewDataMemory *pData, int32_t tableType) {
@ -1564,3 +1572,4 @@ MBCSWrite(NewConverter *cnvData, const UConverterStaticData *staticData,
/* return the number of bytes that should have been written */
return top;
}
U_CDECL_END