changeset 20916:8ddb11c0b1f8

restore return statements after calls to octave_base_stream::error Unlike the global error function, the octave_base_stream::error function simply sets some internal class error info and does return. * oct-fstrm.cc, oct-stream.cc, oct-strstrm.cc: Rstore return statements after calls to octave_base_stream::error.
author John W. Eaton <jwe@octave.org>
date Wed, 16 Dec 2015 17:06:52 -0500
parents a3359fe50966
children a7051a169cad
files libinterp/corefcn/oct-fstrm.cc libinterp/corefcn/oct-stream.cc libinterp/corefcn/oct-strstrm.cc
diffstat 3 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/oct-fstrm.cc	Wed Dec 16 17:02:23 2015 -0500
+++ b/libinterp/corefcn/oct-fstrm.cc	Wed Dec 16 17:06:52 2015 -0500
@@ -65,6 +65,7 @@
 octave_fstream::seek (off_t, int)
 {
   error ("fseek: invalid_operation");
+  return -1;
 }
 
 // Return current stream position.
@@ -73,6 +74,7 @@
 octave_fstream::tell (void)
 {
   error ("ftell: invalid_operation");
+  return -1;
 }
 
 // Return nonzero if EOF has been reached on this stream.
--- a/libinterp/corefcn/oct-stream.cc	Wed Dec 16 17:02:23 2015 -0500
+++ b/libinterp/corefcn/oct-stream.cc	Wed Dec 16 17:06:52 2015 -0500
@@ -2609,6 +2609,8 @@
 
         default:
           error ("%s: invalid format specifier", who.c_str ());
+          return -1;
+          break;
         }
     }
 
--- a/libinterp/corefcn/oct-strstrm.cc	Wed Dec 16 17:02:23 2015 -0500
+++ b/libinterp/corefcn/oct-strstrm.cc	Wed Dec 16 17:06:52 2015 -0500
@@ -32,6 +32,7 @@
 octave_base_strstream::seek (off_t, int)
 {
   error ("fseek: invalid operation");
+  return -1;
 }
 
 // Return current stream position.
@@ -40,6 +41,7 @@
 octave_base_strstream::tell (void)
 {
   error ("ftell: invalid operation");
+  return -1;
 }
 
 octave_stream