Mercurial > hg > octave-lojdl
changeset 3553:c5600b44bef9
[project @ 2000-02-03 03:22:37 by jwe]
author | jwe |
---|---|
date | Thu, 03 Feb 2000 03:22:38 +0000 |
parents | 41daa489833a |
children | 747a87bc8594 |
files | src/ChangeLog src/mkgendoc src/oct-stream.cc |
diffstat | 3 files changed, 30 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2000-02-02 John W. Eaton <jwe@bevo.che.wisc.edu> + * oct-stream.cc (octave_base_stream::read): Rename count to char_count. + (octave_base_stream::do_gets): Likewise. + + * octave-stream.cc (octave_base_stream::write): Rename flt_fmt to ffmt. + (octave_base_stream::read): Likewise. + * TEMPLATE-INST/SLStack-sym.cc: Delete meaningless `extern template' declarations. * TEMPLATE-INST/Array-tc.cc: Ditto.
--- a/src/mkgendoc +++ b/src/mkgendoc @@ -40,16 +40,16 @@ static void print_doc_string (const string& name, const std::string& doc) { - cout << ""; + std::cout << ""; size_t len = name.length (); if (name[0] == '"' && name[len-1] == '"') - cout << name.substr (1, len-2); + std::cout << name.substr (1, len-2); else - cout << name; + std::cout << name; - cout << "\n" << doc << "\n"; + std::cout << "\n" << doc << "\n"; } EOF
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -845,8 +845,8 @@ std::istream *is = input_stream (); std::ostream *os = output_stream (); - int i_fid = is ? ((filebuf *) (is->rdbuf ()))->fd () : -1; - int o_fid = os ? ((filebuf *) (os->rdbuf ()))->fd () : -1; + int i_fid = is ? ((std::filebuf *) (is->rdbuf ()))->fd () : -1; + int o_fid = os ? ((std::filebuf *) (os->rdbuf ()))->fd () : -1; if (i_fid >= 0) { @@ -897,12 +897,12 @@ std::ostrstream buf; int c = 0; - int count = 0; + int char_count = 0; int newline_stripped = 0; while (is && (c = is.get ()) != EOF) { - count++; + char_count++; if (c == '\n') { @@ -916,7 +916,7 @@ else buf << (char) c; - if (max_len > 0 && count == max_len) + if (max_len > 0 && char_count == max_len) break; } @@ -927,7 +927,7 @@ msg.append (": read error"); error (msg); } - else if (count == 0 && is.eof ()) + else if (char_count == 0 && is.eof ()) { err = true; std::string msg = fcn; @@ -966,11 +966,12 @@ octave_value octave_base_stream::read (const Matrix& size, oct_data_conv::data_type dt, int skip, - oct_mach_info::float_format flt_fmt, int& count) + oct_mach_info::float_format ffmt, + int& char_count) { Matrix retval; - count = 0; + char_count = 0; std::istream *isp = input_stream (); @@ -987,15 +988,15 @@ if (! error_state) { - if (flt_fmt == oct_mach_info::unknown) - flt_fmt = float_format (); - - int tmp = retval.read (is, nr, nc, dt, skip, flt_fmt); + if (ffmt == oct_mach_info::unknown) + ffmt = float_format (); + + int tmp = retval.read (is, nr, nc, dt, skip, ffmt); if (tmp < 0) error ("fread: read error"); else - count = tmp; + char_count = tmp; } } else @@ -1550,7 +1551,7 @@ } octave_value -octave_base_stream::scanf (const string& fmt, const Matrix& size, +octave_base_stream::scanf (const std::string& fmt, const Matrix& size, int& count) { octave_value retval = Matrix (); @@ -1899,7 +1900,7 @@ int octave_base_stream::write (const octave_value& data, oct_data_conv::data_type dt, int skip, - oct_mach_info::float_format flt_fmt) + oct_mach_info::float_format ffmt) { int retval = -1; @@ -1913,10 +1914,10 @@ if (! error_state) { - if (flt_fmt == oct_mach_info::unknown) - flt_fmt = float_format (); - - int tmp = mval.write (os, dt, skip, flt_fmt); + if (ffmt == oct_mach_info::unknown) + ffmt = float_format (); + + int tmp = mval.write (os, dt, skip, ffmt); if (tmp < 0) error ("fwrite: write error");