diff options
author | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-14 19:51:50 +0300 |
---|---|---|
committer | romankoshelev <romankoshelev@yandex-team.com> | 2023-08-15 01:24:11 +0300 |
commit | cfcd865e05c0d0525ea27d1e153a043b32a85138 (patch) | |
tree | 68d3b3b25271e8a4998505897a269ff7ce119b76 /contrib/libs/icu/i18n/dtitvinf.cpp | |
parent | ccb790c507bd5e8ffe2ef9886ce5ee0a7ce22a15 (diff) | |
download | ydb-cfcd865e05c0d0525ea27d1e153a043b32a85138.tar.gz |
Update ICU to 73.2
Diffstat (limited to 'contrib/libs/icu/i18n/dtitvinf.cpp')
-rw-r--r-- | contrib/libs/icu/i18n/dtitvinf.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/contrib/libs/icu/i18n/dtitvinf.cpp b/contrib/libs/icu/i18n/dtitvinf.cpp index 6052894b58..3733d04518 100644 --- a/contrib/libs/icu/i18n/dtitvinf.cpp +++ b/contrib/libs/icu/i18n/dtitvinf.cpp @@ -55,12 +55,12 @@ static const char gIntervalDateTimePatternTag[]="intervalFormats"; static const char gFallbackPatternTag[]="fallback"; // {0} -static const UChar gFirstPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET}; +static const char16_t gFirstPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET}; // {1} -static const UChar gSecondPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET}; +static const char16_t gSecondPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET}; // default fall-back -static const UChar gDefaultFallbackPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, EN_DASH, SPACE, LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET, 0}; +static const char16_t gDefaultFallbackPattern[] = {LEFT_CURLY_BRACKET, DIGIT_ZERO, RIGHT_CURLY_BRACKET, SPACE, EN_DASH, SPACE, LEFT_CURLY_BRACKET, DIGIT_ONE, RIGHT_CURLY_BRACKET, 0}; DateIntervalInfo::DateIntervalInfo(UErrorCode& status) : fFallbackIntervalPattern(gDefaultFallbackPattern), @@ -218,10 +218,10 @@ DateIntervalInfo::getFallbackIntervalPattern(UnicodeString& result) const { static const int32_t PATH_PREFIX_LENGTH = 17; -static const UChar PATH_PREFIX[] = {SOLIDUS, CAP_L, CAP_O, CAP_C, CAP_A, CAP_L, CAP_E, SOLIDUS, +static const char16_t PATH_PREFIX[] = {SOLIDUS, CAP_L, CAP_O, CAP_C, CAP_A, CAP_L, CAP_E, SOLIDUS, LOW_C, LOW_A, LOW_L, LOW_E, LOW_N, LOW_D, LOW_A, LOW_R, SOLIDUS}; static const int32_t PATH_SUFFIX_LENGTH = 16; -static const UChar PATH_SUFFIX[] = {SOLIDUS, LOW_I, LOW_N, LOW_T, LOW_E, LOW_R, LOW_V, LOW_A, +static const char16_t PATH_SUFFIX[] = {SOLIDUS, LOW_I, LOW_N, LOW_T, LOW_E, LOW_R, LOW_V, LOW_A, LOW_L, CAP_F, LOW_O, LOW_R, LOW_M, LOW_A, LOW_T, LOW_S}; /** @@ -401,7 +401,7 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& status) char localeWithCalendarKey[ULOC_LOCALE_IDENTIFIER_CAPACITY]; // obtain a locale that always has the calendar key value that should be used (void)ures_getFunctionalEquivalent(localeWithCalendarKey, ULOC_LOCALE_IDENTIFIER_CAPACITY, nullptr, - "calendar", "calendar", locName, nullptr, FALSE, &status); + "calendar", "calendar", locName, nullptr, false, &status); localeWithCalendarKey[ULOC_LOCALE_IDENTIFIER_CAPACITY-1] = 0; // ensure null termination // now get the calendar key value from that locale int32_t calendarTypeLen = uloc_getKeywordValue(localeWithCalendarKey, "calendar", calendarType, @@ -424,7 +424,7 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& status) UResourceBundle *calTypeBundle, *itvDtPtnResource; // Get the fallback pattern - const UChar* resStr = nullptr; + const char16_t* resStr = nullptr; int32_t resStrLen = 0; calTypeBundle = ures_getByKeyWithFallback(calBundle, calendarTypeToUse, nullptr, &status); itvDtPtnResource = ures_getByKeyWithFallback(calTypeBundle, @@ -437,7 +437,7 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& status) } if ( U_SUCCESS(status) && (resStr != nullptr)) { - UnicodeString pattern = UnicodeString(TRUE, resStr, resStrLen); + UnicodeString pattern = UnicodeString(true, resStr, resStrLen); setFallbackIntervalPattern(pattern, status); } ures_close(itvDtPtnResource); @@ -449,7 +449,7 @@ DateIntervalInfo::initializeData(const Locale& locale, UErrorCode& status) const UnicodeString &calendarTypeToUseUString = sink.getNextCalendarType(); // Already loaded calendar types - Hashtable loadedCalendarTypes(FALSE, status); + Hashtable loadedCalendarTypes(false, status); if (U_SUCCESS(status)) { while (!calendarTypeToUseUString.isBogus()) { @@ -504,7 +504,7 @@ DateIntervalInfo::setIntervalPatternInternally(const UnicodeString& skeleton, } patternsOfOneSkeleton[index] = intervalPattern; - if ( emptyHash == TRUE ) { + if ( emptyHash ) { fIntervalPatterns->put(skeleton, patternsOfOneSkeleton, status); } } @@ -547,7 +547,7 @@ DateIntervalInfo::getBestSkeleton(const UnicodeString& skeleton, char result_1[1000]; char mesg[2000]; skeleton.extract(0, skeleton.length(), result, "UTF-8"); - sprintf(mesg, "in getBestSkeleton: skeleton: %s; \n", result); + snprintf(mesg, sizeof(mesg), "in getBestSkeleton: skeleton: %s; \n", result); PRINTMESG(mesg) #endif @@ -616,7 +616,7 @@ DateIntervalInfo::getBestSkeleton(const UnicodeString& skeleton, UnicodeString* newSkeleton = (UnicodeString*)keyTok.pointer; #ifdef DTITVINF_DEBUG skeleton->extract(0, skeleton->length(), result, "UTF-8"); - sprintf(mesg, "available skeletons: skeleton: %s; \n", result); + snprintf(mesg, sizeof(mesg), "available skeletons: skeleton: %s; \n", result); PRINTMESG(mesg) #endif @@ -738,7 +738,7 @@ U_CDECL_BEGIN * * @param val1 one value in comparison * @param val2 the other value in comparison - * @return TRUE if 2 values are the same, FALSE otherwise + * @return true if 2 values are the same, false otherwise */ static UBool U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1, UHashTok val2); @@ -746,9 +746,9 @@ static UBool U_CALLCONV dtitvinfHashTableValueComparator(UHashTok val1, UHashTok val2) { const UnicodeString* pattern1 = (UnicodeString*)val1.pointer; const UnicodeString* pattern2 = (UnicodeString*)val2.pointer; - UBool ret = TRUE; + 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; @@ -763,7 +763,7 @@ DateIntervalInfo::initHash(UErrorCode& status) { return nullptr; } Hashtable* hTable; - if ( (hTable = new Hashtable(FALSE, status)) == nullptr ) { + if ( (hTable = new Hashtable(false, status)) == nullptr ) { status = U_MEMORY_ALLOCATION_ERROR; return nullptr; } |