microprofile: Silence warning in headers

Silences a truncation warning by making the truncation explicit and
documenting the reason for it.
This commit is contained in:
Lioncash 2020-11-03 15:07:08 -05:00 committed by FearlessTobi
parent 2e0ce86c9e
commit 8f7ac4d8cc

View File

@ -927,7 +927,11 @@ typedef HANDLE MicroProfileThread;
DWORD _stdcall ThreadTrampoline(void* pFunc)
{
MicroProfileThreadFunc F = (MicroProfileThreadFunc)pFunc;
return (uint32_t)F(0);
// The return value of F will always return a void*, however, this is for
// compatibility with pthreads. The underlying "address" of the pointer
// is always a 32-bit value, so this cast is safe to perform.
return static_cast<DWORD>(reinterpret_cast<uint64_t>(F(0)));
}
void MicroProfileThreadStart(MicroProfileThread* pThread, MicroProfileThreadFunc Func)