changeset 21550:7ebd8ac26178

Enable seekg and tellg on octave_stream (bug #47517) * c-file-ptr-stream.cc (c_file_ptr_buf::seekoff, c_file_ptr_buf::seekpos): remove "#if 0" and replace fseek by fseeko and ftell by ftello.
author Lachlan Andrew <lachlanbis@gmail.com>
date Sun, 14 Feb 2016 10:12:30 +1100
parents 17845d0e359f
children 990c6c31a684
files libinterp/corefcn/c-file-ptr-stream.cc
diffstat 1 files changed, 7 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/c-file-ptr-stream.cc	Mon Mar 28 08:58:10 2016 -0700
+++ b/libinterp/corefcn/c-file-ptr-stream.cc	Sun Feb 14 10:12:30 2016 +1100
@@ -107,39 +107,31 @@
 }
 
 std::streampos
-c_file_ptr_buf::seekoff (std::streamoff /* offset */,
-                         std::ios::seekdir /* dir */,
+c_file_ptr_buf::seekoff (std::streamoff offset,
+                         std::ios::seekdir dir,
                          std::ios::openmode)
 {
-  // FIXME
-#if 0
   if (f)
     {
-      fseek (f, offset, seekdir_to_whence (dir));
+      gnulib::fseeko (f, offset, seekdir_to_whence (dir));
 
-      return ftell (f);
+      return gnulib::ftello (f);
     }
   else
     return 0;
-#endif
-  return -1;
 }
 
 std::streampos
-c_file_ptr_buf::seekpos (std::streampos /* offset */, std::ios::openmode)
+c_file_ptr_buf::seekpos (std::streampos offset, std::ios::openmode)
 {
-  // FIXME
-#if 0
   if (f)
     {
-      fseek (f, offset, SEEK_SET);
+      gnulib::fseeko (f, offset, SEEK_SET);
 
-      return ftell (f);
+      return gnulib::ftello (f);
     }
   else
     return 0;
-#endif
-  return -1;
 }
 
 int