summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-04-04 20:03:49 +0000
committersmatz <smatz@openttd.org>2008-04-04 20:03:49 +0000
commit6a501c85fc80dbb84a0a912e974e63278c560b4a (patch)
treee681d04220c47d254e150e7d254b87641b2fc68f
parent1db6c4d55e769bc3b69c6fe432b4e623fe81071d (diff)
downloadopenttd-6a501c85fc80dbb84a0a912e974e63278c560b4a.tar.xz
(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
-rw-r--r--src/core/math_func.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/math_func.hpp b/src/core/math_func.hpp
index 0d5c11893..63f21fd28 100644
--- a/src/core/math_func.hpp
+++ b/src/core/math_func.hpp
@@ -177,7 +177,7 @@ static inline int32 ClampToI32(const int64 a)
*/
static inline uint16 ClampToU16(const uint64 a)
{
- return min(a, 0xFFFF);
+ return (uint16)(a <= 0xFFFFU ? a : 0xFFFFU);
}
/**