[host] windows/delay: cast to LONGLONG instead of int

The type of the QuadPart member of the LARGE_INTEGER union is actually
LONGLONG, so we should cast to LONGLONG instead of int.
This avoids truncation should (ms * 10000.0f) exceed 2^31-1.
This commit is contained in:
Quantum 2021-07-20 18:38:01 -04:00 committed by Geoffrey McRae
parent 3c0ebd54ec
commit 26df3579a3

View File

@ -41,6 +41,6 @@ void delayInit(void)
void delayExecution(float ms)
{
LARGE_INTEGER interval = { .QuadPart = -1 * (int)(ms * 10000.0f) };
LARGE_INTEGER interval = { .QuadPart = -1 * (LONGLONG)(ms * 10000.0f) };
NtDelayExecution(FALSE, &interval);
}