mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-23 05:53:40 +00:00
[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:
parent
3c0ebd54ec
commit
26df3579a3
@ -41,6 +41,6 @@ void delayInit(void)
|
|||||||
|
|
||||||
void delayExecution(float ms)
|
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);
|
NtDelayExecution(FALSE, &interval);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user