[GRASS-SVN] r34581 - in grass/trunk/raster: r.horizon r.sun2

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 27 19:51:24 EST 2008


Author: glynn
Date: 2008-11-27 19:51:24 -0500 (Thu, 27 Nov 2008)
New Revision: 34581

Modified:
   grass/trunk/raster/r.horizon/main.c
   grass/trunk/raster/r.horizon/r.horizon.html
   grass/trunk/raster/r.sun2/main.c
Log:
Fix compile errors (7.0 is not 6.4)
Fix HTML


Modified: grass/trunk/raster/r.horizon/main.c
===================================================================
--- grass/trunk/raster/r.horizon/main.c	2008-11-28 00:50:29 UTC (rev 34580)
+++ grass/trunk/raster/r.horizon/main.c	2008-11-28 00:51:24 UTC (rev 34581)
@@ -66,11 +66,11 @@
 
 const double minAngle = DEG;
 
-char *elevin;
-char *latin = NULL;
-char *horizon = NULL;
-char *mapset = NULL;
-char *per;
+const char *elevin;
+const char *latin = NULL;
+const char *horizon = NULL;
+const char *mapset = NULL;
+const char *per;
 char shad_filename[256];
 
 struct Cell_head cellhd;
@@ -188,8 +188,8 @@
 	 " The input for this is the angle (in degrees), which is measured "
 	 " counterclockwise with east=0, north=90 etc. The output is the horizon height in radians.");
 
-    if (G_get_set_window(&cellhd) == -1)
-	G_fatal_error("G_get_set_window() failed");
+    G_get_set_window(&cellhd);
+
     stepx = cellhd.ew_res;
     stepy = cellhd.ns_res;
     stepxhalf = stepx / 2.;
@@ -550,7 +550,7 @@
     }
     /*read Z raster */
 
-    if ((mapset = G_find_cell(elevin, "")) == NULL)
+    if ((mapset = G_find_cell2(elevin, "")) == NULL)
 	G_fatal_error(_("Raster map <%s> not found"), elevin);
 
     fd1 = G_open_cell_old(elevin, mapset);

Modified: grass/trunk/raster/r.horizon/r.horizon.html
===================================================================
--- grass/trunk/raster/r.horizon/r.horizon.html	2008-11-28 00:50:29 UTC (rev 34580)
+++ grass/trunk/raster/r.horizon/r.horizon.html	2008-11-28 00:51:24 UTC (rev 34581)
@@ -29,7 +29,7 @@
 <H3>Flags:</H3>
 <dl>
   <dt><B>-d</B>
-  <dd>Output horizon height in degrees (the default is radians)</dl>
+  <dd>Output horizon height in degrees (the default is radians)</dd>
 </dl>
 
 <H3>Input parameters:</H3>
@@ -156,15 +156,19 @@
 in GIS</A>, 8(2), 175-190</P>
 
 <H2>AUTHORS</H2>
+<P>
 Thomas Huld, Joint Research Centre of
 the European Commission, Ispra, Italy 
 <br>
+<P>
 Tomas Cebecauer, Joint Research Centre
 of the European Commission, Ispra, Italy 
 <br>
+<P>
 Jaroslav Hofierka, GeoModel s.r.o.,
 Bratislava, Slovakia <BR>Marcel Suri, Joint Research Centre of the
 European Commission, Ispra, Italy</P>
+<P>
 &copy; 2007, Thomas Huld, Tomas Cebecauer, Jaroslav Hofierka, Marcel Suri 
 </P>
 

Modified: grass/trunk/raster/r.sun2/main.c
===================================================================
--- grass/trunk/raster/r.sun2/main.c	2008-11-28 00:50:29 UTC (rev 34580)
+++ grass/trunk/raster/r.sun2/main.c	2008-11-28 00:51:24 UTC (rev 34581)
@@ -70,26 +70,26 @@
 FILE *fw;
 
 
-char *elevin;
-char *aspin;
-char *slopein;
-char *civiltime = NULL;
-char *linkein = NULL;
-char *albedo = NULL;
-char *latin = NULL;
-char *coefbh = NULL;
-char *coefdh = NULL;
-char *incidout = NULL;
-char *longin = NULL;
-char *horizon = NULL;
-char *beam_rad = NULL;
-char *insol_time = NULL;
-char *diff_rad = NULL;
-char *refl_rad = NULL;
-char *glob_rad = NULL;
-char *mapset = NULL;
-char *per;
-char *shade;
+const char *elevin;
+const char *aspin;
+const char *slopein;
+const char *civiltime = NULL;
+const char *linkein = NULL;
+const char *albedo = NULL;
+const char *latin = NULL;
+const char *coefbh = NULL;
+const char *coefdh = NULL;
+const char *incidout = NULL;
+const char *longin = NULL;
+const char *horizon = NULL;
+const char *beam_rad = NULL;
+const char *insol_time = NULL;
+const char *diff_rad = NULL;
+const char *refl_rad = NULL;
+const char *glob_rad = NULL;
+const char *mapset = NULL;
+const char *per;
+const char *shade;
 char mapname[1024];
 
 struct Cell_head cellhd;
@@ -232,8 +232,8 @@
 	 "incidence angle and/or irradiance raster maps. The shadowing effect of "
 	 "the topography is optionally incorporated.");
 
-    if (G_get_set_window(&cellhd) == -1)
-	G_fatal_error("G_get_set_window() failed");
+    G_get_set_window(&cellhd);
+
     gridGeom.stepx = cellhd.ew_res;
     gridGeom.stepy = cellhd.ns_res;
     invstepx = 1. / gridGeom.stepx;
@@ -788,7 +788,7 @@
     }
 
 
-    if ((mapset = G_find_cell(elevin, "")) == NULL)
+    if ((mapset = G_find_cell2(elevin, "")) == NULL)
 	G_fatal_error("Elevation raster file not found");
 
 
@@ -805,7 +805,7 @@
 	    }
 
 	}
-	if ((mapset = G_find_cell(slopein, "")) == NULL)
+	if ((mapset = G_find_cell2(slopein, "")) == NULL)
 	       G_fatal_error(_("Raster map <%s> not found"),slopein);
 	fd3 = G_open_cell_old(slopein, mapset);
 
@@ -822,7 +822,7 @@
 	    }
 	}
 
-	if ((mapset = G_find_cell(aspin, "")) == NULL)
+	if ((mapset = G_find_cell2(aspin, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),aspin);
 	fd2 = G_open_cell_old(aspin, mapset);
 
@@ -837,7 +837,7 @@
 		li[l] = (float *)G_malloc(sizeof(float) * (n));
 
 	}
-	if ((mapset = G_find_cell(linkein, "")) == NULL)
+	if ((mapset = G_find_cell2(linkein, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),linkein);
 
 	fd4 = G_open_cell_old(linkein, mapset);
@@ -850,7 +850,7 @@
 	    for (l = 0; l < numRows; l++)
 		a[l] = (float *)G_malloc(sizeof(float) * (n));
 	}
-	if ((mapset = G_find_cell(albedo, "")) == NULL)
+	if ((mapset = G_find_cell2(albedo, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),albedo);
 
 	fd5 = G_open_cell_old(albedo, mapset);
@@ -863,7 +863,7 @@
 	    for (l = 0; l < numRows; l++)
 		la[l] = (float *)G_malloc(sizeof(float) * (n));
 	}
-	if ((mapset = G_find_cell(latin, "")) == NULL)
+	if ((mapset = G_find_cell2(latin, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),latin);
 
 	fd6 = G_open_cell_old(latin, mapset);
@@ -875,7 +875,7 @@
 	for (l = 0; l < numRows; l++)
 	    longitArray[l] = (float *)G_malloc(sizeof(float) * (n));
 
-	if ((mapset = G_find_cell(longin, "")) == NULL)
+	if ((mapset = G_find_cell2(longin, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),longin);
 
 	fd7 = G_open_cell_old(longin, mapset);
@@ -891,7 +891,7 @@
 	    for (l = 0; l < numRows; l++)
 		cbhr[l] = (float *)G_malloc(sizeof(float) * (n));
 	}
-	if ((mapset = G_find_cell(coefbh, "")) == NULL)
+	if ((mapset = G_find_cell2(coefbh, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),coefbh);
 
 	fr1 = G_open_cell_old(coefbh, mapset);
@@ -904,7 +904,7 @@
 	    for (l = 0; l < numRows; l++)
 		cdhr[l] = (float *)G_malloc(sizeof(float) * (n));
 	}
-	if ((mapset = G_find_cell(coefdh, "")) == NULL)
+	if ((mapset = G_find_cell2(coefdh, "")) == NULL)
 	    G_fatal_error(_("Raster map <%s> not found"),coefdh);
 
 	fr2 = G_open_cell_old(coefdh, mapset);
@@ -928,7 +928,7 @@
 	 * 
 	 * horizonbuf[0]=G_allocate_f_raster_buf();
 	 * sprintf(shad_filename, "%s_%02d", horizon, arrayNumInt);
-	 * if((mapset=G_find_cell(shad_filename,""))==NULL)
+	 * if((mapset=G_find_cell2(shad_filename,""))==NULL)
 	 * G_message("Horizon file no. %d not found\n", arrayNumInt);
 	 * 
 	 * fd_shad[0] = G_open_cell_old(shad_filename,mapset);
@@ -941,7 +941,7 @@
 	for (i = 0; i < arrayNumInt; i++) {
 		horizonbuf[i] = G_allocate_f_raster_buf();
 	    sprintf(shad_filename, formatString, horizon, i);
-	    if ((mapset = G_find_cell(shad_filename, "")) == NULL)
+	    if ((mapset = G_find_cell2(shad_filename, "")) == NULL)
 		G_fatal_error(_("Horizon file no. %d <%s> not found"), i, shad_filename);
 
 	    fd_shad[i] = G_open_cell_old(shad_filename, mapset);



More information about the grass-commit mailing list