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

Unified Diff: client/simulate_crash_mac.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: client/simulate_crash_mac.cc
diff --git a/client/simulate_crash_mac.cc b/client/simulate_crash_mac.cc
index b80355a4f161d3ff394892330aa61d90561720a5..053b50a26d730c08515a7602a08d4bdeb3982baa 100644
--- a/client/simulate_crash_mac.cc
+++ b/client/simulate_crash_mac.cc
@@ -143,7 +143,7 @@ bool DeliverException(thread_t thread,
thread_state_data_t new_state;
size_t state_size =
sizeof(natural_t) *
- std::min(state_count, static_cast<unsigned int>(THREAD_STATE_MAX));
+ std::min(state_count, implicit_cast<unsigned int>(THREAD_STATE_MAX));
memcpy(new_state, state, state_size);
mach_msg_type_number_t new_state_count = THREAD_STATE_MAX;
@@ -181,13 +181,13 @@ bool DeliverException(thread_t thread,
void SimulateCrash(const NativeCPUContext* cpu_context) {
#if defined(ARCH_CPU_X86)
DCHECK_EQ(cpu_context->tsh.flavor,
- static_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
- DCHECK_EQ(static_cast<mach_msg_type_number_t>(cpu_context->tsh.count),
+ implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE32));
+ DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context->tsh.count),
x86_THREAD_STATE32_COUNT);
#elif defined(ARCH_CPU_X86_64)
DCHECK_EQ(cpu_context->tsh.flavor,
- static_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
- DCHECK_EQ(static_cast<mach_msg_type_number_t>(cpu_context->tsh.count),
+ implicit_cast<thread_state_flavor_t>(x86_THREAD_STATE64));
+ DCHECK_EQ(implicit_cast<mach_msg_type_number_t>(cpu_context->tsh.count),
x86_THREAD_STATE64_COUNT);
#endif

Powered by Google App Engine
This is Rietveld 408576698