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

Unified Diff: util/numeric/in_range_cast.h

Issue 800073003: win: Avoid warnings about conversion to smaller integer types (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@strlcpy-impl
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/numeric/in_range_cast.h
diff --git a/util/numeric/in_range_cast.h b/util/numeric/in_range_cast.h
index 3a7bdddf827f763ba1a3652374edcaaab5103106..3dba10afa16016bb7149cd1fa7b4ae14c72cfca2 100644
--- a/util/numeric/in_range_cast.h
+++ b/util/numeric/in_range_cast.h
@@ -32,11 +32,11 @@ namespace crashpad {
template <typename Destination, typename Source>
Destination InRangeCast(Source source, Destination default_value) {
if (base::IsValueInRangeForNumericType<Destination>(source)) {
- return source;
+ return static_cast<Destination>(source);
}
LOG(WARNING) << "value " << source << " out of range";
- return default_value;
+ return static_cast<Destination>(default_value);
}
} // namespace crashpad
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698