]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/calendar.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / i18n / calendar.cpp
index 416df5c6c1275ae62b0d6eb5d7d6d04aa4d90aa1..5fccbd0ecad5da21a83f8eba33c96f41c5dfc15c 100644 (file)
@@ -268,6 +268,8 @@ static ECalType getCalendarTypeForLocale(const char *locid) {
 
     // canonicalize, so grandfathered variant will be transformed to keywords
     // e.g ja_JP_TRADITIONAL -> ja_JP@calendar=japanese
+    // NOTE: Since ICU-20187, ja_JP_TRADITIONAL no longer canonicalizes, and
+    // the Gregorian calendar is returned instead.
     int32_t canonicalLen = uloc_canonicalize(locid, canonicalName, sizeof(canonicalName) - 1, &status);
     if (U_FAILURE(status)) {
         return CALTYPE_GREGORIAN;
@@ -748,6 +750,7 @@ fSkippedWallTime(UCAL_WALLTIME_LAST)
     validLocale[0] = 0;
     actualLocale[0] = 0;
     if (U_FAILURE(success)) {
+        delete zone;
         return;
     }
     if(zone == 0) {
@@ -2604,7 +2607,7 @@ Calendar::isWeekend(UDate date, UErrorCode &status) const
         return FALSE;
     }
     // clone the calendar so we don't mess with the real one.
-    Calendar *work = (Calendar*)this->clone();
+    Calendar *work = this->clone();
     if (work == NULL) {
         status = U_MEMORY_ALLOCATION_ERROR;
         return FALSE;
@@ -2764,7 +2767,7 @@ Calendar::getActualMinimum(UCalendarDateFields field, UErrorCode& status) const
 
     // clone the calendar so we don't mess with the real one, and set it to
     // accept anything for the field values
-    Calendar *work = (Calendar*)this->clone();
+    Calendar *work = this->clone();
     if (work == NULL) {
         status = U_MEMORY_ALLOCATION_ERROR;
         return 0;