Prechádzať zdrojové kódy

fix compiler warnings (contributed by Volker Froehlich, sync of https://trac.osgeo.org/grass/changeset/59714)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59715 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 11 rokov pred
rodič
commit
a6c85f0a45

+ 1 - 1
general/g.mapset/main.c

@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
     G_asprintf(&lock_prog, "%s/etc/lock", G_gisbase());
 
     sprintf(path, "%s/.gislock", mapset_new_path);
-    G_debug(2, path);
+    G_debug(2, "%s", path);
     
     ret = G_spawn(lock_prog, lock_prog, path, gis_lock, NULL);
     G_debug(2, "lock result = %d", ret);

+ 1 - 1
general/g.region/main.c

@@ -512,7 +512,7 @@ int main(int argc, char *argv[])
 	    Vect_set_open_level(2);
 	    if (2 > Vect_open_old(&Map, vect_name, mapset))
 		G_fatal_error(_("Unable to open vector map <%s> on topological level"),
-			      vect_name, mapset);
+			      vect_name);
             
 	    Vect_get_map_box(&Map, &box);
 	    map_window = window;

+ 1 - 1
lib/db/dbmi_client/delete_tab.c

@@ -47,7 +47,7 @@ int db_delete_table(const char *drvname, const char *dbname, const char *tblname
     db_init_string(&sql);
     db_set_string(&sql, "drop table ");
     db_append_string(&sql, tblname);
-    G_debug(3, db_get_string(&sql));
+    G_debug(3, "%s", db_get_string(&sql));
 
     if (db_execute_immediate(driver, &sql) != DB_OK) {
 	G_warning(_("Unable to drop table: '%s'"),

+ 1 - 1
lib/ogsf/gvl_calc.c

@@ -746,7 +746,7 @@ void gvl_write_char(int pos, unsigned char **data, unsigned char c)
 	}
 
 	G_debug(3,
-		"gvl_write_char(): reallocate memory for pos : %d to : %d B",
+		"gvl_write_char(): reallocate memory for pos : %d to : %lu B",
 		pos, sizeof(char) * ((pos / BUFFER_SIZE) + 1) * BUFFER_SIZE);
     }
 

+ 1 - 1
lib/proj/get_proj.c

@@ -232,7 +232,7 @@ int pj_get_kv(struct pj_info *info, const struct Key_Value *in_proj_keys,
 	    sprintf(err, " +%s", opt_in[i]);
 	    strcat(buffa, err);
 	}
-	G_warning(buffa);
+	G_warning("%s", buffa);
 	G_warning(_("The error message: %s"), pj_strerrno(pj_errno));
 	return -1;
     }

+ 1 - 1
lib/symbol/read.c

@@ -221,7 +221,7 @@ SYMBOL *err(FILE * fp, SYMBOL * s, char *msg)
 {
     fclose(fp);
     G_free(s);			/* TODO: free all */
-    G_warning(msg);
+    G_warning(msg, "%s");
     return NULL;
 }
 

+ 1 - 1
raster/r.out.ppm/main.c

@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
     fclose(fp);
 
     if (do_stdout)
-	G_done_msg("");
+	G_done_msg("%s", "");
     else
 	G_done_msg(_("File <%s> created"), ofile);
 

+ 1 - 1
raster/r.to.vect/areas_io.c

@@ -371,7 +371,7 @@ int write_area(struct area_table *a_list,	/* list of areas */
 		}
 
 		db_append_string(&sql, ")");
-		G_debug(3, db_get_string(&sql));
+		G_debug(3, "%s", db_get_string(&sql));
 
 		if (db_execute_immediate(driver, &sql) != DB_OK)
 		    G_fatal_error(_("Cannot insert new row: %s"),

+ 2 - 2
vector/v.surf.rst/main.c

@@ -818,12 +818,12 @@ static FILE *create_temp_file(const char *name, char **tmpname)
     *tmpname = tmp = G_tempfile();
     fp = fopen(tmp, "w+");
     if (!fp)
-	G_fatal_error(_("Unable to open temporary file <%s>"), tmpname);
+	G_fatal_error(_("Unable to open temporary file <%s>"), *tmpname);
 
     for (i = 0; i < n_rows; i++) {
 	if (fwrite(zero_array_cell, sizeof(FCELL), n_cols, fp) != n_cols) {
 	    clean();
-	    G_fatal_error(_("Error writing temporary file <%s>"), tmpname);
+	    G_fatal_error(_("Error writing temporary file <%s>"), *tmpname);
 	}
     }
 

+ 1 - 1
vector/v.to.3d/trans3.c

@@ -102,7 +102,7 @@ void trans3d(struct Map_info *In, struct Map_info *Out, int type,
 	}
 	else if (Cats->n_cats > 1) {
 	    G_warning(_("Feature id %d has more categories. "
-			"Using category %d."), line, field, cat);
+			"Using category %d."), line, cat);
 	}
 
 	if (zcolumn && ltype == GV_POINT && cat > -1) {