+2006-10-04 Kevin McCullough <KMcCullough@apple.com>
+
+ Reviewed by DethBakin.
+
+ - Apparently the build bot uses an older version of XCode which warns about conversions and the newest version does not. I hope this fixes the build but I cann't be sure on my system.
+
+ * kjs/DateMath.cpp:
+ (KJS::msToYear):
+ (KJS::dayInYear):
+ (KJS::dateToDayInYear):
+
2006-10-05 Darin Adler <darin@apple.com>
Reviewed by Adam.
return floor(ms / msPerDay);
}
-static inline double msToYear(double ms)
+static inline int msToYear(double ms)
{
- double y = floor(ms /(msPerDay*365.2425)) + 1970;
+ int y = static_cast<int>(floor(ms /(msPerDay*365.2425)) + 1970);
double t2 = msFrom1970ToYear(y);
if (t2 > ms) {
return isLeapYear(msToYear(ms));
}
-static inline double dayInYear(double ms, int year)
+static inline int dayInYear(double ms, int year)
{
- return msToDays(ms) - daysFrom1970ToYear(year);
+ return static_cast<int>(msToDays(ms) - daysFrom1970ToYear(year));
}
static inline double msToMilliseconds(double ms)
static int dateToDayInYear(int year, int month, int day)
{
- year += floor(month / 12);
+ year += static_cast<int>(floor(month / 12));
- month = fmod(month, 12.0);
+ month = static_cast<int>(fmod(month, 12.0));
if (month < 0)
month += 12;