瀏覽代碼

Remove unused 'buf' variables

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36917 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 16 年之前
父節點
當前提交
896dcce9c5
共有 3 個文件被更改,包括 22 次插入29 次删除
  1. 1 3
      lib/gis/put_cellhd.c
  2. 14 19
      lib/gis/quant_rw.c
  3. 7 7
      lib/gis/range.c

+ 1 - 3
lib/gis/put_cellhd.c

@@ -21,9 +21,7 @@ int G_put_cellhd(const char *name, struct Cell_head *cellhd)
     FILE *fd;
 
     if (!(fd = G_fopen_new("cellhd", name))) {
-	char buf[1024];
-
-	G_warning (_("Unable to create header file for [%s]"), name);
+	G_warning(_("Unable to create header file for [%s]"), name);
 	return -1;
     }
 

+ 14 - 19
lib/gis/quant_rw.c

@@ -63,15 +63,14 @@
 
 int G_truncate_fp_map(const char *name, const char *mapset)
 {
-    char buf[300];
     struct Quant quant;
 
     G_quant_init(&quant);
     G_quant_truncate(&quant);
     /* quantize the map */
     if (G_write_quant(name, mapset, &quant) < 0) {
-	G_warning (_("G_truncate_fp_map: can't write quant rules"
-		     " for map %s"),
+	G_warning(_("G_truncate_fp_map: can't write quant rules"
+		    " for map %s"),
 		   name);
 	return -1;
     }
@@ -80,16 +79,15 @@ int G_truncate_fp_map(const char *name, const char *mapset)
 
 int G_round_fp_map(const char *name, const char *mapset)
 {
-    char buf[300];
     struct Quant quant;
 
     G_quant_init(&quant);
     G_quant_round(&quant);
     /* round the map */
     if (G_write_quant(name, mapset, &quant) < 0) {
-	G_warning (_("G_truncate_fp_map: can't write quant rules"
-		     " for map %s"),
-		   name);
+	G_warning(_("G_truncate_fp_map: can't write quant rules"
+		    " for map %s"),
+		  name);
 	return -1;
     }
     return 1;
@@ -113,19 +111,18 @@ int G_round_fp_map(const char *name, const char *mapset)
 int G_quantize_fp_map(const char *name, const char *mapset,
 		      CELL min, CELL max)
 {
-    char buf[300];
     DCELL d_min, d_max;
     struct FPRange fp_range;
 
     if (G_read_fp_range(name, mapset, &fp_range) < 0) {
-	G_warning (_("G_quantize_fp_map: can't read fp range for map %s"),
-		   name);
+	G_warning(_("G_quantize_fp_map: can't read fp range for map %s"),
+		  name);
 	return -1;
     }
     G_get_fp_range_min_max(&fp_range, &d_min, &d_max);
     if (G_is_d_null_value(&d_min) || G_is_d_null_value(&d_max)) {
-	G_warning (_("G_quantize_fp_map: raster map %s is empty"),
-		   name);
+	G_warning(_("G_quantize_fp_map: raster map %s is empty"),
+		  name);
 	return -1;
     }
     return G_quantize_fp_map_range(name, mapset, d_min, d_max, min, max);
@@ -158,16 +155,15 @@ int G_quantize_fp_map(const char *name, const char *mapset,
 int G_quantize_fp_map_range(const char *name, const char *mapset,
 			    DCELL d_min, DCELL d_max, CELL min, CELL max)
 {
-    char buf[300];
     struct Quant quant;
 
     G_quant_init(&quant);
     G_quant_add_rule(&quant, d_min, d_max, min, max);
     /* quantize the map */
     if (G_write_quant(name, mapset, &quant) < 0) {
-	G_warning (_("G_quantize_fp_map_range: can't write quant rules"
-		     " for map %s"),
-		   name);
+	G_warning(_("G_quantize_fp_map_range: can't write quant rules"
+		    " for map %s"),
+		  name);
 	return -1;
     }
     return 1;
@@ -198,11 +194,10 @@ int G_write_quant(const char *name, const char *mapset,
 {
     CELL cell_min, cell_max;
     DCELL d_min, d_max;
-    char buf[300];
 
     if (G_raster_map_type(name, mapset) == CELL_TYPE) {
-	G_warning (_("Cannot write quant rules: map %s is integer"),
-		   name);
+	G_warning(_("Cannot write quant rules: map %s is integer"),
+		  name);
 	return -1;
     }
 

+ 7 - 7
lib/gis/range.c

@@ -137,7 +137,7 @@ int G_read_fp_range(const char *name, const char *mapset,
 {
     struct Range range;
     int fd;
-    char buf[200], xdr_buf[100];
+    char xdr_buf[100];
     DCELL dcell1, dcell2;
     XDR xdr_str;
 
@@ -185,8 +185,8 @@ int G_read_fp_range(const char *name, const char *mapset,
   error:
     if (fd > 0)
 	close(fd);
-    G_warning (_("can't read f_range file for [%s in %s]"),
-	       name, mapset);
+    G_warning(_("can't read f_range file for [%s in %s]"),
+	      name, mapset);
     return -1;
 }
 
@@ -236,8 +236,8 @@ int G_read_range(const char *name, const char *mapset, struct Range *range)
 	DCELL dmin, dmax;
 
 	if (G_read_quant(name, mapset, &quant) < 0) {
-	    G_warning (_("G_read_range(): can't read quant rules"
-			 " for fp map %s@%s"),
+	    G_warning(_("G_read_range(): can't read quant rules"
+			" for fp map %s@%s"),
 		       name, mapset);
 	    return -1;
 	}
@@ -300,8 +300,8 @@ int G_read_range(const char *name, const char *mapset, struct Range *range)
   error:
     if (fd)
 	fclose(fd);
-    G_warning (_("can't read range file for [%s in %s]"),
-	       name, mapset);
+    G_warning(_("can't read range file for [%s in %s]"),
+	      name, mapset);
     return -1;
 }