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/smpdtfst.cpp | |
parent | ccb790c507bd5e8ffe2ef9886ce5ee0a7ce22a15 (diff) | |
download | ydb-cfcd865e05c0d0525ea27d1e153a043b32a85138.tar.gz |
Update ICU to 73.2
Diffstat (limited to 'contrib/libs/icu/i18n/smpdtfst.cpp')
-rw-r--r-- | contrib/libs/icu/i18n/smpdtfst.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/contrib/libs/icu/i18n/smpdtfst.cpp b/contrib/libs/icu/i18n/smpdtfst.cpp index db59a4b4ab..9f9166aceb 100644 --- a/contrib/libs/icu/i18n/smpdtfst.cpp +++ b/contrib/libs/icu/i18n/smpdtfst.cpp @@ -29,20 +29,20 @@ U_NAMESPACE_BEGIN -SimpleDateFormatStaticSets *gStaticSets = NULL; -UInitOnce gSimpleDateFormatStaticSetsInitOnce = U_INITONCE_INITIALIZER; +SimpleDateFormatStaticSets *gStaticSets = nullptr; +UInitOnce gSimpleDateFormatStaticSetsInitOnce {}; SimpleDateFormatStaticSets::SimpleDateFormatStaticSets(UErrorCode &status) -: fDateIgnorables(NULL), - fTimeIgnorables(NULL), - fOtherIgnorables(NULL) +: fDateIgnorables(nullptr), + fTimeIgnorables(nullptr), + fOtherIgnorables(nullptr) { fDateIgnorables = new UnicodeSet(UNICODE_STRING("[-,./[:whitespace:]]", 20), status); fTimeIgnorables = new UnicodeSet(UNICODE_STRING("[-.:[:whitespace:]]", 19), status); fOtherIgnorables = new UnicodeSet(UNICODE_STRING("[:whitespace:]", 14), status); // Check for null pointers - if (fDateIgnorables == NULL || fTimeIgnorables == NULL || fOtherIgnorables == NULL) { + if (fDateIgnorables == nullptr || fTimeIgnorables == nullptr || fOtherIgnorables == nullptr) { goto ExitConstrDeleteAll; } @@ -54,18 +54,18 @@ SimpleDateFormatStaticSets::SimpleDateFormatStaticSets(UErrorCode &status) return; // If we reached this point, everything is fine so just exit ExitConstrDeleteAll: // Remove all sets and return error - delete fDateIgnorables; fDateIgnorables = NULL; - delete fTimeIgnorables; fTimeIgnorables = NULL; - delete fOtherIgnorables; fOtherIgnorables = NULL; + delete fDateIgnorables; fDateIgnorables = nullptr; + delete fTimeIgnorables; fTimeIgnorables = nullptr; + delete fOtherIgnorables; fOtherIgnorables = nullptr; status = U_MEMORY_ALLOCATION_ERROR; } SimpleDateFormatStaticSets::~SimpleDateFormatStaticSets() { - delete fDateIgnorables; fDateIgnorables = NULL; - delete fTimeIgnorables; fTimeIgnorables = NULL; - delete fOtherIgnorables; fOtherIgnorables = NULL; + delete fDateIgnorables; fDateIgnorables = nullptr; + delete fTimeIgnorables; fTimeIgnorables = nullptr; + delete fOtherIgnorables; fOtherIgnorables = nullptr; } @@ -76,26 +76,26 @@ SimpleDateFormatStaticSets::~SimpleDateFormatStaticSets() { // //------------------------------------------------------------------------------ UBool -SimpleDateFormatStaticSets::cleanup(void) +SimpleDateFormatStaticSets::cleanup() { delete gStaticSets; - gStaticSets = NULL; + gStaticSets = nullptr; gSimpleDateFormatStaticSetsInitOnce.reset(); - return TRUE; + return true; } U_CDECL_BEGIN static UBool U_CALLCONV -smpdtfmt_cleanup(void) +smpdtfmt_cleanup() { return SimpleDateFormatStaticSets::cleanup(); } static void U_CALLCONV smpdtfmt_initSets(UErrorCode &status) { ucln_i18n_registerCleanup(UCLN_I18N_SMPDTFMT, smpdtfmt_cleanup); - U_ASSERT(gStaticSets == NULL); + U_ASSERT(gStaticSets == nullptr); gStaticSets = new SimpleDateFormatStaticSets(status); - if (gStaticSets == NULL) { + if (gStaticSets == nullptr) { status = U_MEMORY_ALLOCATION_ERROR; return; } @@ -108,7 +108,7 @@ UnicodeSet *SimpleDateFormatStaticSets::getIgnorables(UDateFormatField fieldInde UErrorCode status = U_ZERO_ERROR; umtx_initOnce(gSimpleDateFormatStaticSetsInitOnce, &smpdtfmt_initSets, status); if (U_FAILURE(status)) { - return NULL; + return nullptr; } switch (fieldIndex) { |