Update to 72-1
Update Diary https://docs.google.com/document/d/1bzme4zR_swaqMoJIYLL9wwk-rsjdAdjGrU073h0TJbo/edit#
Release Note
ICU 72 https://icu.unicode.org/download/72
CLDR 42 https://cldr.unicode.org/index/downloads/cldr-42
Size Impact:
Android +85.1K
Cast: +22.9K
ChromeOS: +55.8K
Desktop: +77K
Bug: 1371208
Change-Id: If5146e996917339d4d41b3f22a2af2e9977a1d4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/3994603
Reviewed-by: Frank Tang <ftang@chromium.org>
Reviewed-by: Jungshik Shin <jshin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/deps/icu/+/4015159
diff --git a/source/common/messagepattern.cpp b/source/common/messagepattern.cpp
index 66fd2f4..52afab5 100644
--- a/source/common/messagepattern.cpp
+++ b/source/common/messagepattern.cpp
@@ -97,9 +97,9 @@
UBool ensureCapacityForOneMore(int32_t oldLength, UErrorCode &errorCode);
UBool equals(const MessagePatternList<T, stackCapacity> &other, int32_t length) const {
for(int32_t i=0; i<length; ++i) {
- if(a[i]!=other.a[i]) { return FALSE; }
+ if(a[i]!=other.a[i]) { return false; }
}
- return TRUE;
+ return true;
}
MaybeStackArray<T, stackCapacity> a;
@@ -124,13 +124,13 @@
UBool
MessagePatternList<T, stackCapacity>::ensureCapacityForOneMore(int32_t oldLength, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
- return FALSE;
+ return false;
}
if(a.getCapacity()>oldLength || a.resize(2*oldLength, oldLength)!=NULL) {
- return TRUE;
+ return true;
}
errorCode=U_MEMORY_ALLOCATION_ERROR;
- return FALSE;
+ return false;
}
// MessagePatternList specializations -------------------------------------- ***
@@ -147,7 +147,7 @@
: aposMode(UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE),
partsList(NULL), parts(NULL), partsLength(0),
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
- hasArgNames(FALSE), hasArgNumbers(FALSE), needsAutoQuoting(FALSE) {
+ hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
init(errorCode);
}
@@ -155,7 +155,7 @@
: aposMode(mode),
partsList(NULL), parts(NULL), partsLength(0),
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
- hasArgNames(FALSE), hasArgNumbers(FALSE), needsAutoQuoting(FALSE) {
+ hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
init(errorCode);
}
@@ -163,7 +163,7 @@
: aposMode(UCONFIG_MSGPAT_DEFAULT_APOSTROPHE_MODE),
partsList(NULL), parts(NULL), partsLength(0),
numericValuesList(NULL), numericValues(NULL), numericValuesLength(0),
- hasArgNames(FALSE), hasArgNumbers(FALSE), needsAutoQuoting(FALSE) {
+ hasArgNames(false), hasArgNumbers(false), needsAutoQuoting(false) {
if(init(errorCode)) {
parse(pattern, parseError, errorCode);
}
@@ -172,15 +172,15 @@
UBool
MessagePattern::init(UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
- return FALSE;
+ return false;
}
partsList=new MessagePatternPartsList();
if(partsList==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
- return FALSE;
+ return false;
}
parts=partsList->a.getAlias();
- return TRUE;
+ return true;
}
MessagePattern::MessagePattern(const MessagePattern &other)
@@ -215,7 +215,7 @@
UBool
MessagePattern::copyStorage(const MessagePattern &other, UErrorCode &errorCode) {
if(U_FAILURE(errorCode)) {
- return FALSE;
+ return false;
}
parts=NULL;
partsLength=0;
@@ -225,14 +225,14 @@
partsList=new MessagePatternPartsList();
if(partsList==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
- return FALSE;
+ return false;
}
parts=partsList->a.getAlias();
}
if(other.partsLength>0) {
partsList->copyFrom(*other.partsList, other.partsLength, errorCode);
if(U_FAILURE(errorCode)) {
- return FALSE;
+ return false;
}
parts=partsList->a.getAlias();
partsLength=other.partsLength;
@@ -242,19 +242,19 @@
numericValuesList=new MessagePatternDoubleList();
if(numericValuesList==NULL) {
errorCode=U_MEMORY_ALLOCATION_ERROR;
- return FALSE;
+ return false;
}
numericValues=numericValuesList->a.getAlias();
}
numericValuesList->copyFrom(
*other.numericValuesList, other.numericValuesLength, errorCode);
if(U_FAILURE(errorCode)) {
- return FALSE;
+ return false;
}
numericValues=numericValuesList->a.getAlias();
numericValuesLength=other.numericValuesLength;
}
- return TRUE;
+ return true;
}
MessagePattern::~MessagePattern() {
@@ -303,8 +303,8 @@
MessagePattern::clear() {
// Mostly the same as preParse().
msg.remove();
- hasArgNames=hasArgNumbers=FALSE;
- needsAutoQuoting=FALSE;
+ hasArgNames=hasArgNumbers=false;
+ needsAutoQuoting=false;
partsLength=0;
numericValuesLength=0;
}
@@ -414,8 +414,8 @@
parseError->postContext[0]=0;
}
msg=pattern;
- hasArgNames=hasArgNumbers=FALSE;
- needsAutoQuoting=FALSE;
+ hasArgNames=hasArgNumbers=false;
+ needsAutoQuoting=false;
partsLength=0;
numericValuesLength=0;
}
@@ -458,7 +458,7 @@
// Add a Part for auto-quoting.
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
u_apos, errorCode); // value=char to be inserted
- needsAutoQuoting=TRUE;
+ needsAutoQuoting=true;
} else {
c=msg.charAt(index);
if(c==u_apos) {
@@ -491,7 +491,7 @@
// Add a Part for auto-quoting.
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
u_apos, errorCode); // value=char to be inserted
- needsAutoQuoting=TRUE;
+ needsAutoQuoting=true;
break;
}
}
@@ -500,7 +500,7 @@
// Add a Part for auto-quoting.
addPart(UMSGPAT_PART_TYPE_INSERT_CHAR, index, 0,
u_apos, errorCode); // value=char to be inserted
- needsAutoQuoting=TRUE;
+ needsAutoQuoting=true;
}
}
} else if(UMSGPAT_ARG_TYPE_HAS_PLURAL_STYLE(parentType) && c==u_pound) {
@@ -560,7 +560,7 @@
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
- hasArgNumbers=TRUE;
+ hasArgNumbers=true;
addPart(UMSGPAT_PART_TYPE_ARG_NUMBER, nameIndex, length, number, errorCode);
} else if(number==UMSGPAT_ARG_NAME_NOT_NUMBER) {
int32_t length=index-nameIndex;
@@ -569,7 +569,7 @@
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
- hasArgNames=TRUE;
+ hasArgNames=true;
addPart(UMSGPAT_PART_TYPE_ARG_NAME, nameIndex, length, 0, errorCode);
} else { // number<-1 (ARG_NAME_NOT_VALID)
setParseError(parseError, nameIndex); // Bad argument syntax.
@@ -727,7 +727,7 @@
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
- parseDouble(numberIndex, index, TRUE, parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
+ parseDouble(numberIndex, index, true, parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
if(U_FAILURE(errorCode)) {
return 0;
}
@@ -774,8 +774,8 @@
return 0;
}
int32_t start=index;
- UBool isEmpty=TRUE;
- UBool hasOther=FALSE;
+ UBool isEmpty=true;
+ UBool hasOther=false;
for(;;) {
// First, collect the selector looking for a small set of terminators.
// It would be a little faster to consider the syntax of each possible
@@ -811,7 +811,7 @@
return 0;
}
addPart(UMSGPAT_PART_TYPE_ARG_SELECTOR, selectorIndex, length, 0, errorCode);
- parseDouble(selectorIndex+1, index, FALSE,
+ parseDouble(selectorIndex+1, index, false,
parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
} else {
index=skipIdentifier(index);
@@ -845,12 +845,12 @@
errorCode=U_INDEX_OUTOFBOUNDS_ERROR;
return 0;
}
- parseDouble(valueIndex, index, FALSE,
+ parseDouble(valueIndex, index, false,
parseError, errorCode); // adds ARG_INT or ARG_DOUBLE
if(U_FAILURE(errorCode)) {
return 0;
}
- isEmpty=FALSE;
+ isEmpty=false;
continue; // no message fragment after the offset
} else {
// normal selector word
@@ -861,7 +861,7 @@
}
addPart(UMSGPAT_PART_TYPE_ARG_SELECTOR, selectorIndex, length, 0, errorCode);
if(0==msg.compare(selectorIndex, length, kOther, 0, 5)) {
- hasOther=TRUE;
+ hasOther=true;
}
}
}
@@ -880,7 +880,7 @@
if(U_FAILURE(errorCode)) {
return 0;
}
- isEmpty=FALSE;
+ isEmpty=false;
}
}
@@ -901,11 +901,11 @@
return 0;
} else {
number=0;
- badNumber=TRUE; // leading zero
+ badNumber=true; // leading zero
}
} else if(0x31<=c && c<=0x39) {
number=c-0x30;
- badNumber=FALSE;
+ badNumber=false;
} else {
return UMSGPAT_ARG_NAME_NOT_NUMBER;
}
@@ -913,7 +913,7 @@
c=s.charAt(start++);
if(0x30<=c && c<=0x39) {
if(number>=INT32_MAX/10) {
- badNumber=TRUE; // overflow
+ badNumber=true; // overflow
}
number=number*10+(c-0x30);
} else {