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

Unified Diff: minidump/minidump_system_info_writer.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: minidump/minidump_system_info_writer.cc
diff --git a/minidump/minidump_system_info_writer.cc b/minidump/minidump_system_info_writer.cc
index 3e1d91f2072d88dfbd3a0b2229777311e044ae87..4797d6ea06322e4640118b6be149f872e4bbcacd 100644
--- a/minidump/minidump_system_info_writer.cc
+++ b/minidump/minidump_system_info_writer.cc
@@ -34,12 +34,12 @@ uint64_t AMD64FeaturesFromSystemSnapshot(
// x86_64. cmpxchg is supported on 486 and later.
uint64_t minidump_features = ADD_FEATURE(PF_COMPARE_EXCHANGE_DOUBLE);
-#define MAP_FEATURE(features, cpuid_bit, minidump_bit) \
-do { \
- if ((features) & (static_cast<decltype(features)>(1) << (cpuid_bit))) { \
- minidump_features |= ADD_FEATURE(minidump_bit); \
- } \
-} while (false)
+#define MAP_FEATURE(features, cpuid_bit, minidump_bit) \
+ do { \
+ if ((features) & (implicit_cast<decltype(features)>(1) << (cpuid_bit))) { \
+ minidump_features |= ADD_FEATURE(minidump_bit); \
+ } \
+ } while (false)
#define F_TSC 4
#define F_PAE 6
@@ -128,8 +128,8 @@ void MinidumpSystemInfoWriter::InitializeFromSnapshot(
SetCPUArchitecture(cpu_architecture);
uint32_t cpu_revision = system_snapshot->CPURevision();
- SetCPULevelAndRevision(
- (cpu_revision & 0xffff0000) >> 16, cpu_revision & 0x0000ffff);
+ SetCPULevelAndRevision((cpu_revision & 0xffff0000) >> 16,
+ cpu_revision & 0x0000ffff);
SetCPUCount(system_snapshot->CPUCount());
if (cpu_architecture == kMinidumpCPUArchitectureX86) {

Powered by Google App Engine
This is Rietveld 408576698