changeset 4888:4a796c5fc7a3

[project @ 2004-04-30 18:27:07 by jwe]
author jwe
date Fri, 30 Apr 2004 18:27:07 +0000
parents bbddd4339cf2
children 658aad1c1b05
files src/ChangeLog src/DLD-FUNCTIONS/dassl.cc src/DLD-FUNCTIONS/odessa.cc src/c-file-ptr-stream.h src/oct-stream.cc
diffstat 5 files changed, 28 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Apr 30 17:08:55 2004 +0000
+++ b/src/ChangeLog	Fri Apr 30 18:27:07 2004 +0000
@@ -1,3 +1,11 @@
+2004-04-30  John W. Eaton  <jwe@octave.org>
+
+	* oct-stream.cc (octave_base_stream::clear): Also clear stream state.
+	* oct-stdstrm.h (octave_stdiostream::clear): New function.
+	* c-file-ptr-stream.h (c_file_ptr_buf::clear,
+	i_c_file_ptr_stream::clear, o_c_file_ptr_stream::clear,
+	io_c_file_ptr_stream::clear): New functions.
+
 2004-04-29  David Bateman  <dbateman@free.fr>
 
 	* load-save.cc (Fload, Fsave): Accept -mat as well as -mat-binary.
--- a/src/DLD-FUNCTIONS/dassl.cc	Fri Apr 30 17:08:55 2004 +0000
+++ b/src/DLD-FUNCTIONS/dassl.cc	Fri Apr 30 18:27:07 2004 +0000
@@ -226,13 +226,12 @@
   + c {\\partial f \\over \\partial \\dot{x}}\n\
 $$\n\
 @end tex\n\
+@example\n\
 @ifinfo\n\
       df       df\n\
 jac = -- + c ------\n\
       dx     d xdot\n\
-@example\n\
 @end example\n\
-\n\
 @end ifinfo\n\
 \n\
 The modified Jacobian function must have the form\n\
--- a/src/DLD-FUNCTIONS/odessa.cc	Fri Apr 30 17:08:55 2004 +0000
+++ b/src/DLD-FUNCTIONS/odessa.cc	Fri Apr 30 18:27:07 2004 +0000
@@ -400,8 +400,8 @@
 If the computation is not successful, @var{istate} will be something\n\
 other than 2 and @var{msg} will contain additional information.\n\
 \n\
-You can use the function @code{lsode_options} to set optional\n\
-parameters for @code{lsode}.\n\
+You can use the function @code{odessa_options} to set optional\n\
+parameters for @code{odessa}.\n\
 @end deftypefn\n\
 @seealso{daspk, dassl, dasrt, lsode}")
 {
--- a/src/c-file-ptr-stream.h	Fri Apr 30 17:08:55 2004 +0000
+++ b/src/c-file-ptr-stream.h	Fri Apr 30 18:27:07 2004 +0000
@@ -82,6 +82,8 @@
 
   long tell (void) { return f ? ftell (f) : -1; }
 
+  void clear (void) { if (f) clearerr (f); }
+
   static int fclose (FILE *f) { return ::fclose (f); }
 
 protected:
@@ -115,6 +117,8 @@
 
   long tell (void) { return buf ? buf->tell () : -1; }
 
+  void clear (void) { if (buf) buf->clear (); std::istream::clear (); }
+
 private:
 
   c_file_ptr_buf *buf;
@@ -140,6 +144,8 @@
 
   long tell (void) { return buf ? buf->tell () : -1; }
 
+  void clear (void) { if (buf) buf->clear (); std::ostream::clear (); }
+
 private:
 
   c_file_ptr_buf *buf;
@@ -165,6 +171,8 @@
 
   long tell (void) { return buf ? buf->tell () : -1; }
 
+  void clear (void) { if (buf) buf->clear (); std::iostream::clear (); }
+
 private:
 
   c_file_ptr_buf *buf;
@@ -177,4 +185,3 @@
 ;;; mode: C++ ***
 ;;; End: ***
 */
-
--- a/src/oct-stream.cc	Fri Apr 30 17:08:55 2004 +0000
+++ b/src/oct-stream.cc	Fri Apr 30 18:27:07 2004 +0000
@@ -935,6 +935,15 @@
 void
 octave_base_stream::clear (void)
 {
+  std::istream *is = input_stream ();
+  std::ostream *os = output_stream ();
+
+  if (is)
+    is->clear ();
+
+  if (os)
+    os->clear ();
+
   fail = false;
   errmsg = "";
 }