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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@16786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/kjs/DateMath.cpp b/JavaScriptCore/kjs/DateMath.cpp
index baf9ec3..14d1598 100644
--- a/JavaScriptCore/kjs/DateMath.cpp
+++ b/JavaScriptCore/kjs/DateMath.cpp
@@ -113,9 +113,9 @@
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) {
@@ -143,9 +143,9 @@
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)
@@ -277,9 +277,9 @@
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;