[GRASS-SVN] r32758 - in grass/trunk: db/drivers/dbf display/d.barscale display/d.colortable display/d.geodesic display/d.labels display/d.rast.arrow display/d.rhumbline general/g.access general/g.parser general/g.pnmcomp general/manage/cmd imagery/i.cca imagery/i.class imagery/i.his.rgb imagery/i.ortho.photo/photo.rectify imagery/i.pca imagery/i.rgb.his lib/linkm lib/vector/diglib raster/r.basins.fill raster/r.in.bin raster/r.in.gridatb raster/r.le/r.le.patch raster/r.le/r.le.setup/polytocell raster/r.sum raster/r.topidx raster/r.topmodel raster3d/base raster3d/r3.out.ascii raster3d/r3.out.v5d raster3d/r3.showdspf sites/s.in.ascii vector/v.clean/test vector/v.label.sa vector/v.out.pov vector/v.out.svg vector/v.split vector/v.transform visualization/nviz/src

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Aug 14 04:44:54 EDT 2008


Author: glynn
Date: 2008-08-14 04:44:53 -0400 (Thu, 14 Aug 2008)
New Revision: 32758

Modified:
   grass/trunk/db/drivers/dbf/main_debug.c
   grass/trunk/display/d.barscale/main.c
   grass/trunk/display/d.colortable/main.c
   grass/trunk/display/d.geodesic/main.c
   grass/trunk/display/d.labels/main.c
   grass/trunk/display/d.rast.arrow/arrow.c
   grass/trunk/display/d.rhumbline/main.c
   grass/trunk/general/g.access/main.c
   grass/trunk/general/g.parser/main.c
   grass/trunk/general/g.pnmcomp/main.c
   grass/trunk/general/manage/cmd/list.c
   grass/trunk/imagery/i.cca/main.c
   grass/trunk/imagery/i.class/main.c
   grass/trunk/imagery/i.his.rgb/h2rmain.c
   grass/trunk/imagery/i.ortho.photo/photo.rectify/get_wind.c
   grass/trunk/imagery/i.pca/main.c
   grass/trunk/imagery/i.rgb.his/r2hmain.c
   grass/trunk/lib/linkm/oom.c
   grass/trunk/lib/vector/diglib/allocation.c
   grass/trunk/raster/r.basins.fill/main.c
   grass/trunk/raster/r.in.bin/main.c
   grass/trunk/raster/r.in.gridatb/main.c
   grass/trunk/raster/r.le/r.le.patch/input.c
   grass/trunk/raster/r.le/r.le.setup/polytocell/bmf_to_cll.c
   grass/trunk/raster/r.le/r.le.setup/polytocell/ply_t_bmif.c
   grass/trunk/raster/r.sum/main.c
   grass/trunk/raster/r.topidx/main.c
   grass/trunk/raster/r.topmodel/main.c
   grass/trunk/raster3d/base/r3.timestamp.main.c
   grass/trunk/raster3d/r3.out.ascii/main.c
   grass/trunk/raster3d/r3.out.v5d/main.c
   grass/trunk/raster3d/r3.showdspf/main_ogl.c
   grass/trunk/sites/s.in.ascii/main.c
   grass/trunk/vector/v.clean/test/topocheck.c
   grass/trunk/vector/v.label.sa/main.c
   grass/trunk/vector/v.out.pov/main.c
   grass/trunk/vector/v.out.svg/main.c
   grass/trunk/vector/v.split/main.c
   grass/trunk/vector/v.transform/creat_trans.c
   grass/trunk/visualization/nviz/src/nviz_init.c
Log:
Change exit(-1) to exit(EXIT_FAILURE); a negative argument to exit() is invalid
Miscellaneous tidying


Modified: grass/trunk/db/drivers/dbf/main_debug.c
===================================================================
--- grass/trunk/db/drivers/dbf/main_debug.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/db/drivers/dbf/main_debug.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -21,7 +21,7 @@
 
     driver = db_start_driver("dbf");
     if (driver == NULL)
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     db_init_handle(&handle);
     db_set_handle(&handle, "dbf_catalog", NULL);

Modified: grass/trunk/display/d.barscale/main.c
===================================================================
--- grass/trunk/display/d.barscale/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/display/d.barscale/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -103,7 +103,7 @@
     opt3->description =
 	_("The screen coordinates for top-left corner of label ([0,0] is top-left of frame)");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
 

Modified: grass/trunk/display/d.colortable/main.c
===================================================================
--- grass/trunk/display/d.colortable/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/display/d.colortable/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -95,7 +95,7 @@
 
     /* Check command line */
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     map_name = opt1->answer;
     mapset = G_find_cell2(map_name, "");

Modified: grass/trunk/display/d.geodesic/main.c
===================================================================
--- grass/trunk/display/d.geodesic/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/display/d.geodesic/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -71,14 +71,10 @@
     /*    parm.tcolor->options    = D_color_list(); */
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
-    if (G_projection() != PROJECTION_LL) {
-	sprintf(msg, "%s: database is not a %s\n",
-		argv[0], G__projection_name(PROJECTION_LL));
-	G_fatal_error(msg);
-	exit(1);
-    }
+    if (G_projection() != PROJECTION_LL)
+	G_fatal_error(_("Database is not a %s"), G__projection_name(PROJECTION_LL));
 
     if (parm.coor->answers[0] == NULL)
 	G_fatal_error("No coordinates given");

Modified: grass/trunk/display/d.labels/main.c
===================================================================
--- grass/trunk/display/d.labels/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/display/d.labels/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -75,7 +75,7 @@
 
     /* Check command line */
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     /* Save map name */
     label_name = opt1->answer;

Modified: grass/trunk/display/d.rast.arrow/arrow.c
===================================================================
--- grass/trunk/display/d.rast.arrow/arrow.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/display/d.rast.arrow/arrow.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -182,7 +182,7 @@
 
     /* Check command line */
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
 
     strncpy(layer_name, opt1->answer, sizeof(layer_name) - 1);

Modified: grass/trunk/display/d.rhumbline/main.c
===================================================================
--- grass/trunk/display/d.rhumbline/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/display/d.rhumbline/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -71,7 +71,7 @@
 #endif
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     if (G_projection() != PROJECTION_LL)
 	G_fatal_error("%s: database is not a %s database",

Modified: grass/trunk/general/g.access/main.c
===================================================================
--- grass/trunk/general/g.access/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/general/g.access/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -52,7 +52,7 @@
     other_opt->options = "grant,revoke";
     other_opt->description = _("Access for others");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     /* get the unix file name for the mapset directory */

Modified: grass/trunk/general/g.parser/main.c
===================================================================
--- grass/trunk/general/g.parser/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/general/g.parser/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -356,7 +356,7 @@
     if (translate_output)
 	return EXIT_SUCCESS;
 
-    if (G_parser(argc - 1, argv + 1) < 0)
+    if (G_parser(argc - 1, argv + 1))
 	return 1;
 
     /* Because shell from MINGW and CygWin converts all variables

Modified: grass/trunk/general/g.pnmcomp/main.c
===================================================================
--- grass/trunk/general/g.pnmcomp/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/general/g.pnmcomp/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -333,8 +333,8 @@
     opt.bg->type = TYPE_STRING;
     opt.bg->description = _("Background color");
 
-    if (G_parser(argc, argv) < 0)
-	return 1;
+    if (G_parser(argc, argv))
+	exit(EXIT_FAILURE);
 
     width = atoi(opt.width->answer);
     height = atoi(opt.height->answer);

Modified: grass/trunk/general/manage/cmd/list.c
===================================================================
--- grass/trunk/general/manage/cmd/list.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/general/manage/cmd/list.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -69,40 +69,37 @@
     mapset->required = NO;
     mapset->multiple = NO;
     mapset->description = _("Mapset to list (default: current search path)");
-#define MAPSET mapset->answer
 
     full = G_define_flag();
     full->key = 'f';
     full->description = _("Verbose listing (also list map titles)");
-#define FULL full->answer
 
-    if (G_parser(argc, argv)) {
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
-    }
 
-    if (MAPSET == NULL)
-	MAPSET = "";
+    if (mapset->answer == NULL)
+	mapset->answer = "";
 
-    if (G_strcasecmp(MAPSET, ".") == 0)
-	MAPSET = G_mapset();
+    if (G_strcasecmp(mapset->answer, ".") == 0)
+	mapset->answer = G_mapset();
 
     i = 0;
     while (element->answers[i]) {
 	n = parse(element->answers[i]);
 
-	if (FULL) {
-	    char lister[300];
+	if (full->answer) {
+	    char lister[GPATH_MAX];
 
 	    sprintf(lister, "%s/etc/lister/%s", G_gisbase(),
 		    list[n].element[0]);
 	    G_debug(3, "lister CMD: %s", lister);
 	    if (access(lister, 1) == 0)	/* execute permission? */
-		G_spawn(lister, lister, MAPSET, NULL);
+		G_spawn(lister, lister, mapset->answer, NULL);
 	    else
-		do_list(n, MAPSET);
+		do_list(n, mapset->answer);
 	}
 	else {
-	    do_list(n, MAPSET);
+	    do_list(n, mapset->answer);
 	}
 
 	i++;

Modified: grass/trunk/imagery/i.cca/main.c
===================================================================
--- grass/trunk/imagery/i.cca/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/imagery/i.cca/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -100,7 +100,7 @@
     out_opt = G_define_standard_option(G_OPT_R_OUTPUT);
     out_opt->description = _("Output raster map prefix name");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     if (G_legal_filename(grp_opt->answer) < 0)

Modified: grass/trunk/imagery/i.class/main.c
===================================================================
--- grass/trunk/imagery/i.class/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/imagery/i.class/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -119,7 +119,7 @@
     in_sig->required = NO;
     in_sig->description = _("File containing input signatures (seed)");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
 

Modified: grass/trunk/imagery/i.his.rgb/h2rmain.c
===================================================================
--- grass/trunk/imagery/i.his.rgb/h2rmain.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/imagery/i.his.rgb/h2rmain.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -72,7 +72,7 @@
     opt_blue->key = "blue_output";
     opt_blue->description = _("Output map representing the blue");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     /* get dimension of the image */

Modified: grass/trunk/imagery/i.ortho.photo/photo.rectify/get_wind.c
===================================================================
--- grass/trunk/imagery/i.ortho.photo/photo.rectify/get_wind.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/imagery/i.ortho.photo/photo.rectify/get_wind.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -36,7 +36,7 @@
 #endif
 
     if (G_get_cellhd(name, mapset, &cellhd) < 0)
-	exit(-1);
+	exit(EXIT_FAILURE);
 
 #ifdef DEBUG3
     fprintf(Bugsr, "current window: n s = %f %f, \n", cellhd.north,

Modified: grass/trunk/imagery/i.pca/main.c
===================================================================
--- grass/trunk/imagery/i.pca/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/imagery/i.pca/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -77,7 +77,7 @@
     opt_scale->description =
 	_("Rescaling range output (For no rescaling use 0,0)");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     /* determine number of bands passed in */

Modified: grass/trunk/imagery/i.rgb.his/r2hmain.c
===================================================================
--- grass/trunk/imagery/i.rgb.his/r2hmain.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/imagery/i.rgb.his/r2hmain.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -72,7 +72,7 @@
     opt_sat->key = "saturation_output";
     opt_sat->description = _("Output saturation raster map");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     /* get dimension of the image */

Modified: grass/trunk/lib/linkm/oom.c
===================================================================
--- grass/trunk/lib/linkm/oom.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/lib/linkm/oom.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -4,5 +4,5 @@
 int link_out_of_memory(void)
 {
     fprintf(stderr, "LinkM: Out of memory\n");
-    exit(-1);
+    exit(EXIT_FAILURE);
 }

Modified: grass/trunk/lib/vector/diglib/allocation.c
===================================================================
--- grass/trunk/lib/vector/diglib/allocation.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/lib/vector/diglib/allocation.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -41,7 +41,7 @@
     if (p == NULL) {
 	fprintf(stderr, "\nERROR: out of memory.  memory asked for: %d\n",
 		n_wanted);
-	exit(-1);
+	exit(EXIT_FAILURE);
     }
 
     return (p);
@@ -95,7 +95,7 @@
     if ((ret = dig__falloc(nelem, elsize)) == NULL) {
 	fprintf(stderr, "Out of Memory.\n");
 	G_sleep(2);
-	exit(-1);
+	exit(EXIT_FAILURE);
     }
     return (ret);
 }
@@ -107,7 +107,7 @@
     if ((ret = dig__frealloc(oldptr, nelem, elsize, oldnelem)) == NULL) {
 	fprintf(stderr, "\nOut of Memory on realloc.\n");
 	G_sleep(2);
-	exit(-1);
+	exit(EXIT_FAILURE);
     }
     return (ret);
 }

Modified: grass/trunk/raster/r.basins.fill/main.c
===================================================================
--- grass/trunk/raster/r.basins.fill/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.basins.fill/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -82,7 +82,7 @@
     opt4->description = _("Name for the resultant watershed partition file");
     opt4->gisprompt = "new,cell,raster";
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     sscanf(opt1->answer, "%d", &tpass);

Modified: grass/trunk/raster/r.in.bin/main.c
===================================================================
--- grass/trunk/raster/r.in.bin/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.in.bin/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -359,7 +359,7 @@
     if (fd == NULL) {
 	perror(input);
 	G_usage();
-	exit(-1);
+	exit(EXIT_FAILURE);
     }
 
     /* Read binary GMT style header */

Modified: grass/trunk/raster/r.in.gridatb/main.c
===================================================================
--- grass/trunk/raster/r.in.gridatb/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.in.gridatb/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -58,9 +58,8 @@
     params.output->required = YES;
     params.output->gisprompt = "new,cell,raster";
 
-    if (G_parser(argc, argv)) {
-	exit(-1);
-    }
+    if (G_parser(argc, argv))
+	exit(EXIT_FAILURE);
 
     file = params.input->answer;
     oname = params.output->answer;

Modified: grass/trunk/raster/r.le/r.le.patch/input.c
===================================================================
--- grass/trunk/raster/r.le/r.le.patch/input.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.le/r.le.patch/input.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -199,9 +199,9 @@
     out->required = NO;
 
 
-    if (G_parser(argc, argv)) {
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
-    }
+
     /* record the user inputs for map,
        sam and out parameters */
 

Modified: grass/trunk/raster/r.le/r.le.setup/polytocell/bmf_to_cll.c
===================================================================
--- grass/trunk/raster/r.le/r.le.setup/polytocell/bmf_to_cll.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.le/r.le.setup/polytocell/bmf_to_cll.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -40,7 +40,7 @@
     char *mapset;
 
     if (argc != 2)
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     G_gisinit("bmif_to_cell");
 
@@ -134,5 +134,5 @@
 {
     fprintf(stderr,
 	    "    You drew a region outside the mask; restart REGIONS setup\n");
-    exit(-1);
+    exit(EXIT_FAILURE);
 }

Modified: grass/trunk/raster/r.le/r.le.setup/polytocell/ply_t_bmif.c
===================================================================
--- grass/trunk/raster/r.le/r.le.setup/polytocell/ply_t_bmif.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.le/r.le.setup/polytocell/ply_t_bmif.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -8,7 +8,7 @@
 
 #define MAXLINE	 90
 #define FGET	    fgets(buff,MAXLINE,stdin)
-#define READLINE	if (FGET==NULL) exit(-1) ;\
+#define READLINE	if (FGET==NULL) exit(EXIT_FAILURE) ;\
 					sscanf (buff,"%1c %lf %lf %d\n", &type, &U_y, &U_x, &code)
 #define XADJ(x)	 (x * U_to_A_xconv + U_to_A_xadd) ;
 #define YADJ(y)	 (y * U_to_A_yconv + U_to_A_yadd) ;
@@ -38,7 +38,7 @@
     /* read through Grips Header to pick up coordinate conversion factors */
     do {
 	if (FGET == NULL)
-	    exit(-1);
+	    exit(EXIT_FAILURE);
 	sscanf(buff, "%s\n", word);
 	incr = strcmp("ENDT\0", word);
     }
@@ -109,7 +109,7 @@
 			"  number of vertices read: %d   allowed: %d\n",
 			num_verticies, MAX_VERTICIES);
 		fprintf(stderr, "ABORTING\n");
-		exit(-1);
+		exit(EXIT_FAILURE);
 	    }
 	    READLINE;
 	}

Modified: grass/trunk/raster/r.sum/main.c
===================================================================
--- grass/trunk/raster/r.sum/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.sum/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -55,7 +55,7 @@
 
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     cellmap = G_find_file2("cell", rast->answer, "");
     if (!cellmap) {

Modified: grass/trunk/raster/r.topidx/main.c
===================================================================
--- grass/trunk/raster/r.topidx/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.topidx/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -49,9 +49,8 @@
     params.output->key = "output";
     params.output->description = _("Output topographic index map");
 
-    if (G_parser(argc, argv)) {
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
-    }
 
     /* Make sure that the current projection is not lat/long */
     if ((G_projection() == PROJECTION_LL))

Modified: grass/trunk/raster/r.topmodel/main.c
===================================================================
--- grass/trunk/raster/r.topmodel/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster/r.topmodel/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -169,9 +169,8 @@
     flag.input->key = 'i';
     flag.input->description = _("Input data given for (o/i)");
 
-    if (G_parser(argc, argv)) {
-	exit(-1);
-    }
+    if (G_parser(argc, argv))
+	exit(EXIT_FAILURE);
 
     /* Store given parameters and flags */
     map.basin = param.basin->answer;

Modified: grass/trunk/raster3d/base/r3.timestamp.main.c
===================================================================
--- grass/trunk/raster3d/base/r3.timestamp.main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster3d/base/r3.timestamp.main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -58,7 +58,7 @@
     date->type = TYPE_STRING;
     date->description = _("Datetime, datetime1/datetime2, or none");
 
-    if (G_parser(argc, argv) < 0)
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
     name = map->answer;

Modified: grass/trunk/raster3d/r3.out.ascii/main.c
===================================================================
--- grass/trunk/raster3d/r3.out.ascii/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster3d/r3.out.ascii/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -153,7 +153,7 @@
 	if (fp == NULL) {
 	    perror(asciiFile);
 	    G_usage();
-	    exit(-1);
+	    exit(EXIT_FAILURE);
 	}
     }
     else
@@ -250,7 +250,7 @@
 
     /* Have GRASS get inputs */
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     /* Parse input parameters */
     getParams(&input, &output, &decim);

Modified: grass/trunk/raster3d/r3.out.v5d/main.c
===================================================================
--- grass/trunk/raster3d/r3.out.v5d/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster3d/r3.out.v5d/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -299,7 +299,7 @@
 
     /* Have GRASS get inputs */
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     /* Parse input parameters */
     getParams(&input, &output, &decim);

Modified: grass/trunk/raster3d/r3.showdspf/main_ogl.c
===================================================================
--- grass/trunk/raster3d/r3.showdspf/main_ogl.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/raster3d/r3.showdspf/main_ogl.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -135,7 +135,7 @@
     colr->description = "Name of existing color table";
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     /* set-up for select() */
     if (pipe(fdes))
@@ -149,7 +149,7 @@
 
 	if (NULL == (dsp =
 		     check_get_any_dspname(dspf->answer, g3->answer, NULL)))
-	    exit(-1);
+	    exit(EXIT_FAILURE);
 
 
 	/* TODO - check color file */
@@ -206,13 +206,13 @@
 	if ((Headfax.dspfinfp = G_fopen_old(buff, dsp, mapset)) == NULL) {
 	    fprintf(stderr, "ERROR: unable to open %s for reading\n",
 		    Headfax.dspfinfp);
-	    exit(-1);
+	    exit(EXIT_FAILURE);
 	}
 
 	/* read header info from dspf file into GLOBAL variable Headfax */
 	if (dfread_header(&Headfax) < 0) {
 	    fprintf(stderr, "ERROR:  while reading dspf file header\n");
-	    exit(-1);
+	    exit(EXIT_FAILURE);
 	}
 
 	/* set 3dmap for data in Headfax */

Modified: grass/trunk/sites/s.in.ascii/main.c
===================================================================
--- grass/trunk/sites/s.in.ascii/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/sites/s.in.ascii/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -87,7 +87,7 @@
     parm.date->description = "datetime or datetime1/datetime2";
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     if ((input = parm.input->answer)) {
 	in_fd = fopen(input, "r");

Modified: grass/trunk/vector/v.clean/test/topocheck.c
===================================================================
--- grass/trunk/vector/v.clean/test/topocheck.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/vector/v.clean/test/topocheck.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -36,6 +36,8 @@
     int nareas1, nareas2;
     double tarea1, tarea2, darea, pdarea;
 
+    G_gisinit(argv[0]);
+
     module = G_define_module();
     module->keywords = _("vector");
     module->description = "Break lines at intersections.";
@@ -48,9 +50,8 @@
     poly_f->description =
 	"Write areas and isles as closed polygons instead of topo check";
 
-    G_gisinit(argv[0]);
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE));
 
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();

Modified: grass/trunk/vector/v.label.sa/main.c
===================================================================
--- grass/trunk/vector/v.label.sa/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/vector/v.label.sa/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -25,7 +25,7 @@
  * @param argv The command line arguments.
  * @param p The parameters structure.
  */
-static int parse_args(int argc, char *argv[], struct params *p);
+static void parse_args(int argc, char *argv[], struct params *p);
 
 /**
  * The main function controls the program flow.
@@ -48,8 +48,8 @@
 
     //    fprintf(stderr, "Parsing options and flags\n");
     /* parse options and flags */
-    if (parse_args(argc, argv, &p))
-	exit(EXIT_FAILURE);
+    parse_args(argc, argv, &p);
+
     /* initialize labels (get text from database, and get features) */
     labels = labels_init(&p, &n_labels);
     /* start algorithm */
@@ -113,7 +113,7 @@
     return EXIT_SUCCESS;
 }
 
-static int parse_args(int argc, char *argv[], struct params *p)
+static void parse_args(int argc, char *argv[], struct params *p)
 {
     p->map = G_define_standard_option(G_OPT_V_MAP);
 
@@ -230,7 +230,8 @@
     p->bowidth->answer = "0";
     p->bowidth->guisection = _("Colors");
 
-    return G_parser(argc, argv);
+    if (G_parser(argc, argv))
+	exit(EXIT_FAILURE);
 }
 
 void print_label(FILE * labelf, label_t * label, struct params *p)

Modified: grass/trunk/vector/v.out.pov/main.c
===================================================================
--- grass/trunk/vector/v.out.pov/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/vector/v.out.pov/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -83,7 +83,7 @@
 	"\t\tExample: \"pigment { color red 0 green 1 blue 0 }\"";
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     /* Check output type */
     otype = Vect_option_to_types(type_opt);

Modified: grass/trunk/vector/v.out.svg/main.c
===================================================================
--- grass/trunk/vector/v.out.svg/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/vector/v.out.svg/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -104,9 +104,8 @@
 
     field_opt = G_define_standard_option(G_OPT_V_FIELD);
 
-    if (G_parser(argc, argv)) {
+    if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
-    }
 
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();

Modified: grass/trunk/vector/v.split/main.c
===================================================================
--- grass/trunk/vector/v.split/main.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/vector/v.split/main.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -61,7 +61,7 @@
     vertices_opt->description = "Maximum number of vertices in segment.";
 
     if (G_parser(argc, argv))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     /* layer = atoi ( layer_opt->answer ); */
 

Modified: grass/trunk/vector/v.transform/creat_trans.c
===================================================================
--- grass/trunk/vector/v.transform/creat_trans.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/vector/v.transform/creat_trans.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -39,7 +39,7 @@
     n_points = 0;
     /*  Get the coordinates from the file.  */
     if ((n_points = get_coor_from_file(Coord->fp)) < 0)
-	exit(-1);
+	G_fatal_error(_("Error reading coordinates file"));
 
     status = setup_transform(n_points);
 
@@ -47,7 +47,7 @@
 	G_message(_("Number of points that have been entered [%d]"),
 		  n_points);
 	print_transform_error(status);
-	exit(-1);
+	G_fatal_error(_("Error creating transformation"));
     }
 
     if (!quiet)

Modified: grass/trunk/visualization/nviz/src/nviz_init.c
===================================================================
--- grass/trunk/visualization/nviz/src/nviz_init.c	2008-08-14 08:38:48 UTC (rev 32757)
+++ grass/trunk/visualization/nviz/src/nviz_init.c	2008-08-14 08:44:53 UTC (rev 32758)
@@ -414,7 +414,7 @@
     }
 
     if (TCL_ERROR == Tcl_SplitList(interp, tmp2, &argc, args))
-	exit(-1);
+	exit(EXIT_FAILURE);
 
     return (argc);
 }



More information about the grass-commit mailing list