[GRASS-SVN] r59648 - in grass/branches/releasebranch_6_4: . db/drivers/dbf db/drivers/sqlite display/d.text.new imagery/i.ortho.photo/i.photo.elev imagery/i.ortho.photo/i.photo.init imagery/i.pca lib/db/dbmi_client lib/external/shapelib lib/gis lib/ogsf lib/vector/vedit misc/m.cogo raster/r.carve raster/r.in.xyz raster/r.out.gdal raster/r.report raster/r.stats vector/v.type

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 8 13:34:08 PDT 2014


Author: mmetz
Date: 2014-04-08 13:34:08 -0700 (Tue, 08 Apr 2014)
New Revision: 59648

Modified:
   grass/branches/releasebranch_6_4/INSTALL
   grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c
   grass/branches/releasebranch_6_4/db/drivers/sqlite/execute.c
   grass/branches/releasebranch_6_4/display/d.text.new/main.c
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.elev/mod_elev.c
   grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.init/main.c
   grass/branches/releasebranch_6_4/imagery/i.pca/local_proto.h
   grass/branches/releasebranch_6_4/imagery/i.pca/support.c
   grass/branches/releasebranch_6_4/lib/db/dbmi_client/delete_tab.c
   grass/branches/releasebranch_6_4/lib/external/shapelib/shpopen.c
   grass/branches/releasebranch_6_4/lib/gis/closecell.c
   grass/branches/releasebranch_6_4/lib/gis/color_write.c
   grass/branches/releasebranch_6_4/lib/gis/gdal.c
   grass/branches/releasebranch_6_4/lib/ogsf/GVL2.c
   grass/branches/releasebranch_6_4/lib/ogsf/gs.c
   grass/branches/releasebranch_6_4/lib/ogsf/gsd_objs.c
   grass/branches/releasebranch_6_4/lib/ogsf/gsds.c
   grass/branches/releasebranch_6_4/lib/ogsf/gv.c
   grass/branches/releasebranch_6_4/lib/vector/vedit/render.c
   grass/branches/releasebranch_6_4/misc/m.cogo/main.c
   grass/branches/releasebranch_6_4/raster/r.carve/main.c
   grass/branches/releasebranch_6_4/raster/r.carve/support.c
   grass/branches/releasebranch_6_4/raster/r.in.xyz/local_proto.h
   grass/branches/releasebranch_6_4/raster/r.out.gdal/export_band.c
   grass/branches/releasebranch_6_4/raster/r.report/header.c
   grass/branches/releasebranch_6_4/raster/r.stats/main.c
   grass/branches/releasebranch_6_4/vector/v.type/main.c
Log:
sync to debr6

Modified: grass/branches/releasebranch_6_4/INSTALL
===================================================================
--- grass/branches/releasebranch_6_4/INSTALL	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/INSTALL	2014-04-08 20:34:08 UTC (rev 59648)
@@ -53,7 +53,7 @@
   repository (http://svn.osgeo.org/grass/) or as a snapshot
   (*.tar.gz package) of that SVN repository. The SVN snapshot name
   contains the date when the snapshot was created (checked out from
-  the SVN repository), e.g. grass-6.4.0svn_src_snapshot_2008_12_20.tar.gz
+  the SVN repository), e.g. grass-6.4.svn_src_snapshot_2014_04_05.tar.gz
   Further instructions at http://trac.osgeo.org/grass/wiki/DownloadSource
 
 

Modified: grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c
===================================================================
--- grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -468,6 +468,7 @@
 /* Comparison of 2 rows */
 static int cur_cmp_table;
 static int cur_cmp_ocol;
+
 static int cmp_row_asc(const void *pa, const void *pb)
 {
     int *row1 = (int *)pa;

Modified: grass/branches/releasebranch_6_4/db/drivers/sqlite/execute.c
===================================================================
--- grass/branches/releasebranch_6_4/db/drivers/sqlite/execute.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/db/drivers/sqlite/execute.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -82,11 +82,6 @@
 	return DB_FAILED;
     }
 
-    /*
-       if ( rest )
-       G_free ( rest );
-     */
-
     return DB_OK;
 }
 

Modified: grass/branches/releasebranch_6_4/display/d.text.new/main.c
===================================================================
--- grass/branches/releasebranch_6_4/display/d.text.new/main.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/display/d.text.new/main.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -333,7 +333,7 @@
 	if (bg_color == 0) /* ie color="none" */
 	    do_background = 0;
     } else
-       do_background = 0;
+	do_background = 0;
     set_color(opt.fgcolor->answer);
 
     orig_x = orig_y = 0;

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.elev/mod_elev.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.elev/mod_elev.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.elev/mod_elev.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -21,7 +21,7 @@
 	V_clear();
 	V_line(1, "Please check the elevation data convention:");
 	V_line(3,
-	       "ELEV_DATA  =  CELL FILE  [MAPSET  in  LOCATION] [MATH EXPERSION][UNITS]");
+	       "ELEV_DATA  =  CELL FILE  [MAPSET  in  LOCATION] [MATH EXPRESSION][UNITS]");
 
 	V_line(6, "CELL FILE :       ");
 	V_line(7, "MAPSET :          ");

Modified: grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.init/main.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.init/main.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/imagery/i.ortho.photo/i.photo.init/main.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -73,13 +73,13 @@
 *******************/
 
 
-    /* get initial camera exposure infor */
+    /* get initial camera exposure info */
     if (I_find_initial(group.name)) {
 	have_old = 1;
 	I_get_init_info(group.name, &group.camera_exp);
     }
 
-    /* modifiy infor */
+    /* modify info */
     mod_init_info(have_old, &group.camera_exp);
 
     /* save info */

Modified: grass/branches/releasebranch_6_4/imagery/i.pca/local_proto.h
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.pca/local_proto.h	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/imagery/i.pca/local_proto.h	2014-04-08 20:34:08 UTC (rev 59648)
@@ -2,6 +2,6 @@
 #define __LOCAL_PROTO_H__
 
 /* support.c */
-int write_support(int, char *, double **, double *);
+void write_support(int, char *, double **, double *);
 
 #endif

Modified: grass/branches/releasebranch_6_4/imagery/i.pca/support.c
===================================================================
--- grass/branches/releasebranch_6_4/imagery/i.pca/support.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/imagery/i.pca/support.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -4,7 +4,7 @@
 
 
 /* function prototypes */
-static int write_history(int, char *, double **, double *);
+static void write_history(int, char *, double **, double *);
 
 
 void write_support(int bands, char *outname, double **eigmat, double *eigval)
@@ -30,7 +30,7 @@
 }
 
 
-static int write_history(int bands, char *outname, double **eigmat, double *eigval)
+static void write_history(int bands, char *outname, double **eigmat, double *eigval)
 {
     int i, j;
     static int first_map = TRUE;     /* write to stderr? */
@@ -40,7 +40,7 @@
     G_short_history(outname, "raster", &hist);
     sprintf(hist.edhist[0], "Eigen values, (vectors), and [percent importance]:");
 
-    if(first_map)
+    if (first_map)
 	G_message(_("Eigen values, (vectors), and [percent importance]:"));
 
     for (i = 0; i < bands; i++)

Modified: grass/branches/releasebranch_6_4/lib/db/dbmi_client/delete_tab.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/db/dbmi_client/delete_tab.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/db/dbmi_client/delete_tab.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -29,31 +29,22 @@
 int db_delete_table(const char *drvname, const char *dbname, const char *tblname)
 {
     dbDriver *driver;
-    dbHandle handle;
     dbString sql;
 
     G_debug(3, "db_delete_table(): driver = %s, db = %s, table = %s\n",
 	    drvname, dbname, tblname);
 
-    db_init_handle(&handle);
-    db_init_string(&sql);
-
     /* Open driver and database */
-    driver = db_start_driver(drvname);
+    driver = db_start_driver_open_database(drvname, dbname);
     if (driver == NULL) {
-	G_warning(_("Unable to open driver <%s>"), drvname);
+	G_warning(_("Unable open database <%s> by driver <%s>"), dbname,
+		  drvname);
 	return DB_FAILED;
     }
-    db_set_handle(&handle, dbname, NULL);
-    if (db_open_database(driver, &handle) != DB_OK) {
-	G_warning(_("Unable to open database <%s> by driver <%s>"),
-		  dbname, drvname);
-	db_shutdown_driver(driver);
-	return DB_FAILED;
-    }
 
     /* Delete table */
     /* TODO test if the tables exist */
+    db_init_string(&sql);
     db_set_string(&sql, "drop table ");
     db_append_string(&sql, tblname);
     G_debug(3, db_get_string(&sql));
@@ -61,13 +52,11 @@
     if (db_execute_immediate(driver, &sql) != DB_OK) {
 	G_warning(_("Unable to drop table: '%s'"),
 		  db_get_string(&sql));
-	db_close_database(driver);
-	db_shutdown_driver(driver);
+	db_close_database_shutdown_driver(driver);
 	return DB_FAILED;
     }
 
-    db_close_database(driver);
-    db_shutdown_driver(driver);
+    db_close_database_shutdown_driver(driver);
 
     return DB_OK;
 }

Modified: grass/branches/releasebranch_6_4/lib/external/shapelib/shpopen.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/external/shapelib/shpopen.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/external/shapelib/shpopen.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -846,6 +846,8 @@
     if( fpSHP == NULL )
     {
         psHooks->Error( "Failed to create file .shp file." );
+	free( pszFullname );
+	free( pszBasename );
         return( NULL );
     }
 
@@ -854,6 +856,8 @@
     if( fpSHX == NULL )
     {
         psHooks->Error( "Failed to create file .shx file." );
+	free( pszFullname );
+	free( pszBasename );
         return( NULL );
     }
 

Modified: grass/branches/releasebranch_6_4/lib/gis/closecell.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/closecell.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/gis/closecell.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -57,14 +57,6 @@
  * See Raster_Map_Layer_Support_Routines for routines which write
  * raster support files.
  *
- *  \param fd
- *  \return int
- */
-
-
-/*!
- * \brief 
- *
  * If the map is a new floating point, move the
  * <tt>.tmp</tt> file into the <tt>fcell</tt> element, create an empty file in the
  * <tt>cell</tt> directory; write the floating-point range file; write a default
@@ -73,6 +65,7 @@
  * (for backwards compatibility). Move the <tt>.tmp</tt> NULL-value bitmap file to
  * the <tt>cell_misc</tt> directory.
  *
+ *  \param fd
  *  \return int
  */
 
@@ -269,7 +262,6 @@
 			      fcb->mapset);
 	    remove(path);
 	    strcpy(CELL_DIR, "cell");
-	    close(fd);
 	}
     }				/* ok */
     /* NOW CLOSE THE FILE DESCRIPTOR */

Modified: grass/branches/releasebranch_6_4/lib/gis/color_write.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/color_write.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/gis/color_write.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -121,7 +121,7 @@
     fprintf(fd, "%% %s %s\n", str1, str2);
 
     if (colors->shift) {
-	sprintf(str2, "%.17g", (double)colors->shift);
+	sprintf(str2, "%.15g", (double)colors->shift);
 	G_trim_decimal(str2);
 	fprintf(fd, "shift:%s\n", str2);
     }
@@ -169,7 +169,7 @@
 	if (rule->low.value == dmin)
 	    format_min(str, (double)rule->low.value);
 	else {
-	    sprintf(str, "%.17g", (double)rule->low.value);
+	    sprintf(str, "%.15g", (double)rule->low.value);
 	    G_trim_decimal(str);
 	}
 	fprintf(fd, "%s:%d", str, (int)rule->low.red);
@@ -180,7 +180,7 @@
 	    if (rule->high.value == dmax)
 		format_max(str, (double)rule->high.value);
 	    else {
-		sprintf(str, "%.17g", (double)rule->high.value);
+		sprintf(str, "%.15g", (double)rule->high.value);
 		G_trim_decimal(str);
 	    }
 	    fprintf(fd, " %s:%d", str, (int)rule->high.red);
@@ -246,16 +246,16 @@
 {
     double dtmp;
 
-    sprintf(str, "%.17g", dval);
+    sprintf(str, "%.15g", dval);
     /* Note that G_trim_decimal() does not trim e.g. 1.0000000e-20 */
     G_trim_decimal(str);
     sscanf(str, "%lf", &dtmp);
     if (dtmp != dval) {  /* if no zeros after decimal point were trimmed */
 	/* lower dval by GRASS_EPSILON fraction */
 	if (dval > 0)
-	    sprintf(str, "%.17g", dval * (1 - GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 - GRASS_EPSILON));
 	else
-	    sprintf(str, "%.17g", dval * (1 + GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 + GRASS_EPSILON));
     }
 
     return 0;
@@ -265,16 +265,16 @@
 {
     double dtmp;
 
-    sprintf(str, "%.17g", dval);
+    sprintf(str, "%.15g", dval);
     /* Note that G_trim_decimal() does not trim e.g. 1.0000000e-20 */
     G_trim_decimal(str);
     sscanf(str, "%lf", &dtmp);
     if (dtmp != dval) {  /* if  no zeros after decimal point were trimmed */
 	/* increase dval by by GRASS_EPSILON fraction */
 	if (dval > 0)
-	    sprintf(str, "%.17g", dval * (1 + GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 + GRASS_EPSILON));
 	else
-	    sprintf(str, "%.17g", dval * (1 - GRASS_EPSILON));
+	    sprintf(str, "%.15g", dval * (1 - GRASS_EPSILON));
     }
 
     return 0;

Modified: grass/branches/releasebranch_6_4/lib/gis/gdal.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/gdal.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/gis/gdal.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -91,6 +91,7 @@
 	"libgdal1.7.0.so",
 # endif
 # ifdef _WIN32
+	"gdal110.dll",
 	"gdal19.dll",
 	"gdal18.dll",
 	"gdal17.dll",

Modified: grass/branches/releasebranch_6_4/lib/ogsf/GVL2.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/GVL2.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/ogsf/GVL2.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -301,7 +301,7 @@
 	G_debug(3, "GVL_get_dims() id=%d, rows=%d, cols=%d, depths=%d",
 	    gvl->gvol_id, gvl->rows, gvl->cols, gvl->depths);
     }
-    
+
     return;
 }
 

Modified: grass/branches/releasebranch_6_4/lib/ogsf/gs.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/gs.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/ogsf/gs.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -711,8 +711,7 @@
    \param desc attribute id (descriptor)
    \param type buffer type (based on raster map type)
 
-   \return -1 on error
-   \return pointer to typbuff (casted)
+   \return 1 on success, -1 on failure
  */
 int gs_malloc_att_buff(geosurf * gs, int desc, int type)
 {

Modified: grass/branches/releasebranch_6_4/lib/ogsf/gsd_objs.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/gsd_objs.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/ogsf/gsd_objs.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -1246,7 +1246,7 @@
    \return 1
  */
 int gsd_scalebar_v2(float *pos, float len, GLuint fontbase,
-		 unsigned long bar_clr, unsigned long text_clr)
+		    unsigned long bar_clr, unsigned long text_clr)
 {
     float base[6][3];
     float Ntop[] = { 0.0, 0.0, 1.0 };

Modified: grass/branches/releasebranch_6_4/lib/ogsf/gsds.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/gsds.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/ogsf/gsds.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -481,7 +481,8 @@
 int gsds_alloc_typbuff(int id, int *dims, int ndims, int type)
 {
     dataset *ds;
-    int i, siz = 1;
+    int i;
+    size_t siz = 1;
 
     if ((ds = get_dataset(id))) {
 	/*
@@ -596,7 +597,7 @@
 		"gsds_alloc_typbuff(): %f Kbytes allocated, current total = %f",
 		siz / 1000., Tot_mem / 1000.);
 
-	return (siz);
+	return (1);
     }
 
     return (-1);

Modified: grass/branches/releasebranch_6_4/lib/ogsf/gv.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/ogsf/gv.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/ogsf/gv.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -184,7 +184,7 @@
     if (!gv) {
 	return (-1);
     }
-    
+
     G_debug(5, "gv_set_defaults() id=%d", gv->gvect_id);
 
     gv->filename = NULL;

Modified: grass/branches/releasebranch_6_4/lib/vector/vedit/render.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/vector/vedit/render.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/lib/vector/vedit/render.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -135,6 +135,9 @@
 				     list_obj->nitems *
 				     sizeof(struct robject *));
 
+    G_debug(1, "Vedit_render_map(): -> nitems = %d",
+	    list_obj->nitems);
+
     Vect_destroy_list(list);
 
     return list_obj;
@@ -461,6 +464,7 @@
     /* get area's boundary */
     Vect_get_area_points(Map, area, state.Points);
     robj = robj_alloc(TYPE_AREA, state.Points->n_points);
+    robj->fid = centroid;
     robj_points(robj, state.Points);
     list_append(list, robj);
 
@@ -473,6 +477,7 @@
 
 	Vect_get_isle_points(Map, isle, ipoints);
 	robj = robj_alloc(TYPE_ISLE, ipoints->n_points);
+	robj->fid = -1;
 	robj_points(robj, ipoints);
 	list_append(list, robj);
     }

Modified: grass/branches/releasebranch_6_4/misc/m.cogo/main.c
===================================================================
--- grass/branches/releasebranch_6_4/misc/m.cogo/main.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/misc/m.cogo/main.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -49,29 +49,29 @@
 };
 
 
-static void print_coordinates(FILE * outfile, struct survey_record *in)
+static void print_coordinates(FILE *outfile, struct survey_record *in)
 {
     if (in->haslabel == YES)
-	fprintf(outfile, "%f %f %s\n", in->x, in->y, in->label);
+	fprintf(outfile, "%.15g %.15g %s\n", in->x, in->y, in->label);
     else
-	fprintf(outfile, "%f %f\n", in->x, in->y);
+	fprintf(outfile, "%.15g %.15g\n", in->x, in->y);
 }
 
 
-static void print_cogo(FILE * outfile, struct survey_record *in)
+static void print_cogo(FILE *outfile, struct survey_record *in)
 {
     if (in->haslabel == YES)
-	fprintf(outfile, "%s %s %d:%d:%.3f %s %f\n",
+	fprintf(outfile, "%s %s %02d:%02d:%02.9g %s %.13g\n",
 		in->label, in->n_s, in->deg, in->min, in->sec,
 		in->e_w, in->dist);
     else
-	fprintf(outfile, "%s %d:%d:%.3f %s %f\n",
+	fprintf(outfile, "%s %02d:%02d:%02.9g %s %.13g\n",
 		in->n_s, in->deg, in->min, in->sec, in->e_w, in->dist);
 
 }
 
 
-static const char *next_line(FILE * infile)
+static const char *next_line(FILE *infile)
 {
     static char line[512];
     const char *cptr;
@@ -210,12 +210,14 @@
     struct Flag *format;
     struct Flag *quiet;
     struct Flag *reverse;
+    struct Flag *close;
     struct GModule *module;
     FILE *infile, *outfile;
-    struct survey_record record;
+    struct survey_record record, first_record;
     const char *cptr;
     char *ss;
-    int verbose = 1, linenum = 0;
+    int verbose = TRUE;
+    unsigned long linenum = 0, dataline = 0;
     int (*parse_line) (const char *, struct survey_record *);
     void (*print_func) (FILE *, struct survey_record *);
 
@@ -240,6 +242,11 @@
     reverse->description =
 	_("Convert from coordinates to bearing and distance");
 
+    close = G_define_flag();
+    close->key = 'c';
+    close->description =
+	_("Repeat the starting coordinate at the end to close a loop");
+
     input = G_define_standard_option(G_OPT_F_INPUT);
     input->required = NO;
     input->answer = "-";
@@ -288,7 +295,7 @@
     }
 
     if (quiet->answer)
-	verbose = 0;
+	verbose = FALSE;
 
     if (reverse->answer) {
 	parse_line = parse_reverse;
@@ -324,9 +331,19 @@
 		G_warning(_("Input parse error on line %d"), linenum);
 	    continue;
 	}
+
+	dataline++;
+
+	if (dataline == 1)
+	    first_record = record;
+
 	print_func(outfile, &record);
     }
 
+    if (close->answer)
+	print_func(outfile, &first_record);
+
+
     if (infile != stdin)
 	fclose(infile);
     if (outfile != stdout)

Modified: grass/branches/releasebranch_6_4/raster/r.carve/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.carve/main.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/raster/r.carve/main.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -9,7 +9,7 @@
  * PURPOSE:      Takes vector stream data, converts it to 3D raster and
  *               subtracts a specified depth
  *
- * COPYRIGHT:    (C) 2006-2013 by the GRASS Development Team
+ * COPYRIGHT:    (C) 2006, 2010 by the GRASS Development Team
  *
  *               This program is free software under the GNU General Public
  *               License (>=v2). Read the file COPYING that comes with GRASS

Modified: grass/branches/releasebranch_6_4/raster/r.carve/support.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.carve/support.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/raster/r.carve/support.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -38,8 +38,10 @@
     G_short_history(parm->outrast->answer, "raster", &hist);
     sprintf(hist.edhist[0], "%s version %.2f", G_program_name(), APP_VERSION);
     sprintf(hist.edhist[1], "stream width: %.2f", parm->swidth * 2);
-    sprintf(hist.datsrc_1, "raster elevation file: %s", parm->inrast->answer);
-    sprintf(hist.datsrc_2, "vector stream file: %s", parm->invect->answer);
+    G_snprintf(hist.datsrc_1, RECORD_LEN, "raster elevation map: %s",
+		parm->inrast->answer);
+    G_snprintf(hist.datsrc_2, RECORD_LEN, "vector stream map: %s",
+		parm->invect->answer);
     hist.edlinecnt = 2;
     G_command_history(&hist);
 

Modified: grass/branches/releasebranch_6_4/raster/r.in.xyz/local_proto.h
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.in.xyz/local_proto.h	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/raster/r.in.xyz/local_proto.h	2014-04-08 20:34:08 UTC (rev 59648)
@@ -21,7 +21,7 @@
 #include <grass/gis.h>
 
 
-#define BUFFSIZE 256
+#define BUFFSIZE 1024
 
 #define METHOD_N           1
 #define METHOD_MIN         2

Modified: grass/branches/releasebranch_6_4/raster/r.out.gdal/export_band.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.out.gdal/export_band.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/raster/r.out.gdal/export_band.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -190,7 +190,7 @@
 				(int)nodataval, nodatakey);
 	else
 	    G_important_message(_("Input raster map contains cells with NULL-value (no-data). "
-				 "The value %f will be used to represent no-data values in the input map. "
+				 "The value %g will be used to represent no-data values in the input map. "
 				 "You can specify a nodata value with the %s option."),
 				nodataval, nodatakey);
     }

Modified: grass/branches/releasebranch_6_4/raster/r.report/header.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.report/header.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/raster/r.report/header.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -72,8 +72,6 @@
 
 	divider("|");
 
-	label = nlayers > 1 ? "MAPS:" : "MAP:";
-
 	mask = maskinfo();
 	label = "MASK:";
 	len1 = strlen(label) + 1;

Modified: grass/branches/releasebranch_6_4/raster/r.stats/main.c
===================================================================
--- grass/branches/releasebranch_6_4/raster/r.stats/main.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/raster/r.stats/main.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -199,9 +199,11 @@
     flag.i->key = 'i';
     flag.i->description = _("Read fp map as integer (use map's quant rules)");
 
+
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
+
     name = option.output->answer;
     if (name != NULL && strcmp(name, "-") != 0) {
 	if (NULL == freopen(name, "w", stdout)) {
@@ -240,7 +242,7 @@
     with_coordinates = flag.g->answer;
     with_xy = flag.x->answer;
     if (with_coordinates || with_xy)
-	raw_data = 1;
+	raw_data = TRUE;
 
     /* get field separator */
     strcpy(fs, " ");
@@ -276,6 +278,7 @@
 	fd[nfiles] = G_open_cell_old(name, mapset);
 	if (fd[nfiles] < 0)
 	    exit(1);
+
 	if (!as_int)
 	    is_fp[nfiles] = G_raster_map_is_fp(name, mapset);
 	else {

Modified: grass/branches/releasebranch_6_4/vector/v.type/main.c
===================================================================
--- grass/branches/releasebranch_6_4/vector/v.type/main.c	2014-04-08 19:47:26 UTC (rev 59647)
+++ grass/branches/releasebranch_6_4/vector/v.type/main.c	2014-04-08 20:34:08 UTC (rev 59648)
@@ -15,9 +15,6 @@
  *               for details.
  *
  **************************************************************/
-#ifdef FOR_GRASS7
-#include <string.h>
-#endif
 
 #include <stdlib.h>
 #include <grass/gis.h>
@@ -32,16 +29,10 @@
     int type;
     char *mapset;
     struct GModule *module;
-
-#ifdef FOR_GRASS7
-    struct Option *in_opt, *out_opt, *to_opt, *from_opt;
-    int from_type, to_type;
-#else
     int i, j;
     struct Option *in_opt, *out_opt, *type_opt;
     int types[100];		/* array of input,output types */
     int ntypes;			/* number of types (number of pairs * 2) */
-#endif
 
     module = G_define_module();
     module->keywords = _("vector, geometry");
@@ -50,27 +41,6 @@
     in_opt = G_define_standard_option(G_OPT_V_INPUT);
     out_opt = G_define_standard_option(G_OPT_V_OUTPUT);
 
-#ifdef FOR_GRASS7
-    from_opt = G_define_option();
-    from_opt->type = TYPE_STRING;
-    from_opt->key = "from";
-    from_opt->key_desc = "type";
-    from_opt->options = "point,line,boundary,centroid,face,kernel";
-    from_opt->answer = "boundary";
-    from_opt->required = YES;
-    from_opt->multiple = NO;
-    from_opt->description = _("Feature type to convert from");
-
-    to_opt = G_define_option();
-    to_opt->type = TYPE_STRING;
-    to_opt->key = "to";
-    to_opt->key_desc = "type";
-    to_opt->options = "point,line,boundary,centroid,face,kernel";
-    to_opt->answer = "line";
-    to_opt->required = YES;
-    to_opt->multiple = NO;
-    to_opt->description = _("Feature type to convert to");
-#else
     type_opt = G_define_standard_option(G_OPT_V_TYPE);
     type_opt->options = "point,line,boundary,centroid,face,kernel";
     type_opt->answer = "line,boundary,point,centroid";
@@ -79,7 +49,6 @@
 	_("<input_type1>,<output_type1>,<input_type2>,<output_type2>,...\n"
 	  "\t\tExample1: line,boundary\n"
 	  "\t\tExample2: line,boundary,point,centroid");
-#endif
 
 
     G_gisinit(argv[0]);
@@ -87,60 +56,6 @@
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-#ifdef FOR_GRASS7
-    if (!strcmp(from_opt->answer, to_opt->answer))
-	G_fatal_error(_("Nothing to do"));
-
-    switch (from_opt->answer[0]) {
-    case 'p':
-	from_type = GV_POINT;
-	break;
-    case 'l':
-	from_type = GV_LINE;
-	break;
-    case 'b':
-	from_type = GV_BOUNDARY;
-	break;
-    case 'c':
-	from_type = GV_CENTROID;
-	break;
-    case 'f':
-	from_type = GV_FACE;
-	break;
-    case 'k':
-	from_type = GV_KERNEL;
-	break;
-    }
-    switch (to_opt->answer[0]) {
-    case 'p':
-	to_type = GV_POINT;
-	break;
-    case 'l':
-	to_type = GV_LINE;
-	break;
-    case 'b':
-	to_type = GV_BOUNDARY;
-	break;
-    case 'c':
-	to_type = GV_CENTROID;
-	break;
-    case 'f':
-	to_type = GV_FACE;
-	break;
-    case 'k':
-	to_type = GV_KERNEL;
-	break;
-    }
-    /* check type compatibility */
-    if (((from_type & (GV_POINT | GV_CENTROID | GV_KERNEL)) &&
-	 (to_type & (GV_LINE | GV_BOUNDARY | GV_FACE))
-	) || ((from_type & (GV_LINE | GV_BOUNDARY | GV_FACE)) &&
-	      (to_type & (GV_POINT | GV_CENTROID | GV_KERNEL))
-	)
-	)
-	G_fatal_error(_("Incompatible types"));
-
-#else
     i = 0;
     j = 0;
     while (type_opt->answers[i]) {
@@ -189,7 +104,6 @@
 	G_fatal_error(_("Odd number of types"));
 
     ntypes = i;
-#endif
 
     Vect_check_input_output_name(in_opt->answer, out_opt->answer,
 				 GV_FATAL_EXIT);
@@ -216,17 +130,12 @@
     Vect_hist_command(&Out);
 
     while ((type = Vect_read_next_line(&In, Points, Cats)) > 0) {
-#ifdef FOR_GRASS7
-	if (type == from_type)
-	    type = to_type;
-#else
 	for (i = 0; i < ntypes; i += 2) {
 	    if (type == types[i]) {
 		type = types[i + 1];
 		break;
 	    }
 	}
-#endif
 	Vect_write_line(&Out, type, Points, Cats);
     }
 



More information about the grass-commit mailing list