[GRASS-SVN] r56422 - in grass/branches/develbranch_6: include lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 26 04:41:10 PDT 2013
Author: hamish
Date: 2013-05-26 04:41:10 -0700 (Sun, 26 May 2013)
New Revision: 56422
Modified:
grass/branches/develbranch_6/include/gisdefs.h
grass/branches/develbranch_6/lib/gis/seek.c
Log:
int to off_t for fseeks and ftells (undo r45468, add #include for types.h)
Modified: grass/branches/develbranch_6/include/gisdefs.h
===================================================================
--- grass/branches/develbranch_6/include/gisdefs.h 2013-05-26 10:46:36 UTC (rev 56421)
+++ grass/branches/develbranch_6/include/gisdefs.h 2013-05-26 11:41:10 UTC (rev 56422)
@@ -19,7 +19,7 @@
/*============================= Include Files ==============================*/
-/* none */
+#include <sys/types.h> /* for off_t */
/*=========================== Constants/Defines ============================*/
@@ -1081,8 +1081,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/develbranch_6/lib/gis/seek.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/seek.c 2013-05-26 10:46:36 UTC (rev 56421)
+++ grass/branches/develbranch_6/lib/gis/seek.c 2013-05-26 11:41:10 UTC (rev 56422)
@@ -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