move MIN/MAX definition, use MIN() instead of min(), patch by DevHC

This commit is contained in:
Thilo Schulz 2011-05-15 13:27:24 +00:00
parent 017bc7e5da
commit 3ddc59a3ba
3 changed files with 10 additions and 11 deletions

View File

@ -48,10 +48,6 @@ static const char rcsid[] =
static char* med3(char *, char *, char *, cmp_t *);
static void swapfunc(char *, char *, int, int);
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
#endif
/*
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
*/
@ -167,9 +163,9 @@ loop: SWAPINIT(a, es);
}
pn = (char *)a + n * es;
r = min(pa - (char *)a, pb - pa);
r = MIN(pa - (char *)a, pb - pa);
vecswap(a, pb - r, r);
r = min(pd - pc, pn - pd - es);
r = MIN(pd - pc, pn - pd - es);
vecswap(pb, pn - r, r);
if ((r = pb - pa) > es)
qsort(a, r / es, es, cmp);
@ -1460,8 +1456,6 @@ static int dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c );
#define DP_C_LDOUBLE 4
#define char_to_int(p) (p - '0')
#define MAX(p,q) ((p >= q) ? p : q)
#define MIN(p,q) ((p <= q) ? p : q)
static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
{

View File

@ -640,6 +640,14 @@ void PerpendicularVector( vec3_t dst, const vec3_t src );
int Q_isnan( float x );
#ifndef MAX
#define MAX(x,y) ((x)>(y)?(x):(y))
#endif
#ifndef MIN
#define MIN(x,y) ((x)<(y)?(x):(y))
#endif
//=============================================
float Com_Clamp( float min, float max, float value );

View File

@ -43,9 +43,6 @@ static const char* cur_line;
static FILE* fout;
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#define crap(fmt, args...) do { \
_crap(__FUNCTION__, fmt, ##args); \
} while(0)