Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1533)

Unified Diff: Source/wtf/CheckedArithmetic.h

Issue 641643004: Reapply the non-MathExtras parts of (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/wtf/CheckedArithmetic.h
diff --git a/Source/wtf/CheckedArithmetic.h b/Source/wtf/CheckedArithmetic.h
index 75d4a41b418f508166fca6e4a3fbfc5f0ffc4329..dcbc896b8ad81217d88ff96e8038ea44efdd3417 100644
--- a/Source/wtf/CheckedArithmetic.h
+++ b/Source/wtf/CheckedArithmetic.h
@@ -251,7 +251,7 @@ template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOper
return false;
}
} // if the signs do not match this operation can't overflow
- result = lhs + rhs;
+ result = static_cast<ResultType>(lhs + rhs);
return true;
}
@@ -266,7 +266,7 @@ template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOper
return false;
}
} // if the signs match this operation can't overflow
- result = lhs - rhs;
+ result = static_cast<ResultType>(lhs - rhs);
return true;
}
@@ -291,7 +291,7 @@ template <typename LHS, typename RHS, typename ResultType> struct ArithmeticOper
return false;
}
}
- result = lhs * rhs;
+ result = static_cast<ResultType>(lhs * rhs);
return true;
}
« no previous file with comments | « Source/platform/transforms/PerspectiveTransformOperation.cpp ('k') | Source/wtf/CryptographicallyRandomNumber.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698