mirror of https://github.com/libsdl-org/SDL
Fixed integral constant overflow
This commit is contained in:
parent
5fab64f862
commit
86c6376140
|
@ -47,7 +47,7 @@ SDL_GetPerformanceFrequency(void)
|
|||
|
||||
void SDL_DelayNS(Uint64 ns)
|
||||
{
|
||||
const Uint64 max_delay = 0x7fffffff * SDL_NS_PER_US;
|
||||
const Uint64 max_delay = 0x7fffffffLLU * SDL_NS_PER_US;
|
||||
if (ns > max_delay) {
|
||||
ns = max_delay;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ SDL_GetPerformanceFrequency(void)
|
|||
|
||||
void SDL_DelayNS(Uint64 ns)
|
||||
{
|
||||
const Uint64 max_delay = 0xffffffff * SDL_NS_PER_US;
|
||||
const Uint64 max_delay = 0xffffffffLLU * SDL_NS_PER_US;
|
||||
if (ns > max_delay) {
|
||||
ns = max_delay;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ SDL_GetPerformanceFrequency(void)
|
|||
|
||||
void SDL_DelayNS(Uint64 ns)
|
||||
{
|
||||
const Uint64 max_delay = 0xffffffff * SDL_NS_PER_US;
|
||||
const Uint64 max_delay = 0xffffffffLLU * SDL_NS_PER_US;
|
||||
if (ns > max_delay) {
|
||||
ns = max_delay;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ void SDL_DelayNS(Uint64 ns)
|
|||
#endif
|
||||
|
||||
{
|
||||
const Uint64 max_delay = 0xffffffff * SDL_NS_PER_MS;
|
||||
const Uint64 max_delay = 0xffffffffLLU * SDL_NS_PER_MS;
|
||||
if (ns > max_delay) {
|
||||
ns = max_delay;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue