[GRASS-SVN] r59649 - in grass/branches/develbranch_6: . db/base db/drivers/dbf db/drivers/sqlite display/d.mon/cmd display/d.mon/pgms display/d.vect imagery/i.atcorr imagery/i.ortho.photo/i.photo.elev imagery/i.ortho.photo/i.photo.init imagery/i.pca include include/iostream lib/external/shapelib lib/gis lib/init lib/ogsf lib/vector/Vlib lib/vector/vedit raster/r.cost raster/r.null raster/r.walk

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Apr 8 13:44:17 PDT 2014


Author: mmetz
Date: 2014-04-08 13:44:17 -0700 (Tue, 08 Apr 2014)
New Revision: 59649

Modified:
   grass/branches/develbranch_6/INSTALL
   grass/branches/develbranch_6/db/base/select.c
   grass/branches/develbranch_6/db/drivers/dbf/dbfexe.c
   grass/branches/develbranch_6/db/drivers/sqlite/create_table.c
   grass/branches/develbranch_6/db/drivers/sqlite/fetch.c
   grass/branches/develbranch_6/display/d.mon/cmd/main.c
   grass/branches/develbranch_6/display/d.mon/pgms/Makefile
   grass/branches/develbranch_6/display/d.vect/label.c
   grass/branches/develbranch_6/imagery/i.atcorr/main.cpp
   grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.elev/mod_elev.c
   grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/main.c
   grass/branches/develbranch_6/imagery/i.pca/main.c
   grass/branches/develbranch_6/imagery/i.pca/support.c
   grass/branches/develbranch_6/include/iostream/ami_stream.h
   grass/branches/develbranch_6/include/ogsf_proto.h
   grass/branches/develbranch_6/lib/external/shapelib/shpopen.c
   grass/branches/develbranch_6/lib/gis/closecell.c
   grass/branches/develbranch_6/lib/gis/color_look.c
   grass/branches/develbranch_6/lib/gis/gdal.c
   grass/branches/develbranch_6/lib/init/set_data.c
   grass/branches/develbranch_6/lib/ogsf/GVL2.c
   grass/branches/develbranch_6/lib/ogsf/gs.c
   grass/branches/develbranch_6/lib/ogsf/gsds.c
   grass/branches/develbranch_6/lib/ogsf/gv.c
   grass/branches/develbranch_6/lib/vector/Vlib/map.c
   grass/branches/develbranch_6/lib/vector/vedit/render.c
   grass/branches/develbranch_6/raster/r.cost/main.c
   grass/branches/develbranch_6/raster/r.null/null.c
   grass/branches/develbranch_6/raster/r.walk/main.c
Log:
sync devbr6 to relbr6

Modified: grass/branches/develbranch_6/INSTALL
===================================================================
--- grass/branches/develbranch_6/INSTALL	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/INSTALL	2014-04-08 20:44:17 UTC (rev 59649)
@@ -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.svn_src_snapshot_2008_01_19.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/develbranch_6/db/base/select.c
===================================================================
--- grass/branches/develbranch_6/db/base/select.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/db/base/select.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -198,6 +198,17 @@
     table = G_define_standard_option(G_OPT_TABLE);
     table->guisection = _("Connection"); 
 
+    database = G_define_standard_option(G_OPT_DATABASE);
+    if ((db = db_get_default_database_name()))
+	database->answer = (char *) db;
+    database->guisection = _("Connection");
+
+    driver = G_define_standard_option(G_OPT_DRIVER);
+    driver->options = db_list_drivers();
+    if ((drv = db_get_default_driver_name()))
+	driver->answer = (char *) drv;
+    driver->guisection = _("Connection");
+
     sql = G_define_option();
     sql->key = "sql";
     sql->type = TYPE_STRING;
@@ -212,17 +223,6 @@
     input->description = _("Name of file with SQL select statement(s)");
     input->guisection = _("Query");
 
-    database = G_define_standard_option(G_OPT_DATABASE);
-    if ((db = db_get_default_database_name()))
-	database->answer = (char *) db;
-    database->guisection = _("Connection");
-
-    driver = G_define_standard_option(G_OPT_DRIVER);
-    driver->options = db_list_drivers();
-    if ((drv = db_get_default_driver_name()))
-	driver->answer = (char *) drv;
-    driver->guisection = _("Connection");
-
     fs = G_define_standard_option(G_OPT_F_SEP);
     fs->description = _("Output field separator");
     fs->guisection = _("Format");

Modified: grass/branches/develbranch_6/db/drivers/dbf/dbfexe.c
===================================================================
--- grass/branches/develbranch_6/db/drivers/dbf/dbfexe.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/db/drivers/dbf/dbfexe.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -453,7 +453,6 @@
 		dbval->d = val->d;
 	    else if (val->type == SQLP_S) {
 		char *tailptr;
-
 		double dval = strtod(val->s, &tailptr);
 
 		if (!(*tailptr)) {
@@ -468,7 +467,6 @@
 
 /* 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)

Modified: grass/branches/develbranch_6/db/drivers/sqlite/create_table.c
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/create_table.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/db/drivers/sqlite/create_table.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -116,7 +116,9 @@
      * If the database schema has changed, sqlite can prepare a statement,
      * but sqlite can not step, the statement needs to be prepared anew again */
     while (1) {
-	ret = sqlite3_prepare(sqlite, db_get_string(&sql), -1, &statement, &rest);
+	ret =
+	    sqlite3_prepare(sqlite, db_get_string(&sql), -1, &statement,
+			    &rest);
 
 	if (ret != SQLITE_OK) {
 	    append_error("Cannot create table:\n");

Modified: grass/branches/develbranch_6/db/drivers/sqlite/fetch.c
===================================================================
--- grass/branches/develbranch_6/db/drivers/sqlite/fetch.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/db/drivers/sqlite/fetch.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -64,6 +64,7 @@
 	    c->row = -1;
 
 	ret = sqlite3_step(c->statement);
+
 	if (ret != SQLITE_ROW) {
 	    /* get real result code */
 	    ret = sqlite3_reset(c->statement);

Modified: grass/branches/develbranch_6/display/d.mon/cmd/main.c
===================================================================
--- grass/branches/develbranch_6/display/d.mon/cmd/main.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/display/d.mon/cmd/main.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -98,7 +98,6 @@
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-
     if (unlock->answer)
 	run("release", "-f", unlock->answer);
 

Modified: grass/branches/develbranch_6/display/d.mon/pgms/Makefile
===================================================================
--- grass/branches/develbranch_6/display/d.mon/pgms/Makefile	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/display/d.mon/pgms/Makefile	2014-04-08 20:44:17 UTC (rev 59649)
@@ -1,3 +1,4 @@
+
 MODULE_TOPDIR = ../../..
 
 include $(MODULE_TOPDIR)/include/Make/Platform.make

Modified: grass/branches/develbranch_6/display/d.vect/label.c
===================================================================
--- grass/branches/develbranch_6/display/d.vect/label.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/display/d.vect/label.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -30,7 +30,7 @@
 	    return 0;
 	}
 
-	if (!(type & ltype)&& !((type & GV_AREA) && (ltype & GV_CENTROID)))
+	if (!(type & ltype) && !((type & GV_AREA) && (ltype & GV_CENTROID)))
 	    continue;		/* used for both lines and labels */
 
 	R_RGB_color(lattr->color.R, lattr->color.G, lattr->color.B);

Modified: grass/branches/develbranch_6/imagery/i.atcorr/main.cpp
===================================================================
--- grass/branches/develbranch_6/imagery/i.atcorr/main.cpp	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/imagery/i.atcorr/main.cpp	2014-04-08 20:44:17 UTC (rev 59649)
@@ -470,10 +470,10 @@
     opts.iscl->guisection = _("Input");
 
     opts.ialt = G_define_standard_option(G_OPT_R_ELEV);
+    opts.ialt->key              = "ialt";
     opts.ialt->required	        = NO;
     opts.ialt->description      = _("Name of input elevation raster map (in m)");
     opts.ialt->guisection       = _("Input");
-    opts.ialt->key              = "ialt";
     
     opts.ivis = G_define_standard_option(G_OPT_R_INPUT);
     opts.ivis->key		= "ivis";
@@ -487,7 +487,7 @@
     opts.icnd->description	= _("Name of input text file with 6S parameters");
 
     opts.oimg = G_define_standard_option(G_OPT_R_OUTPUT);
-    opts.oimg->key = "oimg";
+    opts.oimg->key		= "oimg";
 
     opts.oscl = G_define_option();
     opts.oscl->key          = "oscl";

Modified: grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.elev/mod_elev.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.elev/mod_elev.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.elev/mod_elev.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -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/develbranch_6/imagery/i.ortho.photo/i.photo.init/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/main.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/imagery/i.ortho.photo/i.photo.init/main.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -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/develbranch_6/imagery/i.pca/main.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.pca/main.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/imagery/i.pca/main.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -145,7 +145,7 @@
     if (!calc_mu_cov(inp_fd, covar, mu, stddev, bands))
 	G_fatal_error(_("No non-null values"));
 
-    G_math_d_copy(covar[0], eigmat[0], bands*bands);
+    G_math_d_copy(covar[0], eigmat[0], bands * bands);
     G_debug(1, "Calculating eigenvalues and eigenvectors...");
     G_math_eigen(eigmat, eigval, bands);
 

Modified: grass/branches/develbranch_6/imagery/i.pca/support.c
===================================================================
--- grass/branches/develbranch_6/imagery/i.pca/support.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/imagery/i.pca/support.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -1,10 +1,10 @@
 #include <string.h>
 #include <grass/gis.h>
 #include <grass/glocale.h>
-#include "local_proto.h"
 
+
 /* 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++)
@@ -65,8 +65,8 @@
 
 	sprintf(hist.edhist[i + 1], tmpeigen);
 
-	/* write eigen values to screen */
-	if(first_map)
+	/* write eigen values to stdout */
+	if (first_map)
 	    fprintf(stdout, "%s\n", tmpeigen);
     }
 

Modified: grass/branches/develbranch_6/include/iostream/ami_stream.h
===================================================================
--- grass/branches/develbranch_6/include/iostream/ami_stream.h	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/include/iostream/ami_stream.h	2014-04-08 20:44:17 UTC (rev 59649)
@@ -389,7 +389,7 @@
 #else
   struct stat buf;
   if (stat(path, &buf) == -1) {
-    perror("AMI_STREAM::stream_len(): fstat failed ");
+    perror("ERROR: AMI_STREAM::stream_len(): fstat failed ");
     DEBUG_ASSERT assert(0);
     exit(1);
   }

Modified: grass/branches/develbranch_6/include/ogsf_proto.h
===================================================================
--- grass/branches/develbranch_6/include/ogsf_proto.h	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/include/ogsf_proto.h	2014-04-08 20:44:17 UTC (rev 59649)
@@ -404,7 +404,7 @@
 int gs_get_att_type(geosurf *, int);
 int gs_get_att_src(geosurf *, int);
 typbuff *gs_get_att_typbuff(geosurf *, int, int);
-size_t gs_malloc_att_buff(geosurf *, int, int);
+int gs_malloc_att_buff(geosurf *, int, int);
 int gs_malloc_lookup(geosurf *, int);
 int gs_set_att_type(geosurf *, int, int);
 int gs_set_att_src(geosurf *, int, int);

Modified: grass/branches/develbranch_6/lib/external/shapelib/shpopen.c
===================================================================
--- grass/branches/develbranch_6/lib/external/shapelib/shpopen.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/external/shapelib/shpopen.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -848,7 +848,7 @@
         psHooks->Error( "Failed to create file .shp file." );
 	free( pszFullname );
 	free( pszBasename );
-	return( NULL );
+        return( NULL );
     }
 
     sprintf( pszFullname, "%s.shx", pszBasename );

Modified: grass/branches/develbranch_6/lib/gis/closecell.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/closecell.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/gis/closecell.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -28,7 +28,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <signal.h>
 #include <grass/gis.h>
@@ -106,7 +105,6 @@
 {
     struct fileinfo *fcb = &G__.fileinfo[fd];
 
-    G_debug(5, "G_unopen_cell()");
     if (fd < 0 || fd >= G__.fileinfo_count || fcb->open_mode <= 0)
 	return -1;
     if (fcb->open_mode == OPEN_OLD)
@@ -189,14 +187,8 @@
 	G__make_mapset_element_misc("cell_misc", fcb->name);
 	G__file_name_misc(path, "cell_misc", NULL_FILE, fcb->name,
 			  G_mapset());
+	remove(path);
 
-	if (access(path, F_OK) == 0) {
-	    if (remove(path) != 0) {
-		perror(path);
-		G_warning(_("Unable to delete prior null-cells file"));
-	    }
-	}
-
 	if (fcb->null_cur_row > 0) {
 	    /* if temporary NULL file exists, write it into cell_misc/name/null */
 	    int null_fd;
@@ -222,33 +214,22 @@
 		    G__write_null_bits(null_fd, fcb->null_work_buf, row,
 				       fcb->cellhd.cols, fd);
 	    }
-	    if (close(null_fd) != 0)
-		G_warning(_("Unable to close the null-cells file"));
+	    close(null_fd);
 
 	    if (rename(fcb->null_temp_name, path)) {
 		G_warning(_("closecell: can't move [%s] to null-cells file [%s]"),
 			  fcb->null_temp_name, path);
 		stat = -1;
 	    }
-	    else { /* if the rename() was successful I'm not sure why there'd be anything left to remove() */
-		if (access(fcb->null_temp_name, F_OK) == 0) {
-		    if (remove(fcb->null_temp_name) != 0)
-			G_warning(_("Unable to delete the temporary null-cells file"));
-		}
+	    else {
+		remove(fcb->null_temp_name);
 	    }
 	}
-	else { /* no NULL data encountered */
-	    if (access(fcb->null_temp_name, F_OK) == 0) {
-		if (remove(fcb->null_temp_name) != 0)
-		    G_warning(_("Unable to delete the empty temporary null-cells file"));
-	    }
-	    if (access(path, F_OK) == 0) {
-		if (remove(path) != 0)  /* duplicate? */
-		    G_warning(_("Unable to delete the prior null-cells file"));
-	    }
-	}		/* null_cur_row > 0 */
+	else {
+	    remove(fcb->null_temp_name);
+	    remove(path);
+	}			/* null_cur_row > 0 */
 
-
 	if (fcb->open_mode == OPEN_NEW_COMPRESSED) {	/* auto compression */
 	    fcb->row_ptr[fcb->cellhd.rows] = lseek(fd, 0L, SEEK_CUR);
 	    G__write_row_ptrs(fd);
@@ -268,37 +249,23 @@
 	    cell_fd =
 		creat(G__file_name(path, "cell", fcb->name, fcb->mapset),
 		      0666);
-	    if (close(cell_fd) != 0)
-		G_warning(_("Unable to close the 'cell' file"));
-
+	    close(cell_fd);
 	    strcpy(CELL_DIR, "fcell");
 	}
 	else {
-	    /* it's a CELL map, so remove fcell/name file if it exists */
+	    /* remove fcell/name file */
 	    G__file_name(path, "fcell", fcb->name, fcb->mapset);
-
-	    if (access(path, F_OK) == 0) {
-		if (remove(path) != 0)
-		    G_warning(_("Unable to delete prior 'fcell' file"));
-	    }
-
+	    remove(path);
 	    /* remove cell_misc/name/f_format */
 	    G__file_name_misc(path, "cell_misc", FORMAT_FILE, fcb->name,
 			      fcb->mapset);
-
-	    if (access(path, F_OK) == 0) {
-		if (remove(path) != 0)
-		    G_warning(_("Unable to delete the prior %s file"), FORMAT_FILE);
-	    }
-
+	    remove(path);
 	    strcpy(CELL_DIR, "cell");
 	}
-    }		/* if(ok) */
-
+    }				/* ok */
     /* NOW CLOSE THE FILE DESCRIPTOR */
-    if (close(fd) != 0)
-	G_warning(_("Unable to close file"));
 
+    close(fd);
     /* remember open_mode */
     open_mode = fcb->open_mode;
     fcb->open_mode = -1;
@@ -318,26 +285,15 @@
      */
     stat = 1;
     if (ok && (fcb->temp_name != NULL)) {
-	G_debug(5, "Moving temporary cell map into main mapset...");
 	G__file_name(path, CELL_DIR, fcb->name, fcb->mapset);
-
-	if (access(path, F_OK) == 0) {
-	    if (remove(path) != 0) {
-		perror(path);
-		G_warning(_("Unable to delete the prior 'cell' file"));
-	    }
-	}
-
+	remove(path);
 	if (rename(fcb->temp_name, path)) {
 	    G_warning(_("closecell: can't move [%s] to cell file [%s]"),
 		      fcb->temp_name, path);
 	    stat = -1;
 	}
-	else { /* if the rename() was successful I'm not sure why there'd be anything left to remove() */
-	    if (access(fcb->temp_name, F_OK) == 0) {
-		if (remove(fcb->temp_name) != 0)
-		    G_warning(_("Unable to delete the temporary 'cell' file"));
-	    }
+	else {
+	    remove(fcb->temp_name);
 	}
     }
 
@@ -393,10 +349,7 @@
 	    /* remove cell_misc/name/f_quant */
 	    G__file_name_misc(path, "cell_misc", QUANT_FILE, fcb->name,
 			      fcb->mapset);
-	    if (access(path, F_OK) == 0) {
-		if (remove(path) != 0)
-		    G_warning(_("Unable to delete the %s file"), QUANT_FILE);
-	    }
+	    remove(path);
 	}
 
 	/* create empty cats file */

Modified: grass/branches/develbranch_6/lib/gis/color_look.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/color_look.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/gis/color_look.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -243,7 +243,6 @@
     int cell_type;
     int lookup, max_ind, min_ind, try;
     int (*lower) ();
-    size_t size = G_raster_size(data_type);
 
     if (mod)
 	cp = &colors->modular;
@@ -259,7 +258,7 @@
     dmin = cp->min;
     dmax = cp->max;
     min = (CELL) dmin;
-    max = (CELL) dmax;
+    max = (CELL) dmax + 1;
 
     cell_type = (data_type == CELL_TYPE);
 
@@ -284,7 +283,7 @@
 
     for (; n-- > 0;
 	 ptr =
-	 G_incr_void_ptr(ptr, size), red++, grn++, blu++,
+	 G_incr_void_ptr(ptr, G_raster_size(data_type)), red++, grn++, blu++,
 	 *set++ = found) {
 	/* if the cell is the same as last one, use the prev color values */
 	if (ptr != raster && G_raster_cmp(ptr, last_ptr, data_type) == 0) {

Modified: grass/branches/develbranch_6/lib/gis/gdal.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/gdal.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/gis/gdal.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -108,10 +108,8 @@
 
     for (i = 0; candidates[i]; i++) {
 	try_load_library(candidates[i]);
-	if (library_h) {
-	    G_debug(3, "found %s", candidates[i]);
+	if (library_h)
 	    return;
-	}
     }
 
     G_fatal_error(_("Unable to load GDAL library"));

Modified: grass/branches/develbranch_6/lib/init/set_data.c
===================================================================
--- grass/branches/develbranch_6/lib/init/set_data.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/init/set_data.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -55,7 +55,7 @@
     char version[80];
     char gisdbase[GPATH_MAX];
     char location_name[GMAPSET_MAX];
-    char location[GPATH_MAX+GMAPSET_MAX];
+    char location[GPATH_MAX + GMAPSET_MAX];
     char mapset[GMAPSET_MAX];
     int line;
     int yes;

Modified: grass/branches/develbranch_6/lib/ogsf/GVL2.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/GVL2.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/ogsf/GVL2.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -297,11 +297,11 @@
 	*rows = gvl->rows;
 	*cols = gvl->cols;
 	*depths = gvl->depths;
+
+	G_debug(3, "GVL_get_dims() id=%d, rows=%d, cols=%d, depths=%d",
+	    gvl->gvol_id, gvl->rows, gvl->cols, gvl->depths);
     }
 
-    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/develbranch_6/lib/ogsf/gs.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gs.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/ogsf/gs.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -712,9 +712,9 @@
    \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
  */
-size_t gs_malloc_att_buff(geosurf * gs, int desc, int type)
+int gs_malloc_att_buff(geosurf * gs, int desc, int type)
 {
     int hdata, dims[2], ndims;
 

Modified: grass/branches/develbranch_6/lib/ogsf/gsds.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gsds.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/ogsf/gsds.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -597,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/develbranch_6/lib/ogsf/gv.c
===================================================================
--- grass/branches/develbranch_6/lib/ogsf/gv.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/ogsf/gv.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -181,12 +181,12 @@
 {
     int i;
 
-    G_debug(5, "gv_set_defaults() id=%d", gv->gvect_id);
-
     if (!gv) {
 	return (-1);
     }
 
+    G_debug(5, "gv_set_defaults() id=%d", gv->gvect_id);
+
     gv->filename = NULL;
     gv->n_lines = gv->n_surfs = gv->use_mem = 0;
     gv->x_trans = gv->y_trans = gv->z_trans = 0.0;

Modified: grass/branches/develbranch_6/lib/vector/Vlib/map.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/map.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/vector/Vlib/map.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -23,7 +23,6 @@
 #include <dirent.h>
 #include <string.h>
 #include <unistd.h>
-#include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -61,8 +60,8 @@
     if (Vect_level(In) >= 2) {
 	nlines = Vect_get_num_lines(In);
 	for (i = 1; i <= nlines; i++) {
-            if (!Vect_line_alive(In, i))
-                continue;
+	    if (!Vect_line_alive(In, i))
+		continue;
 
 	    type = Vect_read_line(In, Points, Cats, i);
 	    if (type == -1) {
@@ -521,9 +520,9 @@
 	sprintf(buf, "%s/%s/vector/%s/%s", G_location_path(), G_mapset(), map,
 		ent->d_name);
 	G_debug(3, "delete file '%s'", buf);
-	ret = remove(buf);
+	ret = unlink(buf);
 	if (ret == -1) {
-	    G_warning(_("Unable to delete file '%s'. Reason: %s"), buf, strerror(errno));
+	    G_warning(_("Unable to delete file '%s'"), buf);
 	    closedir(dir);
 	    return -1;
 	}
@@ -540,7 +539,7 @@
     ret = rename(buf, tmp);
 
     if (ret == -1) {
-	G_warning(_("Unable to rename directory '%s' to '%s'. Reason: %s"), buf, tmp, strerror(errno));
+	G_warning(_("Unable to rename directory '%s' to '%s'"), buf, tmp);
 	return -1;
     }
 
@@ -548,7 +547,7 @@
     /* Warning: remove() fails on Windows */
     ret = rmdir(tmp);
     if (ret == -1) {
-	G_warning(_("Unable to remove directory '%s'. Reason: %s"), tmp, strerror(errno));
+	G_warning(_("Unable to remove directory '%s'"), tmp);
 	return -1;
     }
 

Modified: grass/branches/develbranch_6/lib/vector/vedit/render.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/vedit/render.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/lib/vector/vedit/render.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -134,12 +134,12 @@
 	(struct robject **)G_realloc(list_obj->item,
 				     list_obj->nitems *
 				     sizeof(struct robject *));
-    
+
     G_debug(1, "Vedit_render_map(): -> nitems = %d",
 	    list_obj->nitems);
-    
+
     Vect_destroy_list(list);
-    
+
     return list_obj;
 }
 

Modified: grass/branches/develbranch_6/raster/r.cost/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.cost/main.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/raster/r.cost/main.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -1129,12 +1129,11 @@
     }
     G_percent(1, 1, 1);
 
-    double *p;
-
     if (dir == 1) {
 	G_message(_("Writing movement direction file %s..."), move_dir_layer);
 	for (row = 0; row < nrows; row++) {
-	    p = dir_cell;
+	    double *p = dir_cell;
+
 	    for (col = 0; col < ncols; col++) {
 		segment_get(&out_seg2, &cur_dir, row, col);
 		*(p + col) = cur_dir;

Modified: grass/branches/develbranch_6/raster/r.null/null.c
===================================================================
--- grass/branches/develbranch_6/raster/r.null/null.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/raster/r.null/null.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -329,9 +329,6 @@
 
     rast = G_allocate_raster_buf(map_type);
 
-    if (change_null)
-	G_debug(5, "new null=%.15g", new_null);
-
     G_verbose_message(_("Writing new data for raster map <%s>..."), name);
 
     /* the null file is written automatically */

Modified: grass/branches/develbranch_6/raster/r.walk/main.c
===================================================================
--- grass/branches/develbranch_6/raster/r.walk/main.c	2014-04-08 20:34:08 UTC (rev 59648)
+++ grass/branches/develbranch_6/raster/r.walk/main.c	2014-04-08 20:44:17 UTC (rev 59649)
@@ -1607,12 +1607,11 @@
 	}
     }
 
-    double *p;
-
     if (dir == 1) {
 	G_message(_("Writing movement direction file %s..."), move_dir_layer);
 	for (row = 0; row < nrows; row++) {
-	    p = dir_cell;
+	    double *p = dir_cell;
+
 	    for (col = 0; col < ncols; col++) {
 		segment_get(&out_seg2, &cur_dir, row, col);
 		*(p + col) = cur_dir;



More information about the grass-commit mailing list