diff libinterp/interp-core/c-file-ptr-stream.h @ 16011:8122286c69a9

initial large file support for 32-bit systems * bootstrap.conf (gnulib_modules): Explicitly list largefile. * c-file-ptr-stream.cc, c-file-ptr-stream.h, oct-fstrm.cc, oct-fstrm.h, oct-iostrm.cc, oct-iostrm.h, oct-stdstrm.h, oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h, file-io.cc: Use off_t instead of long for seek and tell file position values.
author John W. Eaton <jwe@octave.org>
date Thu, 07 Feb 2013 11:58:46 -0500
parents 2fc554ffbc28
children
line wrap: on
line diff
--- a/libinterp/interp-core/c-file-ptr-stream.h	Thu Feb 07 11:58:40 2013 -0500
+++ b/libinterp/interp-core/c-file-ptr-stream.h	Thu Feb 07 11:58:46 2013 -0500
@@ -74,9 +74,9 @@
 
   int file_number () const { return f ? fileno (f) : -1; }
 
-  int seek (long offset, int origin);
+  int seek (off_t offset, int origin);
 
-  long tell (void);
+  off_t tell (void);
 
   void clear (void) { if (f) clearerr (f); }
 
@@ -117,10 +117,10 @@
 
   void stream_close (void) { if (buf) buf->buf_close (); }
 
-  int seek (long offset, int origin)
+  int seek (off_t offset, int origin)
     { return buf ? buf->seek (offset, origin) : -1; }
 
-  long tell (void) { return buf ? buf->tell () : -1; }
+  off_t tell (void) { return buf ? buf->tell () : -1; }
 
   void clear (void) { if (buf) buf->clear (); STREAM_T::clear (); }
 
@@ -192,10 +192,10 @@
 
   int file_number () const { return -1; }
 
-  int seek (long offset, int origin)
-    { return f ? gzseek (f, offset, origin) : -1; }
+  int seek (off_t offset, int origin)
+    { return f ? gzseek (f, offset, origin) >= 0 : -1; }
 
-  long tell (void) { return f ? gztell (f) : -1; }
+  off_t tell (void) { return f ? gztell (f) : -1; }
 
   void clear (void) { if (f) gzclearerr (f); }