mirror of
https://github.com/UberGames/ioef.git
synced 2025-02-12 06:50:43 +00:00
move MIN/MAX definition, use MIN() instead of min(), patch by DevHC
This commit is contained in:
parent
017bc7e5da
commit
3ddc59a3ba
3 changed files with 10 additions and 11 deletions
|
@ -48,10 +48,6 @@ static const char rcsid[] =
|
||||||
static char* med3(char *, char *, char *, cmp_t *);
|
static char* med3(char *, char *, char *, cmp_t *);
|
||||||
static void swapfunc(char *, char *, int, int);
|
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".
|
* Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
|
||||||
*/
|
*/
|
||||||
|
@ -167,9 +163,9 @@ loop: SWAPINIT(a, es);
|
||||||
}
|
}
|
||||||
|
|
||||||
pn = (char *)a + n * 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);
|
vecswap(a, pb - r, r);
|
||||||
r = min(pd - pc, pn - pd - es);
|
r = MIN(pd - pc, pn - pd - es);
|
||||||
vecswap(pb, pn - r, r);
|
vecswap(pb, pn - r, r);
|
||||||
if ((r = pb - pa) > es)
|
if ((r = pb - pa) > es)
|
||||||
qsort(a, r / es, es, cmp);
|
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 DP_C_LDOUBLE 4
|
||||||
|
|
||||||
#define char_to_int(p) (p - '0')
|
#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)
|
static int dopr (char *buffer, size_t maxlen, const char *format, va_list args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -640,6 +640,14 @@ void PerpendicularVector( vec3_t dst, const vec3_t src );
|
||||||
int Q_isnan( float x );
|
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 );
|
float Com_Clamp( float min, float max, float value );
|
||||||
|
|
|
@ -43,9 +43,6 @@ static const char* cur_line;
|
||||||
|
|
||||||
static FILE* fout;
|
static FILE* fout;
|
||||||
|
|
||||||
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
||||||
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
||||||
|
|
||||||
#define crap(fmt, args...) do { \
|
#define crap(fmt, args...) do { \
|
||||||
_crap(__FUNCTION__, fmt, ##args); \
|
_crap(__FUNCTION__, fmt, ##args); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
Loading…
Reference in a new issue