# HG changeset patch # User jwe # Date 846224150 0 # Node ID 2f50b24ce84f9d5b5ec1c11fc2e6aa5ba2214dac # Parent 1b5536a0bbb408005c609d8ff1f1ebe67516f8e3 [project @ 1996-10-25 06:15:28 by jwe] diff -r 1b5536a0bbb4 -r 2f50b24ce84f ChangeLog --- a/ChangeLog Fri Oct 25 02:33:12 1996 +0000 +++ b/ChangeLog Fri Oct 25 06:15:50 1996 +0000 @@ -1,3 +1,12 @@ +Fri Oct 25 01:13:45 1996 John W. Eaton + + * configure.in: Define RUSAGE_TIMES_ONLY if cygwin32. + +Thu Oct 24 21:17:53 1996 John W. Eaton + + * config.guess: Update to version that understands what to do for + cygwin32 systems. + Fri Oct 18 12:23:57 1996 John W. Eaton * configure.in: Don't comment out substitutions for plplot stuff. diff -r 1b5536a0bbb4 -r 2f50b24ce84f configure.in --- a/configure.in Fri Oct 25 02:33:12 1996 +0000 +++ b/configure.in Fri Oct 25 06:15:50 1996 +0000 @@ -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. ### diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ChangeLog --- a/src/ChangeLog Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ChangeLog Fri Oct 25 06:15:50 1996 +0000 @@ -1,3 +1,18 @@ +Fri Oct 25 01:10:51 1996 John W. Eaton + + * resource.cc (getrusage): [HAVE_GETRUSAGE && RUSAGE_TIMES_ONLY]: + Only fill in time values. + +Thu Oct 24 20:37:28 1996 John W. Eaton + + * parse.y: Comment out the %expect declaration so byacc can + compile this file. + (if_cmd_list): Add missing semicolon. + Include 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 * ov.h (octave_value::index): Undo previous change. diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ov-range.cc --- a/src/ov-range.cc Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ov-range.cc Fri Oct 25 06:15:50 1996 +0000 @@ -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; diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ov-str-mat.cc --- a/src/ov-str-mat.cc Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ov-str-mat.cc Fri Oct 25 06:15:50 1996 +0000 @@ -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; diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ov-typeinfo.cc --- a/src/ov-typeinfo.cc Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ov-typeinfo.cc Fri Oct 25 06:15:50 1996 +0000 @@ -41,15 +41,15 @@ #include #include -template class Array; -template class Array2; -template class Array3; +template class Array; +template class Array2; +template class Array3; -template class Array; -template class Array2; +template class Array; +template class Array2; -template class Array; -template class Array2; +template class Array; +template class Array2; 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 -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); diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ov-typeinfo.h --- a/src/ov-typeinfo.h Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ov-typeinfo.h Fri Oct 25 06:15:50 1996 +0000 @@ -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 types; - Array3 binary_ops; + Array3 binary_ops; - Array2 assign_ops; + Array2 assign_ops; Array2 pref_assign_conv; - Array2 widening_ops; + Array2 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); diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ov.cc --- a/src/ov.cc Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ov.cc Fri Oct 25 06:15:50 1996 +0000 @@ -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) diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/ov.h --- a/src/ov.h Fri Oct 25 02:33:12 1996 +0000 +++ b/src/ov.h Fri Oct 25 06:15:50 1996 +0000 @@ -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, diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/parse.y --- a/src/parse.y Fri Oct 25 02:33:12 1996 +0000 +++ b/src/parse.y Fri Oct 25 06:15:50 1996 +0000 @@ -31,6 +31,10 @@ #include #endif +#ifdef YYBYACC +#include +#endif + #include #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); diff -r 1b5536a0bbb4 -r 2f50b24ce84f src/resource.cc --- a/src/resource.cc Fri Oct 25 02:33:12 1996 +0000 +++ b/src/resource.cc Fri Oct 25 06:15:50 1996 +0000 @@ -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)