--- deliantra/server/include/util.h 2011/04/26 14:41:36 1.115 +++ deliantra/server/include/util.h 2011/12/31 06:18:01 1.116 @@ -88,8 +88,8 @@ // rationale for using (U) not (T) is to reduce signed/unsigned issues, // as a is often a constant while b is the variable. it is still a bug, though. -template static inline T min (T a, U b) { return (U)a < b ? (U)a : b; } -template static inline T max (T a, U b) { return (U)a > b ? (U)a : b; } +template static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } +template static inline T max (T a, U b) { return a > (T)b ? a : (T)b; } template static inline T clamp (T v, U a, V b) { return v < (T)a ? (T)a : v >(T)b ? (T)b : v; } template static inline void min_it (T &v, U m) { v = min (v, (T)m); }