[GRASS-SVN] r56590 - in grass/branches/releasebranch_6_4: include lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 4 02:38:48 PDT 2013
Author: hamish
Date: 2013-06-04 02:38:47 -0700 (Tue, 04 Jun 2013)
New Revision: 56590
Modified:
grass/branches/releasebranch_6_4/include/gisdefs.h
grass/branches/releasebranch_6_4/lib/gis/seek.c
Log:
int to off_t for fseeks and ftells (#1971, merge r56422 from devbr6)
Modified: grass/branches/releasebranch_6_4/include/gisdefs.h
===================================================================
--- grass/branches/releasebranch_6_4/include/gisdefs.h 2013-06-04 09:21:12 UTC (rev 56589)
+++ grass/branches/releasebranch_6_4/include/gisdefs.h 2013-06-04 09:38:47 UTC (rev 56590)
@@ -19,7 +19,7 @@
/*============================= Include Files ==============================*/
-/* none */
+#include <sys/types.h> /* for off_t */
/*=========================== Constants/Defines ============================*/
@@ -1085,8 +1085,8 @@
void G_rotate_around_point_int(int, int, int *, int *, double);
/* seek.c */
-int G_ftell(FILE *);
-void G_fseek(FILE *, int, int);
+off_t G_ftell(FILE *);
+void G_fseek(FILE *, off_t, int);
/* sample.c */
DCELL G_get_raster_sample_nearest(
Modified: grass/branches/releasebranch_6_4/lib/gis/seek.c
===================================================================
--- grass/branches/releasebranch_6_4/lib/gis/seek.c 2013-06-04 09:21:12 UTC (rev 56589)
+++ grass/branches/releasebranch_6_4/lib/gis/seek.c 2013-06-04 09:38:47 UTC (rev 56590)
@@ -24,12 +24,12 @@
\return file position
\return -1 on failure
*/
-int G_ftell(FILE *fp)
+off_t G_ftell(FILE *fp)
{
#ifdef HAVE_FSEEKO
return ftello(fp);
#else
- return (int) ftell(fp);
+ return (off_t) ftell(fp);
#endif
}
@@ -45,14 +45,14 @@
\param offset offset
\param whence
*/
-void G_fseek(FILE *fp, int offset, int whence)
+void G_fseek(FILE *fp, off_t offset, int whence)
{
#ifdef HAVE_FSEEKO
if (fseeko(fp, offset, whence) != 0)
G_fatal_error(_("Unable to seek"));
#else
long loff = (long) offset;
- if ((int) loff != offset)
+ if ((off_t) loff != offset)
G_fatal_error(_("Seek offset out of range"));
if (fseek(fp, loff, whence) != 0)
G_fatal_error(_("Unable to seek"));
More information about the grass-commit
mailing list