[quake3-commits] r1986 - in trunk/code: game qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sun May 15 09:27:24 EDT 2011


Author: thilo
Date: 2011-05-15 09:27:24 -0400 (Sun, 15 May 2011)
New Revision: 1986

Modified:
   trunk/code/game/bg_lib.c
   trunk/code/qcommon/q_shared.h
   trunk/code/qcommon/vm_x86_64_assembler.c
Log:
move MIN/MAX definition, use MIN() instead of min(), patch by DevHC


Modified: trunk/code/game/bg_lib.c
===================================================================
--- trunk/code/game/bg_lib.c	2011-05-15 13:15:14 UTC (rev 1985)
+++ trunk/code/game/bg_lib.c	2011-05-15 13:27:24 UTC (rev 1986)
@@ -48,10 +48,6 @@
 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 @@
 	}
 
 	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 @@
 #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)
 {

Modified: trunk/code/qcommon/q_shared.h
===================================================================
--- trunk/code/qcommon/q_shared.h	2011-05-15 13:15:14 UTC (rev 1985)
+++ trunk/code/qcommon/q_shared.h	2011-05-15 13:27:24 UTC (rev 1986)
@@ -640,6 +640,14 @@
 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 );

Modified: trunk/code/qcommon/vm_x86_64_assembler.c
===================================================================
--- trunk/code/qcommon/vm_x86_64_assembler.c	2011-05-15 13:15:14 UTC (rev 1985)
+++ trunk/code/qcommon/vm_x86_64_assembler.c	2011-05-15 13:27:24 UTC (rev 1986)
@@ -43,9 +43,6 @@
 
 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)



More information about the quake3-commits mailing list