summaryrefslogtreecommitdiff
path: root/src/core
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
commita7d885e4c60b044dc9e57ec1ec6a3e3b514d4b2f (patch)
treee681d04220c47d254e150e7d254b87641b2fc68f /src/core
parentc5814a72ced79ec7650e11919d7078094e6ab209 (diff)
downloadopenttd-a7d885e4c60b044dc9e57ec1ec6a3e3b514d4b2f.tar.xz
(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
Diffstat (limited to 'src/core')
-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);
}
/**