mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
This commit is contained in:
parent
1db6c4d55e
commit
6a501c85fc
@ -177,7 +177,7 @@ static inline int32 ClampToI32(const int64 a)
|
|||||||
*/
|
*/
|
||||||
static inline uint16 ClampToU16(const uint64 a)
|
static inline uint16 ClampToU16(const uint64 a)
|
||||||
{
|
{
|
||||||
return min(a, 0xFFFF);
|
return (uint16)(a <= 0xFFFFU ? a : 0xFFFFU);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user