Commit 7cff3cce authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: use long long in casts when initializing durations

parent f28918dc
Pipeline #8083 failed with stages
in 70 minutes and 16 seconds
......@@ -164,7 +164,7 @@ public:
friend Duration& operator*=(Duration & u, double v)
{
u.m_Duration = boost::posix_time::nanoseconds(static_cast<long>(std::round(
u.m_Duration = boost::posix_time::nanoseconds(static_cast<long long>(std::round(
u.m_Duration.total_nanoseconds() * v)));
return u;
}
......@@ -172,7 +172,7 @@ public:
friend Duration& operator/=(Duration & u, double v)
{
u.m_Duration = boost::posix_time::nanoseconds(static_cast<long>(std::round(
u.m_Duration = boost::posix_time::nanoseconds(static_cast<long long>(std::round(
u.m_Duration.total_nanoseconds() / v)));
return u;
}
......
......@@ -238,7 +238,7 @@ public:
precise_duration() = default;
precise_duration(InternalDurationType const& d): m_duration(d) {}
precise_duration(double us ): m_duration(boost::posix_time::nanoseconds(static_cast<long>(std::floor(us * 1e3)))){}
precise_duration(double us ): m_duration(boost::posix_time::nanoseconds(static_cast<long long>(std::floor(us * 1e3)))){}
double total_seconds() const {
......@@ -270,7 +270,7 @@ precise_duration(double us ): m_duration(boost::posix_time::nanoseconds(static_c
friend precise_duration& operator*=(precise_duration & u, double v)
{
u.m_duration = boost::posix_time::nanoseconds(static_cast<long>(std::round(
u.m_duration = boost::posix_time::nanoseconds(static_cast<long long>(std::round(
u.m_duration.total_nanoseconds() * v)));
return u;
}
......@@ -278,7 +278,7 @@ precise_duration(double us ): m_duration(boost::posix_time::nanoseconds(static_c
friend precise_duration& operator/=(precise_duration & u, double v)
{
u.m_duration = boost::posix_time::nanoseconds(static_cast<long>(std::round(
u.m_duration = boost::posix_time::nanoseconds(static_cast<long long>(std::round(
u.m_duration.total_nanoseconds() / v)));
return u;
}
......
Markdown is supported
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