Commit 6a497e1d authored by Victor Zverovich's avatar Victor Zverovich

Fix warnings

parent e9b9b0ae
...@@ -258,13 +258,15 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from, ...@@ -258,13 +258,15 @@ To safe_duration_cast(std::chrono::duration<FromRep, FromPeriod> from,
// multiply with Factor::num without overflow or underflow // multiply with Factor::num without overflow or underflow
if (Factor::num != 1) { if (Factor::num != 1) {
constexpr auto max1 = constexpr auto max1 =
std::numeric_limits<IntermediateRep>::max() / Factor::num; std::numeric_limits<IntermediateRep>::max() /
static_cast<IntermediateRep>(Factor::num);
if (count > max1) { if (count > max1) {
ec = 1; ec = 1;
return {}; return {};
} }
constexpr auto min1 = constexpr auto min1 =
std::numeric_limits<IntermediateRep>::lowest() / Factor::num; std::numeric_limits<IntermediateRep>::lowest() /
static_cast<IntermediateRep>(Factor::num);
if (count < min1) { if (count < min1) {
ec = 1; ec = 1;
return {}; return {};
......
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