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: package.cpp
* encoding: US-ASCII
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
@ -381,7 +381,7 @@ U_CDECL_END
U_NAMESPACE_BEGIN
Package::Package()
Package::Package()
: doAutoPrefix(FALSE), prefixEndsWithType(FALSE) {
inPkgName[0]=0;
pkgPrefix[0]=0;
@ -610,7 +610,7 @@ Package::readPackage(const char *filename) {
memcpy(prefix, s, ++prefixLength); // include the /
} else {
// Use the package basename as prefix.
int32_t inPkgNameLength=strlen(inPkgName);
int32_t inPkgNameLength= static_cast<int32_t>(strlen(inPkgName));
memcpy(prefix, inPkgName, inPkgNameLength);
prefixLength=inPkgNameLength;
@ -663,7 +663,7 @@ Package::readPackage(const char *filename) {
// set the last item's platform type
typeEnum=getTypeEnumForInputData(items[itemCount-1].data, items[itemCount-1].length, &errorCode);
if(typeEnum<0 || U_FAILURE(errorCode)) {
fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[itemCount-1].name, filename);
exit(U_INVALID_FORMAT_ERROR);
}
items[itemCount-1].type=makeTypeLetter(typeEnum);
@ -1043,7 +1043,7 @@ Package::addItem(const char *name, uint8_t *data, int32_t length, UBool isDataOw
memset(items+idx, 0, sizeof(Item));
// copy the item's name
items[idx].name=allocString(TRUE, strlen(name));
items[idx].name=allocString(TRUE, static_cast<int32_t>(strlen(name)));
strcpy(items[idx].name, name);
pathToTree(items[idx].name);
} else {
@ -1281,7 +1281,7 @@ Package::sortItems() {
}
}
void Package::setItemCapacity(int32_t max)
void Package::setItemCapacity(int32_t max)
{
if(max<=itemMax) {
return;
@ -1289,8 +1289,8 @@ void Package::setItemCapacity(int32_t max)
Item *newItems = (Item*)uprv_malloc(max * sizeof(items[0]));
Item *oldItems = items;
if(newItems == NULL) {
fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
(unsigned long)max*sizeof(items[0]), max);
fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
(unsigned long)(max*sizeof(items[0])), max);
exit(U_MEMORY_ALLOCATION_ERROR);
}
if(items && itemCount>0) {