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

Unified Diff: sandbox/win/src/process_policy_test.cc

Issue 1684963003: Use double cast to avoid VS 2015 64-bit warning (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Double casts for DWORD to ptr also Created 4 years, 10 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/process_policy_test.cc
diff --git a/sandbox/win/src/process_policy_test.cc b/sandbox/win/src/process_policy_test.cc
index d272e624cc096b8d711a517bd4adcf14d0a16fe9..e97a16ff6c00749b624809663527a89bbdcf5557 100644
--- a/sandbox/win/src/process_policy_test.cc
+++ b/sandbox/win/src/process_policy_test.cc
@@ -284,8 +284,8 @@ std::wstring GenerateEventName(DWORD pid) {
// This is the function that is called when testing thread creation.
// It is expected to set an event that the caller is waiting on.
DWORD TestThreadFunc(LPVOID lpdwThreadParam) {
- std::wstring event_name =
- GenerateEventName(reinterpret_cast<DWORD>(lpdwThreadParam));
+ std::wstring event_name = GenerateEventName(
+ static_cast<DWORD>(reinterpret_cast<uintptr_t>(lpdwThreadParam)));
if (!event_name.length()) {
return 1;
}
@@ -314,7 +314,8 @@ SBOX_TESTS_COMMAND int Process_CreateThread(int argc, wchar_t** argv) {
DWORD thread_id = 0;
HANDLE thread = NULL;
thread = ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&TestThreadFunc,
- reinterpret_cast<LPVOID>(pid), 0, &thread_id);
+ reinterpret_cast<LPVOID>(static_cast<uintptr_t>(pid)),
+ 0, &thread_id);
if (!thread) {
return SBOX_TEST_THIRD_ERROR;
@@ -499,9 +500,9 @@ TEST(ProcessPolicyTest, TestCreateThreadOutsideSandbox) {
DWORD thread_id = 0;
HANDLE thread = NULL;
- thread = TargetCreateThread(::CreateThread, NULL, 0,
- (LPTHREAD_START_ROUTINE)&TestThreadFunc,
- reinterpret_cast<LPVOID>(pid), 0, &thread_id);
+ thread = TargetCreateThread(
+ ::CreateThread, NULL, 0, (LPTHREAD_START_ROUTINE)&TestThreadFunc,
+ reinterpret_cast<LPVOID>(static_cast<uintptr_t>(pid)), 0, &thread_id);
EXPECT_NE(static_cast<HANDLE>(NULL), thread);
EXPECT_EQ(WAIT_OBJECT_0, WaitForSingleObject(thread, INFINITE));
EXPECT_EQ(WAIT_OBJECT_0, WaitForSingleObject(event, INFINITE));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698