[GRASS-SVN] r32937 - grass/branches/develbranch_6/lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 20 16:18:29 EDT 2008


Author: neteler
Date: 2008-08-20 16:18:29 -0400 (Wed, 20 Aug 2008)
New Revision: 32937

Modified:
   grass/branches/develbranch_6/lib/gis/fpreclass.c
   grass/branches/develbranch_6/lib/gis/quant.c
Log:
glynn: #undef MIN/MAX, as GDAL headers also define these; Fix lack of parentheses in MIN/MAX (merge from trunk, r32931)

Modified: grass/branches/develbranch_6/lib/gis/fpreclass.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/fpreclass.c	2008-08-20 20:13:36 UTC (rev 32936)
+++ grass/branches/develbranch_6/lib/gis/fpreclass.c	2008-08-20 20:18:29 UTC (rev 32937)
@@ -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/branches/develbranch_6/lib/gis/quant.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/quant.c	2008-08-20 20:13:36 UTC (rev 32936)
+++ grass/branches/develbranch_6/lib/gis/quant.c	2008-08-20 20:18:29 UTC (rev 32937)
@@ -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