From 07f9f2f101754c38570ed75ce9a7083090769a0f Mon Sep 17 00:00:00 2001 From: Sinan Kaya Date: Sun, 17 Mar 2019 20:24:40 +0000 Subject: [PATCH] Fix conversion issues --- src/debug/daccess/daccess.cpp | 4 ++-- src/debug/ee/debugger.cpp | 2 +- src/gc/unix/gcenv.unix.cpp | 2 +- src/pal/src/numa/numa.cpp | 2 +- src/vm/gchandleutilities.cpp | 2 +- src/vm/gchandleutilities.h | 2 +- src/zap/zapimport.cpp | 8 ++++---- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp index a5e1387..237a9b6 100644 --- a/src/debug/daccess/daccess.cpp +++ b/src/debug/daccess/daccess.cpp @@ -7554,8 +7554,8 @@ BOOL OutOfProcessExceptionEventGetProcessIdAndThreadId(HANDLE hProcess, HANDLE h #ifdef FEATURE_PAL // UNIXTODO: mikem 1/13/15 Need appropriate PAL functions for getting ids - *pPId = (DWORD)hProcess; - *pThreadId = (DWORD)hThread; + *pPId = (DWORD)(SIZE_T)hProcess; + *pThreadId = (DWORD)(SIZE_T)hThread; #else #if !defined(FEATURE_CORESYSTEM) HMODULE hKernel32 = WszGetModuleHandle(W("kernel32.dll")); diff --git a/src/debug/ee/debugger.cpp b/src/debug/ee/debugger.cpp index d1eabb2..cb083c3 100644 --- a/src/debug/ee/debugger.cpp +++ b/src/debug/ee/debugger.cpp @@ -11100,7 +11100,7 @@ bool Debugger::HandleIPCEvent(DebuggerIPCEvent * pEvent) { // Get the appdomain IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager(); - ADIndex appDomainIndex = ADIndex(reinterpret_cast(mgr->GetHandleContext(objectHandle))); + ADIndex appDomainIndex = ADIndex((DWORD)(SIZE_T)(mgr->GetHandleContext(objectHandle))); pAppDomain = SystemDomain::GetAppDomainAtIndex(appDomainIndex); _ASSERTE(pAppDomain != NULL); diff --git a/src/gc/unix/gcenv.unix.cpp b/src/gc/unix/gcenv.unix.cpp index ed09e89..572fc3b 100644 --- a/src/gc/unix/gcenv.unix.cpp +++ b/src/gc/unix/gcenv.unix.cpp @@ -449,7 +449,7 @@ the processors enabled. --*/ static uintptr_t GetFullAffinityMask(int cpuCount) { - if (cpuCount < sizeof(uintptr_t) * 8) + if ((size_t)cpuCount < sizeof(uintptr_t) * 8) { return ((uintptr_t)1 << cpuCount) - 1; } diff --git a/src/pal/src/numa/numa.cpp b/src/pal/src/numa/numa.cpp index 8793a09..9283a04 100644 --- a/src/pal/src/numa/numa.cpp +++ b/src/pal/src/numa/numa.cpp @@ -166,7 +166,7 @@ the processors enabled. --*/ KAFFINITY GetFullAffinityMask(int cpuCount) { - if (cpuCount < sizeof(KAFFINITY) * 8) + if ((size_t)cpuCount < sizeof(KAFFINITY) * 8) { return ((KAFFINITY)1 << (cpuCount)) - 1; } diff --git a/src/vm/gchandleutilities.cpp b/src/vm/gchandleutilities.cpp index 220445a..a4fdec3 100644 --- a/src/vm/gchandleutilities.cpp +++ b/src/vm/gchandleutilities.cpp @@ -33,7 +33,7 @@ void ValidateHandleAssignment(OBJECTHANDLE handle, OBJECTREF objRef) #endif IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager(); - ADIndex appDomainIndex = ADIndex(reinterpret_cast(mgr->GetHandleContext(handle))); + ADIndex appDomainIndex = ADIndex((DWORD)((SIZE_T)mgr->GetHandleContext(handle))); ValidateObjectAndAppDomain(objRef, appDomainIndex); #endif // _DEBUG_IMPL diff --git a/src/vm/gchandleutilities.h b/src/vm/gchandleutilities.h index 86227cd..8c26737 100644 --- a/src/vm/gchandleutilities.h +++ b/src/vm/gchandleutilities.h @@ -42,7 +42,7 @@ inline OBJECTREF ObjectFromHandle(OBJECTHANDLE handle) #if defined(_DEBUG_IMPL) && !defined(DACCESS_COMPILE) // not allowed to dispatch virtually on a IGCHandleManager when compiling for DAC - DWORD context = (DWORD)GCHandleUtilities::GetGCHandleManager()->GetHandleContext(handle); + DWORD context = (DWORD)(SIZE_T)GCHandleUtilities::GetGCHandleManager()->GetHandleContext(handle); OBJECTREF objRef = ObjectToOBJECTREF(*(Object**)handle); ValidateObjectAndAppDomain(objRef, ADIndex(context)); diff --git a/src/zap/zapimport.cpp b/src/zap/zapimport.cpp index d84ea79..9bdc1d9 100644 --- a/src/zap/zapimport.cpp +++ b/src/zap/zapimport.cpp @@ -1831,7 +1831,7 @@ ZapImport * ZapImportTable::GetDictionaryLookupCell(CORCOMPILE_FIXUP_BLOB_KIND k ThrowHR(E_NOTIMPL); } - _ASSERTE(((DWORD)pResolvedToken->tokenContext & 1) == 0); + _ASSERTE(((DWORD)(SIZE_T)pResolvedToken->tokenContext & 1) == 0); return GetImportForSignature((void*)pResolvedToken->tokenContext, &sigBuilder); } @@ -1894,12 +1894,12 @@ public: ReadyToRunHelper GetReadyToRunHelper() { - return (ReadyToRunHelper)((DWORD)GetHandle() & ~READYTORUN_HELPER_FLAG_VSD); + return (ReadyToRunHelper)((DWORD)(SIZE_T)GetHandle() & ~READYTORUN_HELPER_FLAG_VSD); } DWORD GetSectionIndex() { - return (DWORD)GetHandle2(); + return (DWORD)(SIZE_T)GetHandle2(); } BOOL IsDelayLoadHelper() @@ -1919,7 +1919,7 @@ public: BOOL IsVSD() { - return ((DWORD)GetHandle() & READYTORUN_HELPER_FLAG_VSD) != 0; + return ((DWORD)(SIZE_T)GetHandle() & READYTORUN_HELPER_FLAG_VSD) != 0; } BOOL IsLazyHelper() -- 2.7.4