diff --git a/stepmania/src/RageUtil.h b/stepmania/src/RageUtil.h index 3bb1107083..9b7bf58bbe 100644 --- a/stepmania/src/RageUtil.h +++ b/stepmania/src/RageUtil.h @@ -24,16 +24,12 @@ #define ZERO(x) memset(&x, 0, sizeof(x)) #define COPY(a,b) { ASSERT(sizeof(a)==sizeof(b)); memcpy(&a, &b, sizeof(a)); } -/* Common harmless mismatches. */ -/* replace both with a single function (same with max) - * --Steve */ -#ifndef min -inline float min(float a, float b) { return a < b? a:b; } -#endif - -#ifndef max -inline float max(float a, float b) { return a > b? a:b; } -#endif +/* Common harmless mismatches. All min(T,T) and max(T,T) cases are handled + * by the generic template we get from . */ +inline float min(float a, int b) { return a < b? a:b; } +inline float min(int a, float b) { return a < b? a:b; } +inline float max(float a, int b) { return a > b? a:b; } +inline float max(int a, float b) { return a > b? a:b; } /* Traditional defines. Only use this if you absolutely need * a constant value. */ diff --git a/stepmania/src/global.h b/stepmania/src/global.h index 68f422d70f..d6ffae2b5d 100644 --- a/stepmania/src/global.h +++ b/stepmania/src/global.h @@ -124,6 +124,8 @@ inline const T& min(const T &a, const T &b, P Pr) #endif /* Define a few functions if necessary */ +/* This is the wrong way to do this; see my post to sm-devs. -glenn */ +#if 0 #ifndef powf #define powf (float)pow #endif @@ -143,6 +145,7 @@ inline const T& min(const T &a, const T &b, P Pr) #ifndef acosf #define acosf (float)acos #endif +#endif /* Don't include our own headers here, since they tend to change * often. */