Mercurial > hg > octave-nkf
changeset 3233:98d0ee053ba4
[project @ 1999-01-27 20:23:40 by jwe]
author | jwe |
---|---|
date | Wed, 27 Jan 1999 20:23:46 +0000 |
parents | 3f6ae91e86b0 |
children | be8e0ba13644 |
files | ChangeLog Makeconf.in aclocal.m4 configure.in doc/interpreter/control.texi doc/interpreter/io.texi liboctave/CMatrix.cc liboctave/ChangeLog liboctave/dMatrix.cc mkoctfile.in scripts/ChangeLog scripts/linear-algebra/krylov.m scripts/plot/__pltopt1__.m scripts/plot/oneplot.m scripts/plot/subplot.m src/ChangeLog src/DLD-FUNCTIONS/time.cc src/Makefile.in src/load-save.cc src/oct-stream.cc src/pager.cc src/parse.y src/version.h test/ChangeLog test/octave.test/system/clock-1.m |
diffstat | 25 files changed, 351 insertions(+), 171 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +Wed Jan 20 12:56:02 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in: Don't put -O in FFLAGS for powerpc-apple-machten*. + +Wed Dec 9 14:02:45 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makeconf.in (RDYNAMIC_FLAG): Substitute RDYNAMIC_FLAG here. + * configure.in: Check for G++ compiler flag -rdynamic if setting + up to support dynamic linking, and substitute RDYNAMIC_FLAG if + -rdynamic is accepted. + * aclocal.m4 (OCTAVE_CC_FLAG, OCTAVE_CXX_FLAG): Clarify usage comment. + +Mon Dec 7 19:49:26 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in: Check for -lm just after compiler tests. + Remove -lm from other macro calls. Don't check for -lm on NeXT + systems. Eric Norum <eric@skatter.usask.ca> says /lib/libsys_s.a + has all the routines that are traditionally in libc.a and libm.a + on *NIX systems. NeXT also supplies a libm.a, but it seems to be + horribly buggy. + +Sat Dec 5 10:48:40 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * mkoctfile.in: Correctly handle -?. + Fri Dec 4 18:05:51 1998 Kurt Hornik <Kurt.Hornik@ci.tuwien.ac.at> * emacs/octave-mod.el (octave-abbrev-start): Use the correct name
--- a/Makeconf.in +++ b/Makeconf.in @@ -129,6 +129,8 @@ SONAME_FLAGS = @SONAME_FLAGS@ +RDYNAMIC_FLAG = @RDYNAMIC_FLAG@ + RLD_FLAG = @RLD_FLAG@ FLIBS = @FLIBS@
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -675,8 +675,10 @@ fi ]) dnl -dnl Check to see if C compiler handles FLAG command line option and -dnl add it to CFLAGS if it does. +dnl Check to see if C compiler handles FLAG command line option. If +dnl two arguments are specified, execute the second arg as shell +dnl commands. Otherwise, add FLAG to CFLAGS if the compiler accepts +dnl the flag. dnl dnl OCTAVE_CC_FLAG AC_DEFUN(OCTAVE_CC_FLAG, [ @@ -704,8 +706,10 @@ fi ]) dnl -dnl Check to see if C++ compiler handles FLAG command line option and -dnl add it to CXXFLAGS if it does. +dnl Check to see if C++ compiler handles FLAG command line option. If +dnl two arguments are specified, execute the second arg as shell +dnl commands. Otherwise, add FLAG to CXXFLAGS if the compiler accepts +dnl the flag. dnl dnl OCTAVE_CXX_FLAG AC_DEFUN(OCTAVE_CXX_FLAG, [
--- a/configure.in +++ b/configure.in @@ -21,7 +21,7 @@ ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA ### 02111-1307, USA. -AC_REVISION($Revision: 1.314 $) +AC_REVISION($Revision: 1.315 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -393,6 +393,9 @@ FFLAGS="-fpe1 $FFLAGS" fi ;; + powerpc-apple-machten*) + FFLAGS= + ;; esac if test -n "$FFLAGS"; then AC_MSG_RESULT([defining FFLAGS to be $FFLAGS])
--- a/doc/interpreter/control.texi +++ b/doc/interpreter/control.texi @@ -6,7 +6,7 @@ @chapter Control Theory The Octave Control Systems Toolbox (OCST) was initially developed -by Dr.\ A.\ Scottedward Hodel +by Dr.@: A. Scottedward Hodel @email{a.s.hodel@@eng.auburn.edu} with the assistance of his students @itemize @bullet @@ -2031,7 +2031,7 @@ Iglesias and Glover, "State-Space approach to discrete-time Hinf control," Int. J. Control, vol 54, #5, 1991 Zhou, Doyle, Glover, "Robust and Optimal Control," Prentice-Hall, 1996 - $Revision: 1.8 $ + $Revision: 1.9 $ @end deftypefn @deftypefn {Function File } { @var{Qb} =} obsv (@var{sys}@{, @var{c}@}) @@ -3336,7 +3336,7 @@ @deftypefn {Function File } { outputs =} mb ( inputs ) @format - $Revision: 1.8 $ + $Revision: 1.9 $ @end format
--- a/doc/interpreter/io.texi +++ b/doc/interpreter/io.texi @@ -145,8 +145,8 @@ @table @code @item short -This is the default format. Octave will try to print numbers with at -least 5 significant figures within a field that is a maximum of 10 +Octave will try to print numbers with at +least 3 significant figures within a field that is a maximum of 8 characters wide. If Octave is unable to format a matrix so that columns line up on the @@ -213,6 +213,16 @@ in IEEE format with the least significant byte first. This format only works for numeric types. @end table + +By default, Octave will try to print numbers with at least 5 significant +figures within a field that is a maximum of 10 characters wide. + +If Octave is unable to format a matrix so that columns line up on the +decimal point and all the numbers fit within the maximum field width, +it switches to an @samp{e} format. + +If @code{format} is invoked without any options, the default format +state is restored. @end deffn @defvr {Built-in Variable} print_answer_id_name
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -1695,25 +1695,21 @@ ComplexMatrix retval; int len = v.length (); - int a_len = a.length (); - - if (len != a_len) - gripe_nonconformant ("operator *", len, 1, 1, a_len); - else + + if (len != 0) { - if (len != 0) - { - retval.resize (len, a_len); - Complex *c = retval.fortran_vec (); - - F77_XFCN (zgemm, ZGEMM, ("N", "N", len, a_len, 1, 1.0, - v.data (), len, a.data (), 1, 0.0, - c, len, 1L, 1L)); - - if (f77_exception_encountered) - (*current_liboctave_error_handler) - ("unrecoverable error in zgemm"); - } + int a_len = a.length (); + + retval.resize (len, a_len); + Complex *c = retval.fortran_vec (); + + F77_XFCN (zgemm, ZGEMM, ("N", "N", len, a_len, 1, 1.0, + v.data (), len, a.data (), 1, 0.0, + c, len, 1L, 1L)); + + if (f77_exception_encountered) + (*current_liboctave_error_handler) + ("unrecoverable error in zgemm"); } return retval;
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,10 @@ +Tue Jan 19 09:34:55 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * dMatrix.cc (operator * (const ColumnVector& v, const RowVector& a)): + Don't require lengths to be equal. + * CMatrix.cc (operator * (const ComplexColumnVector& v, const + ComplexRowVector& a)): Likewise + Tue Nov 24 23:38:19 1998 Eric Norum <eric@skatter.USask.Ca> * statdefs.h: Only define mode_t if not already defined.
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -1527,25 +1527,21 @@ Matrix retval; int len = v.length (); - int a_len = a.length (); - - if (len != a_len) - gripe_nonconformant ("operator *", len, 1, 1, a_len); - else + + if (len != 0) { - if (len != 0) - { - retval.resize (len, a_len); - double *c = retval.fortran_vec (); - - F77_XFCN (dgemm, DGEMM, ("N", "N", len, a_len, 1, 1.0, - v.data (), len, a.data (), 1, 0.0, - c, len, 1L, 1L)); - - if (f77_exception_encountered) - (*current_liboctave_error_handler) - ("unrecoverable error in dgemm"); - } + int a_len = a.length (); + + retval.resize (len, a_len); + double *c = retval.fortran_vec (); + + F77_XFCN (dgemm, DGEMM, ("N", "N", len, a_len, 1, 1.0, + v.data (), len, a.data (), 1, 0.0, + c, len, 1L, 1L)); + + if (f77_exception_encountered) + (*current_liboctave_error_handler) + ("unrecoverable error in dgemm"); } return retval;
--- a/mkoctfile.in +++ b/mkoctfile.in @@ -76,13 +76,13 @@ -d | --debug | -v | --verbose) dbg=echo ;; - -h | -? | --help) + -h | -\? | --help) echo $usage_msg cat << EOF Options: - -h, -? --help Print this message. + -h, -?, --help Print this message. -IDIR Add -IDIR to compile commands. -DDEF Add -DDEF to compile commands. -lLIB Add library LIB to link command.
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,6 +1,26 @@ +Tue Jan 12 10:31:15 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * plot/__pltopt1__.m: Accept "k" to mean black. + +Fri Dec 11 10:43:19 1998 A Scott Hodel <hodel@edalf1.msfc.nasa.gov> + + * linear-algebra/krylov.m: Force empty_list_elements_ok for this + function. + +Thu Dec 10 11:07:00 1998 A Scott Hodel <hodel@edalf1.msfc.nasa.gov> + + * control/ss2sys.m: Fix typo. + +Wed Dec 9 12:42:19 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * plot/subplot.m, plot/oneplot.m: Don't call clearplot. + + * control: Update from A. S. Hodel <a.s.hodel@eng.auburn.edu> for + signal names as lists of strings instead of string arrays. + Fri Dec 4 16:08:42 1998 John W. Eaton <jwe@bevo.che.wisc.edu> - * quaternion: New directory of functions from A. S. Hodel, + * quaternion: New directory of functions from A. S. Hodel <a.s.hodel@eng.auburn.edu>. * Makefile.in (SUBDIRS): Add it to the list. * quaternion/Makefile.in: New file.
--- a/scripts/linear-algebra/krylov.m +++ b/scripts/linear-algebra/krylov.m @@ -41,6 +41,9 @@ # $Revision: 1.2 $ # $Log$ + save_empty_list_elements_ok = empty_list_elements_ok; + empty_list_elements_ok = 1; + if (nargin > 5) usage("[U,H,k1] = krylov(A,v,k{,eps1,pflg})"); elseif(nargin < 5) pflg = 0; elseif(nargin < 4) eps1 = 1e-12; endif @@ -154,4 +157,6 @@ warning("krylov: trivial null space corrupted; set pflg=1 or eps1>%e",eps1); endif + empty_list_elements_ok = save_empty_list_elements_ok; + endfunction
--- a/scripts/plot/__pltopt1__.m +++ b/scripts/plot/__pltopt1__.m @@ -118,7 +118,7 @@ elseif (strcmp (char, "c")) set_color = 1; color = "5"; - elseif (strcmp (char, "w")) + elseif (strcmp (char, "w") || strcmp (char, "k")) set_color = 1; color = "6"; elseif (strcmp (char, "*"))
--- a/scripts/plot/oneplot.m +++ b/scripts/plot/oneplot.m @@ -41,7 +41,6 @@ gset origin 0, 0; __multiplot_mode__ = 0; gnuplot_command_replot = "rep"; - clearplot; endif endif
--- a/scripts/plot/subplot.m +++ b/scripts/plot/subplot.m @@ -152,8 +152,6 @@ eval (sprintf ("gset origin %g, %g", xo, yo)); - clearplot; - endif endfunction
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,49 @@ +Wed Jan 27 14:18:29 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (DEFFUN_PATTERN, DEFVAR_PATTERN): Use egrep again. + Make the patterns work with stupid egreps that don't like empty + elements in alternation patterns. + +Fri Jan 22 04:41:48 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * load-save.cc (save_ascii_data): Check for string type first, + then range, then the rest. + (save_binary_data): Ditto. + + * pager.cc (more_than_a_screenful): Accept length as second arg. + Handle long lines properly, assuming the terminal wraps long lines. + (octave_pager_buf::do_sync): Accept length of data as second arg. + Use write instead of << to put characters on output stream. + (octave_pager_buf::sync): Don't assume data ends at first NUL. + (octave_diary_buf::sync): Ditto. + +Thu Jan 21 22:15:23 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * load-save.cc (save_mat_binary_data): Check for string type + first, then range, then the rest. + +Wed Jan 20 12:01:14 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * oct-stream.cc (octave_base_stream::do_scanf): Handle short and + long ints correctly. + +Fri Jan 15 13:04:58 1999 John W. Eaton <jwe@bevo.che.wisc.edu> + + * parse.y (end_error): Handle case of endswitch too. + + * Makefile.in: Use basic regular expressions and grep instead of + egrep to find files that contain DEFVAR, DEFCONST, or DEFUN. + +Wed Dec 9 14:14:11 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * Makefile.in (octave): Add $(RDYNAMIC_FLAG) to link command. + +Fri Dec 4 20:26:33 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * DLD-FUNCTIONS/time.cc (Fstrftime): Make it work even when not + using the GNU version of strftime, which allows passing NULL for + the buffer to determine the required size of the buffer. + Wed Dec 2 22:38:40 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * utils.cc (file_in_loadpath): Expect argc == 2, not 3.
--- a/src/DLD-FUNCTIONS/time.cc +++ b/src/DLD-FUNCTIONS/time.cc @@ -215,6 +215,10 @@ return retval; } +#if !defined STRFTIME_BUF_INITIAL_SIZE +#define STRFTIME_BUF_INITIAL_SIZE 128 +#endif + DEFUN_DLD (strftime, args, , "strftime (FMT, TMSTRUCT)\n\ \n\ @@ -293,13 +297,20 @@ { const char *fmt_str = fmt.c_str (); - size_t bufsize = strftime (0, (size_t) UINT_MAX, fmt_str, tm); - - char *buf = new char [++bufsize]; + char *buf = 0; + size_t bufsize = STRFTIME_BUF_INITIAL_SIZE; + size_t chars_written = 0; - buf[0] = '\0'; + while (chars_written == 0) + { + delete [] buf; + buf = new char[bufsize]; + buf[0] = '\0'; - strftime (buf, bufsize, fmt_str, tm); + chars_written = strftime (buf, bufsize, fmt_str, tm); + + bufsize *= 2; + } retval = buf;
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -153,7 +153,11 @@ DEP_1 := $(patsubst %.c, %.d, $(DEP_2)) MAKEDEPS := $(patsubst %.cc, %.d, $(DEP_1)) -DEFUN_PATTERN = "^DEFUN(|_DLD|_TEXT)[ \t]*\\(" +# Some stupid egreps don't like empty elements in alternation patterns, +# so we have to repeat ourselves because some stupid egreps don't like +# empty elements in alternation patterns. + +DEFUN_PATTERN = "^[ \t]*DEFU(N|N_DLD|N_TEXT)[ \t]*\\(" DEF_5 := $(SOURCES) $(DLD_SRC) DEF_4 := $(addprefix $(srcdir)/, $(DEF_5)) @@ -162,7 +166,7 @@ DEF_1 := $(patsubst %.l, %.df, $(DEF_2)) DEF_FILES := $(patsubst %.cc, %.df, $(DEF_1)) -DEFVAR_PATTERN = "^[\t ]*DEF(VAR|CONST)[ \t]*\\(" +DEFVAR_PATTERN = "^[ \t]*DEF(VAR|CONST)[ \t]*\\(" VAR_5 := $(SOURCES) $(DLD_SRC) VAR_4 := $(addprefix $(srcdir)/, $(VAR_5)) @@ -204,7 +208,8 @@ touch stamp-prereq octave: octave.o builtins.o ops.o $(DLD_STATIC_OBJ) libraries - $(CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(ALL_LDFLAGS) -o octave \ + $(CXX) $(CPPFLAGS) $(ALL_CXXFLAGS) $(RDYNAMIC_FLAG) \ + $(ALL_LDFLAGS) -o octave \ octave.o builtins.o ops.o $(DLD_STATIC_OBJ) \ $(OCTAVE_LFLAGS) \ $(OCTAVE_LIBS) \
--- a/src/load-save.cc +++ b/src/load-save.cc @@ -1906,7 +1906,37 @@ tmp = mark_as_global; os.write (&tmp, 1); - if (tc.is_real_scalar ()) + if (tc.is_string ()) + { + tmp = 7; + os.write (&tmp, 1); + FOUR_BYTE_INT nr = tc.rows (); + os.write (&nr, 4); + charMatrix chm = tc.char_matrix_value (); + for (int i = 0; i < nr; i++) + { + FOUR_BYTE_INT len = chm.cols (); + os.write (&len, 4); + string tstr = chm.row_as_string (i); + const char *tmp = tstr.data (); + os.write (tmp, len); + } + } + else if (tc.is_range ()) + { + tmp = 6; + os.write (&tmp, 1); + tmp = (char) LS_DOUBLE; + os.write (&tmp, 1); + Range r = tc.range_value (); + double bas = r.base (); + double lim = r.limit (); + double inc = r.inc (); + os.write (&bas, 8); + os.write (&lim, 8); + os.write (&inc, 8); + } + else if (tc.is_real_scalar ()) { tmp = 1; os.write (&tmp, 1); @@ -1984,36 +2014,6 @@ const Complex *mtmp = m.data (); write_doubles (os, X_CAST (const double *, mtmp), st, 2*len); } - else if (tc.is_string ()) - { - tmp = 7; - os.write (&tmp, 1); - FOUR_BYTE_INT nr = tc.rows (); - os.write (&nr, 4); - charMatrix chm = tc.char_matrix_value (); - for (int i = 0; i < nr; i++) - { - FOUR_BYTE_INT len = chm.cols (); - os.write (&len, 4); - string tstr = chm.row_as_string (i); - const char *tmp = tstr.data (); - os.write (tmp, len); - } - } - else if (tc.is_range ()) - { - tmp = 6; - os.write (&tmp, 1); - tmp = (char) LS_DOUBLE; - os.write (&tmp, 1); - Range r = tc.range_value (); - double bas = r.base (); - double lim = r.limit (); - double inc = r.inc (); - os.write (&bas, 8); - os.write (&lim, 8); - os.write (&inc, 8); - } else gripe_wrong_type_arg ("save", tc, false); @@ -2057,7 +2057,28 @@ os.write (&name_len, 4); os << name << '\0'; - if (tc.is_real_scalar ()) + if (tc.is_string ()) + { + unwind_protect::begin_frame ("save_mat_binary_data"); + unwind_protect_int (Vimplicit_str_to_num_ok); + Vimplicit_str_to_num_ok = true; + Matrix m = tc.matrix_value (); + os.write (m.data (), 8 * len); + unwind_protect::run_frame ("save_mat_binary_data"); + } + else if (tc.is_range ()) + { + Range r = tc.range_value (); + double base = r.base (); + double inc = r.inc (); + int nel = r.nelem (); + for (int i = 0; i < nel; i++) + { + double x = base + i * inc; + os.write (&x, 8); + } + } + else if (tc.is_real_scalar ()) { double tmp = tc.double_value (); os.write (&tmp, 8); @@ -2080,27 +2101,6 @@ m = ::imag(m_cmplx); os.write (m.data (), 8 * len); } - else if (tc.is_string ()) - { - unwind_protect::begin_frame ("save_mat_binary_data"); - unwind_protect_int (Vimplicit_str_to_num_ok); - Vimplicit_str_to_num_ok = true; - Matrix m = tc.matrix_value (); - os.write (m.data (), 8 * len); - unwind_protect::run_frame ("save_mat_binary_data"); - } - else if (tc.is_range ()) - { - Range r = tc.range_value (); - double base = r.base (); - double inc = r.inc (); - int nel = r.nelem (); - for (int i = 0; i < nel; i++) - { - double x = base + i * inc; - os.write (&x, 8); - } - } else gripe_wrong_type_arg ("save", tc, false); @@ -2219,7 +2219,32 @@ long old_precision = os.precision (); os.precision (precision); - if (tc.is_real_scalar ()) + if (tc.is_string ()) + { + ascii_save_type (os, "string array", mark_as_global); + charMatrix chm = tc.char_matrix_value (); + int elements = chm.rows (); + os << "# elements: " << elements << "\n"; + for (int i = 0; i < elements; i++) + { + int len = chm.cols (); + os << "# length: " << len << "\n"; + string tstr = chm.row_as_string (i); + const char *tmp = tstr.data (); + os.write (tmp, len); + os << "\n"; + } + } + else if (tc.is_range ()) + { + ascii_save_type (os, "range", mark_as_global); + Range tmp = tc.range_value (); + os << "# base, limit, increment\n" + << tmp.base () << " " + << tmp.limit () << " " + << tmp.inc () << "\n"; + } + else if (tc.is_real_scalar ()) { ascii_save_type (os, "scalar", mark_as_global); @@ -2292,31 +2317,6 @@ os << tmp; } - else if (tc.is_string ()) - { - ascii_save_type (os, "string array", mark_as_global); - charMatrix chm = tc.char_matrix_value (); - int elements = chm.rows (); - os << "# elements: " << elements << "\n"; - for (int i = 0; i < elements; i++) - { - int len = chm.cols (); - os << "# length: " << len << "\n"; - string tstr = chm.row_as_string (i); - const char *tmp = tstr.data (); - os.write (tmp, len); - os << "\n"; - } - } - else if (tc.is_range ()) - { - ascii_save_type (os, "range", mark_as_global); - Range tmp = tc.range_value (); - os << "# base, limit, increment\n" - << tmp.base () << " " - << tmp.limit () << " " - << tmp.inc () << "\n"; - } else gripe_wrong_type_arg ("save", tc, false);
--- a/src/oct-stream.cc +++ b/src/oct-stream.cc @@ -289,7 +289,6 @@ break; case 'h': case 'l': case 'L': - // We accept these but we don't actually use them. if (modifier != '\0') nconv = -1; else @@ -927,6 +926,14 @@ do_scanf_conv (istream&, const char*, int*, Matrix&, double*, int&, int, int, bool); +template void +do_scanf_conv (istream&, const char*, long int*, Matrix&, double*, int&, + int, int, bool); + +template void +do_scanf_conv (istream&, const char*, short int*, Matrix&, double*, int&, + int, int, bool); + #if 0 template void do_scanf_conv (istream&, const char*, float*, Matrix&, double*, int&, @@ -1033,10 +1040,32 @@ case 'd': case 'i': case 'o': case 'u': case 'x': { - int tmp; - - do_scanf_conv (is, fmt, &tmp, mval, data, count, - nr, max_size, discard); + switch (elt->modifier) + { + case 'h': + { + short int tmp; + do_scanf_conv (is, fmt, &tmp, mval, data, count, + nr, max_size, discard); + } + break; + + case 'l': + { + long int tmp; + do_scanf_conv (is, fmt, &tmp, mval, data, count, + nr, max_size, discard); + } + break; + + default: + { + int tmp; + do_scanf_conv (is, fmt, &tmp, mval, data, count, + nr, max_size, discard); + } + break; + } } break;
--- a/src/pager.cc +++ b/src/pager.cc @@ -116,13 +116,13 @@ } static void -do_sync (const char *msg, bool bypass_pager) +do_sync (const char *msg, int len, bool bypass_pager) { - if (msg && *msg) + if (msg && len > 0) { if (bypass_pager) { - cout << msg; + cout.write (msg, len); cout.flush (); } else @@ -152,7 +152,7 @@ { if (octave_pager_pid > 0 && external_pager->good ()) { - *external_pager << msg; + external_pager->write (msg, len); // These checks are needed if a signal handler // invoked since the last set of checks attempts @@ -178,32 +178,41 @@ } else { - cout << msg; + cout.write (msg, len); cout.flush (); } } } } +// Assume our terminal wraps long lines. + static bool -more_than_a_screenful (const char *s) +more_than_a_screenful (const char *s, int len) { if (s) { int available_rows = command_editor::terminal_rows () - 2; + int cols = command_editor::terminal_cols (); + int count = 0; - char c; + int chars_this_line = 0; - while ((c = *s++) != '\0') - if (c == '\n') - { - count++; + for (int i = 0; i < len; i++) + { + if (*s++ == '\n') + { + count += chars_this_line / cols + 1; + chars_this_line = 0; + } + else + chars_this_line++; + } - if (count > available_rows) - return true; - } + if (count > available_rows) + return true; } return false; @@ -217,22 +226,25 @@ || (Vpage_screen_output && Vpage_output_immediately) || ! Vpage_screen_output) { - sputc ('\0'); + char *buf = eback (); - char *buf = eback (); + int len = pptr () - buf; bool bypass_pager = (! interactive || ! Vpage_screen_output || (really_flush_to_pager && Vpage_screen_output && ! Vpage_output_immediately - && ! more_than_a_screenful (buf))); - - seekoff (0, ios::beg); + && ! more_than_a_screenful (buf, len))); - do_sync (buf, bypass_pager); + if (len > 0) + { + do_sync (buf, len, bypass_pager); - octave_diary << buf; + seekoff (0, ios::beg); + + octave_diary.write (buf, len); + } } return 0; @@ -241,10 +253,13 @@ int octave_diary_buf::sync (void) { - sputc ('\0'); + if (write_to_diary_file && external_diary_file) + { + int len = pptr () - eback (); - if (write_to_diary_file && external_diary_file) - external_diary_file << eback (); + if (len > 0) + external_diary_file.write (eback (), len); + } seekoff (0, ios::beg);
--- a/src/parse.y +++ b/src/parse.y @@ -1423,6 +1423,10 @@ error (fmt, type, "endif", l, c); break; + case token::switch_end: + error (fmt, type, "endswitch", l, c); + break; + case token::while_end: error (fmt, type, "endwhile", l, c); break;
--- a/src/version.h +++ b/src/version.h @@ -23,7 +23,7 @@ #if !defined (octave_version_h) #define octave_version_h 1 -#define OCTAVE_VERSION "2.1.11" +#define OCTAVE_VERSION "2.1.13" #define OCTAVE_COPYRIGHT \ "Copyright (C) 1996, 1997, 1998 John W. Eaton."
--- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +Fri Dec 4 20:55:47 1998 John W. Eaton <jwe@bevo.che.wisc.edu> + + * octave.test/system/clock-1.m: Use standard format specifiers %d + and %H instead of %e and %k. + Fri Oct 23 15:53:01 1998 John W. Eaton <jwe@bevo.che.wisc.edu> * octave.test/arith/exp-5.m: New test.