mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-11 13:10:45 +00:00
Use ClampTo in RXCompressUint to fix narrowing warning
This commit is contained in:
parent
8f5f4326ac
commit
ed3e401d06
@ -135,7 +135,7 @@ uint16_t RXCompressUint(uint32_t num)
|
||||
{
|
||||
if (num <= 0x100) return num;
|
||||
if (num <= 0x7900) return 0x100 + ((num - 0x100) >> 3);
|
||||
return std::min<uint32_t>(UINT16_MAX, 0x1000 + ((num - 0x7900) >> 6));
|
||||
return ClampTo<uint16_t>(0x1000 + ((num - 0x7900) >> 6));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user