From 408262d58fabff5a10211f23763fc40e9507c772 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Fri, 7 Nov 2014 10:02:21 -0500 Subject: [PATCH] Fix MinidumpMiscInfoWriter test compilation with 32-bit time_t. This produced errors such as: minidump_misc_info_writer_test.cc:665:32: error: non-constant-expression cannot be narrowed from type 'uint32_t' (aka 'unsigned int') to '__darwin_time_t' (aka 'long') in initializer list [-Wc++11-narrowing] const timeval kStartTime = { expect_misc_info.ProcessCreateTime, 0 }; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ minidump_misc_info_writer_test.cc:665:32: note: override this message by inserting an explicit cast const timeval kStartTime = { expect_misc_info.ProcessCreateTime, 0 }; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ static_cast<__darwin_time_t>( ) TEST=minidump_test MinidumpMiscInfoWriter.InitializeFromSnapshot R=rsesek@chromium.org Review URL: https://codereview.chromium.org/711603002 --- minidump/minidump_misc_info_writer_test.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/minidump/minidump_misc_info_writer_test.cc b/minidump/minidump_misc_info_writer_test.cc index 6e55a088..929c9288 100644 --- a/minidump/minidump_misc_info_writer_test.cc +++ b/minidump/minidump_misc_info_writer_test.cc @@ -662,9 +662,12 @@ TEST(MinidumpMiscInfoWriter, InitializeFromSnapshot) { debug_build_string_utf16.c_str(), arraysize(expect_misc_info.DbgBldStr)); - const timeval kStartTime = { expect_misc_info.ProcessCreateTime, 0 }; - const timeval kUserCPUTime = { expect_misc_info.ProcessUserTime, 0 }; - const timeval kSystemCPUTime = { expect_misc_info.ProcessKernelTime, 0 }; + const timeval kStartTime = + { implicit_cast(expect_misc_info.ProcessCreateTime), 0 }; + const timeval kUserCPUTime = + { implicit_cast(expect_misc_info.ProcessUserTime), 0 }; + const timeval kSystemCPUTime = + { implicit_cast(expect_misc_info.ProcessKernelTime), 0 }; TestProcessSnapshot process_snapshot; process_snapshot.SetProcessID(expect_misc_info.ProcessId);