diff options
author | mcheshkov <mcheshkov@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:15 +0300 |
commit | e9d19cec64684c9c1e6b0c98297e5b895cf904fe (patch) | |
tree | 2768b1223e96a8a0610a93d18425d9647c1123c8 /contrib/libs/icu/i18n/zonemeta.cpp | |
parent | 60040c91ffe701a84689b2c6310ff845e65cff42 (diff) | |
download | ydb-e9d19cec64684c9c1e6b0c98297e5b895cf904fe.tar.gz |
Restoring authorship annotation for <mcheshkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/icu/i18n/zonemeta.cpp')
-rw-r--r-- | contrib/libs/icu/i18n/zonemeta.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/contrib/libs/icu/i18n/zonemeta.cpp b/contrib/libs/icu/i18n/zonemeta.cpp index 72c590f424..b2c6abeff0 100644 --- a/contrib/libs/icu/i18n/zonemeta.cpp +++ b/contrib/libs/icu/i18n/zonemeta.cpp @@ -1,4 +1,4 @@ -// © 2016 and later: Unicode, Inc. and others. +// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html /* ******************************************************************************* @@ -17,7 +17,7 @@ #include "unicode/ustring.h" #include "unicode/putil.h" #include "unicode/simpletz.h" -#include "unicode/strenum.h" +#include "unicode/strenum.h" #include "umutex.h" #include "uvector.h" #include "cmemory.h" @@ -28,9 +28,9 @@ #include "uresimp.h" #include "uhash.h" #include "olsontz.h" -#include "uinvchar.h" +#include "uinvchar.h" -static icu::UMutex gZoneMetaLock; +static icu::UMutex gZoneMetaLock; // CLDR Canonical ID mapping table static UHashtable *gCanonicalIDCache = NULL; @@ -256,12 +256,12 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) { tzid.extract(utzid, ZID_KEY_MAX + 1, tmpStatus); U_ASSERT(tmpStatus == U_ZERO_ERROR); // we checked the length of tzid already - if (!uprv_isInvariantUString(utzid, -1)) { - // All of known tz IDs are only containing ASCII invariant characters. - status = U_ILLEGAL_ARGUMENT_ERROR; - return NULL; - } - + if (!uprv_isInvariantUString(utzid, -1)) { + // All of known tz IDs are only containing ASCII invariant characters. + status = U_ILLEGAL_ARGUMENT_ERROR; + return NULL; + } + // Check if it was already cached umtx_lock(&gZoneMetaLock); { @@ -319,10 +319,10 @@ ZoneMeta::getCanonicalCLDRID(const UnicodeString &tzid, UErrorCode& status) { id[len] = (char) 0; // Make sure it is null terminated. // replace '/' with ':' - char *q = id; - while (*q++) { - if (*q == '/') { - *q = ':'; + char *q = id; + while (*q++) { + if (*q == '/') { + *q = ':'; } } @@ -690,7 +690,7 @@ ZoneMeta::createMetazoneMappings(const UnicodeString &tzid) { mzMappings = new UVector(deleteOlsonToMetaMappingEntry, NULL, status); if (U_FAILURE(status)) { delete mzMappings; - mzMappings = NULL; + mzMappings = NULL; uprv_free(entry); break; } @@ -784,14 +784,14 @@ static void U_CALLCONV initAvailableMetaZoneIDs () { UResourceBundle *rb = ures_openDirect(NULL, gMetaZones, &status); UResourceBundle *bundle = ures_getByKey(rb, gMapTimezonesTag, NULL, &status); - StackUResourceBundle res; + StackUResourceBundle res; while (U_SUCCESS(status) && ures_hasNext(bundle)) { - ures_getNextResource(bundle, res.getAlias(), &status); + ures_getNextResource(bundle, res.getAlias(), &status); if (U_FAILURE(status)) { break; } - const char *mzID = ures_getKey(res.getAlias()); - int32_t len = static_cast<int32_t>(uprv_strlen(mzID)); + const char *mzID = ures_getKey(res.getAlias()); + int32_t len = static_cast<int32_t>(uprv_strlen(mzID)); UChar *uMzID = (UChar*)uprv_malloc(sizeof(UChar) * (len + 1)); if (uMzID == NULL) { status = U_MEMORY_ALLOCATION_ERROR; @@ -848,13 +848,13 @@ ZoneMeta::createCustomTimeZone(int32_t offset) { negative = TRUE; tmp = -offset; } - uint8_t hour, min, sec; + uint8_t hour, min, sec; tmp /= 1000; - sec = static_cast<uint8_t>(tmp % 60); + sec = static_cast<uint8_t>(tmp % 60); tmp /= 60; - min = static_cast<uint8_t>(tmp % 60); - hour = static_cast<uint8_t>(tmp / 60); + min = static_cast<uint8_t>(tmp % 60); + hour = static_cast<uint8_t>(tmp / 60); UnicodeString zid; formatCustomID(hour, min, sec, negative, zid); |