Bug 1792775 - Part 1: Update or remove ICU patches. r=platform-i18n-reviewers,dminor

Remove the patch for bug 1766220 because the local patch was just a backport
from the ICU development branch.

And update the local patches for Sorbian and WASI integration to apply cleanly
on ICU 72.

Differential Revision: https://phabricator.services.mozilla.com/D160179
This commit is contained in:
André Bargull 2022-11-23 10:42:31 +00:00
Родитель 098175cf10
Коммит 271e5e44f0
6 изменённых файлов: 442 добавлений и 72 удалений

Просмотреть файл

@ -1,22 +1,19 @@
diff --git a/intl/icu/source/data/locales/dsb.txt b/intl/icu/source/data/locales/dsb.txt
--- a/intl/icu/source/data/locales/dsb.txt
+++ b/intl/icu/source/data/locales/dsb.txt
@@ -532,25 +532,29 @@ dsb{
few{"'tyźeń' W MMMM"}
one{"'tyźeń' W MMMM"}
other{"'tyźeń' W MMMM"}
two{"'tyźeń' W MMMM"}
@@ -547,23 +547,27 @@ dsb{
other{"W. 'tyźeń' MMMM"}
two{"W. 'tyźeń' MMMM"}
}
- MMMMd{"d MMMM"}
+ MMMMd{"d. MMMM"}
MMMMd{"d. MMMM"}
MMMd{"d. MMM"}
+ MMd{"d. MM"}
+ MMdd{"dd. MM"}
Md{"d.M."}
d{"d"}
h{"h a"}
hm{"h:mm a"}
hms{"h:mm:ss a"}
d{"d."}
h{"ha"}
hm{"h:mma"}
hms{"h:mm:ssa"}
ms{"mm:ss"}
y{"y"}
yM{"M.y"}
@ -31,26 +28,23 @@ diff --git a/intl/icu/source/data/locales/dsb.txt b/intl/icu/source/data/locales
yQQQ{"QQQ y"}
yQQQQ{"QQQQ y"}
yw{
few{"'tyźeń' w 'lěta' Y"}
few{"w. 'tyźeń' 'lěta' Y"}
diff --git a/intl/icu/source/data/locales/hsb.txt b/intl/icu/source/data/locales/hsb.txt
--- a/intl/icu/source/data/locales/hsb.txt
+++ b/intl/icu/source/data/locales/hsb.txt
@@ -531,25 +531,29 @@ hsb{
few{"'tydźeń' W MMMM"}
one{"'tydźeń' W MMMM"}
other{"'tydźeń' W MMMM"}
two{"'tydźeń' W MMMM"}
@@ -546,23 +546,27 @@ hsb{
other{"W. 'tydźeń' MMMM"}
two{"W. 'tydźeń' MMMM"}
}
- MMMMd{"d MMMM"}
+ MMMMd{"d. MMMM"}
MMMMd{"d. MMMM"}
MMMd{"d. MMM"}
+ MMd{"d. MM"}
+ MMdd{"dd. MM"}
Md{"d.M."}
d{"d"}
h{"h a"}
hm{"h:mm a"}
hms{"h:mm:ss a"}
d{"d."}
h{"ha"}
hm{"h:mma"}
hms{"h:mm:ssa"}
ms{"mm:ss"}
y{"y"}
yM{"M.y"}
@ -65,4 +59,4 @@ diff --git a/intl/icu/source/data/locales/hsb.txt b/intl/icu/source/data/locales
yQQQ{"QQQ y"}
yQQQQ{"QQQQ y"}
yw{
few{"'tydźeń' w 'lěta' Y"}
few{"w. 'tydźeń' 'lěta' Y"}

Просмотреть файл

@ -282,15 +282,17 @@ index 8d76b3f..c1a58db 100644
diff --git a/intl/icu/source/common/unifiedcache.cpp b/intl/icu/source/common/unifiedcache.cpp
index 493ab79..a13eed8 100644
--- a/intl/icu/source/common/unifiedcache.cpp
+++ b/intl/icu/source/common/unifiedcache.cpp
@@ -13,15 +13,19 @@
@@ -11,19 +11,23 @@
*/
#include "unifiedcache.h"
#include <algorithm> // For std::max()
-#include <mutex>
+#ifndef __wasi__
#include <mutex>
+ #include <mutex>
+#endif
#include "uassert.h"
@ -302,10 +304,14 @@ index 493ab79..a13eed8 100644
static std::mutex *gCacheMutex = nullptr;
static std::condition_variable *gInProgressValueAddedCond;
+#endif
static icu::UInitOnce gCacheInitOnce = U_INITONCE_INITIALIZER;
static icu::UInitOnce gCacheInitOnce {};
static const int32_t MAX_EVICT_ITERATIONS = 10;
@@ -34,10 +38,12 @@ static UBool U_CALLCONV unifiedcache_cleanup() {
static const int32_t DEFAULT_MAX_UNUSED = 1000;
static const int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100;
@@ -32,14 +36,16 @@ static const int32_t DEFAULT_PERCENTAGE_OF_IN_USE = 100;
U_CDECL_BEGIN
static UBool U_CALLCONV unifiedcache_cleanup() {
gCacheInitOnce.reset();
delete gCache;
gCache = nullptr;
@ -315,10 +321,14 @@ index 493ab79..a13eed8 100644
gInProgressValueAddedCond->~condition_variable();
gInProgressValueAddedCond = nullptr;
+#endif
return TRUE;
return true;
}
U_CDECL_END
@@ -72,8 +78,10 @@ static void U_CALLCONV cacheInit(UErrorCode &status) {
@@ -70,12 +76,14 @@ CacheKeyBase::~CacheKeyBase() {
static void U_CALLCONV cacheInit(UErrorCode &status) {
U_ASSERT(gCache == NULL);
ucln_common_registerCleanup(
UCLN_COMMON_UNIFIED_CACHE, unifiedcache_cleanup);
@ -329,7 +339,11 @@ index 493ab79..a13eed8 100644
gCache = new UnifiedCache(status);
if (gCache == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
@@ -135,28 +143,38 @@ void UnifiedCache::setEvictionPolicy(
}
if (U_FAILURE(status)) {
@@ -133,41 +141,53 @@ void UnifiedCache::setEvictionPolicy(
}
if (count < 0 || percentageOfInUseItems < 0) {
status = U_ILLEGAL_ARGUMENT_ERROR;
return;
}
@ -368,7 +382,8 @@ index 493ab79..a13eed8 100644
// Use a loop in case cache items that are flushed held hard references to
// other cache items making those additional cache items eligible for
@@ -165,7 +183,9 @@ void UnifiedCache::flush() const {
// flushing.
while (_flush(false));
}
void UnifiedCache::handleUnreferencedObject() const {
@ -378,7 +393,11 @@ index 493ab79..a13eed8 100644
--fNumValuesInUse;
_runEvictionSlice();
}
@@ -184,7 +204,9 @@ void UnifiedCache::dump() {
#ifdef UNIFIED_CACHE_DEBUG
@@ -182,11 +202,13 @@ void UnifiedCache::dump() {
}
cache->dumpContents();
}
void UnifiedCache::dumpContents() const {
@ -388,17 +407,25 @@ index 493ab79..a13eed8 100644
_dumpContents();
}
@@ -224,7 +246,9 @@ UnifiedCache::~UnifiedCache() {
// Dumps content of cache.
// On entry, gCacheMutex must be held.
@@ -222,11 +244,13 @@ UnifiedCache::~UnifiedCache() {
flush();
{
// Now all that should be left in the cache are entries that refer to
// each other and entries with hard references from outside the cache.
// Nothing we can do about these so proceed to wipe out the cache.
+#ifndef __wasi__
std::lock_guard<std::mutex> lock(*gCacheMutex);
+#endif
_flush(TRUE);
_flush(true);
}
uhash_close(fHashtable);
@@ -325,7 +349,9 @@ void UnifiedCache::_putIfAbsentAndGet(
fHashtable = nullptr;
delete fNoValue;
@@ -323,11 +347,13 @@ void UnifiedCache::_putNew(
void UnifiedCache::_putIfAbsentAndGet(
const CacheKeyBase &key,
const SharedObject *&value,
UErrorCode &status) const {
@ -408,7 +435,11 @@ index 493ab79..a13eed8 100644
const UHashElement *element = uhash_find(fHashtable, &key);
if (element != NULL && !_inProgress(element)) {
_fetch(element, value, status);
@@ -350,14 +376,18 @@ UBool UnifiedCache::_poll(
return;
}
@@ -348,18 +374,22 @@ UBool UnifiedCache::_poll(
const CacheKeyBase &key,
const SharedObject *&value,
UErrorCode &status) const {
U_ASSERT(value == NULL);
U_ASSERT(status == U_ZERO_ERROR);
@ -427,7 +458,11 @@ index 493ab79..a13eed8 100644
element = uhash_find(fHashtable, &key);
}
@@ -428,9 +458,11 @@ void UnifiedCache::_put(
// If the hash table contains an entry for the key,
// fetch out the contents and return them.
@@ -426,13 +456,15 @@ void UnifiedCache::_put(
UHashElement *ptr = const_cast<UHashElement *>(element);
ptr->value.pointer = (void *) value;
U_ASSERT(oldValue == fNoValue);
removeSoftRef(oldValue);
@ -439,6 +474,8 @@ index 493ab79..a13eed8 100644
}
void UnifiedCache::_fetch(
const UHashElement *element,
const SharedObject *&value,
diff --git a/intl/icu/source/i18n/decContext.h b/intl/icu/source/i18n/decContext.h
index 59ab65e..20f3526 100644
--- a/intl/icu/source/i18n/decContext.h

Просмотреть файл

@ -1,32 +0,0 @@
# https://github.com/unicode-org/icu/pull/2067
# https://github.com/unicode-org/icu/pull/2067.diff
#
# ICU bug: https://unicode-org.atlassian.net/browse/ICU-21994
diff --git a/intl/icu/source/common/locid.cpp b/intl/icu/source/common/locid.cpp
index 73bb8d8aec1..96d3851804d 100644
--- a/intl/icu/source/common/locid.cpp
+++ b/intl/icu/source/common/locid.cpp
@@ -716,20 +716,19 @@ AliasDataBuilder::readAlias(
status = U_MEMORY_ALLOCATION_ERROR;
return;
}
- int i = 0;
- while (ures_hasNext(alias)) {
+ for (int i = 0; U_SUCCESS(status) && ures_hasNext(alias); i++) {
LocalUResourceBundlePointer res(
ures_getNextResource(alias, nullptr, &status));
const char* aliasFrom = ures_getKey(res.getAlias());
UnicodeString aliasTo =
ures_getUnicodeStringByKey(res.getAlias(), "replacement", &status);
+ if (U_FAILURE(status)) return;
checkType(aliasFrom);
checkReplacement(aliasTo);
rawTypes[i] = aliasFrom;
rawIndexes[i] = strings->add(aliasTo, status);
- i++;
}
}

Просмотреть файл

@ -0,0 +1,19 @@
# https://github.com/unicode-org/icu/pull/2248
# https://github.com/unicode-org/icu/pull/2248.diff
#
# ICU bug: https://unicode-org.atlassian.net/browse/ICU-22198
diff --git a/intl/icu/source/common/uresbund.cpp b/intl/icu/source/common/uresbund.cpp
index 17c0177a05c..81fb90e1384 100644
--- a/intl/icu/source/common/uresbund.cpp
+++ b/intl/icu/source/common/uresbund.cpp
@@ -202,7 +202,8 @@ typedef enum UResOpenType UResOpenType;
*/
static bool getParentLocaleID(char *name, const char *origName, UResOpenType openType) {
// early out if the locale ID has a variant code or ends with _
- if (name[uprv_strlen(name) - 1] == '_' || hasVariant(name)) {
+ size_t nameLen = uprv_strlen(name);
+ if (!nameLen || name[nameLen - 1] == '_' || hasVariant(name)) {
return chopLocale(name);
}

Просмотреть файл

@ -0,0 +1,351 @@
# https://github.com/unicode-org/icu/pull/2255
# https://github.com/unicode-org/icu/pull/2255.diff
#
# ICU bug: https://unicode-org.atlassian.net/browse/ICU-22206
diff --git a/intl/icu/source/common/rbbiscan.cpp b/intl/icu/source/common/rbbiscan.cpp
index 8232bd94e47..87d31f8af40 100644
--- a/intl/icu/source/common/rbbiscan.cpp
+++ b/intl/icu/source/common/rbbiscan.cpp
@@ -918,7 +918,7 @@ void RBBIRuleScanner::nextChar(RBBIRuleChar &c) {
// Toggle quoting mode.
// Return either '(' or ')', because quotes cause a grouping of the quoted text.
fQuoteMode = !fQuoteMode;
- if (fQuoteMode == true) {
+ if (fQuoteMode) {
c.fChar = chLParen;
} else {
c.fChar = chRParen;
diff --git a/intl/icu/source/common/ucnvisci.cpp b/intl/icu/source/common/ucnvisci.cpp
index 4d747e1ff84..839f7ff9c62 100644
--- a/intl/icu/source/common/ucnvisci.cpp
+++ b/intl/icu/source/common/ucnvisci.cpp
@@ -1472,7 +1472,7 @@ UConverter_toUnicode_ISCII_OFFSETS_LOGIC(UConverterToUnicodeArgs *args, UErrorCo
if (targetUniChar != missingCharMarker) {
/* now save the targetUniChar for delayed write */
*toUnicodeStatus = (UChar) targetUniChar;
- if (data->resetToDefaultToUnicode==true) {
+ if (data->resetToDefaultToUnicode) {
data->currentDeltaToUnicode = data->defDeltaToUnicode;
data->currentMaskToUnicode = data->defMaskToUnicode;
data->resetToDefaultToUnicode=false;
diff --git a/intl/icu/source/common/udata.cpp b/intl/icu/source/common/udata.cpp
index 2bc74c97898..c5d0a9feb7b 100644
--- a/intl/icu/source/common/udata.cpp
+++ b/intl/icu/source/common/udata.cpp
@@ -568,7 +568,7 @@ const char *UDataPathIterator::next(UErrorCode *pErrorCode)
/* check for .dat files */
pathBasename = findBasename(pathBuffer.data());
- if(checkLastFour == true &&
+ if(checkLastFour &&
(pathLen>=4) &&
uprv_strncmp(pathBuffer.data() +(pathLen-4), suffix.data(), 4)==0 && /* suffix matches */
uprv_strncmp(findBasename(pathBuffer.data()), basename, basenameLen)==0 && /* base matches */
diff --git a/intl/icu/source/common/uidna.cpp b/intl/icu/source/common/uidna.cpp
index 1cbdeec3272..7135a166f21 100644
--- a/intl/icu/source/common/uidna.cpp
+++ b/intl/icu/source/common/uidna.cpp
@@ -287,7 +287,7 @@ _internal_toASCII(const UChar* src, int32_t srcLength,
failPos = j;
}
}
- if(useSTD3ASCIIRules == true){
+ if(useSTD3ASCIIRules){
// verify 3a and 3b
// 3(a) Verify the absence of non-LDH ASCII code points; that is, the
// absence of 0..2C, 2E..2F, 3A..40, 5B..60, and 7B..7F.
@@ -731,7 +731,7 @@ uidna_IDNToASCII( const UChar *src, int32_t srcLength,
remainingDestCapacity = 0;
}
- if(done == true){
+ if(done){
break;
}
@@ -829,7 +829,7 @@ uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
remainingDestCapacity = 0;
}
- if(done == true){
+ if(done){
break;
}
diff --git a/intl/icu/source/common/uresbund.cpp b/intl/icu/source/common/uresbund.cpp
index 17c0177a05c..c065387bdae 100644
--- a/intl/icu/source/common/uresbund.cpp
+++ b/intl/icu/source/common/uresbund.cpp
@@ -2448,7 +2448,7 @@ U_CAPI UResourceBundle* U_EXPORT2 ures_getByKey(const UResourceBundle *resB, con
res = res_getTableItemByKey(&resB->getResData(), resB->fRes, &t, &key);
if(res == RES_BOGUS) {
key = inKey;
- if(resB->fHasFallback == true) {
+ if(resB->fHasFallback) {
dataEntry = getFallbackData(resB, &key, &res, status);
if(U_SUCCESS(*status)) {
/* check if resB->fResPath gives the right name here */
@@ -2503,7 +2503,7 @@ U_CAPI const UChar* U_EXPORT2 ures_getStringByKey(const UResourceBundle *resB, c
if(res == RES_BOGUS) {
key = inKey;
- if(resB->fHasFallback == true) {
+ if(resB->fHasFallback) {
dataEntry = getFallbackData(resB, &key, &res, status);
if(U_SUCCESS(*status)) {
switch (RES_GET_TYPE(res)) {
diff --git a/intl/icu/source/common/usprep.cpp b/intl/icu/source/common/usprep.cpp
index 50d16081d1d..8175dc7fa82 100644
--- a/intl/icu/source/common/usprep.cpp
+++ b/intl/icu/source/common/usprep.cpp
@@ -160,7 +160,7 @@ usprep_internal_flushCache(UBool noRefCount){
key = (UStringPrepKey *) e->key.pointer;
if ((noRefCount== false && profile->refCount == 0) ||
- noRefCount== true) {
+ noRefCount) {
deletedNum++;
uhash_removeElement(SHARED_DATA_HASHTABLE, e);
@@ -746,16 +746,16 @@ usprep_prepare( const UStringPrepProfile* profile,
}
}
}
- if(profile->checkBiDi == true){
+ if(profile->checkBiDi){
// satisfy 2
- if( leftToRight == true && rightToLeft == true){
+ if( leftToRight && rightToLeft){
*status = U_STRINGPREP_CHECK_BIDI_ERROR;
uprv_syntaxError(b2,(rtlPos>ltrPos) ? rtlPos : ltrPos, b2Len, parseError);
return 0;
}
//satisfy 3
- if( rightToLeft == true &&
+ if( rightToLeft &&
!((firstCharDir == U_RIGHT_TO_LEFT || firstCharDir == U_RIGHT_TO_LEFT_ARABIC) &&
(direction == U_RIGHT_TO_LEFT || direction == U_RIGHT_TO_LEFT_ARABIC))
){
diff --git a/intl/icu/source/common/utext.cpp b/intl/icu/source/common/utext.cpp
index 548e6a60f31..89e3d669f6e 100644
--- a/intl/icu/source/common/utext.cpp
+++ b/intl/icu/source/common/utext.cpp
@@ -223,7 +223,7 @@ utext_current32(UText *ut) {
trail = ut->chunkContents[ut->chunkOffset];
}
UBool r = ut->pFuncs->access(ut, nativePosition, false); // reverse iteration flag loads preceding chunk
- U_ASSERT(r==true);
+ U_ASSERT(r);
ut->chunkOffset = originalOffset;
if(!r) {
return U_SENTINEL;
diff --git a/intl/icu/source/i18n/calendar.cpp b/intl/icu/source/i18n/calendar.cpp
index f5a40e48395..5431d87bdd2 100644
--- a/intl/icu/source/i18n/calendar.cpp
+++ b/intl/icu/source/i18n/calendar.cpp
@@ -3510,7 +3510,7 @@ int32_t Calendar::handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t w
switch(bestField) {
case UCAL_WEEK_OF_YEAR:
if(woy == 1) {
- if(jan1InPrevYear == true) {
+ if(jan1InPrevYear) {
// the first week of January is in the previous year
// therefore WOY1 is always solidly within yearWoy
return yearWoy;
diff --git a/intl/icu/source/i18n/dcfmtsym.cpp b/intl/icu/source/i18n/dcfmtsym.cpp
index 5d06c189fbe..fa5920aaa50 100644
--- a/intl/icu/source/i18n/dcfmtsym.cpp
+++ b/intl/icu/source/i18n/dcfmtsym.cpp
@@ -329,11 +329,13 @@ struct CurrencySpacingSink : public ResourceSink {
// both beforeCurrency and afterCurrency were found in CLDR.
static const char* defaults[] = { "[:letter:]", "[:digit:]", " " };
if (!hasBeforeCurrency || !hasAfterCurrency) {
- for (UBool beforeCurrency = 0; beforeCurrency <= true; beforeCurrency++) {
- for (int32_t pattern = 0; pattern < UNUM_CURRENCY_SPACING_COUNT; pattern++) {
- dfs.setPatternForCurrencySpacing((UCurrencySpacing)pattern,
- beforeCurrency, UnicodeString(defaults[pattern], -1, US_INV));
- }
+ for (int32_t pattern = 0; pattern < UNUM_CURRENCY_SPACING_COUNT; pattern++) {
+ dfs.setPatternForCurrencySpacing((UCurrencySpacing)pattern,
+ false, UnicodeString(defaults[pattern], -1, US_INV));
+ }
+ for (int32_t pattern = 0; pattern < UNUM_CURRENCY_SPACING_COUNT; pattern++) {
+ dfs.setPatternForCurrencySpacing((UCurrencySpacing)pattern,
+ true, UnicodeString(defaults[pattern], -1, US_INV));
}
}
}
diff --git a/intl/icu/source/i18n/dtitvinf.cpp b/intl/icu/source/i18n/dtitvinf.cpp
index f5fb86ce581..0a30cf14419 100644
--- a/intl/icu/source/i18n/dtitvinf.cpp
+++ b/intl/icu/source/i18n/dtitvinf.cpp
@@ -504,7 +504,7 @@ DateIntervalInfo::setIntervalPatternInternally(const UnicodeString& skeleton,
}
patternsOfOneSkeleton[index] = intervalPattern;
- if ( emptyHash == true ) {
+ if ( emptyHash ) {
fIntervalPatterns->put(skeleton, patternsOfOneSkeleton, status);
}
}
@@ -748,7 +748,7 @@ U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1, UHashTok val2) {
const UnicodeString* pattern2 = (UnicodeString*)val2.pointer;
UBool ret = true;
int8_t i;
- for ( i = 0; i < DateIntervalInfo::kMaxIntervalPatternIndex && ret == true; ++i ) {
+ for ( i = 0; i < DateIntervalInfo::kMaxIntervalPatternIndex && ret ; ++i ) {
ret = (pattern1[i] == pattern2[i]);
}
return ret;
diff --git a/intl/icu/source/i18n/gregocal.cpp b/intl/icu/source/i18n/gregocal.cpp
index 882d25b4a2a..0e00127e314 100644
--- a/intl/icu/source/i18n/gregocal.cpp
+++ b/intl/icu/source/i18n/gregocal.cpp
@@ -487,7 +487,7 @@ int32_t GregorianCalendar::handleComputeJulianDay(UCalendarDateFields bestField)
// The following check handles portions of the cutover year BEFORE the
// cutover itself happens.
//if ((fIsGregorian==true) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */
- if ((fIsGregorian==true) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */
+ if ((fIsGregorian) != (jd >= fCutoverJulianDay)) { /* cutoverJulianDay)) { */
#if defined (U_DEBUG_CAL)
fprintf(stderr, "%s:%d: jd [invert] %d\n",
__FILE__, __LINE__, jd);
diff --git a/intl/icu/source/i18n/regexcmp.cpp b/intl/icu/source/i18n/regexcmp.cpp
index 4b507002d63..adc8f700c7f 100644
--- a/intl/icu/source/i18n/regexcmp.cpp
+++ b/intl/icu/source/i18n/regexcmp.cpp
@@ -4065,7 +4065,7 @@ void RegexCompile::nextChar(RegexPatternChar &c) {
if (c.fChar == (UChar32)-1) {
break; // End of Input
}
- if (c.fChar == chPound && fEOLComments == true) {
+ if (c.fChar == chPound && fEOLComments) {
// Start of a comment. Consume the rest of it, until EOF or a new line
for (;;) {
c.fChar = nextCharLL();
diff --git a/intl/icu/source/i18n/search.cpp b/intl/icu/source/i18n/search.cpp
index 56d9b744098..d55902bfa7b 100644
--- a/intl/icu/source/i18n/search.cpp
+++ b/intl/icu/source/i18n/search.cpp
@@ -81,10 +81,9 @@ USearchAttributeValue SearchIterator::getAttribute(
{
switch (attribute) {
case USEARCH_OVERLAP :
- return (m_search_->isOverlap == true ? USEARCH_ON : USEARCH_OFF);
+ return (m_search_->isOverlap ? USEARCH_ON : USEARCH_OFF);
case USEARCH_CANONICAL_MATCH :
- return (m_search_->isCanonicalMatch == true ? USEARCH_ON :
- USEARCH_OFF);
+ return (m_search_->isCanonicalMatch ? USEARCH_ON : USEARCH_OFF);
case USEARCH_ELEMENT_COMPARISON :
{
int16_t value = m_search_->elementComparisonType;
@@ -242,7 +241,7 @@ int32_t SearchIterator::next(UErrorCode &status)
int32_t matchindex = m_search_->matchedIndex;
int32_t matchlength = m_search_->matchedLength;
m_search_->reset = false;
- if (m_search_->isForwardSearching == true) {
+ if (m_search_->isForwardSearching) {
int32_t textlength = m_search_->textLength;
if (offset == textlength || matchindex == textlength ||
(matchindex != USEARCH_DONE &&
@@ -295,7 +294,7 @@ int32_t SearchIterator::previous(UErrorCode &status)
}
int32_t matchindex = m_search_->matchedIndex;
- if (m_search_->isForwardSearching == true) {
+ if (m_search_->isForwardSearching) {
// switching direction.
// if matchedIndex == USEARCH_DONE, it means that either a
// setOffset has been called or that next ran off the text
diff --git a/intl/icu/source/i18n/usearch.cpp b/intl/icu/source/i18n/usearch.cpp
index 0fecd709e74..39f76a1b985 100644
--- a/intl/icu/source/i18n/usearch.cpp
+++ b/intl/icu/source/i18n/usearch.cpp
@@ -819,11 +819,9 @@ U_CAPI USearchAttributeValue U_EXPORT2 usearch_getAttribute(
if (strsrch) {
switch (attribute) {
case USEARCH_OVERLAP :
- return (strsrch->search->isOverlap == true ? USEARCH_ON :
- USEARCH_OFF);
+ return (strsrch->search->isOverlap ? USEARCH_ON : USEARCH_OFF);
case USEARCH_CANONICAL_MATCH :
- return (strsrch->search->isCanonicalMatch == true ? USEARCH_ON :
- USEARCH_OFF);
+ return (strsrch->search->isCanonicalMatch ? USEARCH_ON : USEARCH_OFF);
case USEARCH_ELEMENT_COMPARISON :
{
int16_t value = strsrch->search->elementComparisonType;
@@ -1249,7 +1247,7 @@ U_CAPI int32_t U_EXPORT2 usearch_previous(UStringSearch *strsrch,
}
int32_t matchedindex = search->matchedIndex;
- if (search->isForwardSearching == true) {
+ if (search->isForwardSearching) {
// switching direction.
// if matchedIndex == USEARCH_DONE, it means that either a
// setOffset has been called or that next ran off the text
diff --git a/intl/icu/source/i18n/uspoof_conf.cpp b/intl/icu/source/i18n/uspoof_conf.cpp
index 5ecc59c12a8..376ac64e3ce 100644
--- a/intl/icu/source/i18n/uspoof_conf.cpp
+++ b/intl/icu/source/i18n/uspoof_conf.cpp
@@ -407,7 +407,7 @@ void ConfusabledataBuilder::build(const char * confusables, int32_t confusablesL
//
void ConfusabledataBuilder::outputData(UErrorCode &status) {
- U_ASSERT(fSpoofImpl->fSpoofData->fDataOwned == true);
+ U_ASSERT(fSpoofImpl->fSpoofData->fDataOwned);
// The Key Table
// While copying the keys to the runtime array,
diff --git a/intl/icu/source/io/uscanf_p.cpp b/intl/icu/source/io/uscanf_p.cpp
index 9b27e2ebf8d..26a790dd9b6 100644
--- a/intl/icu/source/io/uscanf_p.cpp
+++ b/intl/icu/source/io/uscanf_p.cpp
@@ -323,7 +323,7 @@ u_scanf_skip_leading_ws(UFILE *input,
UBool isNotEOF;
/* skip all leading ws in the input */
- while( ((isNotEOF = ufile_getch(input, &c)) == true) && (c == pad || u_isWhitespace(c)) )
+ while( ((isNotEOF = ufile_getch(input, &c))==(UBool)true) && (c == pad || u_isWhitespace(c)) )
{
count++;
}
@@ -357,7 +357,7 @@ u_scanf_skip_leading_positive_sign(UFILE *input,
if (U_SUCCESS(localStatus)) {
/* skip all leading ws in the input */
- while( ((isNotEOF = ufile_getch(input, &c)) == true) && (count < symbolLen && c == plusSymbol[count]) )
+ while( ((isNotEOF = ufile_getch(input, &c))==(UBool)true) && (count < symbolLen && c == plusSymbol[count]) )
{
count++;
}
@@ -868,7 +868,7 @@ u_scanf_string_handler(UFILE *input,
return -1;
while( (info->fWidth == -1 || count < info->fWidth)
- && ((isNotEOF = ufile_getch(input, &c)) == true)
+ && ((isNotEOF = ufile_getch(input, &c))==(UBool)true)
&& (!info->fIsString || (c != info->fPadChar && !u_isWhitespace(c))))
{
@@ -959,7 +959,7 @@ u_scanf_ustring_handler(UFILE *input,
count = 0;
while( (info->fWidth == -1 || count < info->fWidth)
- && ((isNotEOF = ufile_getch(input, &c)) == true)
+ && ((isNotEOF = ufile_getch(input, &c))==(UBool)true)
&& (!info->fIsString || (c != info->fPadChar && !u_isWhitespace(c))))
{
@@ -1262,7 +1262,7 @@ u_scanf_scanset_handler(UFILE *input,
/* grab characters one at a time and make sure they are in the scanset */
while(chLeft > 0) {
- if ( ((isNotEOF = ufile_getch32(input, &c)) == true) && uset_contains(scanset, c) ) {
+ if ( ((isNotEOF = ufile_getch32(input, &c))==(UBool)true) && uset_contains(scanset, c) ) {
readCharacter = true;
if (!info->fSkipArg) {
int32_t idx = 0;

Просмотреть файл

@ -57,8 +57,9 @@ for patch in \
bug-1636984-display-name-fractional-seconds.diff \
bug-1636984-append-item-dayperiod-fractional-seconds.diff \
bug-1706949-wasi-workaround.diff \
bug-1766220-ICU-21994.diff \
bug-1790071-ICU-22132-standardize-vtzone-output.diff \
bug-1792775-ICU-22198.diff \
bug-1792775-ICU-22206.diff \
; do
echo "Applying local patch $patch"
patch -d ${icu_dir}/../../ -p1 --no-backup-if-mismatch < ${icu_dir}/../icu-patches/$patch