Przeglądaj źródła

LFS-safe r.drain

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38632 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 15 lat temu
rodzic
commit
43fff4b3c2

+ 5 - 2
raster/r.drain/filldir.c

@@ -1,3 +1,5 @@
+#include <grass/config.h>
+#include <sys/types.h>
 #include <stdlib.h>
 #include <math.h>
 #include <limits.h>
@@ -34,7 +36,8 @@ void check(CELL newdir, CELL * dir, void *center, void *edge, double cnst,
 void build_one_row(int i, int nl, int ns, struct band3 *bnd, CELL * dir,
 		   struct metrics m)
 {
-    int j, offset, inc;
+    int j, inc;
+    off_t offset;
     CELL sdir;
     double slope;
     char *center;
@@ -97,7 +100,7 @@ void build_one_row(int i, int nl, int ns, struct band3 *bnd, CELL * dir,
 
 void filldir(int fe, int fd, int nl, struct band3 *bnd, struct metrics *m)
 {
-    int i, bufsz;
+    int i, bufsz;  /* use off_t bufsz for large files ? MM */
     CELL *dir;
 
     /* determine the flow direction in each cell.  On outer rows and columns

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

@@ -25,6 +25,7 @@
  *
  *****************************************************************************/
 
+#include <grass/config.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -87,7 +88,8 @@ int main(int argc, char **argv)
 
     struct point *list;
     struct point *thispoint;
-    int ival, bsz, start_row, start_col, mode;
+    int ival, start_row, start_col, mode;
+    off_t bsz;
     int costmode = 0;
     double east, north, val;
     struct point *drain(int, struct point *, int, int);

+ 1 - 0
raster/r.drain/resolve.c

@@ -1,3 +1,4 @@
+#include <grass/config.h>
 #include <stdlib.h>
 #include <string.h>
 #include <grass/gis.h>

+ 1 - 0
raster/r.drain/tinf.c

@@ -1,3 +1,4 @@
+#include <grass/config.h>
 /* #include <limits.h> */
 #include <float.h>
 #include <math.h>

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

@@ -94,7 +94,7 @@ double slope_d(void *, void *, double);
 struct band3
 {
     int ns;			/* samples per line */
-    int sz;			/* bytes per line */
+    off_t sz;			/* bytes per line */
     char *b[3];			/* pointers to start of each line */
 };