[GRASS-SVN] r32931 - grass/trunk/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 20 15:24:35 EDT 2008


Author: glynn
Date: 2008-08-20 15:24:35 -0400 (Wed, 20 Aug 2008)
New Revision: 32931

Modified:
   grass/trunk/lib/gis/fpreclass.c
   grass/trunk/lib/gis/quant.c
Log:
#undef MIN/MAX, as GDAL headers also define these
Fix lack of parentheses in MIN/MAX


Modified: grass/trunk/lib/gis/fpreclass.c
===================================================================
--- grass/trunk/lib/gis/fpreclass.c	2008-08-20 19:04:18 UTC (rev 32930)
+++ grass/trunk/lib/gis/fpreclass.c	2008-08-20 19:24:35 UTC (rev 32931)
@@ -245,8 +245,10 @@
 
 /*--------------------------------------------------------------------------*/
 
-#define MIN(a,b) (a < b ? a : b)
-#define MAX(a,b) (a > b ? a : b)
+#undef MIN
+#undef MAX
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
 
 #define NO_DEFAULT_RULE (! r->defaultDRuleSet)
 #define NO_LEFT_INFINITE_RULE (! r->infiniteLeftSet)

Modified: grass/trunk/lib/gis/quant.c
===================================================================
--- grass/trunk/lib/gis/quant.c	2008-08-20 19:04:18 UTC (rev 32930)
+++ grass/trunk/lib/gis/quant.c	2008-08-20 19:24:35 UTC (rev 32931)
@@ -290,10 +290,13 @@
 
 #define USE_LOOKUP 1
 #define MAX_LOOKUP_TABLE_SIZE 2048
-#define MIN(a,b) (a < b ? a : b)
-#define MAX(a,b) (a > b ? a : b)
 #define NO_DATA (G_set_c_null_value (&tmp, 1), (CELL) tmp)
 
+#undef MIN
+#undef MAX
+#define MIN(a,b) ((a) < (b) ? (a) : (b))
+#define MAX(a,b) ((a) > (b) ? (a) : (b))
+
 #define NO_LEFT_INFINITE_RULE (! q->infiniteLeftSet)
 #define NO_RIGHT_INFINITE_RULE (! q->infiniteRightSet)
 #define NO_FINITE_RULE (q->nofRules <= 0)



More information about the grass-commit mailing list