[GRASS-SVN] r72179 - grass/trunk/raster/r.random.surface

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jan 28 07:33:13 PST 2018


Author: neteler
Date: 2018-01-28 07:33:13 -0800 (Sun, 28 Jan 2018)
New Revision: 72179

Modified:
   grass/trunk/raster/r.random.surface/calcsurf.c
   grass/trunk/raster/r.random.surface/init.c
   grass/trunk/raster/r.random.surface/main.c
   grass/trunk/raster/r.random.surface/ransurf.h
   grass/trunk/raster/r.random.surface/save.c
   grass/trunk/raster/r.random.surface/zero.c
Log:
r.random.surface: rename variable Surface to RSurface to avoid variable clash with GDAL on EPEL7

Modified: grass/trunk/raster/r.random.surface/calcsurf.c
===================================================================
--- grass/trunk/raster/r.random.surface/calcsurf.c	2018-01-28 15:31:55 UTC (rev 72178)
+++ grass/trunk/raster/r.random.surface/calcsurf.c	2018-01-28 15:33:13 UTC (rev 72179)
@@ -93,14 +93,14 @@
 	    if (ODD(Row)) {
 		for (Col = Cs - 1; Col >= 0; Col--) {
 		    G_percent(Count++, MapCount, 1);
-		    Surface[Row][Col] =
+		    RSurface[Row][Col] =
 			MakePP(Row, Col, OutRows, OutCols, Randoms, BigF);
 		}
 	    }
 	    else {
 		for (Col = 0; Col < Cs; Col++) {
 		    G_percent(Count++, MapCount, 1);
-		    Surface[Row][Col] =
+		    RSurface[Row][Col] =
 			MakePP(Row, Col, OutRows, OutCols, Randoms, BigF);
 		}
 	    }
@@ -113,10 +113,10 @@
 	    if (ODD(Row)) {
 		for (Col = Cs - 1; Col >= 0; Col--) {
 		    if (CellBuffer[Col] == 0)
-			Surface[Row][Col] = 0.0;
+			RSurface[Row][Col] = 0.0;
 		    else {
 			G_percent(Count++, MapCount, 1);
-			Surface[Row][Col] =
+			RSurface[Row][Col] =
 			    MakePP(Row, Col, OutRows, OutCols, Randoms, BigF);
 		    }
 		}
@@ -124,10 +124,10 @@
 	    else {
 		for (Col = 0; Col < Cs; Col++) {
 		    if (CellBuffer[Col] == 0)
-			Surface[Row][Col] = 0.0;
+			RSurface[Row][Col] = 0.0;
 		    else {
 			G_percent(Count++, MapCount, 1);
-			Surface[Row][Col] =
+			RSurface[Row][Col] =
 			    MakePP(Row, Col, OutRows, OutCols, Randoms, BigF);
 		    }
 		}

Modified: grass/trunk/raster/r.random.surface/init.c
===================================================================
--- grass/trunk/raster/r.random.surface/init.c	2018-01-28 15:31:55 UTC (rev 72178)
+++ grass/trunk/raster/r.random.surface/init.c	2018-01-28 15:33:13 UTC (rev 72179)
@@ -24,9 +24,9 @@
 
     Rs = Rast_window_rows();
     Cs = Rast_window_cols();
-    Surface = (double **)G_malloc(Rs * sizeof(double *));
+    RSurface = (double **)G_malloc(Rs * sizeof(double *));
     for (row = 0; row < Rs; row++)
-	Surface[row] = (double *)G_malloc(Cs * sizeof(double));
+	RSurface[row] = (double *)G_malloc(Cs * sizeof(double));
 
     G_get_set_window(&Region);
     EW = Region.ew_res;

Modified: grass/trunk/raster/r.random.surface/main.c
===================================================================
--- grass/trunk/raster/r.random.surface/main.c	2018-01-28 15:31:55 UTC (rev 72178)
+++ grass/trunk/raster/r.random.surface/main.c	2018-01-28 15:33:13 UTC (rev 72179)
@@ -31,7 +31,7 @@
 #include "local_proto.h"
 
 BIGF BigF;
-double **Surface, NS, EW, FilterSD, AllMaxDist, *Norm;
+double **RSurface, NS, EW, FilterSD, AllMaxDist, *Norm;
 int MapCount, FDM, Rs, Cs, Theory;
 CELL *CellBuffer;
 FILTER *AllFilters, Filter;

Modified: grass/trunk/raster/r.random.surface/ransurf.h
===================================================================
--- grass/trunk/raster/r.random.surface/ransurf.h	2018-01-28 15:31:55 UTC (rev 72178)
+++ grass/trunk/raster/r.random.surface/ransurf.h	2018-01-28 15:33:13 UTC (rev 72179)
@@ -38,7 +38,7 @@
 };
 
 extern BIGF BigF;
-extern double **Surface, NS, EW, FilterSD, AllMaxDist, *Norm;
+extern double **RSurface, NS, EW, FilterSD, AllMaxDist, *Norm;
 extern int MapCount, FDM, Rs, Cs, Theory;
 extern CELL *CellBuffer;
 extern FILTER *AllFilters, Filter;

Modified: grass/trunk/raster/r.random.surface/save.c
===================================================================
--- grass/trunk/raster/r.random.surface/save.c	2018-01-28 15:31:55 UTC (rev 72178)
+++ grass/trunk/raster/r.random.surface/save.c	2018-01-28 15:33:13 UTC (rev 72179)
@@ -26,7 +26,7 @@
     if (FDM == -1) {
 	for (Row = 0; Row < Rs; Row++) {
 	    for (Col = 0; Col < Cs; Col++) {
-		Value = Surface[Row][Col];
+		Value = RSurface[Row][Col];
 		MeanMod += Value;
 	    }
 	}
@@ -37,13 +37,13 @@
 	DownInterval = UpInterval = Value;
 	for (Row = 0; Row < Rs; Row++) {
 	    for (Col = 0; Col < Cs; Col++) {
-		Value = Surface[Row][Col];
+		Value = RSurface[Row][Col];
 		/*
 		   Value = (Value - MeanMod) / FilterSD
 		   + MeanMod / FilterSD;
 		 */
 		Value /= FilterSD;
-		Surface[Row][Col] = Value;
+		RSurface[Row][Col] = Value;
 
 		if (UpInterval < Value)
 		    UpInterval = Value;
@@ -58,7 +58,7 @@
 	    Rast_get_c_row_nomask(FDM, CellBuffer, Row);
 	    for (Col = 0; Col < Cs; Col++) {
 		if (CellBuffer[Col] != 0) {
-		    Value = Surface[Row][Col];
+		    Value = RSurface[Row][Col];
 		    MeanMod += Value;
 		}
 	    }
@@ -77,13 +77,13 @@
 	    Rast_get_c_row_nomask(FDM, CellBuffer, Row);
 	    for (Col = 0; Col < Cs; Col++) {
 		if (CellBuffer[Col] != 0) {
-		    Value = Surface[Row][Col];
+		    Value = RSurface[Row][Col];
 		    /*
 		       Value = (Value - MeanMod) / FilterSD
 		       + MeanMod / FilterSD;
 		     */
 		    Value /= FilterSD;
-		    Surface[Row][Col] = Value;
+		    RSurface[Row][Col] = Value;
 
 		    if (UpInterval < Value)
 			UpInterval = Value;
@@ -111,7 +111,7 @@
 	/* normal distribution */
 	for (Row = 0; Row < Rs; Row++) {
 	    for (Col = 0; Col < Cs; Col++) {
-		Value = Surface[Row][Col];
+		Value = RSurface[Row][Col];
 		if (Value > UpInterval) {
 		    Value = UpInterval;
 		}
@@ -132,7 +132,7 @@
 		if (Value < CatInfo.Min[Index])
 		    CatInfo.Min[Index] = Value;
 
-		Surface[Row][Col] = 1 + Index;
+		RSurface[Row][Col] = 1 + Index;
 	    }
 	}
     }
@@ -140,7 +140,7 @@
 	/* mapping to cumulative normal distribution function */
 	for (Row = 0; Row < Rs; Row++) {
 	    for (Col = 0; Col < Cs; Col++) {
-		Value = Surface[Row][Col];
+		Value = RSurface[Row][Col];
 		Ratio = (double)(Value - MIN_INTERVAL) /
 		    (MAX_INTERVAL - MIN_INTERVAL);
 		Index = (int)(Ratio * (SIZE_OF_DISTRIBUTION - 1));
@@ -157,7 +157,7 @@
 		    CatInfo.Min[NormIndex] = Value;
 
 		/* NormIndex in range of [0 .. (CatInfo.NumCat-1)] */
-		Surface[Row][Col] = 1 + NormIndex;
+		RSurface[Row][Col] = 1 + NormIndex;
 	    }
 	}
     }
@@ -165,7 +165,7 @@
     for (Row = 0; Row < Rs; Row++) {
 	G_percent(Row, Rs, 2);
 	for (Col = 0; Col < Cs; Col++) {
-	    CellBuffer[Col] = (CELL) Surface[Row][Col];
+	    CellBuffer[Col] = (CELL) RSurface[Row][Col];
 	}
 	Rast_put_row(OutFD, CellBuffer, CELL_TYPE);
     }

Modified: grass/trunk/raster/r.random.surface/zero.c
===================================================================
--- grass/trunk/raster/r.random.surface/zero.c	2018-01-28 15:31:55 UTC (rev 72178)
+++ grass/trunk/raster/r.random.surface/zero.c	2018-01-28 15:33:13 UTC (rev 72179)
@@ -14,6 +14,6 @@
 
     for (Row = 0; Row < Rs; Row++) {
 	for (Col = 0; Col < Cs; Col++)
-	    Surface[Row][Col] = 0.0;
+	    RSurface[Row][Col] = 0.0;
     }
 }



More information about the grass-commit mailing list