|
Use implicit_cast<> instead of static_cast<> whenever possible.
implicit_cast<> only performs a cast in cases where an implicit
conversion would be possible. It’s even safer than static_cast<> It’s an
“explicit implicit” cast, which is not normally necsesary, but is
frequently required when working with the ?: operator, functions like
std::min() and std::max(), and logging and testing macros.
The public style guide does not mention implicit_cast<> only because it
is not part of the standard library, but would otherwise require it in
these situations. Since base does provide implicit_cast<>, it should be
used whenever possible.
The only uses of static_cast<> not converted to implicit_cast<> are
those that require static_cast<>, such as those that assign an integer
constant to a variable of an enum type.
R=rsesek@chromium.org
Committed: https://chromium.googlesource.com/crashpad/crashpad/+/48b1964d1b215dae805bdf08089007bb8a7b285f
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+127 lines, -119 lines) |
Patch |
|
M |
client/capture_context_mac_test.cc
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
client/simple_string_dictionary.h
|
View
|
|
1 chunk |
+1 line, -1 line |
2 comments
|
Download
|
|
M |
client/simulate_crash_mac.cc
|
View
|
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
client/simulate_crash_mac_test.cc
|
View
|
|
3 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
minidump/minidump_module_writer.cc
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
minidump/minidump_module_writer_test.cc
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
minidump/minidump_system_info_writer.cc
|
View
|
|
2 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
|
M |
minidump/minidump_system_info_writer_test.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
minidump/test/minidump_writable_test_util.cc
|
View
|
|
3 chunks |
+5 lines, -3 lines |
0 comments
|
Download
|
|
M |
snapshot/cpu_context.cc
|
View
|
|
2 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
|
M |
snapshot/mac/mach_o_image_reader.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
snapshot/mac/mach_o_image_reader_test.cc
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
snapshot/mac/process_types_test.cc
|
View
|
|
7 chunks |
+9 lines, -8 lines |
0 comments
|
Download
|
|
M |
util/file/file_writer.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
util/file/string_file_writer_test.cc
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
util/mac/launchd.mm
|
View
|
|
3 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
util/mach/exc_client_variants_test.cc
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
util/mach/exc_server_variants_test.cc
|
View
|
|
5 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
util/mach/mach_extensions.h
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
util/mach/mach_message_server.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
util/mach/mach_message_server_test.cc
|
View
|
|
4 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
|
M |
util/mach/symbolic_constants_mach.cc
|
View
|
|
7 chunks |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
util/mach/symbolic_constants_mach_test.cc
|
View
|
|
2 chunks |
+16 lines, -16 lines |
0 comments
|
Download
|
|
M |
util/misc/clock_test.cc
|
View
|
|
1 chunk |
+7 lines, -7 lines |
0 comments
|
Download
|
|
M |
util/net/http_body.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
util/net/http_body_test.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
util/net/http_transport_mac.mm
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
util/numeric/checked_range.h
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
util/numeric/in_range_cast_test.cc
|
View
|
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
util/posix/process_util_test.cc
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
util/posix/symbolic_constants_posix.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
util/test/mac/mach_multiprocess.cc
|
View
|
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
util/test/posix/close_multiple.cc
|
View
|
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
Total messages: 5 (1 generated)
|