Index: base/numerics/safe_math_impl.h |
diff --git a/base/numerics/safe_math_impl.h b/base/numerics/safe_math_impl.h |
index 3b5e64dd5b51de808e440f318f0bef9125213943..34e2bf5cb35a47a78fc669f9fddaa4cdcb1ca6dd 100644 |
--- a/base/numerics/safe_math_impl.h |
+++ b/base/numerics/safe_math_impl.h |
@@ -277,7 +277,7 @@ typename enable_if< |
CheckedAbs(T value, RangeConstraint* validity) { |
*validity = |
value != std::numeric_limits<T>::min() ? RANGE_VALID : RANGE_OVERFLOW; |
- return std::abs(value); |
+ return static_cast<T>(std::abs(value)); |
} |
template <typename T> |
@@ -359,7 +359,7 @@ class CheckedNumericState<T, NUMERIC_INTEGER> { |
template <typename Src> |
CheckedNumericState(Src value, RangeConstraint validity) |
- : value_(value), |
+ : value_(static_cast<T>(value)), |
validity_(GetRangeConstraint(validity | |
DstRangeRelationToSrcRange<T>(value))) { |
COMPILE_ASSERT(std::numeric_limits<Src>::is_specialized, |