changeset 8824:f7bac453f496 draft

(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
author smatz <smatz@openttd.org>
date Fri, 04 Apr 2008 20:03:49 +0000
parents 3dd7b7a0bccb
children 1603ed357fcb
files src/core/math_func.hpp
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/math_func.hpp
+++ b/src/core/math_func.hpp
@@ -177,7 +177,7 @@
  */
 static inline uint16 ClampToU16(const uint64 a)
 {
-	return min(a, 0xFFFF);
+	return (uint16)(a <= 0xFFFFU ? a : 0xFFFFU);
 }
 
 /**