Mercurial > hg > octave-terminal
changeset 2427:2f50b24ce84f
[project @ 1996-10-25 06:15:28 by jwe]
author | jwe |
---|---|
date | Fri, 25 Oct 1996 06:15:50 +0000 |
parents | 1b5536a0bbb4 |
children | 6979248bf0d3 |
files | ChangeLog configure.in src/ChangeLog src/ov-range.cc src/ov-str-mat.cc src/ov-typeinfo.cc src/ov-typeinfo.h src/ov.cc src/ov.h src/parse.y src/resource.cc |
diffstat | 11 files changed, 102 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Fri Oct 25 01:13:45 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * configure.in: Define RUSAGE_TIMES_ONLY if cygwin32. + +Thu Oct 24 21:17:53 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * config.guess: Update to version that understands what to do for + cygwin32 systems. + Fri Oct 18 12:23:57 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * configure.in: Don't comment out substitutions for plplot stuff.
--- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ ### along with Octave; see the file COPYING. If not, write to the Free ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -AC_REVISION($Revision: 1.219 $) +AC_REVISION($Revision: 1.220 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -889,6 +889,12 @@ AC_CHECK_FUNCS(getrusage times) +case "$canonical_host_type" in + *-*-cygwin32) + AC_DEFINE(RUSAGE_TIMES_ONLY, 1) + ;; +esac + ### Checks for other programs used for building, testing, installing, ### and running Octave. ###
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +Fri Oct 25 01:10:51 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * resource.cc (getrusage): [HAVE_GETRUSAGE && RUSAGE_TIMES_ONLY]: + Only fill in time values. + +Thu Oct 24 20:37:28 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + + * parse.y: Comment out the %expect declaration so byacc can + compile this file. + (if_cmd_list): Add missing semicolon. + Include <cstdlib> for getenv if using byacc. + + * ov.h: Move typedefs outside of octave_value class scope to avoid + problem with cygwin32 beta16 compiler. + Fri Oct 18 13:44:33 1996 John W. Eaton <jwe@bevo.che.wisc.edu> * ov.h (octave_value::index): Undo previous change.
--- a/src/ov-range.cc +++ b/src/ov-range.cc @@ -50,7 +50,7 @@ return new octave_matrix (v.matrix_value ()); } -octave_value::type_conv_fcn +type_conv_fcn octave_range::numeric_conversion_function (void) const { return default_numeric_conversion_function;
--- a/src/ov-str-mat.cc +++ b/src/ov-str-mat.cc @@ -50,7 +50,7 @@ return new octave_matrix (v.matrix_value ()); } -octave_value::type_conv_fcn +type_conv_fcn octave_char_matrix_str::numeric_conversion_function (void) const { return default_numeric_conversion_function;
--- a/src/ov-typeinfo.cc +++ b/src/ov-typeinfo.cc @@ -41,15 +41,15 @@ #include <Array2.cc> #include <Array3.cc> -template class Array<octave_value::binary_op_fcn>; -template class Array2<octave_value::binary_op_fcn>; -template class Array3<octave_value::binary_op_fcn>; +template class Array<binary_op_fcn>; +template class Array2<binary_op_fcn>; +template class Array3<binary_op_fcn>; -template class Array<octave_value::assign_op_fcn>; -template class Array2<octave_value::assign_op_fcn>; +template class Array<assign_op_fcn>; +template class Array2<assign_op_fcn>; -template class Array<octave_value::type_conv_fcn>; -template class Array2<octave_value::type_conv_fcn>; +template class Array<type_conv_fcn>; +template class Array2<type_conv_fcn>; int octave_value_typeinfo::register_type (const string& name) @@ -63,7 +63,7 @@ bool octave_value_typeinfo::register_binary_op (octave_value::binary_op op, int t1, int t2, - octave_value::binary_op_fcn f) + binary_op_fcn f) { if (! instance) instance = new octave_value_typeinfo (); @@ -73,7 +73,7 @@ bool octave_value_typeinfo::register_assign_op (int t_lhs, int t_rhs, - octave_value::assign_op_fcn f) + assign_op_fcn f) { if (! instance) instance = new octave_value_typeinfo (); @@ -93,7 +93,7 @@ bool octave_value_typeinfo::register_widening_op (int t, int t_result, - octave_value::type_conv_fcn f) + type_conv_fcn f) { if (! instance) instance = new octave_value_typeinfo (); @@ -119,13 +119,13 @@ types.resize (len, string ()); binary_ops.resize ((int) octave_value::num_binary_ops, len, len, - (octave_value::binary_op_fcn) 0); + (binary_op_fcn) 0); - assign_ops.resize (len, len, (octave_value::assign_op_fcn) 0); + assign_ops.resize (len, len, (assign_op_fcn) 0); pref_assign_conv.resize (len, len, -1); - widening_ops.resize (len, len, (octave_value::type_conv_fcn) 0); + widening_ops.resize (len, len, (type_conv_fcn) 0); } types (i) = name; @@ -138,7 +138,7 @@ bool octave_value_typeinfo::do_register_binary_op (octave_value::binary_op op, int t1, int t2, - octave_value::binary_op_fcn f) + binary_op_fcn f) { binary_ops.checkelem ((int) op, t1, t2) = f; @@ -147,7 +147,7 @@ bool octave_value_typeinfo::do_register_assign_op (int t_lhs, int t_rhs, - octave_value::assign_op_fcn f) + assign_op_fcn f) { assign_ops.checkelem (t_lhs, t_rhs) = f; @@ -165,7 +165,7 @@ bool octave_value_typeinfo::do_register_widening_op - (int t, int t_result, octave_value::type_conv_fcn f) + (int t, int t_result, type_conv_fcn f) { widening_ops.checkelem (t, t_result) = f; @@ -174,14 +174,14 @@ #include <iostream.h> -octave_value::binary_op_fcn +binary_op_fcn octave_value_typeinfo::do_lookup_binary_op (octave_value::binary_op op, int t1, int t2) { return binary_ops.checkelem ((int) op, t1, t2); } -octave_value::assign_op_fcn +assign_op_fcn octave_value_typeinfo::do_lookup_assign_op (int t_lhs, int t_rhs) { return assign_ops.checkelem (t_lhs, t_rhs); @@ -193,7 +193,7 @@ return pref_assign_conv.checkelem (t_lhs, t_rhs); } -octave_value::type_conv_fcn +type_conv_fcn octave_value_typeinfo::do_lookup_widening_op (int t, int t_result) { return widening_ops.checkelem (t, t_result);
--- a/src/ov-typeinfo.h +++ b/src/ov-typeinfo.h @@ -45,21 +45,21 @@ static int register_type (const string&); static bool register_binary_op (octave_value::binary_op, int, int, - octave_value::binary_op_fcn); + binary_op_fcn); - static bool register_assign_op (int, int, octave_value::assign_op_fcn); + static bool register_assign_op (int, int, assign_op_fcn); static bool register_pref_assign_conv (int, int, int); - static bool register_widening_op (int, int, octave_value::type_conv_fcn); + static bool register_widening_op (int, int, type_conv_fcn); - static octave_value::binary_op_fcn + static binary_op_fcn lookup_binary_op (octave_value::binary_op op, int t1, int t2) { return instance->do_lookup_binary_op (op, t1, t2); } - static octave_value::assign_op_fcn + static assign_op_fcn lookup_assign_op (int t_lhs, int t_rhs) { return instance->do_lookup_assign_op (t_lhs, t_rhs); @@ -71,7 +71,7 @@ return instance->do_lookup_pref_assign_conv (t_lhs, t_rhs); } - static octave_value::type_conv_fcn + static type_conv_fcn lookup_widening_op (int t, int t_result) { return instance->do_lookup_widening_op (t, t_result); @@ -87,10 +87,10 @@ octave_value_typeinfo (void) : num_types (0), types (32, string ()), binary_ops (octave_value::num_binary_ops, 32, 32, - (octave_value::binary_op_fcn) 0), - assign_ops (32, 32, (octave_value::assign_op_fcn) 0), + (binary_op_fcn) 0), + assign_ops (32, 32, (assign_op_fcn) 0), pref_assign_conv (32, 32, -1), - widening_ops (32, 32, (octave_value::type_conv_fcn) 0) { } + widening_ops (32, 32, (type_conv_fcn) 0) { } private: @@ -100,33 +100,33 @@ Array<string> types; - Array3<octave_value::binary_op_fcn> binary_ops; + Array3<binary_op_fcn> binary_ops; - Array2<octave_value::assign_op_fcn> assign_ops; + Array2<assign_op_fcn> assign_ops; Array2<int> pref_assign_conv; - Array2<octave_value::type_conv_fcn> widening_ops; + Array2<type_conv_fcn> widening_ops; int do_register_type (const string&); bool do_register_binary_op (octave_value::binary_op, int, int, - octave_value::binary_op_fcn); + binary_op_fcn); - bool do_register_assign_op (int, int, octave_value::assign_op_fcn); + bool do_register_assign_op (int, int, assign_op_fcn); bool do_register_pref_assign_conv (int, int, int); - bool do_register_widening_op (int, int, octave_value::type_conv_fcn); + bool do_register_widening_op (int, int, type_conv_fcn); - octave_value::binary_op_fcn + binary_op_fcn do_lookup_binary_op (octave_value::binary_op, int, int); - octave_value::assign_op_fcn do_lookup_assign_op (int, int); + assign_op_fcn do_lookup_assign_op (int, int); int do_lookup_pref_assign_conv (int, int); - octave_value::type_conv_fcn do_lookup_widening_op (int, int); + type_conv_fcn do_lookup_widening_op (int, int); string_vector do_installed_type_names (void);
--- a/src/ov.cc +++ b/src/ov.cc @@ -576,7 +576,7 @@ if (t_result >= 0) { - octave_value::type_conv_fcn cf + type_conv_fcn cf = octave_value_typeinfo::lookup_widening_op (t_lhs, t_result); if (cf) @@ -617,7 +617,7 @@ if (! (error_state || assignment_ok)) { octave_value tmp_rhs; - octave_value::type_conv_fcn cf_rhs = rhs.numeric_conversion_function (); + type_conv_fcn cf_rhs = rhs.numeric_conversion_function (); if (cf_rhs) tmp_rhs = octave_value (cf_rhs (*rhs.rep)); @@ -625,7 +625,7 @@ tmp_rhs = rhs; octave_value *old_rep = 0; - octave_value::type_conv_fcn cf_this = numeric_conversion_function (); + type_conv_fcn cf_this = numeric_conversion_function (); if (cf_this) { @@ -670,8 +670,7 @@ int t_lhs = type_id (); int t_rhs = rhs.type_id (); - octave_value::assign_op_fcn f - = octave_value_typeinfo::lookup_assign_op (t_lhs, t_rhs); + assign_op_fcn f = octave_value_typeinfo::lookup_assign_op (t_lhs, t_rhs); if (f) { @@ -699,15 +698,14 @@ int t1 = v1.type_id (); int t2 = v2.type_id (); - octave_value::binary_op_fcn f - = octave_value_typeinfo::lookup_binary_op (op, t1, t2); + binary_op_fcn f = octave_value_typeinfo::lookup_binary_op (op, t1, t2); if (f) retval = f (*v1.rep, *v2.rep); else { octave_value tv1; - octave_value::type_conv_fcn cf1 = v1.numeric_conversion_function (); + type_conv_fcn cf1 = v1.numeric_conversion_function (); if (cf1) { @@ -718,7 +716,7 @@ tv1 = v1; octave_value tv2; - octave_value::type_conv_fcn cf2 = v2.numeric_conversion_function (); + type_conv_fcn cf2 = v2.numeric_conversion_function (); if (cf2) { @@ -730,7 +728,7 @@ if (cf1 || cf2) { - octave_value::binary_op_fcn f + binary_op_fcn f = octave_value_typeinfo::lookup_binary_op (op, t1, t2); if (f)
--- a/src/ov.h +++ b/src/ov.h @@ -59,19 +59,25 @@ octave_xvalue (void) { } }; +class octave_value; + +// XXX FIXME XXX -- these should probably really be inside the scope +// of the octave_value class, but the cygwin32 beta16 version of g++ +// can't handlt that. + +typedef octave_value (*binary_op_fcn) + (const octave_value&, const octave_value&); + +typedef octave_value (*assign_op_fcn) + (octave_value&, const octave_value_list&, const octave_value&); + +typedef octave_value * (*type_conv_fcn) (const octave_value&); + class octave_value { public: - typedef octave_value (*binary_op_fcn) - (const octave_value&, const octave_value&); - - typedef octave_value (*assign_op_fcn) - (octave_value&, const octave_value_list&, const octave_value&); - - typedef octave_value * (*type_conv_fcn) (const octave_value&); - enum binary_op { add,
--- a/src/parse.y +++ b/src/parse.y @@ -31,6 +31,10 @@ #include <config.h> #endif +#ifdef YYBYACC +#include <cstdlib> +#endif + #include <strstream.h> #include "Matrix.h" @@ -350,8 +354,9 @@ %left UNARY PLUS_PLUS MINUS_MINUS EXPR_NOT %right POW EPOW -// There are 19 shift/reduce conflicts, ok? -%expect 19 +// There are 19 shift/reduce conflicts, ok? But this only works with +// bison... +// %expect 19 // Where to start. %start input @@ -723,7 +728,7 @@ ; if_cmd_list : if_cmd_list1 - { $$ = $1 } + { $$ = $1; } | if_cmd_list1 else_clause { $1->append ($2);
--- a/src/resource.cc +++ b/src/resource.cc @@ -85,6 +85,7 @@ tv_tmp ["usec"] = (double) ru.ru_stime.tv_usec; m ["stime"] = octave_value (tv_tmp); +#if ! defined (RUSAGE_TIMES_ONLY) m ["maxrss"] = (double) ru.ru_maxrss; m ["ixrss"] = (double) ru.ru_ixrss; m ["idrss"] = (double) ru.ru_idrss; @@ -99,6 +100,7 @@ m ["nsignals"] = (double) ru.ru_nsignals; m ["nvcsw"] = (double) ru.ru_nvcsw; m ["nivcsw"] = (double) ru.ru_nivcsw; +#endif #else #if defined (HAVE_TIMES) && defined (HAVE_SYS_TIMES_H)