Changeset - r7851:d007f368444a
[Not reviewed]
master
0 1 0
rubidium - 17 years ago 2007-11-10 23:22:32
rubidium@openttd.org
(svn r11401) -Fix [FS#1391]: make all min functions do exactly the same instead of branching on either < or <=.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/macros.h
Show inline comments
 
@@ -117,13 +117,13 @@ template<typename T> static inline T min
 
 * @param a The first integer
 
 * @param b The second integer
 
 * @return The smaller value
 
 */
 
static inline int min(const int a, const int b)
 
{
 
	return a <= b ? a : b;
 
	return a < b ? a : b;
 
}
 

	
 
/**
 
 * Returns the minimum of two unsigned integers.
 
 *
 
 * This function returns the smaller value of two given unsigned integers.
 
@@ -131,13 +131,13 @@ static inline int min(const int a, const
 
 * @param a The first unsigned integer
 
 * @param b The second unsigned integer
 
 * @return The smaller value
 
 */
 
static inline uint minu(const uint a, const uint b)
 
{
 
	return a <= b ? a : b;
 
	return a < b ? a : b;
 
}
 

	
 
/**
 
 * Clamp an integer between an interval.
 
 *
 
 * This function returns a value which is between the given interval of
0 comments (0 inline, 0 general)