WSL/SLF GitLab Repository

Commit b7c0a9bf authored by Mathias Bavay's avatar Mathias Bavay
Browse files

fixing some warnings on Hera

parent 459d2395
...@@ -506,15 +506,15 @@ int Date::getJulianDayNumber(const bool& gmt) const { ...@@ -506,15 +506,15 @@ int Date::getJulianDayNumber(const bool& gmt) const {
throw UnknownValueException("Date object is undefined!", AT); throw UnknownValueException("Date object is undefined!", AT);
if(gmt) { if(gmt) {
const double first_day_of_year = getJulianDayNumber(gmt_year, 1, 1); const double first_day_of_year = static_cast<double>(getJulianDayNumber(gmt_year, 1, 1));
return (int)(gmt_julian - first_day_of_year + 1); return static_cast<int>(gmt_julian - first_day_of_year + 1);
} else { } else {
const double local_julian = GMTToLocal(gmt_julian); const double local_julian = GMTToLocal(gmt_julian);
int local_year, local_month, local_day, local_hour, local_minute; int local_year, local_month, local_day, local_hour, local_minute;
calculateValues(local_julian, local_year, local_month, local_day, local_hour, local_minute); calculateValues(local_julian, local_year, local_month, local_day, local_hour, local_minute);
const double in_day_offset = 1./24.*((double)local_hour+1./60.*(double)local_minute) - 0.5; const double in_day_offset = 1./24.*((double)local_hour+1./60.*(double)local_minute) - 0.5;
const double first_day_of_year = static_cast<double>(getJulianDayNumber(local_year, 1, 1)) + in_day_offset; const double first_day_of_year = static_cast<double>(getJulianDayNumber(local_year, 1, 1)) + in_day_offset;
return (int)(local_julian - first_day_of_year + 1); return static_cast<int>(local_julian - first_day_of_year + 1);
} }
} }
...@@ -979,8 +979,8 @@ void Date::calculateValues(const double& i_julian, int& o_year, int& o_month, in ...@@ -979,8 +979,8 @@ void Date::calculateValues(const double& i_julian, int& o_year, int& o_month, in
double integral; double integral;
const double frac = modf(tmp_julian+.5, &integral); //the julian date reference is at 12:00 const double frac = modf(tmp_julian+.5, &integral); //the julian date reference is at 12:00
o_minute = Optim::round(frac*24.0*60.0) % 60; o_minute = static_cast<int>(Optim::round(frac*24.0*60.0)) % 60;
o_hour = Optim::round( (24.*60.*frac-(double)o_minute) / 60.0 ); o_hour = static_cast<int>(Optim::round( (24.*60.*frac-(double)o_minute) / 60.0 ));
} }
bool Date::isLeapYear(const int& i_year) const { bool Date::isLeapYear(const int& i_year) const {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment