Ver código fonte

fix Rast_init_cats

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38100 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 anos atrás
pai
commit
6a5e462833

+ 1 - 1
imagery/i.gensig/labels.c

@@ -11,5 +11,5 @@ void read_training_labels(struct parms *parms, struct files *files)
     map = parms->training_map;
     mapset = G_find_cell2(map, "");
     if (Rast_read_cats(map, mapset, &files->training_labels) < 0)
-	Rast_init_cats((CELL) 0, "", &files->training_labels);
+	Rast_init_cats("", &files->training_labels);
 }

+ 1 - 1
imagery/i.gensigset/labels.c

@@ -12,5 +12,5 @@ void read_training_labels(struct parms *parms, struct files *files)
     map = parms->training_map;
     mapset = G_find_cell2(map, "");
     if (Rast_read_cats(map, mapset, &files->training_labels) < 0)
-	Rast_init_cats((CELL) 0, "", &files->training_labels);
+	Rast_init_cats("", &files->training_labels);
 }

+ 1 - 1
lib/raster/closecell.c

@@ -211,7 +211,7 @@ static void write_support_files(int fd)
     Rast_get_range_min_max(&fcb->range, &cell_min, &cell_max);
     if (Rast_is_c_null_value(&cell_max))
 	cell_max = 0;
-    Rast_init_cats(cell_max, (char *)NULL, &cats);
+    Rast_init_cats((char *)NULL, &cats);
     Rast_write_cats(fcb->name, &cats);
     Rast_free_cats(&cats);
 

+ 1 - 1
raster/r.cross/main.c

@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
     }
     strcat(buf, " and ");
     strcat(buf, names[i]);
-    Rast_init_cats((CELL) 0, buf, &pcats);
+    Rast_init_cats(buf, &pcats);
 
     /* first step is cross product, but un-ordered */
     result = cross(fd, non_zero, primary, outfd);

+ 1 - 1
raster/r.in.poly/poly2rast.c

@@ -40,7 +40,7 @@ int poly_to_rast(char *input_file, char *raster_map, char *title, int nrows)
 	title = "";
     G_strip(title);
 
-    Rast_init_cats((CELL) 0, title, &labels);
+    Rast_init_cats(title, &labels);
 
     format = getformat(ifd);
     npasses = begin_rasterization(nrows, format);

+ 1 - 1
raster/r.reclass/main.c

@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
     }
     tty = isatty(fileno(srcfp));
 
-    Rast_init_cats(0, "", &cats);
+    Rast_init_cats("", &cats);
     fp = Rast_raster_map_is_fp(parm.input->answer, old_mapset);
     Rast_read_fp_range(parm.input->answer, old_mapset, &range);
     Rast_get_fp_range_min_max(&range, &min, &max);

+ 1 - 1
raster/r.stats/main.c

@@ -286,7 +286,7 @@ int main(int argc, char *argv[])
 	    labels = (struct Categories *)
 		G_realloc(labels, (nfiles + 1) * sizeof(struct Categories));
 	    if (Rast_read_cats(name, "", &labels[nfiles]) < 0)
-		Rast_init_cats((CELL) 0, "", &labels[nfiles]);
+		Rast_init_cats("", &labels[nfiles]);
 	}
 	if (is_fp[nfiles])
 	    /* floating point map */

+ 1 - 1
raster/r.support.stats/check.c

@@ -77,7 +77,7 @@ int check_stats(const char *name)
 
     /* Further category checks */
     if (!cats_ok)
-	Rast_init_cats(max, "", &cats);
+	Rast_init_cats("", &cats);
     else if (cats.num != max) {
 	cats.num = max;
 	cats_ok = 0;

+ 1 - 1
raster/r.support/check.c

@@ -58,7 +58,7 @@ int check_stats(const char *name)
 
     /* Further category checks */
     if (!cats_ok)
-	Rast_init_cats(max, "", &cats);
+	Rast_init_cats("", &cats);
     else if (cats.num != max) {
 	cats.num = max;
 	cats_ok = 0;

+ 1 - 1
raster/r.support/main.c

@@ -284,7 +284,7 @@ int main(int argc, char *argv[])
 
 	if ((fd = Rast_open_cell_old(infile, "")) < 0)
 	    G_fatal_error(_("Unable to open raster map <%s>"), infile);
-	Rast_init_cats((CELL) 0, "", &cats);
+	Rast_init_cats("", &cats);
 	if (Rast_read_cats(map_opt->answer, "", &cats) < 0)
 	    G_fatal_error(_("Unable to read category file of raster map <%s>"),
 			  map_opt->answer);