[GRASS-SVN] r30109 - in grass/trunk/raster: r.coin r.in.gdal r.quant r.report r.transect r.water.outlet

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 13 04:40:49 EST 2008


Author: neteler
Date: 2008-02-13 04:40:48 -0500 (Wed, 13 Feb 2008)
New Revision: 30109

Modified:
   grass/trunk/raster/r.coin/inter.c
   grass/trunk/raster/r.in.gdal/main.c
   grass/trunk/raster/r.quant/global.h
   grass/trunk/raster/r.report/parse.c
   grass/trunk/raster/r.transect/main.c
   grass/trunk/raster/r.water.outlet/basin.h
   grass/trunk/raster/r.water.outlet/main.c
Log:
use GNAME_MAX, GMAPSET_MAX; some error msg fix

Modified: grass/trunk/raster/r.coin/inter.c
===================================================================
--- grass/trunk/raster/r.coin/inter.c	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.coin/inter.c	2008-02-13 09:40:48 UTC (rev 30109)
@@ -25,7 +25,7 @@
 {
     int  cols;
     char key;
-    char line[128],outname[128],command[1024];
+    char line[128],outname[GNAME_MAX],command[1024];
     char ans[80];
 
     setbuf(stderr,NULL);
@@ -37,11 +37,11 @@
 
     mapset1 = G_ask_cell_old("Enter Name of Map Layer 1",map1name);
     if(!mapset1)
-	    exit (0);
+	    G_fatal_error (_("Raster map <%s> not found"), map1name);
 
     mapset2 = G_ask_cell_old("Enter Name of Map Layer 2",map2name);
     if(!mapset2)
-	    exit (0);
+	    G_fatal_error (_("Raster map <%s> not found"), map2name);
 
     make_coin();
     check_report_size();

Modified: grass/trunk/raster/r.in.gdal/main.c
===================================================================
--- grass/trunk/raster/r.in.gdal/main.c	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.in.gdal/main.c	2008-02-13 09:40:48 UTC (rev 30109)
@@ -602,7 +602,7 @@
     struct Key_Value *proj_info=NULL, *proj_units=NULL;
     char errbuf[256];
     int permissions;
-    char target_mapset[80];
+    char target_mapset[GMAPSET_MAX];
     struct Key_Value *out_proj_info,  /* projection information of    */
                      *out_unit_info;  /* input and output mapsets     */
 

Modified: grass/trunk/raster/r.quant/global.h
===================================================================
--- grass/trunk/raster/r.quant/global.h	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.quant/global.h	2008-02-13 09:40:48 UTC (rev 30109)
@@ -3,15 +3,15 @@
   struct Quant quant_struct;
   CELL old_min, old_max;
   DCELL old_dmin, old_dmax;
-  char *name[100];  /* input map names */
-  char *mapset[100];  /* input mapsets */
+  char *name[GNAME_MAX];  /* input map names */
+  char *mapset[GMAPSET_MAX];  /* input mapsets */
   int noi;
 #else
   extern struct Quant quant_struct;
   extern CELL old_min, old_max;
   extern DCELL old_dmin, old_dmax;
-  extern char *name[100];  /* input map names */
-  extern char *mapset[100];  /* input mapsets */
+  extern char *name[GNAME_MAX];  /* input map names */
+  extern char *mapset[GMAPSET_MAX];  /* input mapsets */
   extern int noi;
 #endif
 /* read_rules.c */

Modified: grass/trunk/raster/r.report/parse.c
===================================================================
--- grass/trunk/raster/r.report/parse.c	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.report/parse.c	2008-02-13 09:40:48 UTC (rev 30109)
@@ -235,8 +235,7 @@
 
 int parse_layer (char *s)
 {
-	char msg[100];
-	char name[200];
+	char name[GNAME_MAX];
 	char *mapset;
 	struct FPRange fp_range;
 	int n;
@@ -245,9 +244,7 @@
 	mapset = G_find_cell2 (name, "");
 
 	if (mapset == NULL)
-	{
 	    G_fatal_error (_("Raster map <%s> not found"), s);
-	}
 
 	n = nlayers++ ;
 	layers = (LAYER *)G_realloc(layers, nlayers * sizeof(LAYER));
@@ -261,10 +258,8 @@
         if(is_fp[n])
 	{
            if(G_read_fp_range (name, mapset, &fp_range) < 0)
-           {
              G_fatal_error (_("Unable to read fp range for raster map <%s>"),
 			    name);
-           }
  	   G_get_fp_range_min_max (&fp_range, &DMIN[n], &DMAX[n]);
         }
 

Modified: grass/trunk/raster/r.transect/main.c
===================================================================
--- grass/trunk/raster/r.transect/main.c	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.transect/main.c	2008-02-13 09:40:48 UTC (rev 30109)
@@ -33,7 +33,7 @@
     int n,err;
     int projection;
     char *mapset;
-    char name[256];
+    char name[GNAME_MAX];
 
     struct GModule *module;
     struct

Modified: grass/trunk/raster/r.water.outlet/basin.h
===================================================================
--- grass/trunk/raster/r.water.outlet/basin.h	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.water.outlet/basin.h	2008-02-13 09:40:48 UTC (rev 30109)
@@ -45,7 +45,7 @@
 GLOBAL SHORT	updrain[3][3]	UPDRAINVAR; 
 GLOBAL char dr_mod[9] DRVAR ;
 GLOBAL char dc_mod[9] DCVAR ;
-GLOBAL char	basin_name[80], swale_name[80], half_name[80], elev_name[80], armsed_name[80];
+GLOBAL char	basin_name[GNAME_MAX], swale_name[GNAME_MAX], half_name[GNAME_MAX], elev_name[GNAME_MAX], armsed_name[GNAME_MAX];
 GLOBAL int	nrows, ncols, done, total;
 GLOBAL int	array_size, high_index, do_index;
 GLOBAL char	*drain_ptrs, ha_f, el_f, ar_f;

Modified: grass/trunk/raster/r.water.outlet/main.c
===================================================================
--- grass/trunk/raster/r.water.outlet/main.c	2008-02-13 06:28:58 UTC (rev 30108)
+++ grass/trunk/raster/r.water.outlet/main.c	2008-02-13 09:40:48 UTC (rev 30109)
@@ -35,7 +35,7 @@
 	double	N,E;
 	int	row, col, basin_fd, drain_fd;
 	CELL	*cell_buf;
-	char	drain_name[80], *drain_mapset, E_f, dr_f, ba_f, N_f,  errr;
+	char	drain_name[GNAME_MAX], *drain_mapset, E_f, dr_f, ba_f, N_f,  errr;
 	struct GModule *module;
         struct Option *opt1, *opt2, *opt3, *opt4;
 	char *buf;



More information about the grass-commit mailing list