aboutsummaryrefslogtreecommitdiff
path: root/src/client/windows/unittests
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2017-08-28 10:26:23 +0300
committerMike Frysinger <vapier@chromium.org>2017-09-25 07:10:11 +0000
commit09df67311f4621cc7504e2281d90241e7605a278 (patch)
treefa07ee0ec531bc0c5a830fc556f6048d42ba509f /src/client/windows/unittests
parentRefresh refresh_binaries.bat (diff)
downloadbreakpad-09df67311f4621cc7504e2281d90241e7605a278.tar.xz
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 <vapier@chromium.org>
Diffstat (limited to 'src/client/windows/unittests')
-rw-r--r--src/client/windows/unittests/exception_handler_death_test.cc6
-rw-r--r--src/client/windows/unittests/exception_handler_test.cc2
-rw-r--r--src/client/windows/unittests/minidump_test.cc2
3 files changed, 5 insertions, 5 deletions
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<int>(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<int>(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<void*>(0xCAFEBABE), // ExceptionAddress;
+ reinterpret_cast<void*>(static_cast<uintptr_t>(0xCAFEBABE)), // ExceptionAddress;
2, // NumberParameters;
{ EXCEPTION_WRITE_FAULT, reinterpret_cast<ULONG_PTR>(this) }
};