diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-10-28 09:11:55 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-10-28 09:11:55 +0300 |
commit | 4e44a271f0cfd00f5d278fd3001f1750cf934e42 (patch) | |
tree | 4dda3aa82f579c74cf6db1116b50cf8c18a75304 /thirdparty/icu4c/i18n | |
parent | 9ff3a43a329182ba2fad34263297052c70a4524e (diff) |
ICU: Update to version 72.1
Diffstat (limited to 'thirdparty/icu4c/i18n')
-rw-r--r-- | thirdparty/icu4c/i18n/scriptset.cpp | 14 | ||||
-rw-r--r-- | thirdparty/icu4c/i18n/scriptset.h | 5 | ||||
-rw-r--r-- | thirdparty/icu4c/i18n/ucln_in.cpp | 2 | ||||
-rw-r--r-- | thirdparty/icu4c/i18n/unicode/uspoof.h | 2 | ||||
-rw-r--r-- | thirdparty/icu4c/i18n/uspoof.cpp | 45 | ||||
-rw-r--r-- | thirdparty/icu4c/i18n/uspoof_impl.cpp | 20 | ||||
-rw-r--r-- | thirdparty/icu4c/i18n/uspoof_impl.h | 1 |
7 files changed, 47 insertions, 42 deletions
diff --git a/thirdparty/icu4c/i18n/scriptset.cpp b/thirdparty/icu4c/i18n/scriptset.cpp index 6a1db8c01c..236bf9d37f 100644 --- a/thirdparty/icu4c/i18n/scriptset.cpp +++ b/thirdparty/icu4c/i18n/scriptset.cpp @@ -55,11 +55,11 @@ bool ScriptSet::operator == (const ScriptSet &other) const { UBool ScriptSet::test(UScriptCode script, UErrorCode &status) const { if (U_FAILURE(status)) { - return FALSE; + return false; } if (script < 0 || (int32_t)script >= SCRIPT_LIMIT) { status = U_ILLEGAL_ARGUMENT_ERROR; - return FALSE; + return false; } uint32_t index = script / 32; uint32_t bit = 1 << (script & 31); @@ -188,19 +188,19 @@ int32_t ScriptSet::nextSetBit(int32_t fromIndex) const { UBool ScriptSet::isEmpty() const { for (uint32_t i=0; i<UPRV_LENGTHOF(bits); i++) { if (bits[i] != 0) { - return FALSE; + return false; } } - return TRUE; + return true; } UnicodeString &ScriptSet::displayScripts(UnicodeString &dest) const { - UBool firstTime = TRUE; + UBool firstTime = true; for (int32_t i = nextSetBit(0); i >= 0; i = nextSetBit(i + 1)) { if (!firstTime) { dest.append((UChar)0x20); } - firstTime = FALSE; + firstTime = false; const char *scriptName = uscript_getShortName((UScriptCode(i))); dest.append(UnicodeString(scriptName, -1, US_INV)); } @@ -248,7 +248,7 @@ void ScriptSet::setScriptExtensions(UChar32 codePoint, UErrorCode& status) { UErrorCode internalStatus = U_ZERO_ERROR; int32_t script_count = -1; - while (TRUE) { + while (true) { script_count = uscript_getScriptExtensions( codePoint, scripts.getAlias(), scripts.getCapacity(), &internalStatus); if (internalStatus == U_BUFFER_OVERFLOW_ERROR) { diff --git a/thirdparty/icu4c/i18n/scriptset.h b/thirdparty/icu4c/i18n/scriptset.h index 51980ab7b3..df5cfdc748 100644 --- a/thirdparty/icu4c/i18n/scriptset.h +++ b/thirdparty/icu4c/i18n/scriptset.h @@ -83,4 +83,7 @@ uhash_hashScriptSet(const UElement key); U_CAPI void U_EXPORT2 uhash_deleteScriptSet(void *obj); -#endif // __SCRIPTSET_H__ +U_CAPI UBool U_EXPORT2 +uhash_equalsScriptSet(const UElement key1, const UElement key2); + +#endif // __SCRIPTSET_H_ diff --git a/thirdparty/icu4c/i18n/ucln_in.cpp b/thirdparty/icu4c/i18n/ucln_in.cpp index f29cbe41dd..cdbd16a65e 100644 --- a/thirdparty/icu4c/i18n/ucln_in.cpp +++ b/thirdparty/icu4c/i18n/ucln_in.cpp @@ -45,7 +45,7 @@ static UBool U_CALLCONV i18n_cleanup(void) #if !UCLN_NO_AUTO_CLEANUP && (defined(UCLN_AUTO_ATEXIT) || defined(UCLN_AUTO_LOCAL)) ucln_unRegisterAutomaticCleanup(); #endif - return TRUE; + return true; } void ucln_i18n_registerCleanup(ECleanupI18NType type, diff --git a/thirdparty/icu4c/i18n/unicode/uspoof.h b/thirdparty/icu4c/i18n/unicode/uspoof.h index b674c91b2c..0aa887b706 100644 --- a/thirdparty/icu4c/i18n/unicode/uspoof.h +++ b/thirdparty/icu4c/i18n/unicode/uspoof.h @@ -35,7 +35,7 @@ /** * \file - * \brief Unicode Security and Spoofing Detection, C API. + * \brief C API: Unicode Security and Spoofing Detection * * <p> * This class, based on <a href="http://unicode.org/reports/tr36">Unicode Technical Report #36</a> and diff --git a/thirdparty/icu4c/i18n/uspoof.cpp b/thirdparty/icu4c/i18n/uspoof.cpp index dd4618baa7..f894dc44ca 100644 --- a/thirdparty/icu4c/i18n/uspoof.cpp +++ b/thirdparty/icu4c/i18n/uspoof.cpp @@ -41,7 +41,7 @@ U_NAMESPACE_USE static UnicodeSet *gInclusionSet = NULL; static UnicodeSet *gRecommendedSet = NULL; static const Normalizer2 *gNfdNormalizer = NULL; -static UInitOnce gSpoofInitStaticsOnce = U_INITONCE_INITIALIZER; +static UInitOnce gSpoofInitStaticsOnce {}; namespace { @@ -53,13 +53,13 @@ uspoof_cleanup(void) { gRecommendedSet = NULL; gNfdNormalizer = NULL; gSpoofInitStaticsOnce.reset(); - return TRUE; + return true; } void U_CALLCONV initializeStatics(UErrorCode &status) { static const char16_t *inclusionPat = - u"['\\-.\\:\\u00B7\\u0375\\u058A\\u05F3\\u05F4\\u06FD\\u06FE\\u0F0B\\u200C" - u"\\u200D\\u2010\\u2019\\u2027\\u30A0\\u30FB]"; + u"['\\-.\\:\\u00B7\\u0375\\u058A\\u05F3\\u05F4\\u06FD\\u06FE\\u0F0B\\u2010" + u"\\u2019\\u2027\\u30A0\\u30FB]"; gInclusionSet = new UnicodeSet(UnicodeString(inclusionPat), status); if (gInclusionSet == NULL) { status = U_MEMORY_ALLOCATION_ERROR; @@ -103,14 +103,14 @@ void U_CALLCONV initializeStatics(UErrorCode &status) { u"\\u0C56\\u0C5D\\u0C60\\u0C61\\u0C66-\\u0C6F\\u0C80\\u0C82\\u0C83\\u0C85-" u"\\u0C8C\\u0C8E-\\u0C90\\u0C92-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80\\u0F82-\\u0F84\\u0F86-\\u0F92\\u0F94-\\u0F97" @@ -131,17 +131,18 @@ void U_CALLCONV initializeStatics(UErrorCode &status) { u"\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u3005-" u"\\u3007\\u3041-\\u3096\\u3099\\u309A\\u309D\\u309E\\u30A1-\\u30FA\\u30FC-" u"\\u30FE\\u3105-\\u312D\\u312F\\u31A0-\\u31BF\\u3400-\\u4DBF\\u4E00-\\u9FFF" - u"\\uA67F\\uA717-\\uA71F\\uA788\\uA78D\\uA792\\uA793\\uA7AA\\uA7AE\\uA7B8" - u"\\uA7B9\\uA7C0-\\uA7CA\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA9E7-\\uA9FE" - u"\\uAA60-\\uAA76\\uAA7A-\\uAA7F\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16" - u"\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB66\\uAB67\\uAC00-\\uD7A3\\uFA0E\\uFA0F" - u"\\uFA11\\uFA13\\uFA14\\uFA1F\\uFA21\\uFA23\\uFA24\\uFA27-\\uFA29\\U00011301" - u"\\U00011303\\U0001133B\\U0001133C\\U00016FF0\\U00016FF1\\U0001B11F-" - u"\\U0001B122\\U0001B150-\\U0001B152\\U0001B164-\\U0001B167\\U0001DF00-" - u"\\U0001DF1E\\U0001E7E0-\\U0001E7E6\\U0001E7E8-\\U0001E7EB\\U0001E7ED" - u"\\U0001E7EE\\U0001E7F0-\\U0001E7FE\\U00020000-\\U0002A6DF\\U0002A700-" - u"\\U0002B738\\U0002B740-\\U0002B81D\\U0002B820-\\U0002CEA1\\U0002CEB0-" - u"\\U0002EBE0\\U00030000-\\U0003134A]"; + u"\\uA67F\\uA717-\\uA71F\\uA788\\uA78D\\uA792\\uA793\\uA7AA\\uA7C0-\\uA7CA" + u"\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7D9\\uA9E7-\\uA9FE\\uAA60-\\uAA76\\uAA7A-" + u"\\uAA7F\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-" + u"\\uAB2E\\uAB66\\uAB67\\uAC00-\\uD7A3\\uFA0E\\uFA0F\\uFA11\\uFA13\\uFA14" + u"\\uFA1F\\uFA21\\uFA23\\uFA24\\uFA27-\\uFA29\\U00011301\\U00011303" + u"\\U0001133B\\U0001133C\\U00016FF0\\U00016FF1\\U0001B11F-\\U0001B122" + u"\\U0001B132\\U0001B150-\\U0001B152\\U0001B155\\U0001B164-\\U0001B167" + u"\\U0001DF00-\\U0001DF1E\\U0001DF25-\\U0001DF2A\\U0001E08F\\U0001E7E0-" + u"\\U0001E7E6\\U0001E7E8-\\U0001E7EB\\U0001E7ED\\U0001E7EE\\U0001E7F0-" + u"\\U0001E7FE\\U00020000-\\U0002A6DF\\U0002A700-\\U0002B739\\U0002B740-" + u"\\U0002B81D\\U0002B820-\\U0002CEA1\\U0002CEB0-\\U0002EBE0\\U00030000-" + u"\\U0003134A\\U00031350-\\U000323AF]"; gRecommendedSet = new UnicodeSet(UnicodeString(recommendedPat), status); if (gRecommendedSet == NULL) { @@ -611,7 +612,7 @@ int32_t checkImpl(const SpoofImpl* This, const UnicodeString& id, CheckResult* c int32_t i; UChar32 c; UChar32 firstNonspacingMark = 0; - UBool haveMultipleMarks = FALSE; + UBool haveMultipleMarks = false; UnicodeSet marksSeenSoFar; // Set of combining marks in a single combining sequence. for (i=0; i<nfdLength ;) { @@ -621,7 +622,7 @@ int32_t checkImpl(const SpoofImpl* This, const UnicodeString& id, CheckResult* c firstNonspacingMark = 0; if (haveMultipleMarks) { marksSeenSoFar.clear(); - haveMultipleMarks = FALSE; + haveMultipleMarks = false; } continue; } @@ -631,7 +632,7 @@ int32_t checkImpl(const SpoofImpl* This, const UnicodeString& id, CheckResult* c } if (!haveMultipleMarks) { marksSeenSoFar.add(firstNonspacingMark); - haveMultipleMarks = TRUE; + haveMultipleMarks = true; } if (marksSeenSoFar.contains(c)) { // report the error, and stop scanning. @@ -656,13 +657,13 @@ uspoof_check2UnicodeString(const USpoofChecker *sc, UErrorCode *status) { const SpoofImpl *This = SpoofImpl::validateThis(sc, *status); if (This == NULL) { - return FALSE; + return false; } if (checkResult != NULL) { CheckResult* ThisCheckResult = CheckResult::validateThis(checkResult, *status); if (ThisCheckResult == NULL) { - return FALSE; + return false; } return checkImpl(This, id, ThisCheckResult, status); } else { diff --git a/thirdparty/icu4c/i18n/uspoof_impl.cpp b/thirdparty/icu4c/i18n/uspoof_impl.cpp index b283d81321..e50344c469 100644 --- a/thirdparty/icu4c/i18n/uspoof_impl.cpp +++ b/thirdparty/icu4c/i18n/uspoof_impl.cpp @@ -320,10 +320,10 @@ URestrictionLevel SpoofImpl::getRestrictionLevel(const UnicodeString& input, UEr // Section 5.2 step 2 // Java use a static UnicodeSet for this test. In C++, avoid the static variable // and just do a simple for loop. - UBool allASCII = TRUE; + UBool allASCII = true; for (int32_t i=0, length=input.length(); i<length; i++) { if (input.charAt(i) > 0x7f) { - allASCII = FALSE; + allASCII = false; break; } } @@ -495,9 +495,9 @@ UBool SpoofData::validateDataVersion(UErrorCode &status) const { fRawData->fFormatVersion[2] != 0 || fRawData->fFormatVersion[3] != 0) { status = U_INVALID_FORMAT_ERROR; - return FALSE; + return false; } - return TRUE; + return true; } static UBool U_CALLCONV @@ -518,9 +518,9 @@ spoofDataIsAcceptable(void *context, if(version != NULL) { uprv_memcpy(version, pInfo->dataVersion, 4); } - return TRUE; + return true; } else { - return FALSE; + return false; } } @@ -538,7 +538,7 @@ spoofDataIsAcceptable(void *context, // uspoof_cleanupDefaultData - Called during cleanup. // -static UInitOnce gSpoofInitDefaultOnce = U_INITONCE_INITIALIZER; +static UInitOnce gSpoofInitDefaultOnce {}; static SpoofData* gDefaultSpoofData; static UBool U_CALLCONV @@ -549,7 +549,7 @@ uspoof_cleanupDefaultData(void) { gDefaultSpoofData = nullptr; gSpoofInitDefaultOnce.reset(); } - return TRUE; + return true; } static void U_CALLCONV uspoof_loadDefaultData(UErrorCode& status) { @@ -655,7 +655,7 @@ SpoofData::SpoofData(UErrorCode &status) { // Called by constructors to put things in a known initial state. void SpoofData::reset() { fRawData = NULL; - fDataOwned = FALSE; + fDataOwned = false; fUDM = NULL; fMemLimit = 0; fRefCount = 1; @@ -945,7 +945,7 @@ uspoof_swap(const UDataSwapper *ds, const void *inData, int32_t length, void *ou uint32_t magic = ds->readUInt32(spoofDH->fMagic); ds->writeUInt32((uint32_t *)&outputDH->fMagic, magic); - if (outputDH->fFormatVersion != spoofDH->fFormatVersion) { + if (inBytes != outBytes) { uprv_memcpy(outputDH->fFormatVersion, spoofDH->fFormatVersion, sizeof(spoofDH->fFormatVersion)); } // swap starting at fLength diff --git a/thirdparty/icu4c/i18n/uspoof_impl.h b/thirdparty/icu4c/i18n/uspoof_impl.h index e75ae262bd..68d7bedae1 100644 --- a/thirdparty/icu4c/i18n/uspoof_impl.h +++ b/thirdparty/icu4c/i18n/uspoof_impl.h @@ -28,6 +28,7 @@ #ifdef __cplusplus #include "capi_helper.h" +#include "umutex.h" U_NAMESPACE_BEGIN |