summaryrefslogtreecommitdiff
path: root/deps/icu-small/source/i18n/gregocal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'deps/icu-small/source/i18n/gregocal.cpp')
-rw-r--r--deps/icu-small/source/i18n/gregocal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/deps/icu-small/source/i18n/gregocal.cpp b/deps/icu-small/source/i18n/gregocal.cpp
index 49c4226049..4db66758df 100644
--- a/deps/icu-small/source/i18n/gregocal.cpp
+++ b/deps/icu-small/source/i18n/gregocal.cpp
@@ -541,8 +541,8 @@ int32_t GregorianCalendar::handleComputeMonthStart(int32_t eyear, int32_t month,
}
UBool isLeap = eyear%4 == 0;
- int32_t y = eyear-1;
- int32_t julianDay = 365*y + ClockMath::floorDivide(y, 4) + (kJan1_1JulianDay - 3);
+ int64_t y = (int64_t)eyear-1;
+ int64_t julianDay = 365*y + ClockMath::floorDivide(y, (int64_t)4) + (kJan1_1JulianDay - 3);
nonConstThis->fIsGregorian = (eyear >= fGregorianCutoverYear);
#if defined (U_DEBUG_CAL)
@@ -572,7 +572,7 @@ int32_t GregorianCalendar::handleComputeMonthStart(int32_t eyear, int32_t month,
julianDay += isLeap?kLeapNumDays[month]:kNumDays[month];
}
- return julianDay;
+ return static_cast<int32_t>(julianDay);
}
int32_t GregorianCalendar::handleGetMonthLength(int32_t extendedYear, int32_t month) const