From 09df67311f4621cc7504e2281d90241e7605a278 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 28 Aug 2017 10:26:23 +0300 Subject: Fix MSVC build on 64-bit Mostly int<->size_t implicit conversions. Warning 4366 (The result of the unary '&' operator may be unaligned) appears in minidump.cc:907, but I don't know why. It looks aligned to me. Change-Id: I641942adc324f8f9832b20662083dc83498688a8 Reviewed-on: https://chromium-review.googlesource.com/637390 Reviewed-by: Mike Frysinger --- src/client/windows/unittests/exception_handler_death_test.cc | 6 +++--- src/client/windows/unittests/exception_handler_test.cc | 2 +- src/client/windows/unittests/minidump_test.cc | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/client/windows') diff --git a/src/client/windows/unittests/exception_handler_death_test.cc b/src/client/windows/unittests/exception_handler_death_test.cc index 30600d41..5ef9e64d 100644 --- a/src/client/windows/unittests/exception_handler_death_test.cc +++ b/src/client/windows/unittests/exception_handler_death_test.cc @@ -82,7 +82,7 @@ void ExceptionHandlerDeathTest::SetUp() { // The test case name is exposed as a c-style string, // convert it to a wchar_t string. int dwRet = MultiByteToWideChar(CP_ACP, 0, test_info->name(), - strlen(test_info->name()), + static_cast(strlen(test_info->name())), test_name_wide, MAX_PATH); if (!dwRet) { @@ -293,8 +293,8 @@ wstring find_minidump_in_directory(const wstring &directory) { wstring filename; do { const wchar_t extension[] = L".dmp"; - const int extension_length = sizeof(extension) / sizeof(extension[0]) - 1; - const int filename_length = wcslen(find_data.cFileName); + const size_t extension_length = sizeof(extension) / sizeof(extension[0]) - 1; + const size_t filename_length = wcslen(find_data.cFileName); if (filename_length > extension_length && wcsncmp(extension, find_data.cFileName + filename_length - extension_length, diff --git a/src/client/windows/unittests/exception_handler_test.cc b/src/client/windows/unittests/exception_handler_test.cc index 0e8ee9ff..a4ce12a8 100644 --- a/src/client/windows/unittests/exception_handler_test.cc +++ b/src/client/windows/unittests/exception_handler_test.cc @@ -120,7 +120,7 @@ void ExceptionHandlerTest::SetUp() { // THe test case name is exposed to use as a c-style string, // But we might be working in UNICODE here on Windows. int dwRet = MultiByteToWideChar(CP_ACP, 0, test_info->name(), - strlen(test_info->name()), + static_cast(strlen(test_info->name())), test_name_wide, MAX_PATH); if (!dwRet) { diff --git a/src/client/windows/unittests/minidump_test.cc b/src/client/windows/unittests/minidump_test.cc index d11fccab..82641125 100644 --- a/src/client/windows/unittests/minidump_test.cc +++ b/src/client/windows/unittests/minidump_test.cc @@ -93,7 +93,7 @@ class MinidumpTest: public testing::Test { STATUS_ACCESS_VIOLATION, // ExceptionCode 0, // ExceptionFlags NULL, // ExceptionRecord; - reinterpret_cast(0xCAFEBABE), // ExceptionAddress; + reinterpret_cast(static_cast(0xCAFEBABE)), // ExceptionAddress; 2, // NumberParameters; { EXCEPTION_WRITE_FAULT, reinterpret_cast(this) } }; -- cgit v1.2.1