(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
authorsmatz
Fri, 04 Apr 2008 20:03:49 +0000
changeset 9320 029fe51fff1e
parent 9319 cc5eb4f7ef4c
child 9321 3bc631f0ef34
(svn r12572) -Fix (r12192): min() has 32bit arguments, clamping of 64bit values didn't work
src/core/math_func.hpp
--- a/src/core/math_func.hpp	Fri Apr 04 19:10:45 2008 +0000
+++ b/src/core/math_func.hpp	Fri Apr 04 20:03:49 2008 +0000
@@ -177,7 +177,7 @@
  */
 static inline uint16 ClampToU16(const uint64 a)
 {
-	return min(a, 0xFFFF);
+	return (uint16)(a <= 0xFFFFU ? a : 0xFFFFU);
 }
 
 /**