Issue #1971 - Part 2: Update ICU source to 63.2.

This commit is contained in:
Job Bautista 2022-07-24 21:03:27 +08:00 • committed by roytam1
commit 1e69214382
3160 changed files with 275815 additions and 234203 deletions

View file

@ -1,4 +1,4 @@
// Copyright (C) 2016 and later: Unicode, Inc. and others.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
**********************************************************************
@ -40,6 +40,17 @@ class ClockMath {
*/
static int32_t floorDivide(int32_t numerator, int32_t denominator);
/**
* Divide two integers, returning the floor of the quotient.
* Unlike the built-in division, this is mathematically
* well-behaved. E.g., <code>-1/4</code> => 0 but
* <code>floorDivide(-1,4)</code> => -1.
* @param numerator the numerator
* @param denominator a divisor which must be != 0
* @return the floor of the quotient
*/
static int64_t floorDivide(int64_t numerator, int64_t denominator);
/**
* Divide two numbers, returning the floor of the quotient.
* Unlike the built-in division, this is mathematically
@ -288,8 +299,8 @@ inline int32_t Grego::millisToJulianDay(double millis) {
}
inline int32_t Grego::gregorianShift(int32_t eyear) {
int32_t y = eyear-1;
int32_t gregShift = ClockMath::floorDivide(y, 400) - ClockMath::floorDivide(y, 100) + 2;
int64_t y = (int64_t)eyear-1;
int32_t gregShift = static_cast<int32_t>(ClockMath::floorDivide(y, (int64_t)400) - ClockMath::floorDivide(y, (int64_t)100) + 2);
return gregShift;
}