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

Unified Diff: snapshot/cpu_context.cc

Issue 700383007: Use implicit_cast<> instead of static_cast<> whenever possible (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 6 years, 1 month 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: snapshot/cpu_context.cc
diff --git a/snapshot/cpu_context.cc b/snapshot/cpu_context.cc
index fd380c11926b7ed61ca844275bc4c98a58e64724..506b07f30263f739b84d276e9894a87a60235a33 100644
--- a/snapshot/cpu_context.cc
+++ b/snapshot/cpu_context.cc
@@ -14,6 +14,7 @@
#include "snapshot/cpu_context.h"
+#include "base/basictypes.h"
#include "base/logging.h"
namespace crashpad {
@@ -55,11 +56,11 @@ uint16_t CPUContextX86::FxsaveToFsaveTagWord(
// The integer bit the “J bit”.
bool integer_bit = st[7] & 0x80;
if (exponent == 0) {
- uint64_t fraction = ((static_cast<uint64_t>(st[7]) & 0x7f) << 56) |
- (static_cast<uint64_t>(st[6]) << 48) |
- (static_cast<uint64_t>(st[5]) << 40) |
- (static_cast<uint64_t>(st[4]) << 32) |
- (static_cast<uint32_t>(st[3]) << 24) |
+ uint64_t fraction = ((implicit_cast<uint64_t>(st[7]) & 0x7f) << 56) |
+ (implicit_cast<uint64_t>(st[6]) << 48) |
+ (implicit_cast<uint64_t>(st[5]) << 40) |
+ (implicit_cast<uint64_t>(st[4]) << 32) |
+ (implicit_cast<uint32_t>(st[3]) << 24) |
(st[2] << 16) | (st[1] << 8) | st[0];
if (!integer_bit && fraction == 0) {
fsave_bits = kX87TagZero;

Powered by Google App Engine
This is Rietveld 408576698