Mercurial > octave
diff libinterp/corefcn/oct-strstrm.cc @ 20931:69dcb58b9ada
Clean up use of error() versus ::error() in stream-based code.
* oct-fstrm.cc, oct-iostrm.cc, oct-strstrm.cc: Add comments before code that is
specifically using error from stream class rather than ::error from error.h
* oct-stream.cc: Overhaul file. Add programming note about difference between
error() and ::error() at top of file. Put input validation first. Cuddle
parentheses to variable when doing indexing. Declare variables as late as
possible. Wrap lines < 80 characters, but try to break comments into
intelligible blocks. Avoid declaring retval when returning a value would
do just as well.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 17 Dec 2015 10:55:28 -0800 |
parents | 8ddb11c0b1f8 |
children | aac911d8847b |
line wrap: on
line diff
--- a/libinterp/corefcn/oct-strstrm.cc Thu Dec 17 13:39:00 2015 -0500 +++ b/libinterp/corefcn/oct-strstrm.cc Thu Dec 17 10:55:28 2015 -0800 @@ -31,6 +31,8 @@ int octave_base_strstream::seek (off_t, int) { + // Note: error() is inherited from octave_base_stream, not ::error(). + // This error function does not halt execution so "return ..." must exist. error ("fseek: invalid operation"); return -1; } @@ -40,6 +42,8 @@ off_t octave_base_strstream::tell (void) { + // Note: error() is inherited from octave_base_stream, not ::error(). + // This error function does not halt execution so "return ..." must exist. error ("ftell: invalid operation"); return -1; }