Browse Source

Rast_get_*_row* now generate errors rather than returning a status

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@40222 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements 15 years ago
parent
commit
0309a419c2
100 changed files with 371 additions and 774 deletions
  1. 8 13
      display/d.his/main.c
  2. 3 6
      display/d.nviz/main.c
  3. 1 2
      display/d.rgb/main.c
  4. 7 12
      display/d.what.rast/what.c
  5. 1 3
      doc/raster/r.example/main.c
  6. 1 2
      general/g.region/zoom.c
  7. 6 12
      imagery/i.albedo/main.c
  8. 3 9
      imagery/i.atcorr/main.cpp
  9. 6 12
      imagery/i.biomass/main.c
  10. 1 2
      imagery/i.cca/transform.c
  11. 1 2
      imagery/i.class/draw_cell.c
  12. 2 3
      imagery/i.class/readbands.c
  13. 1 3
      imagery/i.cluster/main.c
  14. 3 6
      imagery/i.eb.eta/main.c
  15. 3 6
      imagery/i.eb.evapfr/main.c
  16. 15 30
      imagery/i.eb.h_SEBAL01/main.c
  17. 5 15
      imagery/i.eb.soilheatflux/main.c
  18. 1 2
      imagery/i.emissivity/main.c
  19. 3 6
      imagery/i.evapo.time_integration/main.c
  20. 1 3
      imagery/i.fft/main.c
  21. 1 3
      imagery/i.gensig/covariance.c
  22. 1 3
      imagery/i.gensig/get_train.c
  23. 1 2
      imagery/i.gensig/means.c
  24. 1 3
      imagery/i.gensig/read_train.c
  25. 1 3
      imagery/i.gensigset/get_train.c
  26. 1 4
      imagery/i.gensigset/read_data.c
  27. 1 3
      imagery/i.gensigset/read_train.c
  28. 1 2
      imagery/i.his.rgb/main.c
  29. 2 6
      imagery/i.ifft/main.c
  30. 1 2
      imagery/i.latlong/main.c
  31. 1 3
      imagery/i.maxlik/main.c
  32. 1 3
      imagery/i.modis.qc/main.c
  33. 4 8
      imagery/i.pca/main.c
  34. 1 2
      imagery/i.points/drawcell.c
  35. 1 3
      imagery/i.rectify/perform.c
  36. 1 2
      imagery/i.rgb.his/main.c
  37. 1 4
      imagery/i.smap/read_block.c
  38. 2 4
      imagery/i.sunhours/main.c
  39. 11 28
      imagery/i.vi/main.c
  40. 1 2
      imagery/i.vpoints/drawcell.c
  41. 1 2
      imagery/i.zc/main.c
  42. 12 12
      include/rasterdefs.h
  43. 1 4
      lib/gpde/N_arrays_io.c
  44. 4 8
      lib/ogsf/Gs3.c
  45. 78 143
      lib/raster/get_row.c
  46. 5 11
      lib/raster/get_row_colr.c
  47. 4 20
      lib/raster/sample.c
  48. 4 15
      lib/rst/interp_float/ressegm2d.c
  49. 2 3
      raster/r.basins.fill/read_map.c
  50. 1 3
      raster/r.bitpattern/main.c
  51. 1 3
      raster/r.buffer/read_map.c
  52. 1 3
      raster/r.buffer/write_map.c
  53. 1 2
      raster/r.category/cats.c
  54. 1 3
      raster/r.clump/clump.c
  55. 2 6
      raster/r.colors/stats.c
  56. 3 5
      raster/r.composite/main.c
  57. 1 2
      raster/r.compress/main.c
  58. 5 11
      raster/r.cost/main.c
  59. 3 4
      raster/r.covar/main.c
  60. 3 4
      raster/r.cross/cross.c
  61. 1 2
      raster/r.cross/renumber.c
  62. 2 3
      raster/r.describe/describe.c
  63. 2 4
      raster/r.distance/distance.c
  64. 1 2
      raster/r.distance/edges.c
  65. 14 14
      raster/r.drain/tinf.c
  66. 8 8
      raster/r.drain/tinf.h
  67. 14 14
      raster/r.fill.dir/tinf.c
  68. 8 8
      raster/r.fill.dir/tinf.h
  69. 5 11
      raster/r.his/main.c
  70. 2 6
      raster/r.lake/main.c
  71. 2 6
      raster/r.los/main.c
  72. 1 2
      raster/r.mapcalc/map.c
  73. 1 2
      raster/r.mfilter/getrow.c
  74. 1 5
      raster/r.null/main.c
  75. 2 4
      raster/r.out.arc/main.c
  76. 3 6
      raster/r.out.ascii/formspecific.c
  77. 1 2
      raster/r.out.bin/main.c
  78. 6 30
      raster/r.out.gdal/export_band.c
  79. 3 12
      raster/r.out.gridatb/file_io.c
  80. 1 2
      raster/r.out.mat/main.c
  81. 1 3
      raster/r.out.mpeg/main.c
  82. 1 2
      raster/r.out.png/main.c
  83. 1 2
      raster/r.out.pov/main.c
  84. 2 5
      raster/r.out.ppm/main.c
  85. 1 2
      raster/r.out.ppm3/main.c
  86. 3 6
      raster/r.out.tiff/main.c
  87. 9 36
      raster/r.out.vtk/writeascii.c
  88. 2 6
      raster/r.patch/main.c
  89. 2 2
      raster/r.profile/read_rast.c
  90. 1 2
      raster/r.proj/readcell.c
  91. 6 8
      raster/r.random/count.c
  92. 3 9
      raster/r.random/random.c
  93. 1 5
      raster/r.resamp.rst/main.c
  94. 1 2
      raster/r.resample/main.c
  95. 1 2
      raster/r.rescale.eq/get_stats.c
  96. 1 2
      raster/r.rescale/get_range.c
  97. 10 20
      raster/r.ros/main.c
  98. 1 2
      raster/r.spread/collect_ori.c
  99. 6 12
      raster/r.spread/main.c
  100. 0 0
      raster/r.spreadpath/main.c

+ 8 - 13
display/d.his/main.c

@@ -187,19 +187,14 @@ int main(int argc, char **argv)
     for (atrow = 0; atrow < window.rows;) {
     for (atrow = 0; atrow < window.rows;) {
 	G_percent(atrow, window.rows, 2);
 	G_percent(atrow, window.rows, 2);
 
 
-	if (Rast_get_row_colors
-	    (hue_file, atrow, &hue_colors, hue_r, hue_g, hue_b, hue_n) < 0)
-	    G_fatal_error(_("Error reading hue data"));
-
-	if (int_used &&
-	    (Rast_get_row_colors
-	     (int_file, atrow, &int_colors, int_r, dummy, dummy, int_n) < 0))
-	    G_fatal_error(_("Error reading intensity data"));
-
-	if (sat_used &&
-	    (Rast_get_row_colors
-	     (sat_file, atrow, &sat_colors, sat_r, dummy, dummy, sat_n) < 0))
-	    G_fatal_error(_("Error reading saturation data"));
+	Rast_get_row_colors
+	    (hue_file, atrow, &hue_colors, hue_r, hue_g, hue_b, hue_n);
+
+	if (int_used)
+	    Rast_get_row_colors(int_file, atrow, &int_colors, int_r, dummy, dummy, int_n);
+
+	if (sat_used)
+	    Rast_get_row_colors(sat_file, atrow, &sat_colors, sat_r, dummy, dummy, sat_n);
 
 
 	for (atcol = 0; atcol < window.cols; atcol++) {
 	for (atcol = 0; atcol < window.cols; atcol++) {
 	    if (nulldraw->answer) {
 	    if (nulldraw->answer) {

+ 3 - 6
display/d.nviz/main.c

@@ -440,8 +440,7 @@ int read_rast
 
 
     if (data_type == CELL_TYPE) {
     if (data_type == CELL_TYPE) {
 	cell = Rast_allocate_c_buf();
 	cell = Rast_allocate_c_buf();
-	if (Rast_get_c_row(fd, cell, row) < 0)
-	    exit(1);
+	Rast_get_c_row(fd, cell, row);
 
 
 	if (Rast_is_c_null_value(&cell[col]))
 	if (Rast_is_c_null_value(&cell[col]))
 	    camera_height = (double)9999.;
 	    camera_height = (double)9999.;
@@ -451,8 +450,7 @@ int read_rast
 
 
     if (data_type == FCELL_TYPE) {
     if (data_type == FCELL_TYPE) {
 	fcell = Rast_allocate_f_buf();
 	fcell = Rast_allocate_f_buf();
-	if (Rast_get_f_row(fd, fcell, row) < 0)
-	    exit(1);
+	Rast_get_f_row(fd, fcell, row);
 	if (Rast_is_f_null_value(&fcell[col]))
 	if (Rast_is_f_null_value(&fcell[col]))
 	    camera_height = (double)9999.;
 	    camera_height = (double)9999.;
 	else
 	else
@@ -461,8 +459,7 @@ int read_rast
 
 
     if (data_type == DCELL_TYPE) {
     if (data_type == DCELL_TYPE) {
 	dcell = Rast_allocate_d_buf();
 	dcell = Rast_allocate_d_buf();
-	if (Rast_get_d_row(fd, dcell, row) < 0)
-	    exit(1);
+	Rast_get_d_row(fd, dcell, row);
 	if (Rast_is_d_null_value(&dcell[col]))
 	if (Rast_is_d_null_value(&dcell[col]))
 	    camera_height = (double)9999.;
 	    camera_height = (double)9999.;
 	else
 	else

+ 1 - 2
display/d.rgb/main.c

@@ -110,8 +110,7 @@ int main(int argc, char **argv)
 	G_percent(row, window.rows, 5);
 	G_percent(row, window.rows, 5);
 
 
 	for (i = 0; i < 3; i++)
 	for (i = 0; i < 3; i++)
-	    if (Rast_get_row(B[i].file, B[i].array, row, B[i].type) < 0)
-		G_fatal_error(_("Error reading row of data"));
+	    Rast_get_row(B[i].file, B[i].array, row, B[i].type);
 
 
 	if (row == next_row)
 	if (row == next_row)
 	    next_row = D_draw_raster_RGB(next_row,
 	    next_row = D_draw_raster_RGB(next_row,

+ 7 - 12
display/d.what.rast/what.c

@@ -56,17 +56,14 @@ int what(int once, int terse, int colrow, char *fs, int width, int mwidth)
 		G_message(_("You are clicking outside the map"));
 		G_message(_("You are clicking outside the map"));
 		continue;
 		continue;
 	    }
 	    }
-	    if (Rast_get_c_row(fd[i], buf, row) < 0)
-		show_cat(width, mwidth, name[i], mapset[i], null_cell,
-			 "ERROR reading raster map", terse, fs, map_type[i]);
-	    else if (map_type[i] == CELL_TYPE) {
+	    Rast_get_c_row(fd[i], buf, row);
+	    if (map_type[i] == CELL_TYPE) {
 		show_cat(width, mwidth, name[i], mapset[i], buf[col],
 		show_cat(width, mwidth, name[i], mapset[i], buf[col],
 			 Rast_get_c_cat(&buf[col], &cats[i]), terse, fs,
 			 Rast_get_c_cat(&buf[col], &cats[i]), terse, fs,
 			 map_type[i]);
 			 map_type[i]);
 		continue;
 		continue;
 	    }
 	    }
 	    else {		/* fp map */
 	    else {		/* fp map */
-
 		show_cat(width, mwidth, name[i], mapset[i], buf[col],
 		show_cat(width, mwidth, name[i], mapset[i], buf[col],
 			 "", terse, fs, map_type[i]);
 			 "", terse, fs, map_type[i]);
 	    }
 	    }
@@ -74,13 +71,11 @@ int what(int once, int terse, int colrow, char *fs, int width, int mwidth)
 	    if (map_type[i] == CELL_TYPE)
 	    if (map_type[i] == CELL_TYPE)
 		continue;
 		continue;
 
 
-	    if (Rast_get_d_row(fd[i], dbuf, row) < 0)
-		show_dval(width, mwidth, name[i], mapset[i], null_dcell,
-			  "ERROR reading fcell file", terse, fs);
-	    else
-		show_dval(width, mwidth, name[i], mapset[i], dbuf[col],
-			  Rast_get_d_cat(&dbuf[col], &cats[i]), terse,
-			  fs);
+	    Rast_get_d_row(fd[i], dbuf, row);
+
+	    show_dval(width, mwidth, name[i], mapset[i], dbuf[col],
+		      Rast_get_d_cat(&dbuf[col], &cats[i]), terse,
+		      fs);
 	}
 	}
     }
     }
     while (!once);
     while (!once);

+ 1 - 3
doc/raster/r.example/main.c

@@ -135,9 +135,7 @@ int main(int argc, char *argv[])
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
 	/* read input map */
 	/* read input map */
-	if (Rast_get_row(infd, inrast, row, data_type) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), name,
-			  row);
+	Rast_get_row(infd, inrast, row, data_type);
 
 
 	/* process the data */
 	/* process the data */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {

+ 1 - 2
general/g.region/zoom.c

@@ -29,8 +29,7 @@ int zoom(struct Cell_head *window, const char *name, const char *mapset)
     left = ncols;
     left = ncols;
     right = -1;
     right = -1;
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_row(fd, rast_ptr = raster, row, map_type) < 0)
-	    G_fatal_error(_("Could not read from <%s>"), name);
+	Rast_get_row(fd, rast_ptr = raster, row, map_type);
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    if (!Rast_is_null_value(rast_ptr, map_type))
 	    if (!Rast_is_null_value(rast_ptr, map_type))
 		break;
 		break;

+ 6 - 12
imagery/i.albedo/main.c

@@ -185,12 +185,9 @@ int main(int argc, char *argv[])
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
 	    /* read input map */
 	    /* read input map */
-	    for (i = 1; i <= nfiles; i++) {
-		if ((Rast_get_row(
-			 infd[i], inrast[i], row, in_data_type[i])) < 0)
-		    G_fatal_error(_("Unable to read raster map <%s> row %d >"),
-				  name, row);
-	    }
+	    for (i = 1; i <= nfiles; i++)
+		Rast_get_row(infd[i], inrast[i], row, in_data_type[i]);
+
 	    /*process the data */
 	    /*process the data */
 	    for (col = 0; col < ncols; col++) {
 	    for (col = 0; col < ncols; col++) {
 		for (i = 1; i <= nfiles; i++) {
 		for (i = 1; i <= nfiles; i++) {
@@ -343,12 +340,9 @@ int main(int argc, char *argv[])
 
 
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	/* read input map */
 	/* read input map */
-	for (i = 1; i <= nfiles; i++) {
-	    if ((Rast_get_row(
-		     infd[i], inrast[i], row, in_data_type[i])) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      name, row);
-	}
+	for (i = 1; i <= nfiles; i++)
+	    Rast_get_row(infd[i], inrast[i], row, in_data_type[i]);
+
 	/*process the data */
 	/*process the data */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    for (i = 1; i <= nfiles; i++) {
 	    for (i = 1; i <= nfiles; i++) {

+ 3 - 9
imagery/i.atcorr/main.cpp

@@ -304,21 +304,15 @@ static void process_raster (int ifd, InputMask imask, ScaleRange iscale,
 	G_percent(row, nrows, 1);     /* keep the user informed of our progress */
 	G_percent(row, nrows, 1);     /* keep the user informed of our progress */
 		
 		
         /* read the next row */
         /* read the next row */
-	if(Rast_get_row(ifd, buf, row, FCELL_TYPE) < 0)
-	    G_fatal_error (_("Unable to read input raster map row %d"),
-			     row);
+	Rast_get_row(ifd, buf, row, FCELL_TYPE);
 
 
         /* read the next row of elevation values */
         /* read the next row of elevation values */
         if(ialt_fd >= 0)
         if(ialt_fd >= 0)
-	    if(Rast_get_row(ialt_fd, alt, row, FCELL_TYPE) < 0)
-		G_fatal_error (_("Unable to read elevation raster map row %d"),
-			       row);
+	    Rast_get_row(ialt_fd, alt, row, FCELL_TYPE);
 
 
         /* read the next row of elevation values */
         /* read the next row of elevation values */
         if(ivis_fd >= 0)
         if(ivis_fd >= 0)
-	    if(Rast_get_row(ivis_fd, vis, row, FCELL_TYPE) < 0)
-		G_fatal_error (_("Unable to read visibility raster map row %d"),
-			       row);
+	    Rast_get_row(ivis_fd, vis, row, FCELL_TYPE);
 
 
         /* loop over all the values in the row */
         /* loop over all the values in the row */
 	for(col = 0; col < ncols; col++)
 	for(col = 0; col < ncols; col++)

+ 6 - 12
imagery/i.biomass/main.c

@@ -138,18 +138,12 @@ int main(int argc, char *argv[])
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	
 	
         /* read input maps */ 
         /* read input maps */ 
-        if (Rast_get_d_row(infd_fpar, inrast_fpar, row)< 0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"),fpar,row);
-	if (Rast_get_d_row(infd_luf,inrast_luf,row)<0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"),luf,row);
-	if (Rast_get_d_row(infd_lat, inrast_lat, row) < 0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"),lat,row);
-	if (Rast_get_d_row(infd_doy, inrast_doy, row) < 0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"),doy,row);
-	if (Rast_get_d_row(infd_tsw, inrast_tsw, row) < 0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"),tsw,row);
-	if (Rast_get_d_row(infd_wa,inrast_wa,row)<0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"),wa,row); 
+        Rast_get_d_row(infd_fpar, inrast_fpar, row);
+	Rast_get_d_row(infd_luf,inrast_luf,row);
+	Rast_get_d_row(infd_lat, inrast_lat, row);
+	Rast_get_d_row(infd_doy, inrast_doy, row);
+	Rast_get_d_row(infd_tsw, inrast_tsw, row);
+	Rast_get_d_row(infd_wa,inrast_wa,row); 
         /*process the data */ 
         /*process the data */ 
         for (col = 0; col < ncols; col++)
         for (col = 0; col < ncols; col++)
         {
         {

+ 1 - 2
imagery/i.cca/transform.c

@@ -26,8 +26,7 @@ transform(int *datafds, int *outfds, int rows, int cols,
     for (i = 0; i < rows; i++) {
     for (i = 0; i < rows; i++) {
 	/* get one row of data */
 	/* get one row of data */
 	for (j = 0; j < bands; j++)
 	for (j = 0; j < bands; j++)
-	    if (Rast_get_c_row(datafds[j], rowbufs[j], i) < 0)
-		G_fatal_error(_("Error reading cell map during transform."));
+	    Rast_get_c_row(datafds[j], rowbufs[j], i);
 
 
 	/* transform each cell in the row */
 	/* transform each cell in the row */
 	for (l = 0; l < cols; l++) {
 	for (l = 0; l < cols; l++) {

+ 1 - 2
imagery/i.class/draw_cell.c

@@ -47,8 +47,7 @@ int draw_cell(View * view, int overlay)
     D_set_overlay_mode(!overlay);
     D_set_overlay_mode(!overlay);
     D_cell_draw_setup(top, top + nrows, left, left + ncols);
     D_cell_draw_setup(top, top + nrows, left, left + ncols);
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_d_row_nomask(fd, dcell, row) < 0)
-	    break;
+	Rast_get_d_row_nomask(fd, dcell, row);
 	D_draw_d_raster(row, dcell, &colr);
 	D_draw_d_raster(row, dcell, &colr);
     }
     }
     D_cell_draw_end();
     D_cell_draw_end();

+ 2 - 3
imagery/i.class/readbands.c

@@ -5,11 +5,10 @@
 
 
 int readbands(int nbands, int cur)
 int readbands(int nbands, int cur)
 {
 {
-    register int i;
+    int i;
 
 
     for (i = 0; i < nbands; i++)
     for (i = 0; i < nbands; i++)
-	if (Rast_get_c_row_nomask(Bandfd[i], Bandbuf[i], cur) < 0)
-	    G_fatal_error(_("Error reading raster map in function readbands."));
+	Rast_get_c_row_nomask(Bandfd[i], Bandbuf[i], cur);
 
 
     return 0;
     return 0;
 }
 }

+ 1 - 3
imagery/i.cluster/main.c

@@ -277,9 +277,7 @@ int main(int argc, char *argv[])
     for (row = sample_rows - 1; row < nrows; row += sample_rows) {
     for (row = sample_rows - 1; row < nrows; row += sample_rows) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	for (n = 0; n < ref.nfiles; n++)
 	for (n = 0; n < ref.nfiles; n++)
-	    if (Rast_get_d_row(cellfd[n], cell[n], row) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"),
-			      row);
+	    Rast_get_d_row(cellfd[n], cell[n], row);
 	for (col = sample_cols - 1; col < ncols; col += sample_cols) {
 	for (col = sample_cols - 1; col < ncols; col += sample_cols) {
 	    count++;
 	    count++;
 	    for (n = 0; n < ref.nfiles; n++)
 	    for (n = 0; n < ref.nfiles; n++)

+ 3 - 6
imagery/i.eb.eta/main.c

@@ -101,12 +101,9 @@ int main(int argc, char *argv[])
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	
 	
 	/* read input maps */ 
 	/* read input maps */ 
-	if (Rast_get_d_row(infd_rnetday,inrast_rnetday,row)<0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"), rnetday, row);
-	if (Rast_get_d_row(infd_evapfr,inrast_evapfr,row)<0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"), evapfr, row);
-	if (Rast_get_d_row(infd_tempk,inrast_tempk,row)<0)
-	    G_fatal_error(_("Unable to read from <%s> row %d"), tempk, row);
+	Rast_get_d_row(infd_rnetday,inrast_rnetday,row);
+	Rast_get_d_row(infd_evapfr,inrast_evapfr,row);
+	Rast_get_d_row(infd_tempk,inrast_tempk,row);
 	
 	
     /*process the data */ 
     /*process the data */ 
     for (col = 0; col < ncols; col++)
     for (col = 0; col < ncols; col++)

+ 3 - 6
imagery/i.eb.evapfr/main.c

@@ -129,12 +129,9 @@ int main(int argc, char *argv[])
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	
 	
         /* read input maps */ 
         /* read input maps */ 
-        if (Rast_get_d_row(infd_rnet, inrast_rnet, row)<0)
-	  G_fatal_error(_("Unable to read raster map <%s> row %d"), rnet, row);
-	if (Rast_get_d_row(infd_g0, inrast_g0, row) < 0)
-	  G_fatal_error(_("Unable to read raster map <%s> row %d"), g0, row);
-	if (Rast_get_d_row(infd_h0, inrast_h0, row) < 0)
-	  G_fatal_error(_("Unable to read raster map <%s> row %d"), h0, row);
+        Rast_get_d_row(infd_rnet, inrast_rnet, row);
+	Rast_get_d_row(infd_g0, inrast_g0, row);
+	Rast_get_d_row(infd_h0, inrast_h0, row);
 	
 	
         /*process the data */ 
         /*process the data */ 
         for (col = 0; col < ncols; col++)
         for (col = 0; col < ncols; col++)

+ 15 - 30
imagery/i.eb.h_SEBAL01/main.c

@@ -271,12 +271,9 @@ int main(int argc, char *argv[])
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
 	    DCELL d_t0dem;
 	    DCELL d_t0dem;
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
-	    if (Rast_get_d_row(infd_t0dem,inrast_t0dem,row)<0)
-	      G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
-	    if (Rast_get_d_row(infd_Rn,inrast_Rn,row)<0)
-	      G_fatal_error(_("Unable to read raster map <%s> row %d"), Rn, row);
-	    if (Rast_get_d_row(infd_g0,inrast_g0,row)<0)
-	      G_fatal_error(_("Unable to read raster map <%s> row %d"), g0, row);
+	    Rast_get_d_row(infd_t0dem,inrast_t0dem,row);
+	    Rast_get_d_row(infd_Rn,inrast_Rn,row);
+	    Rast_get_d_row(infd_g0,inrast_g0,row);
 	    /*process the data */
 	    /*process the data */
 	    for (col = 0; col < ncols; col++) {
 	    for (col = 0; col < ncols; col++) {
 		d_t0dem = ((DCELL *) inrast_t0dem)[col];
 		d_t0dem = ((DCELL *) inrast_t0dem)[col];
@@ -344,12 +341,9 @@ int main(int argc, char *argv[])
     }
     }
     rowDry = row;
     rowDry = row;
     colDry = col;
     colDry = col;
-    if (Rast_get_d_row(infd_Rn, inrast_Rn, row) < 0)
-	G_fatal_error(_("Unable to read raster map <%s> row %d"), Rn, row);
-    if (Rast_get_d_row(infd_g0, inrast_g0, row) < 0)
-	G_fatal_error(_("Unable to read raster map <%s> row %d"), g0, row);
-    if (Rast_get_d_row(infd_t0dem, inrast_t0dem, row) < 0)
-	G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
+    Rast_get_d_row(infd_Rn, inrast_Rn, row);
+    Rast_get_d_row(infd_g0, inrast_g0, row);
+    Rast_get_d_row(infd_t0dem, inrast_t0dem, row);
     d_Rn_dry = ((DCELL *) inrast_Rn)[col];
     d_Rn_dry = ((DCELL *) inrast_Rn)[col];
     d_g0_dry = ((DCELL *) inrast_g0)[col];
     d_g0_dry = ((DCELL *) inrast_g0)[col];
     d_t0dem_dry = ((DCELL *) inrast_t0dem)[col];
     d_t0dem_dry = ((DCELL *) inrast_t0dem)[col];
@@ -367,8 +361,7 @@ int main(int argc, char *argv[])
     }
     }
     rowWet = row;
     rowWet = row;
     colWet = col;
     colWet = col;
-    if (Rast_get_d_row(infd_t0dem, inrast_t0dem, row) < 0)
-	G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
+    Rast_get_d_row(infd_t0dem, inrast_t0dem, row);
     d_t0dem_wet = ((DCELL *) inrast_t0dem)[col];
     d_t0dem_wet = ((DCELL *) inrast_t0dem)[col];
     /* END OF MANUAL WET/DRY PIXELS */
     /* END OF MANUAL WET/DRY PIXELS */
     double h_dry;
     double h_dry;
@@ -389,10 +382,8 @@ int main(int argc, char *argv[])
 	DCELL d_u5;
 	DCELL d_u5;
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	/* read a line input maps into buffers */
 	/* read a line input maps into buffers */
-	if (Rast_get_d_row(infd_z0m, inrast_z0m, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
-	if (Rast_get_d_row(infd_t0dem, inrast_t0dem,row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
+	Rast_get_d_row(infd_z0m, inrast_z0m, row);
+	Rast_get_d_row(infd_t0dem, inrast_t0dem,row);
 	/* read every cell in the line buffers */
 	/* read every cell in the line buffers */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
             d_z0m = ((DCELL *) inrast_z0m)[col];
             d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -452,10 +443,8 @@ int main(int argc, char *argv[])
 	DCELL d_u5;
 	DCELL d_u5;
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	/* read a line input maps into buffers */
 	/* read a line input maps into buffers */
-	if (Rast_get_d_row(infd_z0m, inrast_z0m, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
-	if (Rast_get_d_row(infd_t0dem, inrast_t0dem,row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
+	Rast_get_d_row(infd_z0m, inrast_z0m, row);
+	Rast_get_d_row(infd_t0dem, inrast_t0dem,row);
 	/* read every cell in the line buffers */
 	/* read every cell in the line buffers */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
             d_z0m = ((DCELL *) inrast_z0m)[col];
             d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -521,10 +510,8 @@ int main(int argc, char *argv[])
 	DCELL d_u5;
 	DCELL d_u5;
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	/* read a line input maps into buffers */
 	/* read a line input maps into buffers */
-	if (Rast_get_d_row(infd_z0m,inrast_z0m,row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
-	if (Rast_get_d_row(infd_t0dem,inrast_t0dem,row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
+	Rast_get_d_row(infd_z0m,inrast_z0m,row);
+	Rast_get_d_row(infd_t0dem,inrast_t0dem,row);
 	/* read every cell in the line buffers */
 	/* read every cell in the line buffers */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
             d_z0m = ((DCELL *) inrast_z0m)[col];
             d_z0m = ((DCELL *) inrast_z0m)[col];
@@ -591,10 +578,8 @@ int main(int argc, char *argv[])
 	DCELL d;		/* Output pixel */
 	DCELL d;		/* Output pixel */
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	/* read a line input maps into buffers */
 	/* read a line input maps into buffers */
-	if (Rast_get_d_row(infd_z0m, inrast_z0m, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), z0m, row);
-	if (Rast_get_d_row(infd_t0dem,inrast_t0dem,row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), t0dem, row);
+	Rast_get_d_row(infd_z0m, inrast_z0m, row);
+	Rast_get_d_row(infd_t0dem,inrast_t0dem,row);
 	/* read every cell in the line buffers */
 	/* read every cell in the line buffers */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
             d_z0m = ((DCELL *) inrast_z0m)[col];
             d_z0m = ((DCELL *) inrast_z0m)[col];

+ 5 - 15
imagery/i.eb.soilheatflux/main.c

@@ -127,21 +127,11 @@ int main(int argc, char *argv[])
 	DCELL d_time;
 	DCELL d_time;
 	G_percent(row, nrows, 2);	
 	G_percent(row, nrows, 2);	
         /* read input maps */ 
         /* read input maps */ 
-        if (Rast_get_d_row(infd_albedo, inrast_albedo, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  albedo, row);
-	if (Rast_get_d_row(infd_ndvi, inrast_ndvi, row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  ndvi, row);
-	if (Rast_get_d_row(infd_tempk, inrast_tempk, row)< 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  tempk, row);
-	if (Rast_get_d_row(infd_rnet, inrast_rnet, row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  rnet, row);
-	if (Rast_get_d_row(infd_time, inrast_time, row)<0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  time, row);
+        Rast_get_d_row(infd_albedo, inrast_albedo, row);
+	Rast_get_d_row(infd_ndvi, inrast_ndvi, row);
+	Rast_get_d_row(infd_tempk, inrast_tempk, row);
+	Rast_get_d_row(infd_rnet, inrast_rnet, row);
+	Rast_get_d_row(infd_time, inrast_time, row);
         /*process the data */ 
         /*process the data */ 
         for (col = 0; col < ncols; col++)
         for (col = 0; col < ncols; col++)
         {
         {

+ 1 - 2
imagery/i.emissivity/main.c

@@ -81,8 +81,7 @@ int main(int argc, char *argv[])
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	
 	
         /* read input maps */ 
         /* read input maps */ 
-        if (Rast_get_row(infd,inr,row,DCELL_TYPE)< 0)
-	    G_fatal_error(_("Could not read from <%s>"), ndvi);
+        Rast_get_row(infd,inr,row,DCELL_TYPE);
 	
 	
         /*process the data */ 
         /*process the data */ 
         for (col = 0; col < ncols; col++)
         for (col = 0; col < ncols; col++)

+ 3 - 6
imagery/i.evapo.time_integration/main.c

@@ -259,16 +259,13 @@ int main(int argc, char *argv[])
 
 
 	/* read input map */
 	/* read input map */
 	for (i = 1; i <= nfiles; i++) 
 	for (i = 1; i <= nfiles; i++) 
-	    if ((Rast_get_d_row(infd[i], inrast[i], row)) <	0) 
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), name, row);
+	    Rast_get_d_row(infd[i], inrast[i], row);
 	
 	
 	for (i = 1; i <= nfiles1; i++) 
 	for (i = 1; i <= nfiles1; i++) 
-	    if ((Rast_get_d_row(infd1[i], inrast1[i], row)) < 0) 
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), name1, row);
+	    Rast_get_d_row(infd1[i], inrast1[i], row);
 
 
 	for (i = 1; i <= nfiles2; i++) 
 	for (i = 1; i <= nfiles2; i++) 
-	    if ((Rast_get_d_row (infd2[i], inrast2[i], row)) < 0) 
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), name2, row);
+	    Rast_get_d_row (infd2[i], inrast2[i], row);
 
 
 	/*process the data */
 	/*process the data */
 	for (col = 0; col < ncols; col++) 
 	for (col = 0; col < ncols; col++) 

+ 1 - 3
imagery/i.fft/main.c

@@ -129,9 +129,7 @@ int main(int argc, char *argv[])
     G_message(_("Reading the raster map <%s>..."),
     G_message(_("Reading the raster map <%s>..."),
 	      Cellmap_orig);
 	      Cellmap_orig);
     for (i = 0; i < rows; i++) {
     for (i = 0; i < rows; i++) {
-	if (Rast_get_d_row(inputfd, cell_real, i) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  Cellmap_orig, i);
+	Rast_get_d_row(inputfd, cell_real, i);
 	for (j = 0; j < cols; j++) {
 	for (j = 0; j < cols; j++) {
 	    data[C(i, j)][0] = cell_real[j];
 	    data[C(i, j)][0] = cell_real[j];
 	    data[C(i, j)][1] = 0.0;
 	    data[C(i, j)][1] = 0.0;

+ 1 - 3
imagery/i.gensig/covariance.c

@@ -33,9 +33,7 @@ int compute_covariances(struct files *files, struct Signature *S)
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	read_training_map(class, row, ncols, files);
 	read_training_map(class, row, ncols, files);
 	for (b = 0; b < files->nbands; b++)	/* NOTE: files->nbands == S->nbands */
 	for (b = 0; b < files->nbands; b++)	/* NOTE: files->nbands == S->nbands */
-	    if (Rast_get_d_row(files->band_fd[b], files->band_cell[b], row) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"),
-			      row);
+	    Rast_get_d_row(files->band_fd[b], files->band_cell[b], row);
 	for (b1 = 0; b1 < files->nbands; b1++) {
 	for (b1 = 0; b1 < files->nbands; b1++) {
 	    cell1 = files->band_cell[b1];
 	    cell1 = files->band_cell[b1];
 	    for (b2 = 0; b2 <= b1; b2++) {	/* only need to calculate the lower half */
 	    for (b2 = 0; b2 <= b1; b2++) {	/* only need to calculate the lower half */

+ 1 - 3
imagery/i.gensig/get_train.c

@@ -32,9 +32,7 @@ int get_training_classes(struct files *files, struct Signature *S)
     G_message(_("Finding training classes..."));
     G_message(_("Finding training classes..."));
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(fd, cell, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), cell,
-			  row);
+	Rast_get_c_row(fd, cell, row);
 	Rast_update_cell_stats(cell, ncols, &cell_stats);
 	Rast_update_cell_stats(cell, ncols, &cell_stats);
     }
     }
     G_percent(nrows, nrows, 2);
     G_percent(nrows, nrows, 2);

+ 1 - 2
imagery/i.gensig/means.c

@@ -29,8 +29,7 @@ int compute_means(struct files *files, struct Signature *S)
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	read_training_map(class, row, ncols, files);
 	read_training_map(class, row, ncols, files);
 	for (b = 0; b < files->nbands; b++) {	/* NOTE: files->nbands == S->nbands */
 	for (b = 0; b < files->nbands; b++) {	/* NOTE: files->nbands == S->nbands */
-	    if (Rast_get_d_row(files->band_fd[b], cell = files->band_cell[b], row) < 0)
-		exit(1);
+	    Rast_get_d_row(files->band_fd[b], cell = files->band_cell[b], row);
 	    for (col = 0; col < ncols; col++) {
 	    for (col = 0; col < ncols; col++) {
 		if (Rast_is_d_null_value(&cell[col])) {
 		if (Rast_is_d_null_value(&cell[col])) {
 		    n_nulls++;
 		    n_nulls++;

+ 1 - 3
imagery/i.gensig/read_train.c

@@ -9,9 +9,7 @@
 
 
 int read_training_map(CELL * class, int row, int ncols, struct files *files)
 int read_training_map(CELL * class, int row, int ncols, struct files *files)
 {
 {
-    if (Rast_get_c_row(files->train_fd, files->train_cell, row) < 0)
-	G_fatal_error(_("Unable to read raster map row %d"),
-		      row);
+    Rast_get_c_row(files->train_fd, files->train_cell, row);
     lookup_class(files->train_cell, ncols, files->training_cats, files->ncats,
     lookup_class(files->train_cell, ncols, files->training_cats, files->ncats,
 		 class);
 		 class);
 
 

+ 1 - 3
imagery/i.gensigset/get_train.c

@@ -35,9 +35,7 @@ int get_training_classes(struct parms *parms,
     G_message(_("Finding training classes..."));
     G_message(_("Finding training classes..."));
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(fd, cell, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), cell,
-			  row);
+	Rast_get_c_row(fd, cell, row);
 	Rast_update_cell_stats(cell, ncols, &cell_stats);
 	Rast_update_cell_stats(cell, ncols, &cell_stats);
     }
     }
     G_percent(nrows, nrows, 2);
     G_percent(nrows, nrows, 2);

+ 1 - 4
imagery/i.gensigset/read_data.c

@@ -25,10 +25,7 @@ int read_data(struct files *files, struct SigSet *S)
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 	read_training_map(class, row, ncols, files);
 	read_training_map(class, row, ncols, files);
 	for (b = 0; b < files->nbands; b++)
 	for (b = 0; b < files->nbands; b++)
-	    if (Rast_get_d_row
-		(files->band_fd[b], files->band_cell[b], row) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"),
-			      row);
+	    Rast_get_d_row(files->band_fd[b], files->band_cell[b], row);
 
 
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    n = class[col];
 	    n = class[col];

+ 1 - 3
imagery/i.gensigset/read_train.c

@@ -9,9 +9,7 @@
 
 
 int read_training_map(CELL * class, int row, int ncols, struct files *files)
 int read_training_map(CELL * class, int row, int ncols, struct files *files)
 {
 {
-    if (Rast_get_c_row(files->train_fd, files->train_cell, row) < 0)
-	G_fatal_error(_("Unable to read raster map row %d"),
-		      row);
+    Rast_get_c_row(files->train_fd, files->train_cell, row);
     lookup_class(files->train_cell, ncols, files->training_cats, files->ncats,
     lookup_class(files->train_cell, ncols, files->training_cats, files->ncats,
 		 class);
 		 class);
 
 

+ 1 - 2
imagery/i.his.rgb/main.c

@@ -94,8 +94,7 @@ int main(int argc, char **argv)
 
 
 	/* read in a row from each cell map */
 	/* read in a row from each cell map */
 	for (band = 0; band < 3; band++)
 	for (band = 0; band < 3; band++)
-	    if (Rast_get_c_row(fd_input[band], rowbuffer[band], i) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"), i);
+	    Rast_get_c_row(fd_input[band], rowbuffer[band], i);
 
 
 	/* process this row of the map */
 	/* process this row of the map */
 	his2rgb(rowbuffer, cols);
 	his2rgb(rowbuffer, cols);

+ 2 - 6
imagery/i.ifft/main.c

@@ -140,12 +140,8 @@ int main(int argc, char *argv[])
     /* Read in cell map values */
     /* Read in cell map values */
     G_message(_("Reading raster maps..."));
     G_message(_("Reading raster maps..."));
     for (i = 0; i < rows; i++) {
     for (i = 0; i < rows; i++) {
-	if (Rast_get_d_row(realfd, cell_real, i) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  Cellmap_real, i);
-	if (Rast_get_d_row(imagfd, cell_imag, i) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  Cellmap_imag, i);
+	Rast_get_d_row(realfd, cell_real, i);
+	Rast_get_d_row(imagfd, cell_imag, i);
 	for (j = 0; j < cols; j++) {
 	for (j = 0; j < cols; j++) {
 	    data[C(i, j)][0] = cell_real[j];
 	    data[C(i, j)][0] = cell_real[j];
 	    data[C(i, j)][1] = cell_imag[j];
 	    data[C(i, j)][1] = cell_imag[j];

+ 1 - 2
imagery/i.latlong/main.c

@@ -123,8 +123,7 @@ int main(int argc, char *argv[])
     {
     {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_d_row(infd, inrast, row) < 0)
-	    G_fatal_error(_("Could not read from <%s>"), in);
+	Rast_get_d_row(infd, inrast, row);
 
 
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)
         {
         {

+ 1 - 3
imagery/i.maxlik/main.c

@@ -109,9 +109,7 @@ int main(int argc, char *argv[])
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
 	for (band = 0; band < Ref.nfiles; band++)
 	for (band = 0; band < Ref.nfiles; band++)
-	    if (Rast_get_d_row(cellfd[band], cell[band], row) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"),
-			      row);
+	    Rast_get_d_row(cellfd[band], cell[band], row);
 	
 	
 	classify(class_cell, reject_cell, ncols);
 	classify(class_cell, reject_cell, ncols);
 	Rast_put_row(class_fd, class_cell, CELL_TYPE);
 	Rast_put_row(class_fd, class_cell, CELL_TYPE);

+ 1 - 3
imagery/i.modis.qc/main.c

@@ -216,9 +216,7 @@ int main(int argc, char *argv[])
     {
     {
 	CELL c;
 	CELL c;
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(infd, inrast, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  qcchan, row);
+	Rast_get_c_row(infd, inrast, row);
 
 
 	/*process the data */ 
 	/*process the data */ 
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)

+ 4 - 8
imagery/i.pca/main.c

@@ -249,8 +249,7 @@ static int calc_mu(int *fds, double *mu, int bands)
 
 
 	    G_percent(row, rows - 1, 2);
 	    G_percent(row, rows - 1, 2);
 
 
-	    if (Rast_get_row(fds[i], rowbuf, row, maptype) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"), row);
+	    Rast_get_row(fds[i], rowbuf, row, maptype);
 
 
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		/* skip null cells */
 		/* skip null cells */
@@ -299,8 +298,7 @@ static int calc_covariance(int *fds, double **covar, double *mu, int bands)
 
 
 	    G_percent(row, rows - 1, 2);
 	    G_percent(row, rows - 1, 2);
 
 
-	    if (Rast_get_row(fds[j], rowbuf1, row, maptype) < 0)
-		G_fatal_error(_("Unable to read raster map row %d"), row);
+	    Rast_get_row(fds[j], rowbuf1, row, maptype);
 
 
 	    for (k = j; k < bands; k++) {
 	    for (k = j; k < bands; k++) {
 		RASTER_MAP_TYPE maptype2 = Rast_get_map_type(fds[k]);
 		RASTER_MAP_TYPE maptype2 = Rast_get_map_type(fds[k]);
@@ -311,8 +309,7 @@ static int calc_covariance(int *fds, double **covar, double *mu, int bands)
 		if ((rowbuf2 = Rast_allocate_buf(maptype2)) == NULL)
 		if ((rowbuf2 = Rast_allocate_buf(maptype2)) == NULL)
 		    G_fatal_error(_("Unable to allocate memory for row buffer"));
 		    G_fatal_error(_("Unable to allocate memory for row buffer"));
 
 
-		if (Rast_get_row(fds[k], rowbuf2, row, maptype2) < 0)
-		    G_fatal_error(_("Unable to read raster map row %d"), row);
+		Rast_get_row(fds[k], rowbuf2, row, maptype2);
 
 
 		ptr1 = rowbuf1;
 		ptr1 = rowbuf1;
 		ptr2 = rowbuf2;
 		ptr2 = rowbuf2;
@@ -421,8 +418,7 @@ write_pca(double **eigmat, int *inp_fd, char *out_basename,
 		    if (!(rowbuf = Rast_allocate_buf(maptype)))
 		    if (!(rowbuf = Rast_allocate_buf(maptype)))
 			G_fatal_error(_("Unable allocate memory for row buffer"));
 			G_fatal_error(_("Unable allocate memory for row buffer"));
 
 
-		    if (Rast_get_row(inp_fd[j], rowbuf, row, maptype) < 0)
-			G_fatal_error(_("Unable to read raster map row %d"), row);
+		    Rast_get_row(inp_fd[j], rowbuf, row, maptype);
 
 
 		    rowptr = rowbuf;
 		    rowptr = rowbuf;
 		    outptr = outbuf;
 		    outptr = outbuf;

+ 1 - 2
imagery/i.points/drawcell.c

@@ -57,8 +57,7 @@ int drawcell(View * view)
 
 
     D_cell_draw_setup(top, top + nrows, left, left + ncols);
     D_cell_draw_setup(top, top + nrows, left, left + ncols);
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_d_row_nomask(fd, dcell, row) < 0)
-	    break;
+	Rast_get_d_row_nomask(fd, dcell, row);
 	D_draw_d_raster(row, dcell, colors);
 	D_draw_d_raster(row, dcell, colors);
     }
     }
     D_cell_draw_end();
     D_cell_draw_end();

+ 1 - 3
imagery/i.rectify/perform.c

@@ -39,9 +39,7 @@ int perform_georef(int infd, void *rast)
 	   fprintf (stderr, "read row %d\n", row);
 	   fprintf (stderr, "read row %d\n", row);
 	 */
 	 */
 
 
-	if (Rast_get_row_nomask
-	    (infd, G_incr_void_ptr(rast, rast_size), row, map_type) < 0)
-	    return 0;
+	Rast_get_row_nomask(infd, G_incr_void_ptr(rast, rast_size), row, map_type);
 
 
 	for (i = curidx; i < matrix_rows; i++) {
 	for (i = curidx; i < matrix_rows; i++) {
 	    idx = row_idx[i];
 	    idx = row_idx[i];

+ 1 - 2
imagery/i.rgb.his/main.c

@@ -93,8 +93,7 @@ int main(int argc, char **argv)
 	G_percent(i, rows, 2);
 	G_percent(i, rows, 2);
 
 
 	for (band = 0; band < 3; band++)
 	for (band = 0; band < 3; band++)
-	    if (Rast_get_c_row(fd_input[band], rowbuffer[band], i) < 0)
-		G_fatal_error(_("Unable to read raster map row %ld"), i);
+	    Rast_get_c_row(fd_input[band], rowbuffer[band], i);
 
 
 	/* process this row of the map */
 	/* process this row of the map */
 	rgb2his(rowbuffer, cols);
 	rgb2his(rowbuffer, cols);

+ 1 - 4
imagery/i.smap/read_block.c

@@ -14,10 +14,7 @@ int read_block(DCELL *** img,	/* img[band][row[col] */
 
 
     for (band = 0; band < files->nbands; band++) {
     for (band = 0; band < files->nbands; band++) {
 	for (row = region->ymin; row < region->ymax; row++) {
 	for (row = region->ymin; row < region->ymax; row++) {
-	    if (Rast_get_d_row(files->band_fd[band], files->cellbuf, row)
-		< 0)
-		G_fatal_error(_("Unable to read raster map row %d"),
-			      row);
+	    Rast_get_d_row(files->band_fd[band], files->cellbuf, row);
 	    for (col = region->xmin; col < region->xmax; col++)
 	    for (col = region->xmin; col < region->xmax; col++)
 		img[band][row][col] = files->cellbuf[col];
 		img[band][row][col] = files->cellbuf[col];
 	}
 	}

+ 2 - 4
imagery/i.sunhours/main.c

@@ -95,10 +95,8 @@ int main(int argc, char *argv[])
 	DCELL d_doy;
 	DCELL d_doy;
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_row(infd_doy, inrast_doy, row, DCELL_TYPE) < 0)
-	    G_fatal_error(_("Could not read from <%s>"), doy);
-	if (Rast_get_row(infd_lat, inrast_lat, row, DCELL_TYPE) < 0)
-	    G_fatal_error(_("Could not read from <%s>"), lat);
+	Rast_get_row(infd_doy, inrast_doy, row, DCELL_TYPE);
+	Rast_get_row(infd_lat, inrast_lat, row, DCELL_TYPE);
 
 
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)
         {
         {

+ 11 - 28
imagery/i.vi/main.c

@@ -257,34 +257,17 @@ int main(int argc, char *argv[])
 
 
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_d_row(infd_redchan, inrast_redchan, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  redchan, row);
-	if (nirchan) {
-	    if (Rast_get_d_row(infd_nirchan, inrast_nirchan, row) < 0)
-	        G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      nirchan, row);
-        }
-	if (greenchan) {
-	    if (Rast_get_d_row(infd_greenchan, inrast_greenchan, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      greenchan, row);
-	}
-	if (bluechan) {
-	    if (Rast_get_d_row(infd_bluechan, inrast_bluechan, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      bluechan, row);
-	}
-	if (chan5chan) {
-	    if (Rast_get_d_row(infd_chan5chan, inrast_chan5chan, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      chan5chan, row);
-	}
-	if (chan7chan) {
-	    if (Rast_get_d_row(infd_chan7chan, inrast_chan7chan, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      chan7chan, row);
-	}
+	Rast_get_d_row(infd_redchan, inrast_redchan, row);
+	if (nirchan)
+	    Rast_get_d_row(infd_nirchan, inrast_nirchan, row);
+	if (greenchan)
+	    Rast_get_d_row(infd_greenchan, inrast_greenchan, row);
+	if (bluechan)
+	    Rast_get_d_row(infd_bluechan, inrast_bluechan, row);
+	if (chan5chan)
+	    Rast_get_d_row(infd_chan5chan, inrast_chan5chan, row);
+	if (chan7chan)
+	    Rast_get_d_row(infd_chan7chan, inrast_chan7chan, row);
 
 
 	/* process the data */ 
 	/* process the data */ 
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)

+ 1 - 2
imagery/i.vpoints/drawcell.c

@@ -67,8 +67,7 @@ int drawcell(View * view, int initflag)
 
 
     D_cell_draw_setup(top, top + nrows, left, left + ncols);
     D_cell_draw_setup(top, top + nrows, left, left + ncols);
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_d_row_nomask(fd, dcell, row) < 0)
-	    break;
+	Rast_get_d_row_nomask(fd, dcell, row);
 	D_draw_d_raster(row, dcell, colors);
 	D_draw_d_raster(row, dcell, colors);
     }
     }
     D_cell_draw_end();
     D_cell_draw_end();

+ 1 - 2
imagery/i.zc/main.c

@@ -150,8 +150,7 @@ int main(int argc, char *argv[])
     /* Read in cell map values */
     /* Read in cell map values */
     G_message(_("Reading raster map..."));
     G_message(_("Reading raster map..."));
     for (i = 0; i < or; i++) {
     for (i = 0; i < or; i++) {
-	if (Rast_get_c_row(inputfd, cell_row, i) < 0)
-	    G_fatal_error(_("Error while reading input raster map."));
+	Rast_get_c_row(inputfd, cell_row, i);
 
 
 	for (j = 0; j < oc; j++)
 	for (j = 0; j < oc; j++)
 	    *(data[0] + (i * size) + j) = (double)cell_row[j];
 	    *(data[0] + (i * size) + j) = (double)cell_row[j];

+ 12 - 12
include/rasterdefs.h

@@ -297,20 +297,20 @@ int Rast_close_gdal_write_link(struct GDAL_link *);
 void Rast_get_cellhd(const char *, const char *, struct Cell_head *);
 void Rast_get_cellhd(const char *, const char *, struct Cell_head *);
 
 
 /* get_row.c */
 /* get_row.c */
-int Rast_get_row_nomask(int, void *, int, RASTER_MAP_TYPE);
-int Rast_get_c_row_nomask(int, CELL *, int);
-int Rast_get_f_row_nomask(int, FCELL *, int);
-int Rast_get_d_row_nomask(int, DCELL *, int);
-int Rast_get_row(int, void *, int, RASTER_MAP_TYPE);
-int Rast_get_c_row(int, CELL *, int);
-int Rast_get_f_row(int, FCELL *, int);
-int Rast_get_d_row(int, DCELL *, int);
-int Rast_get_null_value_row(int, char *, int);
+void Rast_get_row_nomask(int, void *, int, RASTER_MAP_TYPE);
+void Rast_get_c_row_nomask(int, CELL *, int);
+void Rast_get_f_row_nomask(int, FCELL *, int);
+void Rast_get_d_row_nomask(int, DCELL *, int);
+void Rast_get_row(int, void *, int, RASTER_MAP_TYPE);
+void Rast_get_c_row(int, CELL *, int);
+void Rast_get_f_row(int, FCELL *, int);
+void Rast_get_d_row(int, DCELL *, int);
+void Rast_get_null_value_row(int, char *, int);
 
 
 /* get_row_colr.c */
 /* get_row_colr.c */
-int Rast_get_row_colors(int, int, struct Colors *,
-			    unsigned char *, unsigned char *, unsigned char *,
-			    unsigned char *);
+void Rast_get_row_colors(int, int, struct Colors *,
+			 unsigned char *, unsigned char *, unsigned char *,
+			 unsigned char *);
 /* histo_eq.c */
 /* histo_eq.c */
 void Rast_histogram_eq(const struct Histogram *, unsigned char **,
 void Rast_histogram_eq(const struct Histogram *, unsigned char **,
 		    CELL *, CELL *);
 		    CELL *, CELL *);

+ 1 - 4
lib/gpde/N_arrays_io.c

@@ -95,10 +95,7 @@ N_array_2d *N_read_rast_to_array_2d(char *name, N_array_2d * array)
     for (y = 0; y < rows; y++) {
     for (y = 0; y < rows; y++) {
 	G_percent(y, rows - 1, 10);
 	G_percent(y, rows - 1, 10);
 
 
-	if (!Rast_get_row(map, rast, y, type)) {
-	    Rast_close(map);
-	    G_fatal_error(_("Could not get raster row"));
-	}
+	Rast_get_row(map, rast, y, type);
 
 
 	for (x = 0, ptr = rast; x < cols;
 	for (x = 0, ptr = rast; x < cols;
 	     x++, ptr = G_incr_void_ptr(ptr, Rast_cell_size(type))) {
 	     x++, ptr = G_incr_void_ptr(ptr, Rast_cell_size(type))) {

+ 4 - 8
lib/ogsf/Gs3.c

@@ -834,10 +834,8 @@ int Gs_get_cat_label(const char *filename, int drow, int dcol, char *catstr)
 	if (map_type == CELL_TYPE) {
 	if (map_type == CELL_TYPE) {
 	    buf = Rast_allocate_c_buf();
 	    buf = Rast_allocate_c_buf();
 
 
-	    if (Rast_get_c_row(fd, buf, drow) < 0) {
-		sprintf(catstr, "error");
-	    }
-	    else if (Rast_is_c_null_value(&buf[dcol])) {
+	    Rast_get_c_row(fd, buf, drow);
+	    if (Rast_is_c_null_value(&buf[dcol])) {
 		sprintf(catstr, "(NULL) %s",
 		sprintf(catstr, "(NULL) %s",
 			Rast_get_c_cat(&buf[dcol], &cats));
 			Rast_get_c_cat(&buf[dcol], &cats));
 	    }
 	    }
@@ -853,10 +851,8 @@ int Gs_get_cat_label(const char *filename, int drow, int dcol, char *catstr)
 	    /* fp map */
 	    /* fp map */
 	    dbuf = Rast_allocate_d_buf();
 	    dbuf = Rast_allocate_d_buf();
 
 
-	    if (Rast_get_d_row(fd, dbuf, drow) < 0) {
-		sprintf(catstr, "error");
-	    }
-	    else if (Rast_is_d_null_value(&dbuf[dcol])) {
+	    Rast_get_d_row(fd, dbuf, drow);
+	    if (Rast_is_d_null_value(&dbuf[dcol])) {
 		sprintf(catstr, "(NULL) %s",
 		sprintf(catstr, "(NULL) %s",
 			Rast_get_d_cat(&dbuf[dcol], &cats));
 			Rast_get_d_cat(&dbuf[dcol], &cats));
 	    }
 	    }

+ 78 - 143
lib/raster/get_row.c

@@ -25,7 +25,7 @@
 #include "../gis/G.h"
 #include "../gis/G.h"
 #include "R.h"
 #include "R.h"
 
 
-static int embed_nulls(int, void *, int, RASTER_MAP_TYPE, int, int);
+static void embed_nulls(int, void *, int, RASTER_MAP_TYPE, int, int);
 
 
 static int compute_window_row(int fd, int row, int *cellRow)
 static int compute_window_row(int fd, int row, int *cellRow)
 {
 {
@@ -35,10 +35,8 @@ static int compute_window_row(int fd, int row, int *cellRow)
 
 
     /* check for row in window */
     /* check for row in window */
     if (row < 0 || row >= G__.window.rows) {
     if (row < 0 || row >= G__.window.rows) {
-	G_warning(_("Reading raster map <%s@%s> request for row %d is outside region"),
-		  fcb->name, fcb->mapset, row);
-
-	return -1;
+	G_fatal_error(_("Reading raster map <%s@%s> request for row %d is outside region"),
+		      fcb->name, fcb->mapset, row);
     }
     }
 
 
     /* convert window row to cell file row */
     /* convert window row to cell file row */
@@ -86,8 +84,8 @@ static void do_reclass_int(int fd, void *cell, int null_is_zero)
     }
     }
 }
 }
 
 
-static int read_data_fp_compressed(int fd, int row, unsigned char *data_buf,
-				   int *nbytes)
+static void read_data_fp_compressed(int fd, int row, unsigned char *data_buf,
+				    int *nbytes)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     off_t t1 = fcb->row_ptr[row];
     off_t t1 = fcb->row_ptr[row];
@@ -96,14 +94,12 @@ static int read_data_fp_compressed(int fd, int row, unsigned char *data_buf,
     size_t bufsize = fcb->cellhd.cols * fcb->nbytes;
     size_t bufsize = fcb->cellhd.cols * fcb->nbytes;
 
 
     if (lseek(fd, t1, SEEK_SET) < 0)
     if (lseek(fd, t1, SEEK_SET) < 0)
-	return -1;
+	G_fatal_error(_("Error reading raster data"));
 
 
     *nbytes = fcb->nbytes;
     *nbytes = fcb->nbytes;
 
 
     if ((size_t) G_zlib_read(fd, readamount, data_buf, bufsize) != bufsize)
     if ((size_t) G_zlib_read(fd, readamount, data_buf, bufsize) != bufsize)
-	return -1;
-
-    return 0;
+	G_fatal_error(_("Error reading raster data"));
 }
 }
 
 
 static void rle_decompress(unsigned char *dst, const unsigned char *src,
 static void rle_decompress(unsigned char *dst, const unsigned char *src,
@@ -125,8 +121,8 @@ static void rle_decompress(unsigned char *dst, const unsigned char *src,
     }
     }
 }
 }
 
 
-static int read_data_compressed(int fd, int row, unsigned char *data_buf,
-				int *nbytes)
+static void read_data_compressed(int fd, int row, unsigned char *data_buf,
+				 int *nbytes)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     off_t t1 = fcb->row_ptr[row];
     off_t t1 = fcb->row_ptr[row];
@@ -136,13 +132,13 @@ static int read_data_compressed(int fd, int row, unsigned char *data_buf,
     int n;
     int n;
 
 
     if (lseek(fd, t1, SEEK_SET) < 0)
     if (lseek(fd, t1, SEEK_SET) < 0)
-	return -1;
+	G_fatal_error(_("Error reading raster data"));
 
 
     cmp = G__alloca(readamount);
     cmp = G__alloca(readamount);
 
 
     if (read(fd, cmp, readamount) != readamount) {
     if (read(fd, cmp, readamount) != readamount) {
 	G__freea(cmp);
 	G__freea(cmp);
-	return -1;
+	G_fatal_error(_("Error reading raster data"));
     }
     }
 
 
     /* Now decompress the row */
     /* Now decompress the row */
@@ -165,12 +161,10 @@ static int read_data_compressed(int fd, int row, unsigned char *data_buf,
 	memcpy(data_buf, cmp, readamount);
 	memcpy(data_buf, cmp, readamount);
 
 
     G__freea(cmp);
     G__freea(cmp);
-
-    return 0;
 }
 }
 
 
-static int read_data_uncompressed(int fd, int row, unsigned char *data_buf,
-				  int *nbytes)
+static void read_data_uncompressed(int fd, int row, unsigned char *data_buf,
+				   int *nbytes)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     ssize_t bufsize = fcb->cellhd.cols * fcb->nbytes;
     ssize_t bufsize = fcb->cellhd.cols * fcb->nbytes;
@@ -178,17 +172,15 @@ static int read_data_uncompressed(int fd, int row, unsigned char *data_buf,
     *nbytes = fcb->nbytes;
     *nbytes = fcb->nbytes;
 
 
     if (lseek(fd, (off_t) row * bufsize, SEEK_SET) == -1)
     if (lseek(fd, (off_t) row * bufsize, SEEK_SET) == -1)
-	return -1;
+	G_fatal_error(_("Error reading raster data"));
 
 
     if (read(fd, data_buf, bufsize) != bufsize)
     if (read(fd, data_buf, bufsize) != bufsize)
-	return -1;
-
-    return 0;
+	G_fatal_error(_("Error reading raster data"));
 }
 }
 
 
 #ifdef HAVE_GDAL
 #ifdef HAVE_GDAL
-static int read_data_gdal(int fd, int row, unsigned char *data_buf,
-			  int *nbytes)
+static void read_data_gdal(int fd, int row, unsigned char *data_buf,
+			   int *nbytes)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     unsigned char *buf;
     unsigned char *buf;
@@ -217,28 +209,28 @@ static int read_data_gdal(int fd, int row, unsigned char *data_buf,
 	G__freea(buf);
 	G__freea(buf);
     }
     }
 
 
-    return err == CE_None ? 0 : -1;
+    if (err != CE_None)
+	G_fatal_error(_("Error reading raster data via GDAL"));
 }
 }
 #endif
 #endif
 
 
-static int read_data(int fd, int row, unsigned char *data_buf, int *nbytes)
+static void read_data(int fd, int row, unsigned char *data_buf, int *nbytes)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
 
 
 #ifdef HAVE_GDAL
 #ifdef HAVE_GDAL
-    if (fcb->gdal)
-	return read_data_gdal(fd, row, data_buf, nbytes);
+    if (fcb->gdal) {
+	read_data_gdal(fd, row, data_buf, nbytes);
+	return;
+    }
 #endif
 #endif
 
 
     if (!fcb->cellhd.compressed)
     if (!fcb->cellhd.compressed)
-	return read_data_uncompressed(fd, row, data_buf, nbytes);
-
-    /* map is in compressed form */
-
-    if (fcb->map_type == CELL_TYPE)
-	return read_data_compressed(fd, row, data_buf, nbytes);
+	read_data_uncompressed(fd, row, data_buf, nbytes);
+    else if (fcb->map_type == CELL_TYPE)
+	read_data_compressed(fd, row, data_buf, nbytes);
     else
     else
-	return read_data_fp_compressed(fd, row, data_buf, nbytes);
+	read_data_fp_compressed(fd, row, data_buf, nbytes);
 }
 }
 
 
 /* copy cell file data to user buffer translated by window column mapping */
 /* copy cell file data to user buffer translated by window column mapping */
@@ -591,35 +583,20 @@ static int get_map_row_nomask(int fd, void *rast, int row,
     };
     };
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     int r;
     int r;
-    int rowStatus;
+    int row_status;
 
 
-    rowStatus = compute_window_row(fd, row, &r);
+    row_status = compute_window_row(fd, row, &r);
 
 
-    if (rowStatus <= 0) {
+    if (!row_status) {
 	fcb->cur_row = -1;
 	fcb->cur_row = -1;
 	Rast_zero_buf(rast, data_type);
 	Rast_zero_buf(rast, data_type);
-	return rowStatus;
+	return 0;
     }
     }
 
 
     /* read cell file row if not in memory */
     /* read cell file row if not in memory */
     if (r != fcb->cur_row) {
     if (r != fcb->cur_row) {
 	fcb->cur_row = r;
 	fcb->cur_row = r;
-
-	if (read_data(fd, fcb->cur_row, fcb->data, &fcb->cur_nbytes) < 0) {
-	    Rast_zero_buf(rast, data_type);
-
-	    if (!fcb->io_error) {
-		if (fcb->cellhd.compressed)
-		    G_warning(_("Error reading compressed map <%s@%s>, row %d"),
-			      fcb->name, fcb->mapset, r);
-		else
-		    G_warning(_("Error reading map <%s@%s>, row %d"),
-			      fcb->name, fcb->mapset, r);
-
-		fcb->io_error = 1;
-	    }
-	    return -1;
-	}
+	read_data(fd, fcb->cur_row, fcb->data, &fcb->cur_nbytes);
     }
     }
 
 
     (transfer_to_cell_FtypeOtype[fcb->map_type][data_type]) (fd, rast);
     (transfer_to_cell_FtypeOtype[fcb->map_type][data_type]) (fd, rast);
@@ -627,32 +604,22 @@ static int get_map_row_nomask(int fd, void *rast, int row,
     return 1;
     return 1;
 }
 }
 
 
-static int get_map_row_no_reclass(int fd, void *rast, int row,
-				  RASTER_MAP_TYPE data_type, int null_is_zero,
-				  int with_mask)
+static void get_map_row_no_reclass(int fd, void *rast, int row,
+				   RASTER_MAP_TYPE data_type, int null_is_zero,
+				   int with_mask)
 {
 {
-    int stat;
-
-    stat = get_map_row_nomask(fd, rast, row, data_type);
-    if (stat < 0)
-	return stat;
-
-    stat = embed_nulls(fd, rast, row, data_type, null_is_zero, with_mask);
-    if (stat < 0)
-	return stat;
-
-    return 1;
+    get_map_row_nomask(fd, rast, row, data_type);
+    embed_nulls(fd, rast, row, data_type, null_is_zero, with_mask);
 }
 }
 
 
-static int get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
-		       int null_is_zero, int with_mask)
+static void get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
+			int null_is_zero, int with_mask)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     int size = Rast_cell_size(data_type);
     int size = Rast_cell_size(data_type);
     CELL *temp_buf = NULL;
     CELL *temp_buf = NULL;
     void *buf;
     void *buf;
     int type;
     int type;
-    int stat;
     int i;
     int i;
 
 
     if (fcb->reclass_flag && data_type != CELL_TYPE) {
     if (fcb->reclass_flag && data_type != CELL_TYPE) {
@@ -665,16 +632,10 @@ static int get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
 	type = data_type;
 	type = data_type;
     }
     }
 
 
-    stat =
-	get_map_row_no_reclass(fd, buf, row, type, null_is_zero, with_mask);
-    if (stat < 0) {
-	if (temp_buf)
-	    G__freea(temp_buf);
-	return stat;
-    }
+    get_map_row_no_reclass(fd, buf, row, type, null_is_zero, with_mask);
 
 
     if (!fcb->reclass_flag)
     if (!fcb->reclass_flag)
-	return 1;
+	return;
 
 
     /* if the map is reclass table, get and
     /* if the map is reclass table, get and
        reclass CELL row and copy results to needed type  */
        reclass CELL row and copy results to needed type  */
@@ -682,7 +643,7 @@ static int get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
     do_reclass_int(fd, buf, null_is_zero);
     do_reclass_int(fd, buf, null_is_zero);
 
 
     if (data_type == CELL_TYPE)
     if (data_type == CELL_TYPE)
-	return 1;
+	return;
 
 
     for (i = 0; i < G__.window.cols; i++) {
     for (i = 0; i < G__.window.cols; i++) {
 	Rast_set_c_value(rast, temp_buf[i], data_type);
 	Rast_set_c_value(rast, temp_buf[i], data_type);
@@ -690,8 +651,6 @@ static int get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
     }
     }
 
 
     G__freea(temp_buf);
     G__freea(temp_buf);
-
-    return 1;
 }
 }
 
 
 /*!
 /*!
@@ -719,13 +678,11 @@ static int get_map_row(int fd, void *rast, int row, RASTER_MAP_TYPE data_type,
  * \param row data row desired
  * \param row data row desired
  * \param data_type data type
  * \param data_type data type
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_row_nomask(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
+void Rast_get_row_nomask(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
 {
 {
-    return get_map_row(fd, buf, row, data_type, 0, 0);
+    get_map_row(fd, buf, row, data_type, 0, 0);
 }
 }
 
 
 /*!
 /*!
@@ -738,13 +695,11 @@ int Rast_get_row_nomask(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
  * \param row data row desired
  * \param row data row desired
  * \param data_type data type
  * \param data_type data type
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_c_row_nomask(int fd, CELL * buf, int row)
+void Rast_get_c_row_nomask(int fd, CELL * buf, int row)
 {
 {
-    return Rast_get_row_nomask(fd, buf, row, CELL_TYPE);
+    Rast_get_row_nomask(fd, buf, row, CELL_TYPE);
 }
 }
 
 
 /*!
 /*!
@@ -757,13 +712,11 @@ int Rast_get_c_row_nomask(int fd, CELL * buf, int row)
  * \param row data row desired
  * \param row data row desired
  * \param data_type data type
  * \param data_type data type
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_f_row_nomask(int fd, FCELL * buf, int row)
+void Rast_get_f_row_nomask(int fd, FCELL * buf, int row)
 {
 {
-    return Rast_get_row_nomask(fd, buf, row, FCELL_TYPE);
+    Rast_get_row_nomask(fd, buf, row, FCELL_TYPE);
 }
 }
 
 
 /*!
 /*!
@@ -776,13 +729,11 @@ int Rast_get_f_row_nomask(int fd, FCELL * buf, int row)
  * \param row data row desired
  * \param row data row desired
  * \param data_type data type
  * \param data_type data type
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_d_row_nomask(int fd, DCELL * buf, int row)
+void Rast_get_d_row_nomask(int fd, DCELL * buf, int row)
 {
 {
-    return Rast_get_row_nomask(fd, buf, row, DCELL_TYPE);
+    Rast_get_row_nomask(fd, buf, row, DCELL_TYPE);
 }
 }
 
 
 /*!
 /*!
@@ -823,13 +774,11 @@ int Rast_get_d_row_nomask(int fd, DCELL * buf, int row)
  * \param row data row desired
  * \param row data row desired
  * \param data_type data type
  * \param data_type data type
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_row(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
+void Rast_get_row(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
 {
 {
-    return get_map_row(fd, buf, row, data_type, 0, 1);
+    get_map_row(fd, buf, row, data_type, 0, 1);
 }
 }
 
 
 /*!
 /*!
@@ -849,13 +798,11 @@ int Rast_get_row(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
  * \param buf buffer for the row to be placed into
  * \param buf buffer for the row to be placed into
  * \param row data row desired
  * \param row data row desired
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_c_row(int fd, CELL * buf, int row)
+void Rast_get_c_row(int fd, CELL * buf, int row)
 {
 {
-    return Rast_get_row(fd, buf, row, CELL_TYPE);
+    Rast_get_row(fd, buf, row, CELL_TYPE);
 }
 }
 
 
 /*!
 /*!
@@ -871,13 +818,11 @@ int Rast_get_c_row(int fd, CELL * buf, int row)
  * \param buf buffer for the row to be placed into
  * \param buf buffer for the row to be placed into
  * \param row data row desired
  * \param row data row desired
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_f_row(int fd, FCELL * buf, int row)
+void Rast_get_f_row(int fd, FCELL * buf, int row)
 {
 {
-    return Rast_get_row(fd, buf, row, FCELL_TYPE);
+    Rast_get_row(fd, buf, row, FCELL_TYPE);
 }
 }
 
 
 /*!
 /*!
@@ -890,13 +835,11 @@ int Rast_get_f_row(int fd, FCELL * buf, int row)
  * \param buf buffer for the row to be placed into
  * \param buf buffer for the row to be placed into
  * \param row data row desired
  * \param row data row desired
  *
  *
- * \return 1 on success
- * \return 0 row requested not within window
- * \return -1 on error
+ * \return void
  */
  */
-int Rast_get_d_row(int fd, DCELL * buf, int row)
+void Rast_get_d_row(int fd, DCELL * buf, int row)
 {
 {
-    return Rast_get_row(fd, buf, row, DCELL_TYPE);
+    Rast_get_row(fd, buf, row, DCELL_TYPE);
 }
 }
 
 
 static int read_null_bits(int fd, int row)
 static int read_null_bits(int fd, int row)
@@ -915,20 +858,16 @@ static int read_null_bits(int fd, int row)
     }
     }
 
 
     if (null_fd < 0)
     if (null_fd < 0)
-	return -1;
+	return 0;
 
 
     size = Rast__null_bitstream_size(cols);
     size = Rast__null_bitstream_size(cols);
     offset = (off_t) size * R;
     offset = (off_t) size * R;
 
 
-    if (lseek(null_fd, offset, SEEK_SET) < 0) {
-	G_warning(_("Error reading null row %d"), R);
-	return -1;
-    }
+    if (lseek(null_fd, offset, SEEK_SET) < 0)
+	G_fatal_error(_("Error reading null row %d"), R);
 
 
-    if (read(null_fd, flags, size) != size) {
-	G_warning(_("Error reading null row %d"), R);
-	return -1;
-    }
+    if (read(null_fd, flags, size) != size)
+	G_fatal_error(_("Error reading null row %d"), R);
 
 
     return 1;
     return 1;
 }
 }
@@ -947,7 +886,7 @@ static void get_null_value_row_nomask(int fd, char *flags, int row)
     }
     }
 
 
     if (row != fcb->null_cur_row) {
     if (row != fcb->null_cur_row) {
-	if (read_null_bits(fd, row) < 0) {
+	if (!read_null_bits(fd, row)) {
 	    fcb->null_cur_row = -1;
 	    fcb->null_cur_row = -1;
 	    if (fcb->map_type == CELL_TYPE) {
 	    if (fcb->map_type == CELL_TYPE) {
 		/* If can't read null row, assume  that all map 0's are nulls */
 		/* If can't read null row, assume  that all map 0's are nulls */
@@ -1048,8 +987,8 @@ static void get_null_value_row(int fd, char *flags, int row, int with_mask)
 	embed_mask(flags, row);
 	embed_mask(flags, row);
 }
 }
 
 
-static int embed_nulls(int fd, void *buf, int row, RASTER_MAP_TYPE map_type,
-		       int null_is_zero, int with_mask)
+static void embed_nulls(int fd, void *buf, int row, RASTER_MAP_TYPE map_type,
+			int null_is_zero, int with_mask)
 {
 {
     struct fileinfo *fcb = &R__.fileinfo[fd];
     struct fileinfo *fcb = &R__.fileinfo[fd];
     char *null_buf;
     char *null_buf;
@@ -1059,7 +998,7 @@ static int embed_nulls(int fd, void *buf, int row, RASTER_MAP_TYPE map_type,
        in data row or mask */
        in data row or mask */
     if (null_is_zero && !fcb->null_file_exists
     if (null_is_zero && !fcb->null_file_exists
 	&& (R__.auto_mask <= 0 || !with_mask))
 	&& (R__.auto_mask <= 0 || !with_mask))
-	return 1;
+	return;
 
 
     null_buf = G__alloca(G__.window.cols);
     null_buf = G__alloca(G__.window.cols);
 
 
@@ -1077,8 +1016,6 @@ static int embed_nulls(int fd, void *buf, int row, RASTER_MAP_TYPE map_type,
     }
     }
 
 
     G__freea(null_buf);
     G__freea(null_buf);
-
-    return 1;
 }
 }
 
 
 /*!
 /*!
@@ -1095,11 +1032,9 @@ static int embed_nulls(int fd, void *buf, int row, RASTER_MAP_TYPE map_type,
    \param buf buffer for the row to be placed into
    \param buf buffer for the row to be placed into
    \param row data row desired
    \param row data row desired
 
 
-   \return 1
+   \return void
  */
  */
-int Rast_get_null_value_row(int fd, char *flags, int row)
+void Rast_get_null_value_row(int fd, char *flags, int row)
 {
 {
     get_null_value_row(fd, flags, row, 1);
     get_null_value_row(fd, flags, row, 1);
-
-    return 1;
 }
 }

+ 5 - 11
lib/raster/get_row_colr.c

@@ -34,12 +34,11 @@
  *  \param[out] blu blue value
  *  \param[out] blu blue value
  *  \param[out] nul null value
  *  \param[out] nul null value
  *
  *
- *  \return -1 on error
- *  \return 0 on success
+ *  \return void
  */
  */
-int Rast_get_row_colors(int fd, int row, struct Colors *colors,
-			unsigned char *red, unsigned char *grn,
-			unsigned char *blu, unsigned char *nul)
+void Rast_get_row_colors(int fd, int row, struct Colors *colors,
+			 unsigned char *red, unsigned char *grn,
+			 unsigned char *blu, unsigned char *nul)
 {
 {
     int cols = G_window_cols();
     int cols = G_window_cols();
     int type = Rast_get_map_type(fd);
     int type = Rast_get_map_type(fd);
@@ -51,10 +50,7 @@ int Rast_get_row_colors(int fd, int row, struct Colors *colors,
 
 
     array = G__alloca(cols * size);
     array = G__alloca(cols * size);
 
 
-    if (Rast_get_row(fd, array, row, type) < 0) {
-	G__freea(array);
-	return -1;
-    }
+    Rast_get_row(fd, array, row, type);
 
 
     if (nul)
     if (nul)
 	for (i = 0, p = array; i < cols; i++, p = G_incr_void_ptr(p, size))
 	for (i = 0, p = array; i < cols; i++, p = G_incr_void_ptr(p, size))
@@ -66,6 +62,4 @@ int Rast_get_row_colors(int fd, int row, struct Colors *colors,
 
 
     G__freea(array);
     G__freea(array);
     G__freea(set);
     G__freea(set);
-
-    return 0;
 }
 }

+ 4 - 20
lib/raster/sample.c

@@ -24,8 +24,6 @@
 
 
 /* prototypes */
 /* prototypes */
 static double scancatlabel(const char *);
 static double scancatlabel(const char *);
-static void raster_row_error(const struct Cell_head *window, double north,
-			     double east);
 
 
 /*!
 /*!
  *  \brief Extract a cell value from raster map.
  *  \brief Extract a cell value from raster map.
@@ -109,8 +107,7 @@ DCELL Rast_get_sample_nearest(int fd,
 	goto done;
 	goto done;
     }
     }
 
 
-    if (Rast_get_d_row(fd, maprow, row) < 0)
-	raster_row_error(window, north, east);
+    Rast_get_d_row(fd, maprow, row);
 
 
     if (Rast_is_d_null_value(&maprow[col])) {
     if (Rast_is_d_null_value(&maprow[col])) {
 	Rast_set_d_null_value(&result, 1);
 	Rast_set_d_null_value(&result, 1);
@@ -176,10 +173,8 @@ DCELL Rast_get_sample_bilinear(int fd,
 	goto done;
 	goto done;
     }
     }
 
 
-    if (Rast_get_d_row(fd, arow, row) < 0)
-	raster_row_error(window, north, east);
-    if (Rast_get_d_row(fd, brow, row + 1) < 0)
-	raster_row_error(window, north, east);
+    Rast_get_d_row(fd, arow, row);
+    Rast_get_d_row(fd, brow, row + 1);
 
 
     if (Rast_is_d_null_value(&arow[col]) ||
     if (Rast_is_d_null_value(&arow[col]) ||
 	Rast_is_d_null_value(&arow[col + 1]) ||
 	Rast_is_d_null_value(&arow[col + 1]) ||
@@ -271,8 +266,7 @@ DCELL Rast_get_sample_cubic(int fd,
     }
     }
 
 
     for (i = 0; i < 4; i++)
     for (i = 0; i < 4; i++)
-	if (Rast_get_d_row(fd, rows[i], row + i) < 0)
-	    raster_row_error(window, north, east);
+	Rast_get_d_row(fd, rows[i], row + i);
 
 
     for (i = 0; i < 4; i++)
     for (i = 0; i < 4; i++)
 	for (j = 0; j < 4; j++)
 	for (j = 0; j < 4; j++)
@@ -337,13 +331,3 @@ static double scancatlabel(const char *str)
     return val;
     return val;
 }
 }
 
 
-
-static void raster_row_error(const struct Cell_head *window, double north,
-			     double east)
-{
-    G_debug(3, "DIAG: \tRegion is: n=%g s=%g e=%g w=%g",
-	    window->north, window->south, window->east, window->west);
-    G_debug(3, "      \tData point is north=%g east=%g", north, east);
-
-    G_fatal_error(_("Problem reading raster map"));
-}

+ 4 - 15
lib/rst/interp_float/ressegm2d.c

@@ -505,21 +505,10 @@ static int input_data(struct interp_params *params,
 	cellsmooth = Rast_allocate_f_buf();
 	cellsmooth = Rast_allocate_f_buf();
 
 
     for (m1 = 0; m1 <= last_row - first_row; m1++) {
     for (m1 = 0; m1 <= last_row - first_row; m1++) {
-	ret_val =
-	    Rast_get_f_row(fdinp, cellinp, inp_rows - m1 - first_row);
-	if (ret_val < 0) {
-	    fprintf(stderr, "Cannot get row %d (return value = %d)\n", m1,
-		    ret_val);
-	    return -1;
-	}
-	if (fdsmooth >= 0) {
-	    ret_val1 =
-		Rast_get_f_row(fdsmooth, cellsmooth,
-				   inp_rows - m1 - first_row);
-	    if (ret_val1 < 0) {
-		fprintf(stderr, "Cannot get smoothing row\n");
-	    }
-	}
+	Rast_get_f_row(fdinp, cellinp, inp_rows - m1 - first_row);
+	if (fdsmooth >= 0)
+	    Rast_get_f_row(fdsmooth, cellsmooth, inp_rows - m1 - first_row);
+
 	y = params->y_orig + (m1 + first_row - 1 + 0.5) * inp_ns_res;
 	y = params->y_orig + (m1 + first_row - 1 + 0.5) * inp_ns_res;
 	for (m2 = 0; m2 < inp_cols; m2++) {
 	for (m2 = 0; m2 < inp_cols; m2++) {
 	    x = params->x_orig + (m2 + 0.5) * inp_ew_res;
 	    x = params->x_orig + (m2 + 0.5) * inp_ew_res;

+ 2 - 3
raster/r.basins.fill/read_map.c

@@ -27,7 +27,7 @@ CELL *read_map(const char *name, int nomask, int nrows, int ncols)
     int fd;
     int fd;
     CELL *map;
     CELL *map;
     int row;
     int row;
-    int (*get_row)(int, CELL *, int);
+    void (*get_row)(int, CELL *, int);
 
 
     /* allocate entire map */
     /* allocate entire map */
     map = (CELL *) G_malloc(nrows * ncols * sizeof(CELL));
     map = (CELL *) G_malloc(nrows * ncols * sizeof(CELL));
@@ -45,8 +45,7 @@ CELL *read_map(const char *name, int nomask, int nrows, int ncols)
 
 
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 10);
 	G_percent(row, nrows, 10);
-	if ((*get_row) (fd, map + row * ncols, row) < 0)
-	    G_fatal_error(_("Error reading <%s>"), name);
+	(*get_row)(fd, map + row * ncols, row);
     }
     }
     G_percent(nrows, nrows, 10);
     G_percent(nrows, nrows, 10);
 
 

+ 1 - 3
raster/r.bitpattern/main.c

@@ -120,9 +120,7 @@ int main(int argc, char *argv[])
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
 
 
 	/* read input map */
 	/* read input map */
-	if (Rast_get_row(infd, inrast, row, data_type) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), name,
-			  row);
+	Rast_get_row(infd, inrast, row, data_type);
 
 
 	/*process the data */
 	/*process the data */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {

+ 1 - 3
raster/r.buffer/read_map.c

@@ -58,9 +58,7 @@ int read_input_map(char *input, char *mapset, int ZEROFLAG)
 	hit = 0;
 	hit = 0;
 	G_percent(row, window.rows, 2);
 	G_percent(row, window.rows, 2);
 
 
-	if (Rast_get_c_row(fd, cell, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  G_fully_qualified_name(input, mapset), row);
+	Rast_get_c_row(fd, cell, row);
 
 
 	for (col = 0; col < window.cols; col++) {
 	for (col = 0; col < window.cols; col++) {
 	    if (ZEROFLAG) {
 	    if (ZEROFLAG) {

+ 1 - 3
raster/r.buffer/write_map.c

@@ -54,9 +54,7 @@ int write_output_map(char *output, int offset)
 		*cell++ = (CELL) * ptr++;
 		*cell++ = (CELL) * ptr++;
 	}
 	}
 	else {
 	else {
-	    if (Rast_get_c_row_nomask(fd_in, cell, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      output, row);
+	    Rast_get_c_row_nomask(fd_in, cell, row);
 
 
 	    while (col-- > 0) {
 	    while (col-- > 0) {
 		if (*cell == 0 && *ptr != 0)
 		if (*cell == 0 && *ptr != 0)

+ 1 - 2
raster/r.category/cats.c

@@ -48,8 +48,7 @@ int get_cats(const char *name, const char *mapset)
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	if (G_verbose() > G_verbose_std())
 	if (G_verbose() > G_verbose_std())
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
-	if (Rast_get_c_row_nomask(fd, cell, row) < 0)
-	    exit(EXIT_SUCCESS);
+	Rast_get_c_row_nomask(fd, cell, row);
 	Rast_update_cell_stats(cell, ncols, &statf);
 	Rast_update_cell_stats(cell, ncols, &statf);
     }
     }
     /* done */
     /* done */

+ 1 - 3
raster/r.clump/clump.c

@@ -98,9 +98,7 @@ CELL clump(int in_fd, int out_fd)
 
 
 	G_message(_("Pass %d..."), pass);
 	G_message(_("Pass %d..."), pass);
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
-	    if (Rast_get_c_row(in_fd, cur_in + 1, row) < 0)
-		G_fatal_error(_("Unable to read raster map row %d "),
-			      row);
+	    Rast_get_c_row(in_fd, cur_in + 1, row);
 	    
 	    
 	    G_percent(row+1, nrows, 2);
 	    G_percent(row+1, nrows, 2);
 	    X = 0;
 	    X = 0;

+ 2 - 6
raster/r.colors/stats.c

@@ -41,9 +41,7 @@ int get_stats(const char *name, const char *mapset, struct Cell_stats *statf)
 		      G_fully_qualified_name(name, mapset));
 		      G_fully_qualified_name(name, mapset));
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(fd, cell, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  G_fully_qualified_name(name, mapset), row);
+	Rast_get_c_row(fd, cell, row);
 	Rast_update_cell_stats(cell, ncols, statf);
 	Rast_update_cell_stats(cell, ncols, statf);
     }
     }
     G_percent(row, nrows, 2);
     G_percent(row, nrows, 2);
@@ -106,9 +104,7 @@ void get_fp_stats(const char *name, const char *mapset,
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_d_row(fd, dcell, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  G_fully_qualified_name(name, mapset), row);
+	Rast_get_d_row(fd, dcell, row);
 	
 	
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    DCELL x;
 	    DCELL x;

+ 3 - 5
raster/r.composite/main.c

@@ -195,11 +195,9 @@ int main(int argc, char **argv)
 	for (i = 0; i < 3; i++) {
 	for (i = 0; i < 3; i++) {
 	    struct band *b = &B[i];
 	    struct band *b = &B[i];
 
 
-	    if (Rast_get_row_colors(b->file, atrow, &b->colors,
-					b->array[0],
-					b->array[1], b->array[2], nulls) < 0)
-		G_fatal_error(_("Error reading raster map <%s>"),
-			      color_names[i]);
+	    Rast_get_row_colors(b->file, atrow, &b->colors,
+				b->array[0],
+				b->array[1], b->array[2], nulls);
 
 
 	    if (dither) {
 	    if (dither) {
 		short *tmp = b->floyd[0];
 		short *tmp = b->floyd[0];

+ 1 - 2
raster/r.compress/main.c

@@ -210,8 +210,7 @@ static int doit(char *name, int uncompress, RASTER_MAP_TYPE map_type)
     /* the null file is written automatically */
     /* the null file is written automatically */
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_row_nomask(old, rast, row, map_type) < 0)
-	    break;
+	Rast_get_row_nomask(old, rast, row, map_type);
 	if (Rast_put_row(new, rast, map_type) < 0)
 	if (Rast_put_row(new, rast, map_type) < 0)
 	    break;
 	    break;
     }
     }

+ 5 - 11
raster/r.cost/main.c

@@ -481,9 +481,7 @@ int main(int argc, char *argv[])
 
 
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
-	    if (Rast_get_row(cost_fd, cell, row, data_type) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      cost_layer, row);
+	    Rast_get_row(cost_fd, cell, row, data_type);
 
 
 	    /* INPUT NULL VALUES: ??? */
 	    /* INPUT NULL VALUES: ??? */
 	    ptr2 = cell;
 	    ptr2 = cell;
@@ -655,9 +653,7 @@ int main(int argc, char *argv[])
 	G_message(_("Reading raster map <%s>..."), opt9->answer);
 	G_message(_("Reading raster map <%s>..."), opt9->answer);
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
-	    if (Rast_get_row(fd, cell2, row, data_type2) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      opt9->answer, row);
+	    Rast_get_row(fd, cell2, row, data_type2);
 	    ptr2 = cell2;
 	    ptr2 = cell2;
 	    for (col = 0; col < ncols; col++) {
 	    for (col = 0; col < ncols; col++) {
 		/* Did I understand that concept of cummulative cost map? - (pmx) 12 april 2000 */
 		/* Did I understand that concept of cummulative cost map? - (pmx) 12 april 2000 */
@@ -1001,11 +997,9 @@ int main(int argc, char *argv[])
 
 
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
-	    if (keep_nulls) {
-		if (Rast_get_row(cost_fd, cell2, row, data_type) < 0)
-		    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-				  cost_layer, row);
-	    }
+	    if (keep_nulls)
+		Rast_get_row(cost_fd, cell2, row, data_type);
+
 	    p = cell;
 	    p = cell;
 	    p2 = cell2;
 	    p2 = cell2;
 	    for (col = 0; col < ncols; col++) {
 	    for (col = 0; col < ncols; col++) {

+ 3 - 4
raster/r.covar/main.c

@@ -86,10 +86,9 @@ int main(int argc, char *argv[])
     count = 0;
     count = 0;
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	for (i = 0; i < nfiles; i++) {
-	    if (Rast_get_d_row(fd[i], dcell[i], row) < 0)
-		exit(1);
-	}
+	for (i = 0; i < nfiles; i++)
+	    Rast_get_d_row(fd[i], dcell[i], row);
+
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    /* ignore cells where any of the maps has null value */
 	    /* ignore cells where any of the maps has null value */
 	    for (i = 0; i < nfiles; i++)
 	    for (i = 0; i < nfiles; i++)

+ 3 - 4
raster/r.cross/cross.c

@@ -55,14 +55,13 @@ CELL cross(int fd[], int non_zero, int primary, int outfd)
 	G_percent(row, nrows, 5);
 	G_percent(row, nrows, 5);
 
 
 	/* read the primary file first, even if not first in the list */
 	/* read the primary file first, even if not first in the list */
-	if (Rast_get_c_row(fd[primary], cell[0], row) < 0)
-	    exit(1);
+	Rast_get_c_row(fd[primary], cell[0], row);
 
 
 	/* read the others */
 	/* read the others */
 	col = 1;
 	col = 1;
 	for (i = 0; i < nfiles; i++)
 	for (i = 0; i < nfiles; i++)
-	    if (i != primary && Rast_get_c_row(fd[i], cell[col++], row) < 0)
-		exit(1);
+	    if (i != primary)
+		Rast_get_c_row(fd[i], cell[col++], row);
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    zero = 1;
 	    zero = 1;
 	    for (i = 0; i < nfiles; i++) {
 	    for (i = 0; i < nfiles; i++) {

+ 1 - 2
raster/r.cross/renumber.c

@@ -33,8 +33,7 @@ int renumber(int in, int out)
     G_message(_("%s: STEP 3 ... "), G_program_name());
     G_message(_("%s: STEP 3 ... "), G_program_name());
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 5);
 	G_percent(row, nrows, 5);
-	if (Rast_get_c_row(in, c = cell, row) < 0)
-	    exit(1);
+	Rast_get_c_row(in, c = cell, row);
 	col = ncols;
 	col = ncols;
 	while (col-- > 0) {
 	while (col-- > 0) {
 	    *c = table[*c];
 	    *c = table[*c];

+ 2 - 3
raster/r.describe/describe.c

@@ -37,7 +37,7 @@ int describe(const char *name, int compact, char *no_data_str,
     struct Quant q;
     struct Quant q;
     struct FPRange r;
     struct FPRange r;
     DCELL dmin, dmax;
     DCELL dmin, dmax;
-    int (*get_row)(int, CELL *, int);
+    void (*get_row)(int, CELL *, int);
 
 
     if (windowed) {
     if (windowed) {
 	get_row = Rast_get_c_row;
 	get_row = Rast_get_c_row;
@@ -94,8 +94,7 @@ int describe(const char *name, int compact, char *no_data_str,
     G_verbose_message(_("Reading <%s> ..."), name);
     G_verbose_message(_("Reading <%s> ..."), name);
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if ((*get_row) (fd, b = buf, row) < 0)
-	    break;
+	(*get_row) (fd, b = buf, row);
 	if (range) {
 	if (range) {
 	    for (col = ncols; col-- > 0; b++) {
 	    for (col = ncols; col-- > 0; b++) {
 		if (Rast_is_c_null_value(b))
 		if (Rast_is_c_null_value(b))

+ 2 - 4
raster/r.distance/distance.c

@@ -108,10 +108,8 @@ int null_distance(const char *name1, const char *name2, int *zerro_row, int *zer
 
 
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_row(mapd1, inrast1, row, maptype1) < 0)
-	    G_fatal_error("Could not read from <%s>", name1);
-	if (Rast_get_row(mapd2, inrast2, row, maptype2) < 0)
-	    G_fatal_error("Could not read from <%s>", name2);
+	Rast_get_row(mapd1, inrast1, row, maptype1);
+	Rast_get_row(mapd2, inrast2, row, maptype2);
 
 
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 
 

+ 1 - 2
raster/r.distance/edges.c

@@ -71,8 +71,7 @@ void find_edge_cells(struct Map *map)
 	buf2 = tmp;
 	buf2 = tmp;
 
 
 	/* read a row */
 	/* read a row */
-	if (Rast_get_c_row(fd, &buf1[1], row) < 0)
-	    exit(1);
+	Rast_get_c_row(fd, &buf1[1], row);
 
 
 	for (col = 1; col <= ncols; col++) {
 	for (col = 1; col <= ncols; col++) {
 	    if (buf1[col]	/* is a valid category */
 	    if (buf1[col]	/* is a valid category */

+ 14 - 14
raster/r.drain/tinf.c

@@ -11,9 +11,9 @@ void (*set_null_value) (void *, int);
 int (*bpe) ();
 int (*bpe) ();
 void *(*get_max) (void *, void *);
 void *(*get_max) (void *, void *);
 void *(*get_min) (void *, void *);
 void *(*get_min) (void *, void *);
-int (*get_row) (int, void *, int);
+void (*get_row) (int, void *, int);
 void *(*get_buf) ();
 void *(*get_buf) ();
-int (*put_row) (int, void *);
+void (*put_row) (int, void *);
 double (*slope) (void *, void *, double);
 double (*slope) (void *, void *, double);
 void (*set_min) (void *);
 void (*set_min) (void *);
 void (*set_max) (void *);
 void (*set_max) (void *);
@@ -198,35 +198,35 @@ void *get_max_d(void *v1, void *v2)
 }
 }
 
 
 /* Read one line from a raster map */
 /* Read one line from a raster map */
-int get_row_c(int fd, void *row, int n)
+void get_row_c(int fd, void *row, int n)
 {
 {
-    return Rast_get_c_row(fd, (CELL *) row, n);
+    Rast_get_c_row(fd, (CELL *) row, n);
 }
 }
 
 
-int get_row_f(int fd, void *row, int n)
+void get_row_f(int fd, void *row, int n)
 {
 {
-    return Rast_get_f_row(fd, (FCELL *) row, n);
+    Rast_get_f_row(fd, (FCELL *) row, n);
 }
 }
 
 
-int get_row_d(int fd, void *row, int n)
+void get_row_d(int fd, void *row, int n)
 {
 {
-    return Rast_get_d_row(fd, (DCELL *) row, n);
+    Rast_get_d_row(fd, (DCELL *) row, n);
 }
 }
 
 
 /* Write one row to a raster map */
 /* Write one row to a raster map */
-int put_row_c(int fd, void *row)
+void put_row_c(int fd, void *row)
 {
 {
-    return Rast_put_c_row(fd, (CELL *) row);
+    Rast_put_c_row(fd, (CELL *) row);
 }
 }
 
 
-int put_row_f(int fd, void *row)
+void put_row_f(int fd, void *row)
 {
 {
-    return Rast_put_f_row(fd, (FCELL *) row);
+    Rast_put_f_row(fd, (FCELL *) row);
 }
 }
 
 
-int put_row_d(int fd, void *row)
+void put_row_d(int fd, void *row)
 {
 {
-    return Rast_put_d_row(fd, (DCELL *) row);
+    Rast_put_d_row(fd, (DCELL *) row);
 }
 }
 
 
 /* Allocate memory for one line of data */
 /* Allocate memory for one line of data */

+ 8 - 8
raster/r.drain/tinf.h

@@ -30,13 +30,13 @@ void *get_max_c(void *, void *);
 void *get_max_f(void *, void *);
 void *get_max_f(void *, void *);
 void *get_max_d(void *, void *);
 void *get_max_d(void *, void *);
 
 
-int get_row_c(int, void *, int);
-int get_row_f(int, void *, int);
-int get_row_d(int, void *, int);
+void get_row_c(int, void *, int);
+void get_row_f(int, void *, int);
+void get_row_d(int, void *, int);
 
 
-int put_row_c(int, void *);
-int put_row_f(int, void *);
-int put_row_d(int, void *);
+void put_row_c(int, void *);
+void put_row_f(int, void *);
+void put_row_d(int, void *);
 
 
 void *get_buf_c(void);
 void *get_buf_c(void);
 void *get_buf_f(void);
 void *get_buf_f(void);
@@ -74,9 +74,9 @@ extern void (*set_null_value) (void *, int);
 extern int (*bpe) ();
 extern int (*bpe) ();
 extern void *(*get_max) (void *, void *);
 extern void *(*get_max) (void *, void *);
 extern void *(*get_min) (void *, void *);
 extern void *(*get_min) (void *, void *);
-extern int (*get_row) (int, void *, int);
+extern void (*get_row) (int, void *, int);
 extern void *(*get_buf) ();
 extern void *(*get_buf) ();
-extern int (*put_row) (int, void *);
+extern void (*put_row) (int, void *);
 extern double (*slope) (void *, void *, double);
 extern double (*slope) (void *, void *, double);
 extern void (*set_min) (void *);
 extern void (*set_min) (void *);
 extern void (*set_max) (void *);
 extern void (*set_max) (void *);

+ 14 - 14
raster/r.fill.dir/tinf.c

@@ -14,9 +14,9 @@ int (*is_null) (void *);
 int (*bpe) ();
 int (*bpe) ();
 void *(*get_max) (void *, void *);
 void *(*get_max) (void *, void *);
 void *(*get_min) (void *, void *);
 void *(*get_min) (void *, void *);
-int (*get_row) (int, void *, int);
+void (*get_row) (int, void *, int);
 void *(*get_buf) ();
 void *(*get_buf) ();
-int (*put_row) (int, void *);
+void (*put_row) (int, void *);
 double (*slope) (void *, void *, double);
 double (*slope) (void *, void *, double);
 void (*set_min) (void *);
 void (*set_min) (void *);
 void (*set_max) (void *);
 void (*set_max) (void *);
@@ -178,35 +178,35 @@ void *get_max_d(void *v1, void *v2)
 }
 }
 
 
 /* Read one line from a raster map */
 /* Read one line from a raster map */
-int get_row_c(int fd, void *row, int n)
+void get_row_c(int fd, void *row, int n)
 {
 {
-    return Rast_get_c_row(fd, (CELL *) row, n);
+    Rast_get_c_row(fd, (CELL *) row, n);
 }
 }
 
 
-int get_row_f(int fd, void *row, int n)
+void get_row_f(int fd, void *row, int n)
 {
 {
-    return Rast_get_f_row(fd, (FCELL *) row, n);
+    Rast_get_f_row(fd, (FCELL *) row, n);
 }
 }
 
 
-int get_row_d(int fd, void *row, int n)
+void get_row_d(int fd, void *row, int n)
 {
 {
-    return Rast_get_d_row(fd, (DCELL *) row, n);
+    Rast_get_d_row(fd, (DCELL *) row, n);
 }
 }
 
 
 /* Write one row to a raster map */
 /* Write one row to a raster map */
-int put_row_c(int fd, void *row)
+void put_row_c(int fd, void *row)
 {
 {
-    return Rast_put_c_row(fd, (CELL *) row);
+    Rast_put_c_row(fd, (CELL *) row);
 }
 }
 
 
-int put_row_f(int fd, void *row)
+void put_row_f(int fd, void *row)
 {
 {
-    return Rast_put_f_row(fd, (FCELL *) row);
+    Rast_put_f_row(fd, (FCELL *) row);
 }
 }
 
 
-int put_row_d(int fd, void *row)
+void put_row_d(int fd, void *row)
 {
 {
-    return Rast_put_d_row(fd, (DCELL *) row);
+    Rast_put_d_row(fd, (DCELL *) row);
 }
 }
 
 
 /* Allocate memory for one line of data */
 /* Allocate memory for one line of data */

+ 8 - 8
raster/r.fill.dir/tinf.h

@@ -25,13 +25,13 @@ void *get_max_c(void *, void *);
 void *get_max_f(void *, void *);
 void *get_max_f(void *, void *);
 void *get_max_d(void *, void *);
 void *get_max_d(void *, void *);
 
 
-int get_row_c(int, void *, int);
-int get_row_f(int, void *, int);
-int get_row_d(int, void *, int);
+void get_row_c(int, void *, int);
+void get_row_f(int, void *, int);
+void get_row_d(int, void *, int);
 
 
-int put_row_c(int, void *);
-int put_row_f(int, void *);
-int put_row_d(int, void *);
+void put_row_c(int, void *);
+void put_row_f(int, void *);
+void put_row_d(int, void *);
 
 
 void *get_buf_c();
 void *get_buf_c();
 void *get_buf_f();
 void *get_buf_f();
@@ -69,9 +69,9 @@ extern int (*is_null) (void *);
 extern int (*bpe) ();
 extern int (*bpe) ();
 extern void *(*get_max) (void *, void *);
 extern void *(*get_max) (void *, void *);
 extern void *(*get_min) (void *, void *);
 extern void *(*get_min) (void *, void *);
-extern int (*get_row) (int, void *, int);
+extern void (*get_row) (int, void *, int);
 extern void *(*get_buf) ();
 extern void *(*get_buf) ();
-extern int (*put_row) (int, void *);
+extern void (*put_row) (int, void *);
 extern double (*slope) (void *, void *, double);
 extern double (*slope) (void *, void *, double);
 extern void (*set_min) (void *);
 extern void (*set_min) (void *);
 extern void (*set_max) (void *);
 extern void (*set_max) (void *);

+ 5 - 11
raster/r.his/main.c

@@ -209,17 +209,11 @@ int main(int argc, char **argv)
     for (atrow = 0; atrow < window.rows; atrow++) {
     for (atrow = 0; atrow < window.rows; atrow++) {
 	G_percent(atrow, window.rows, 2);
 	G_percent(atrow, window.rows, 2);
 
 
-	if (Rast_get_row_colors
-	    (hue_file, atrow, &hue_colors, hue_r, hue_g, hue_b, hue_n) < 0)
-	    G_fatal_error(_("Error reading 'hue' map"));
-	if (int_used &&
-	    (Rast_get_row_colors
-	     (int_file, atrow, &int_colors, int_r, dummy, dummy, int_n) < 0))
-	    G_fatal_error(_("Error reading 'intensity' map"));
-	if (sat_used &&
-	    (Rast_get_row_colors
-	     (sat_file, atrow, &sat_colors, sat_r, dummy, dummy, sat_n) < 0))
-	    G_fatal_error(_("Error reading 'saturation' map"));
+	Rast_get_row_colors(hue_file, atrow, &hue_colors, hue_r, hue_g, hue_b, hue_n);
+	if (int_used)
+	    Rast_get_row_colors(int_file, atrow, &int_colors, int_r, dummy, dummy, int_n);
+	if (sat_used)
+	    Rast_get_row_colors(sat_file, atrow, &sat_colors, sat_r, dummy, dummy, sat_n);
 
 
 	for (atcol = 0; atcol < window.cols; atcol++) {
 	for (atcol = 0; atcol < window.cols; atcol++) {
 	    if (nulldraw->answer) {
 	    if (nulldraw->answer) {

+ 2 - 6
raster/r.lake/main.c

@@ -255,14 +255,10 @@ int main(int argc, char *argv[])
 	out_water[row] = (FCELL *) G_calloc(cols, sizeof(FCELL));
 	out_water[row] = (FCELL *) G_calloc(cols, sizeof(FCELL));
 
 
 	/* In newly created space load data from file. */
 	/* In newly created space load data from file. */
-	if (Rast_get_f_row(in_terran_fd, in_terran[row], row) != 1)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  terrainmap, row);
+	Rast_get_f_row(in_terran_fd, in_terran[row], row);
 
 
 	if (smap_opt->answer)
 	if (smap_opt->answer)
-	    if (Rast_get_f_row(out_fd, out_water[row], row) != 1)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      seedmap, row);
+	    Rast_get_f_row(out_fd, out_water[row], row);
 
 
 	G_percent(row + 1, rows, 5);
 	G_percent(row + 1, rows, 5);
     }
     }

+ 2 - 6
raster/r.los/main.c

@@ -259,17 +259,13 @@ int main(int argc, char *argv[])
 	patt_fd = open(patt_name, 2);
 	patt_fd = open(patt_name, 2);
 	segment_init(&seg_patt, patt_fd, 4);
 	segment_init(&seg_patt, patt_fd, 4);
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
-	    if (Rast_get_row(patt, cell, row, CELL_TYPE) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      patt_layer, row);
+	    Rast_get_row(patt, cell, row, CELL_TYPE);
 	    segment_put_row(&seg_patt, cell, row);
 	    segment_put_row(&seg_patt, cell, row);
 	}
 	}
     }
     }
 
 
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_row(old, fcell, row, FCELL_TYPE) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  elev_layer, row);
+	Rast_get_row(old, fcell, row, FCELL_TYPE);
 	segment_put_row(&seg_in, fcell, row);
 	segment_put_row(&seg_in, fcell, row);
     }
     }
 
 

+ 1 - 2
raster/r.mapcalc/map.c

@@ -367,8 +367,7 @@ static void translate_from_cats(struct map *m, CELL * cell, DCELL * xcell,
 
 
 static void read_row(int fd, void *buf, int row, int res_type)
 static void read_row(int fd, void *buf, int row, int res_type)
 {
 {
-    if (Rast_get_row(fd, buf, row, res_type) < 0)
-	G_fatal_error(_("Unable to read raster map row %d"), row);
+    Rast_get_row(fd, buf, row, res_type);
 }
 }
 
 
 static void setup_map(struct map *m)
 static void setup_map(struct map *m)

+ 1 - 2
raster/r.mfilter/getrow.c

@@ -9,8 +9,7 @@
 
 
 int getmaprow(int fd, void *buf, int row, int len)
 int getmaprow(int fd, void *buf, int row, int len)
 {
 {
-    if (Rast_get_d_row(fd, (DCELL *) buf, row) < 0)
-	G_fatal_error(_("Cannot read raster row %d"), row);
+    Rast_get_d_row(fd, (DCELL *) buf, row);
     return 1;
     return 1;
 }
 }
 
 

+ 1 - 5
raster/r.null/main.c

@@ -324,11 +324,7 @@ int doit(const char *name, const char *mapset, int change_null, RASTER_MAP_TYPE
     for (row = 0; row < cellhd.rows; row++) {
     for (row = 0; row < cellhd.rows; row++) {
 	G_percent(row, cellhd.rows, 1);
 	G_percent(row, cellhd.rows, 1);
 
 
-	if (Rast_get_row_nomask(old, rast, row, map_type) < 0) {
-	    G_warning(_("Unable to read raster map <%s> row %d"),
-		      name, row);
-	    break;
-	}
+	Rast_get_row_nomask(old, rast, row, map_type);
 
 
 	mask_raster_array(rast, cellhd.cols, change_null, map_type);
 	mask_raster_array(rast, cellhd.cols, change_null, map_type);
 
 

+ 2 - 4
raster/r.out.arc/main.c

@@ -169,11 +169,9 @@ int main(int argc, char *argv[])
 
 
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_row(fd, raster, row, out_type) < 0)
-	    exit(EXIT_FAILURE);
+	Rast_get_row(fd, raster, row, out_type);
 	/*
 	/*
-	   if (Rast_get_null_value_row(fd, null_row, row) < 0)
-	   exit(EXIT_FAILURE);
+	   Rast_get_null_value_row(fd, null_row, row);
 	 */
 	 */
 	for (col = 0, ptr = raster; col < ncols; col++,
 	for (col = 0, ptr = raster; col < ncols; col++,
 	     ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {
 	     ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {

+ 3 - 6
raster/r.out.ascii/formspecific.c

@@ -38,8 +38,7 @@ int write_GRASS(int fd,
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_row(fd, raster, row, out_type) < 0)
-	    return (row);
+	Rast_get_row(fd, raster, row, out_type);
 
 
 	for (col = 0, ptr = raster; col < ncols; col++,
 	for (col = 0, ptr = raster; col < ncols; col++,
 	     ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {
 	     ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {
@@ -91,8 +90,7 @@ int write_MODFLOW(int fd,
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_row(fd, raster, row, out_type) < 0)
-	    return (row);
+	Rast_get_row(fd, raster, row, out_type);
 
 
 	colcnt = 0;
 	colcnt = 0;
 	for (col = 0, ptr = raster; col < ncols; col++,
 	for (col = 0, ptr = raster; col < ncols; col++,
@@ -177,8 +175,7 @@ int write_GSGRID(int fd,
     for (row = nrows - 1; row >= 0; row--) {
     for (row = nrows - 1; row >= 0; row--) {
 	G_percent((row - nrows) * (-1), nrows, 2);
 	G_percent((row - nrows) * (-1), nrows, 2);
 
 
-	if (Rast_get_row(fd, raster, row, out_type) < 0)
-	    return (row);
+	Rast_get_row(fd, raster, row, out_type);
 
 
 	colcnt = 0;
 	colcnt = 0;
 	for (col = 0, ptr = raster; col < ncols; col++,
 	for (col = 0, ptr = raster; col < ncols; col++,

+ 1 - 2
raster/r.out.bin/main.c

@@ -330,8 +330,7 @@ int main(int argc, char *argv[])
     G_message(_("c=%d"), region.cols);
     G_message(_("c=%d"), region.cols);
 
 
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_row(fd, raster, row, out_type) < 0)
-	    G_fatal_error(_("Reading map"));
+	Rast_get_row(fd, raster, row, out_type);
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
 	for (col = 0, ptr = raster; col < ncols; col++,
 	for (col = 0, ptr = raster; col < ncols; col++,

+ 6 - 30
raster/r.out.gdal/export_band.c

@@ -88,11 +88,7 @@ int exact_checks(GDALDataType export_datatype,
 
 
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 
 
-	    if (Rast_get_row(fd, bufer, row, maptype) < 0) {
-		G_warning(_("Unable to read raster map <%s> row %d"),
-			  name, row);
-		return -1;
-	    }
+	    Rast_get_row(fd, bufer, row, maptype);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		if (nulls[col]) {
 		if (nulls[col]) {
@@ -120,11 +116,7 @@ int exact_checks(GDALDataType export_datatype,
 
 
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 
 
-	    if (Rast_get_row(fd, bufer, row, maptype) < 0) {
-		G_warning(_("Unable to read raster map <%s> row %d"),
-			  name, row);
-		return -1;
-	    }
+	    Rast_get_row(fd, bufer, row, maptype);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		if (nulls[col]) {
 		if (nulls[col]) {
@@ -152,11 +144,7 @@ int exact_checks(GDALDataType export_datatype,
 
 
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 
 
-	    if (Rast_get_row(fd, bufer, row, maptype) < 0) {
-		G_warning(_("Unable to read raster map <%s> row %d"),
-			  name, row);
-		return -1;
-	    }
+	    Rast_get_row(fd, bufer, row, maptype);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		if (nulls[col]) {
 		if (nulls[col]) {
@@ -395,11 +383,7 @@ int export_band(GDALDatasetH hMEMDS, GDALDataType export_datatype, int band,
 
 
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 
 
-	    if (Rast_get_row(fd, bufer, row, maptype) < 0) {
-		G_warning(_("Unable to read raster map <%s> row %d"),
-			  name, row);
-		return -1;
-	    }
+	    Rast_get_row(fd, bufer, row, maptype);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		if (nulls[col]) {
 		if (nulls[col]) {
@@ -429,11 +413,7 @@ int export_band(GDALDatasetH hMEMDS, GDALDataType export_datatype, int band,
 
 
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 
 
-	    if (Rast_get_row(fd, bufer, row, maptype) < 0) {
-		G_warning(_("Unable to read raster map <%s> row %d"),
-			  name, row);
-		return -1;
-	    }
+	    Rast_get_row(fd, bufer, row, maptype);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		if (nulls[col]) {
 		if (nulls[col]) {
@@ -463,11 +443,7 @@ int export_band(GDALDatasetH hMEMDS, GDALDataType export_datatype, int band,
 
 
 	for (row = 0; row < rows; row++) {
 	for (row = 0; row < rows; row++) {
 
 
-	    if (Rast_get_row(fd, bufer, row, maptype) < 0) {
-		G_warning(_("Unable to read raster map <%s> row %d"),
-			  name, row);
-		return -1;
-	    }
+	    Rast_get_row(fd, bufer, row, maptype);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    Rast_get_null_value_row(fd, nulls, row);
 	    for (col = 0; col < cols; col++) {
 	    for (col = 0; col < cols; col++) {
 		if (nulls[col]) {
 		if (nulls[col]) {

+ 3 - 12
raster/r.out.gridatb/file_io.c

@@ -53,10 +53,7 @@ void rdwr_gridatb(void)
 	G_percent(row, cellhd.rows, 2);
 	G_percent(row, cellhd.rows, 2);
 	switch (data_type) {
 	switch (data_type) {
 	case CELL_TYPE:
 	case CELL_TYPE:
-	    if (Rast_get_c_row(fd, cell, row) < 0) {
-		Rast_close(fd);
-		exit(1);
-	    }
+	    Rast_get_c_row(fd, cell, row);
 
 
 	    for (col = 0; col < cellhd.cols; col++) {
 	    for (col = 0; col < cellhd.cols; col++) {
 		if (Rast_is_c_null_value(&cell[col]))
 		if (Rast_is_c_null_value(&cell[col]))
@@ -68,10 +65,7 @@ void rdwr_gridatb(void)
 	    }
 	    }
 	    break;
 	    break;
 	case FCELL_TYPE:
 	case FCELL_TYPE:
-	    if (Rast_get_f_row(fd, fcell, row) < 0) {
-		Rast_close(fd);
-		exit(1);
-	    }
+	    Rast_get_f_row(fd, fcell, row);
 
 
 	    for (col = 0; col < cellhd.cols; col++) {
 	    for (col = 0; col < cellhd.cols; col++) {
 		if (Rast_is_f_null_value(&fcell[col]))
 		if (Rast_is_f_null_value(&fcell[col]))
@@ -83,10 +77,7 @@ void rdwr_gridatb(void)
 	    }
 	    }
 	    break;
 	    break;
 	case DCELL_TYPE:
 	case DCELL_TYPE:
-	    if (Rast_get_d_row(fd, dcell, row) < 0) {
-		Rast_close(fd);
-		exit(1);
-	    }
+	    Rast_get_d_row(fd, dcell, row);
 
 
 	    for (col = 0; col < cellhd.cols; col++) {
 	    for (col = 0; col < cellhd.cols; col++) {
 		if (Rast_is_d_null_value(&dcell[col]))
 		if (Rast_is_d_null_value(&dcell[col]))

+ 1 - 2
raster/r.out.mat/main.c

@@ -307,8 +307,7 @@ int main(int argc, char *argv[])
 	 ptr =
 	 ptr =
 	 G_incr_void_ptr(ptr,
 	 G_incr_void_ptr(ptr,
 			 (G_window_cols() + 1) * Rast_cell_size(map_type))) {
 			 (G_window_cols() + 1) * Rast_cell_size(map_type))) {
-	if (Rast_get_row(fd, ptr, row, map_type) < 0)
-	    G_fatal_error("reading map");
+	Rast_get_row(fd, ptr, row, map_type);
 	G_percent(row, mrows, 2);
 	G_percent(row, mrows, 2);
     }
     }
     G_percent(row, mrows, 2);	/* finish it off */
     G_percent(row, mrows, 2);	/* finish it off */

+ 1 - 3
raster/r.out.mpeg/main.c

@@ -291,9 +291,7 @@ static int load_files(void)
 	    voidc = Rast_allocate_buf(rtype);
 	    voidc = Rast_allocate_buf(rtype);
 
 
 	    for (row = 0; row < vrows; row++) {
 	    for (row = 0; row < vrows; row++) {
-		if (Rast_get_row(fd, voidc,
-				     (int)(row / vscale), rtype) < 0)
-		    G_fatal_error(_("Error reading row <%d>"), row);
+		Rast_get_row(fd, voidc, (int)(row / vscale), rtype);
 
 
 		rowoff = (vyoff + row) * ncols;
 		rowoff = (vyoff + row) * ncols;
 		Rast_lookup_colors(voidc, tr, tg, tb,
 		Rast_lookup_colors(voidc, tr, tg, tb,

+ 1 - 2
raster/r.out.png/main.c

@@ -251,8 +251,7 @@ int main(int argc, char *argv[])
 	    for (row = 0; row < w.rows; row++) {
 	    for (row = 0; row < w.rows; row++) {
 
 
 		G_percent(row, w.rows, 5);
 		G_percent(row, w.rows, 5);
-		if (Rast_get_row(cellfile, (void *)voidc, row, rtype) < 0)
-		    exit(EXIT_FAILURE);
+		Rast_get_row(cellfile, (void *)voidc, row, rtype);
 		Rast_lookup_colors((void *)voidc, ored, ogrn, oblu, set,
 		Rast_lookup_colors((void *)voidc, ored, ogrn, oblu, set,
 				   w.cols, &colors, rtype);
 				   w.cols, &colors, rtype);
 
 

+ 1 - 2
raster/r.out.pov/main.c

@@ -259,8 +259,7 @@ void processProfiles(int inputFile, FILE * outputF)
 
 
     cell = Rast_allocate_c_buf();
     cell = Rast_allocate_c_buf();
     for (r = 0; r < rowCount; r++) {
     for (r = 0; r < rowCount; r++) {
-	if (Rast_get_c_row(inputFile, cell, r) < 0)
-	    exit(1);
+	Rast_get_c_row(inputFile, cell, r);
 	/* break; */
 	/* break; */
 
 
 	for (c = 0; c < columnCount; c++) {
 	for (c = 0; c < columnCount; c++) {

+ 2 - 5
raster/r.out.ppm/main.c

@@ -162,9 +162,7 @@ int main(int argc, char *argv[])
 	if (!gscale->answer) {	/* 24BIT COLOR IMAGE */
 	if (!gscale->answer) {	/* 24BIT COLOR IMAGE */
 	    for (row = 0; row < w.rows; row++) {
 	    for (row = 0; row < w.rows; row++) {
 		G_percent(row, w.rows, 5);
 		G_percent(row, w.rows, 5);
-		if (Rast_get_row(cellfile, (void *)voidc, row, rtype) < 0)
-		    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-				  rast->answer, row);
+		Rast_get_row(cellfile, (void *)voidc, row, rtype);
 		Rast_lookup_colors((void *)voidc, ored, ogrn, oblu, set,
 		Rast_lookup_colors((void *)voidc, ored, ogrn, oblu, set,
 				   w.cols, &colors, rtype);
 				   w.cols, &colors, rtype);
 
 
@@ -186,8 +184,7 @@ int main(int argc, char *argv[])
 	    for (row = 0; row < w.rows; row++) {
 	    for (row = 0; row < w.rows; row++) {
 
 
 		G_percent(row, w.rows, 5);
 		G_percent(row, w.rows, 5);
-		if (Rast_get_row(cellfile, (void *)voidc, row, rtype) < 0)
-		    exit(1);
+		Rast_get_row(cellfile, (void *)voidc, row, rtype);
 		Rast_lookup_colors((void *)voidc, ored, ogrn, oblu, set,
 		Rast_lookup_colors((void *)voidc, ored, ogrn, oblu, set,
 				   w.cols, &colors, rtype);
 				   w.cols, &colors, rtype);
 
 

+ 1 - 2
raster/r.out.ppm3/main.c

@@ -158,8 +158,7 @@ int main(int argc, char **argv)
 	G_percent(row, w.rows, 5);
 	G_percent(row, w.rows, 5);
 
 
 	for (i = 0; i < 3; i++) {
 	for (i = 0; i < 3; i++) {
-	    if (Rast_get_row(B[i].file, B[i].array, row, B[i].type) < 0)
-		G_fatal_error("Rast_get_row failed");
+	    Rast_get_row(B[i].file, B[i].array, row, B[i].type);
 
 
 	    Rast_lookup_colors(B[i].array,
 	    Rast_lookup_colors(B[i].array,
 				   (i == 0) ? B[i].buf : dummy,
 				   (i == 0) ? B[i].buf : dummy,

+ 3 - 6
raster/r.out.tiff/main.c

@@ -249,10 +249,8 @@ int main(int argc, char *argv[])
 		 imagelength) ? imagelength - row : tilelength;
 		 imagelength) ? imagelength - row : tilelength;
 	    uint32 colb = 0;
 	    uint32 colb = 0;
 
 
-	    for (i = 0; i < nrow; i++) {
-		if (Rast_get_c_row(in, cells[i], row + i) < 0)
-		    G_fatal_error(_("Reading raster map..."));
-	    }
+	    for (i = 0; i < nrow; i++)
+		Rast_get_c_row(in, cells[i], row + i);
 
 
 	    for (col = 0; col < imagewidth; col += tilewidth) {
 	    for (col = 0; col < imagewidth; col += tilewidth) {
 		tsample_t s;
 		tsample_t s;
@@ -337,8 +335,7 @@ int main(int argc, char *argv[])
 
 
 	    G_percent(row, h.ras_height, 2);
 	    G_percent(row, h.ras_height, 2);
 
 
-	    if (Rast_get_c_row(in, cell, row) < 0)
-		exit(EXIT_FAILURE);
+	    Rast_get_c_row(in, cell, row);
 
 
 	    cellptr = cell;
 	    cellptr = cell;
 	    if (palette) {
 	    if (palette) {

+ 9 - 36
raster/r.out.vtk/writeascii.c

@@ -181,10 +181,7 @@ write_vtk_structured_coordinates(int fd, FILE * fp, char *varname,
 	colcount = 0;
 	colcount = 0;
 	G_percent((row - nrows) * (-1), nrows, 2);
 	G_percent((row - nrows) * (-1), nrows, 2);
 
 
-	if (Rast_get_row(fd, raster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
+	Rast_get_row(fd, raster, row, out_type);
 
 
 	nspos = region.ns_res / 2 + region.south + rowcount * region.ns_res;
 	nspos = region.ns_res / 2 + region.south + rowcount * region.ns_res;
 	nspos -= y_extent;
 	nspos -= y_extent;
@@ -242,10 +239,7 @@ write_vtk_polygonal_coordinates(int fd, FILE * fp, char *varname,
 	colcount = 0;
 	colcount = 0;
 	G_percent((row - nrows) * (-1), nrows, 10);
 	G_percent((row - nrows) * (-1), nrows, 10);
 
 
-	if (Rast_get_row(fd, raster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
+	Rast_get_row(fd, raster, row, out_type);
 
 
 	nspos = region.ns_res / 2 + region.south + rowcount * region.ns_res;
 	nspos = region.ns_res / 2 + region.south + rowcount * region.ns_res;
 	nspos -= y_extent;
 	nspos -= y_extent;
@@ -354,10 +348,7 @@ write_vtk_data(int fd, FILE * fp, char *varname, struct Cell_head region,
     for (row = nrows - 1; row >= 0; row--) {
     for (row = nrows - 1; row >= 0; row--) {
 	G_percent((row - nrows) * (-1), nrows, 10);
 	G_percent((row - nrows) * (-1), nrows, 10);
 
 
-	if (Rast_get_row(fd, raster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
+	Rast_get_row(fd, raster, row, out_type);
 
 
 	for (col = 0, ptr = raster; col < ncols;
 	for (col = 0, ptr = raster; col < ncols;
 	     col++, ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {
 	     col++, ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {
@@ -401,18 +392,9 @@ write_vtk_rgb_image_data(int redfd, int greenfd, int bluefd, FILE * fp,
     for (row = nrows - 1; row >= 0; row--) {
     for (row = nrows - 1; row >= 0; row--) {
 	G_percent((row - nrows) * (-1), nrows, 10);
 	G_percent((row - nrows) * (-1), nrows, 10);
 
 
-	if (Rast_get_row(redfd, redraster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
-	if (Rast_get_row(greenfd, greenraster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
-	if (Rast_get_row(bluefd, blueraster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
+	Rast_get_row(redfd, redraster, row, out_type);
+	Rast_get_row(greenfd, greenraster, row, out_type);
+	Rast_get_row(bluefd, blueraster, row, out_type);
 
 
 	for (col = 0, redptr = redraster, greenptr = greenraster, blueptr =
 	for (col = 0, redptr = redraster, greenptr = greenraster, blueptr =
 	     blueraster; col < ncols;
 	     blueraster; col < ncols;
@@ -468,18 +450,9 @@ write_vtk_vector_data(int xfd, int yfd, int zfd, FILE * fp,
     for (row = nrows - 1; row >= 0; row--) {
     for (row = nrows - 1; row >= 0; row--) {
 	G_percent((row - nrows) * (-1), nrows, 10);
 	G_percent((row - nrows) * (-1), nrows, 10);
 
 
-	if (Rast_get_row(xfd, xraster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
-	if (Rast_get_row(yfd, yraster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
-	if (Rast_get_row(zfd, zraster, row, out_type) < 0) {
-	    G_fatal_error(_("Unable to read row %i\n"), row);
-	    return;
-	}
+	Rast_get_row(xfd, xraster, row, out_type);
+	Rast_get_row(yfd, yraster, row, out_type);
+	Rast_get_row(zfd, zraster, row, out_type);
 
 
 	for (col = 0, xptr = xraster, yptr = yraster, zptr =
 	for (col = 0, xptr = xraster, yptr = yraster, zptr =
 	     zraster; col < ncols;
 	     zraster; col < ncols;

+ 2 - 6
raster/r.patch/main.c

@@ -118,16 +118,12 @@ int main(int argc, char *argv[])
     G_verbose_message(_("Percent complete..."));
     G_verbose_message(_("Percent complete..."));
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_row(infd[0], presult, row, out_type) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			  names[0], row);
+	Rast_get_row(infd[0], presult, row, out_type);
 
 
 	if (out_type == CELL_TYPE)
 	if (out_type == CELL_TYPE)
 	    Rast_update_cell_stats((CELL *) presult, ncols, &statf[0]);
 	    Rast_update_cell_stats((CELL *) presult, ncols, &statf[0]);
 	for (i = 1; i < nfiles; i++) {
 	for (i = 1; i < nfiles; i++) {
-	    if (Rast_get_row(infd[i], patch, row, out_type) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"),
-			      names[i], row);
+	    Rast_get_row(infd[i], patch, row, out_type);
 	    if (!do_patch
 	    if (!do_patch
 		(presult, patch, &statf[i], ncols, out_type, ZEROFLAG))
 		(presult, patch, &statf[i], ncols, out_type, ZEROFLAG))
 		break;
 		break;

+ 2 - 2
raster/r.profile/read_rast.c

@@ -39,8 +39,8 @@ int read_rast(double east, double north, double dist, int fd, int coords,
 	outofbounds = TRUE;
 	outofbounds = TRUE;
 
 
     if (!outofbounds) {
     if (!outofbounds) {
-	if (row != cur_row && Rast_get_d_row(fd, dcell, row) < 0)
-	    G_fatal_error(_("Unable to read raster map row %d"), row);
+	if (row != cur_row)
+	    Rast_get_d_row(fd, dcell, row);
 	cur_row = row;
 	cur_row = row;
     }
     }
 
 

+ 1 - 2
raster/r.proj/readcell.c

@@ -78,8 +78,7 @@ struct cache *readcell(int fdi, const char *size)
 	    if (row + y >= nrows)
 	    if (row + y >= nrows)
 		break;
 		break;
 
 
-	    if (Rast_get_f_row(fdi, &tmpbuf[y * nx * BDIM], row + y) < 0)
-		G_fatal_error(_("Error reading input"));
+	    Rast_get_f_row(fdi, &tmpbuf[y * nx * BDIM], row + y);
 	}
 	}
 
 
 	for (x = 0; x < nx; x++)
 	for (x = 0; x < nx; x++)

+ 6 - 8
raster/r.random/count.c

@@ -67,14 +67,12 @@ void get_stats(struct rr_state *theState)
     }
     }
     G_message(_("Collecting Stats..."));
     G_message(_("Collecting Stats..."));
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
-	if (Rast_get_row(theState->fd_old, theState->buf.data.v,
-			     row, theState->buf.type) < 0)
-	    G_fatal_error(_("Cannot read raster row [%d]"), row);
-	if (theState->docover == 1) {
-	    if (Rast_get_row(theState->fd_cold, theState->cover.data.v,
-				 row, theState->cover.type) < 0)
-		G_fatal_error(_("Cannot read cover raster row [%d]"), row);
-	}
+	Rast_get_row(theState->fd_old, theState->buf.data.v,
+		     row, theState->buf.type);
+	if (theState->docover == 1)
+	    Rast_get_row(theState->fd_cold, theState->cover.data.v,
+			 row, theState->cover.type);
+
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    if (is_null_value(theState->buf, col)) {
 	    if (is_null_value(theState->buf, col)) {
 		theState->nNulls++;
 		theState->nNulls++;

+ 3 - 9
raster/r.random/random.c

@@ -122,16 +122,10 @@ int execute_random(struct rr_state *theState)
     cat = 1;
     cat = 1;
     /* Execute for loop for every row if nt>1 */
     /* Execute for loop for every row if nt>1 */
     for (row = 0; row < nrows && nt; row++) {
     for (row = 0; row < nrows && nt; row++) {
-	if (Rast_get_row
-	    (infd, theState->buf.data.v, row, theState->buf.type) < 0)
-	    G_fatal_error(_("Cannot read raster row [%d] from raster map <%s>"),
-			  row, theState->inraster);
+	Rast_get_row(infd, theState->buf.data.v, row, theState->buf.type);
 	if (theState->docover == 1) {
 	if (theState->docover == 1) {
-	    if (Rast_get_row
-		(cinfd, theState->cover.data.v, row,
-		 theState->cover.type) < 0)
-		G_fatal_error(_("Cannot read raster row [%d] from cover raster map <%s>"),
-			      row, theState->inrcover);
+	    Rast_get_row(cinfd, theState->cover.data.v, row,
+			 theState->cover.type);
 	}
 	}
 
 
 	for (col = 0; col < ncols && nt; col++) {
 	for (col = 0; col < ncols && nt; col++) {

+ 1 - 5
raster/r.resamp.rst/main.c

@@ -427,11 +427,7 @@ int main(int argc, char *argv[])
     else {
     else {
 	cellrow = Rast_allocate_f_buf();
 	cellrow = Rast_allocate_f_buf();
 	for (m1 = 0; m1 < inp_rows; m1++) {
 	for (m1 = 0; m1 < inp_rows; m1++) {
-	    ret_val = Rast_get_f_row(fdinp, cellrow, m1);
-	    if (ret_val < 0)
-		G_fatal_error(_("Error reading row %d (error = %d)"),
-			      m1, ret_val);
-
+	    Rast_get_f_row(fdinp, cellrow, m1);
 	    Rast_row_update_fp_range(cellrow, m1, &range, FCELL_TYPE);
 	    Rast_row_update_fp_range(cellrow, m1, &range, FCELL_TYPE);
 	}
 	}
 	Rast_get_fp_range_min_max(&range, &cellmin, &cellmax);
 	Rast_get_fp_range_min_max(&range, &cellmin, &cellmax);

+ 1 - 2
raster/r.resample/main.c

@@ -112,8 +112,7 @@ int main(int argc, char *argv[])
 
 
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_row(infd, rast, row, data_type) < 0)
-	    G_fatal_error(_("Error reading row %d"), row);
+	Rast_get_row(infd, rast, row, data_type);
 	if (Rast_put_row(outfd, rast, out_type) < 0)
 	if (Rast_put_row(outfd, rast, out_type) < 0)
 	    G_fatal_error(_("Error writing row %d"), row);
 	    G_fatal_error(_("Error writing row %d"), row);
 	Rast_mark_cats(rast, ncols, &cats, data_type);
 	Rast_mark_cats(rast, ncols, &cats, data_type);

+ 1 - 2
raster/r.rescale.eq/get_stats.c

@@ -19,8 +19,7 @@ int get_stats(const char *name, struct Cell_stats *statf)
     G_message(_("Reading %s ..."), name);
     G_message(_("Reading %s ..."), name);
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(fd, cell, row) < 0)
-	    break;
+	Rast_get_c_row(fd, cell, row);
 	Rast_update_cell_stats(cell, ncols, statf);
 	Rast_update_cell_stats(cell, ncols, statf);
     }
     }
     if (row < nrows)
     if (row < nrows)

+ 1 - 2
raster/r.rescale/get_range.c

@@ -24,8 +24,7 @@ int get_range(const char *name, long *min, long *max)
 	G_message(_("Reading %s ..."), name);
 	G_message(_("Reading %s ..."), name);
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
 	    G_percent(row, nrows, 2);
 	    G_percent(row, nrows, 2);
-	    if (Rast_get_c_row_nomask(fd, cell, row) < 0)
-		exit(1);
+	    Rast_get_c_row_nomask(fd, cell, row);
 	    for (col = 0; col < ncols; col++)
 	    for (col = 0; col < ncols; col++)
 		Rast_update_range(cell[col], &range);
 		Rast_update_range(cell[col], &range);
 	}
 	}

+ 10 - 20
raster/r.ros/main.c

@@ -530,8 +530,7 @@ int main(int argc, char *argv[])
     /*if considering spotting, read elevation map into an array */
     /*if considering spotting, read elevation map into an array */
     if (spotting)
     if (spotting)
 	for (row = 0; row < nrows; row++) {
 	for (row = 0; row < nrows; row++) {
-	    if (Rast_get_c_row(elev_fd, elev, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.elev->answer, row);
+	    Rast_get_c_row(elev_fd, elev, row);
 	    for (col = 0; col < ncols; col++)
 	    for (col = 0; col < ncols; col++)
 		DATA(map_elev, row, col) = elev[col];
 		DATA(map_elev, row, col) = elev[col];
 	}
 	}
@@ -539,31 +538,22 @@ int main(int argc, char *argv[])
     /*major computation: compute ROSs one cell a time */
     /*major computation: compute ROSs one cell a time */
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(fuel_fd, fuel, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.model->answer, row);
+	Rast_get_c_row(fuel_fd, fuel, row);
 	if (parm.mois_1h->answer)
 	if (parm.mois_1h->answer)
-	    if (Rast_get_c_row(mois_1h_fd, mois_1h, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.mois_1h->answer, row);
+	    Rast_get_c_row(mois_1h_fd, mois_1h, row);
 	if (parm.mois_10h->answer)
 	if (parm.mois_10h->answer)
-	    if (Rast_get_c_row(mois_10h_fd, mois_10h, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.mois_10h->answer, row);
+	    Rast_get_c_row(mois_10h_fd, mois_10h, row);
 	if (parm.mois_100h->answer)
 	if (parm.mois_100h->answer)
-	    if (Rast_get_c_row(mois_100h_fd, mois_100h, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.mois_100h->answer, row);
-	if (Rast_get_c_row(mois_live_fd, mois_live, row) < 0)
-	    G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.mois_live->answer, row);
+	    Rast_get_c_row(mois_100h_fd, mois_100h, row);
+	Rast_get_c_row(mois_live_fd, mois_live, row);
 	if (parm.vel->answer)
 	if (parm.vel->answer)
-	    if (Rast_get_c_row(vel_fd, vel, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.vel->answer, row);
+	    Rast_get_c_row(vel_fd, vel, row);
 	if (parm.dir->answer)
 	if (parm.dir->answer)
-	    if (Rast_get_c_row(dir_fd, dir, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.dir->answer, row);
+	    Rast_get_c_row(dir_fd, dir, row);
 	if (parm.slope->answer)
 	if (parm.slope->answer)
-	    if (Rast_get_c_row(slope_fd, slope, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.slope->answer, row);
+	    Rast_get_c_row(slope_fd, slope, row);
 	if (parm.aspect->answer)
 	if (parm.aspect->answer)
-	    if (Rast_get_c_row(aspect_fd, aspect, row) < 0)
-		G_fatal_error(_("Unable to read raster map <%s> row %d"), parm.aspect->answer, row);
+	    Rast_get_c_row(aspect_fd, aspect, row);
 
 
 	/*initialize cell buffers for output map layers */
 	/*initialize cell buffers for output map layers */
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {

+ 1 - 2
raster/r.spread/collect_ori.c

@@ -59,8 +59,7 @@ void collect_ori(int start_fd)
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
 
 
-	if (Rast_get_c_row(start_fd, cell, row) < 0)
-	    exit(1);
+	Rast_get_c_row(start_fd, cell, row);
 
 
 	for (col = 0; col < ncols; col++) {
 	for (col = 0; col < ncols; col++) {
 	    if (*(cell + col) > 0) {
 	    if (*(cell + col) > 0) {

+ 6 - 12
raster/r.spread/main.c

@@ -421,29 +421,23 @@ int main(int argc, char *argv[])
 
 
     for (row = 0; row < nrows; row++) {
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);
 	G_percent(row, nrows, 2);
-	if (Rast_get_c_row(max_fd, cell, row) < 0)
-	    exit(EXIT_FAILURE);
+	Rast_get_c_row(max_fd, cell, row);
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)
 	    DATA(map_max, row, col) = cell[col];
 	    DATA(map_max, row, col) = cell[col];
-	if (Rast_get_c_row(dir_fd, cell, row) < 0)
-	    exit(EXIT_FAILURE);
+	Rast_get_c_row(dir_fd, cell, row);
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)
 	    DATA(map_dir, row, col) = cell[col];
 	    DATA(map_dir, row, col) = cell[col];
-	if (Rast_get_c_row(base_fd, cell, row) < 0)
-	    exit(EXIT_FAILURE);
+	Rast_get_c_row(base_fd, cell, row);
 	for (col = 0; col < ncols; col++)
 	for (col = 0; col < ncols; col++)
 	    DATA(map_base, row, col) = cell[col];
 	    DATA(map_base, row, col) = cell[col];
 	if (spotting) {
 	if (spotting) {
-	    if (Rast_get_c_row(spotdist_fd, cell, row) < 0)
-		exit(EXIT_FAILURE);
+	    Rast_get_c_row(spotdist_fd, cell, row);
 	    for (col = 0; col < ncols; col++)
 	    for (col = 0; col < ncols; col++)
 		DATA(map_spotdist, row, col) = cell[col];
 		DATA(map_spotdist, row, col) = cell[col];
-	    if (Rast_get_c_row(velocity_fd, cell, row) < 0)
-		exit(EXIT_FAILURE);
+	    Rast_get_c_row(velocity_fd, cell, row);
 	    for (col = 0; col < ncols; col++)
 	    for (col = 0; col < ncols; col++)
 		DATA(map_velocity, row, col) = cell[col];
 		DATA(map_velocity, row, col) = cell[col];
-	    if (Rast_get_c_row(mois_fd, cell, row) < 0)
-		exit(EXIT_FAILURE);
+	    Rast_get_c_row(mois_fd, cell, row);
 	    for (col = 0; col < ncols; col++)
 	    for (col = 0; col < ncols; col++)
 		DATA(map_mois, row, col) = cell[col];
 		DATA(map_mois, row, col) = cell[col];
 	}
 	}

+ 0 - 0
raster/r.spreadpath/main.c


Some files were not shown because too many files changed in this diff