changeset 4661:12b6fbd57436

[project @ 2003-11-25 05:41:35 by jwe]
author jwe
date Tue, 25 Nov 2003 05:41:36 +0000
parents 5df5c9c5c166
children 55211d6748c4
files liboctave/Array.cc liboctave/ChangeLog src/ChangeLog src/DLD-FUNCTIONS/dasrt.cc src/DLD-FUNCTIONS/eig.cc src/TEMPLATE-INST/Array-tc.cc src/load-save.cc src/ls-utils.cc src/oct-stream.cc src/ov-base-mat.h src/ov-base-scalar.h src/ov-base.cc src/ov-builtin.h src/ov-cell.h src/ov-list.h src/ov-mapper.h src/ov-range.h src/ov-struct.h src/ov-usr-fcn.h src/ov.cc src/ov.h src/parse.y src/pr-output.cc src/pt-bp.cc src/pt-check.cc src/utils.cc
diffstat 26 files changed, 140 insertions(+), 64 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/Array.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/liboctave/Array.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -40,6 +40,7 @@
 #include "Range.h"
 #include "idx-vector.h"
 #include "lo-error.h"
+#include "lo-sstream.h"
 
 // One dimensional array class.  Handles the reference counting for
 // all the derived classes.
@@ -319,9 +320,25 @@
 T
 Array<T>::range_error (const char *fcn, const Array<int>& ra_idx) const
 {
-  // XXX FIXME XXX -- report index values too!
-
-  (*current_liboctave_error_handler) ("range error in Array");
+  OSSTREAM buf;
+
+  buf << fcn << " (";
+
+  int n = ra_idx.length ();
+
+  if (n > 0)
+    buf << ra_idx(0);
+
+  for (int i = 1; i < n; i++)
+    buf << ", " << ra_idx(i);
+
+  buf << "): range error";
+
+  buf << OSSTREAM_ENDS;
+
+  (*current_liboctave_error_handler) (OSSTREAM_C_STR (buf));
+
+  OSSTREAM_FREEZE (buf);
 
   return T ();
 }
@@ -330,9 +347,25 @@
 T&
 Array<T>::range_error (const char *fcn, const Array<int>& ra_idx)
 {
-  // XXX FIXME XXX -- report index values too!
-
-  (*current_liboctave_error_handler) ("range error in Array");
+  OSSTREAM buf;
+
+  buf << fcn << " (";
+
+  int n = ra_idx.length ();
+
+  if (n > 0)
+    buf << ra_idx(0);
+
+  for (int i = 1; i < n; i++)
+    buf << ", " << ra_idx(i);
+
+  buf << "): range error";
+
+  buf << OSSTREAM_ENDS;
+
+  (*current_liboctave_error_handler) (OSSTREAM_C_STR (buf));
+
+  OSSTREAM_FREEZE (buf);
 
   static T foo;
   return foo;
@@ -1966,7 +1999,7 @@
 
 template <class T>
 Array<T>
-Array<T>::index (Array<idx_vector>& ra_idx, int resize_ok, const T& rfv) const
+Array<T>::index (Array<idx_vector>& ra_idx, int resize_ok, const T&) const
 {
   // This function handles all calls with more than one idx.
   // For (3x3x3), the call can be A(2,5), A(2,:,:), A(3,2,3) etc.
--- a/liboctave/ChangeLog	Tue Nov 25 04:29:47 2003 +0000
+++ b/liboctave/ChangeLog	Tue Nov 25 05:41:36 2003 +0000
@@ -1,6 +1,10 @@
 2003-11-24  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* Array.cc (assignN): Allow single indexing to work.
+	(Array<T>::range_error (const char*, const Array<int>&)):
+	Report index values.
+
+	* Array.cc (Array<T>::index): Delete unused arg names.
 
 	* dim-vector.h (dim_vector::all_ones): New function.
 
--- a/src/ChangeLog	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ChangeLog	Tue Nov 25 05:41:36 2003 +0000
@@ -3,6 +3,48 @@
 	* version.h (OCTAVE_VERSION): Now 2.1.52.
 	(OCTAVE_API_VERSION): Now api-v3.
 
+	* ov.h (octave_value::all_strings): Pass second arg to rep function.
+
+	* DLD-FUNCTIONS/dasrt.cc (dasrt_user_f): Delete unused arg names.
+	* load-save.cc (do_load): Likewise.
+	* ls-utils.cc (get_save_type): Likewise.
+	* parse.y (Fassignin): Likewise.
+	* utils.cc (empty_arg): Likewise.
+	* ov-usr-fcn.h (octave_user_function::subsref): Likewise.
+	* ov-base-mat.h (octave_base_matrix::subsref): Likewise.
+	* ov-mapper.h (octave_mapper::subsref): Likewise.
+	* ov-builtin.h (octave_builtin::subsref): Likewise.
+	* ov-cell.h (octave_cell::subsref): Likewise.
+	* ov-base-scalar.h (octave_base_scalar::subsref): Likewise.
+	* ov-struct.h (octave_struct::subsref): Likewise.
+	* ov-range.h (octave_range::subsref): Likewise.
+	* ov-list.h (octave_list::subsref): Likewise.
+	* ov-base.cc (octave_base_value::print_info): Likewise.
+	* pt-check.cc (tree_checker::visit_subplot_axes): Likewise.
+	* pr-output.cc (octave_print_internal (std::ostream&, double, bool),
+	octave_print_internal (std::ostream&, const Complex&, bool),
+	octave_print_internal (std::ostream& const charNDArray&, bool,
+	int, bool): Likewise.
+	* oct-stream.cc (octave_scan<> (std::istream&, const
+	scanf_format_elt&, char*): Likewise
+	* TEMPLATE-INST/Array-tc.cc (resize_fill_value<octave_value>):
+	Likewise.
+	* pt-bp.cc (tree_breakpoint::visit_octave_user_function,
+	tree_breakpoint::visit_octave_user_function_header,
+	tree_breakpoint::visit_octave_user_function_trailer,
+	tree_breakpoint::visit_plot_limits,
+	tree_breakpoint::visit_plot_range,
+	tree_breakpoint::visit_subplot,
+	tree_breakpoint::visit_subplot_axes,
+	tree_breakpoint::visit_subplot_list,
+	tree_breakpoint::visit_subplot_style,
+	tree_breakpoint::visit_subplot_using): Likewise.
+	* ov.cc (octave_value::column_vector_value,
+	(octave_value::complex_column_vector_value,
+	(octave_value::row_vector_value,
+	octave_value::complex_row_vector_value,
+	octave_value::do_non_const_unary_op): Likewise.
+
 	* load-save.cc: Only include ls-hdf5.h if HAVE_HDF5 is defined.
 	From Melqart <melqart@free.fr>.
 
--- a/src/DLD-FUNCTIONS/dasrt.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/DLD-FUNCTIONS/dasrt.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -58,7 +58,7 @@
 
 static ColumnVector
 dasrt_user_f (const ColumnVector& x, const ColumnVector& xdot,
-	      double t, int& ires)
+	      double t, int&)
 {
   ColumnVector retval;
 
--- a/src/DLD-FUNCTIONS/eig.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/DLD-FUNCTIONS/eig.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -100,7 +100,7 @@
 
   if (nargout == 0 || nargout == 1)
     {
-      retval(0) = result.eigenvalues (), 1;
+      retval(0) = result.eigenvalues ();
     }
   else
     {
--- a/src/TEMPLATE-INST/Array-tc.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/TEMPLATE-INST/Array-tc.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -41,7 +41,7 @@
 
 template<>
 octave_value
-resize_fill_value<octave_value> (const octave_value& x)
+resize_fill_value<octave_value> (const octave_value&)
 {
   static octave_value retval = octave_value (Matrix ());
   return retval;
--- a/src/load-save.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/load-save.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -375,7 +375,7 @@
 octave_value
 do_load (std::istream& stream, const std::string& orig_fname, bool force,
 	 load_save_format format, oct_mach_info::float_format flt_fmt,
-	 bool list_only, bool swap, bool verbose, bool import,
+	 bool list_only, bool swap, bool verbose, bool /* import */,
 	 const string_vector& argv, int argv_idx, int argc, int nargout)
 {
   octave_value retval;
--- a/src/ls-utils.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ls-utils.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -32,7 +32,7 @@
 // they are stored in doubles.
 
 save_type
-get_save_type (double max_val, double min_val)
+get_save_type (double /* max_val */, double /* min_val */)
 {
   save_type st = LS_DOUBLE;
 
--- a/src/oct-stream.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/oct-stream.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -1101,7 +1101,8 @@
 
 template<>
 std::istream&
-octave_scan<> (std::istream& is, const scanf_format_elt& fmt, char* valptr)
+octave_scan<> (std::istream& is, const scanf_format_elt& /* fmt */,
+	       char* valptr)
 {
   return is >> valptr;
 }
--- a/src/ov-base-mat.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-base-mat.h	Tue Nov 25 05:41:36 2003 +0000
@@ -71,9 +71,8 @@
   octave_value subsref (const std::string& type,
 			const std::list<octave_value_list>& idx);
 
-  octave_value_list subsref (const std::string& type,
-			     const std::list<octave_value_list>& idx,
-    			     int nargout)
+  octave_value_list subsref (const std::string&,
+			     const std::list<octave_value_list>&, int)
     {
       panic_impossible ();
       return octave_value_list ();
--- a/src/ov-base-scalar.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-base-scalar.h	Tue Nov 25 05:41:36 2003 +0000
@@ -62,9 +62,8 @@
   octave_value subsref (const std::string& type,
 			const std::list<octave_value_list>& idx);
 
-  octave_value_list subsref (const std::string& type,
-			     const std::list<octave_value_list>& idx,
-    			     int nargout)
+  octave_value_list subsref (const std::string&,
+			     const std::list<octave_value_list>&, int)
     {
       panic_impossible ();
       return octave_value_list ();
--- a/src/ov-base.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-base.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -239,7 +239,7 @@
 
 void
 octave_base_value::print_info (std::ostream& os,
-			       const std::string& prefix) const
+			       const std::string& /* prefix */) const
 {
   os << "no info for type: " << type_name () << "\n";
 }
--- a/src/ov-builtin.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-builtin.h	Tue Nov 25 05:41:36 2003 +0000
@@ -52,8 +52,8 @@
 
   ~octave_builtin (void) { }
 
-  octave_value subsref (const std::string& type,
-			const std::list<octave_value_list>& idx)
+  octave_value subsref (const std::string&,
+			const std::list<octave_value_list>&)
     {
       panic_impossible ();
       return octave_value ();
--- a/src/ov-cell.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-cell.h	Tue Nov 25 05:41:36 2003 +0000
@@ -76,9 +76,8 @@
   octave_value subsref (const std::string& type,
 			const std::list<octave_value_list>& idx);
 
-  octave_value_list subsref (const std::string& type,
-			     const std::list<octave_value_list>& idx,
-    			     int nargout)
+  octave_value_list subsref (const std::string&,
+			     const std::list<octave_value_list>&, int)
     {
       panic_impossible ();
       return octave_value_list ();
--- a/src/ov-list.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-list.h	Tue Nov 25 05:41:36 2003 +0000
@@ -69,9 +69,8 @@
   octave_value subsref (const std::string& type,
 			const std::list<octave_value_list>& idx);
 
-  octave_value_list subsref (const std::string& type,
-			     const std::list<octave_value_list>& idx,
-    			     int nargout)
+  octave_value_list subsref (const std::string&,
+			     const std::list<octave_value_list>&, int)
     {
       panic_impossible ();
       return octave_value_list ();
--- a/src/ov-mapper.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-mapper.h	Tue Nov 25 05:41:36 2003 +0000
@@ -68,8 +68,8 @@
 
   octave_function *function_value (bool = false) { return this; }
 
-  octave_value subsref (const std::string& type,
-			const std::list<octave_value_list>& idx)
+  octave_value subsref (const std::string&,
+			const std::list<octave_value_list>&)
     {
       panic_impossible ();
       return octave_value ();
--- a/src/ov-range.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-range.h	Tue Nov 25 05:41:36 2003 +0000
@@ -88,9 +88,8 @@
   octave_value subsref (const std::string& type,
 			const std::list<octave_value_list>& idx);
 
-  octave_value_list subsref (const std::string& type,
-			     const std::list<octave_value_list>& idx,
-    			     int nargout)
+  octave_value_list subsref (const std::string&,
+			     const std::list<octave_value_list>&, int)
     {
       panic_impossible ();
       return octave_value_list ();
--- a/src/ov-struct.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-struct.h	Tue Nov 25 05:41:36 2003 +0000
@@ -72,9 +72,8 @@
   octave_value subsref (const std::string& type,
 			const std::list<octave_value_list>& idx);
 
-  octave_value_list subsref (const std::string& type,
-			     const std::list<octave_value_list>& idx,
-    			     int nargout)
+  octave_value_list subsref (const std::string&,
+			     const std::list<octave_value_list>&, int)
     {
       panic_impossible ();
       return octave_value_list ();
--- a/src/ov-usr-fcn.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov-usr-fcn.h	Tue Nov 25 05:41:36 2003 +0000
@@ -136,8 +136,8 @@
 	}
     }
 
-  octave_value subsref (const std::string& type,
-			const std::list<octave_value_list>& idx)
+  octave_value subsref (const std::string&,
+			const std::list<octave_value_list>&)
     {
       panic_impossible ();
       return octave_value ();
--- a/src/ov.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -969,7 +969,7 @@
 
 ColumnVector
 octave_value::column_vector_value (bool force_string_conv,
-				   bool force_vector_conversion) const
+				   bool /* frc_vec_conv */) const
 {
   ColumnVector retval;
 
@@ -998,7 +998,7 @@
 
 ComplexColumnVector
 octave_value::complex_column_vector_value (bool force_string_conv,
-					   bool force_vector_conversion) const
+					   bool /* frc_vec_conv */) const
 {
   ComplexColumnVector retval;
 
@@ -1027,7 +1027,7 @@
 
 RowVector
 octave_value::row_vector_value (bool force_string_conv,
-				bool force_vector_conversion) const
+				bool /* frc_vec_conv */) const
 {
   RowVector retval;
 
@@ -1056,7 +1056,7 @@
 
 ComplexRowVector
 octave_value::complex_row_vector_value (bool force_string_conv,
-					bool force_vector_conversion) const
+					bool /* frc_vec_conv */) const
 {
   ComplexRowVector retval;
 
@@ -1671,7 +1671,7 @@
 #endif
 
 void
-octave_value::do_non_const_unary_op (unary_op op, const octave_value_list& idx)
+octave_value::do_non_const_unary_op (unary_op, const octave_value_list&)
 {
   abort ();
 }
--- a/src/ov.h	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/ov.h	Tue Nov 25 05:41:36 2003 +0000
@@ -536,7 +536,7 @@
 
   virtual string_vector all_strings (bool pad = false,
 				     bool force = false) const
-    { return rep->all_strings (pad); }
+    { return rep->all_strings (pad, force); }
 
   virtual std::string string_value (bool force = false) const
     { return rep->string_value (); }
--- a/src/parse.y	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/parse.y	Tue Nov 25 05:41:36 2003 +0000
@@ -3811,7 +3811,7 @@
   return retval;
 }
 
-DEFUN (assignin, args, nargout,
+DEFUN (assignin, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} assignin (@var{context}, @var{varname}, @var{value})\n\
 Assign @var{value} to @var{varname} in context @var{context}, which\n\
--- a/src/pr-output.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/pr-output.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -1354,7 +1354,8 @@
 }
 
 void
-octave_print_internal (std::ostream& os, double d, bool pr_as_read_syntax)
+octave_print_internal (std::ostream& os, double d,
+		       bool /* pr_as_read_syntax */)
 {
   if (plus_format)
     {
@@ -1614,7 +1615,7 @@
 
 void
 octave_print_internal (std::ostream& os, const Complex& c,
-		       bool pr_as_read_syntax)
+		       bool /* pr_as_read_syntax */)
 {
   if (plus_format)
     {
@@ -1964,7 +1965,7 @@
 
 void
 octave_print_internal (std::ostream& os, const charNDArray& nda,
-		       bool pr_as_read_syntax, int extra_indent,
+		       bool pr_as_read_syntax, int /* extra_indent */,
 		       bool pr_as_string)
 {
   switch (nda.ndims ())
--- a/src/pt-bp.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/pt-bp.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -271,22 +271,23 @@
 }
 
 void 
-tree_breakpoint::visit_octave_user_function (octave_user_function& cmd)
+tree_breakpoint::visit_octave_user_function (octave_user_function&)
 {
-  // we should not visit octave user functions because the function we are currently 
-  // in is the function where the breakpoint was requested
+  // We should not visit octave user functions because the function we
+  // are currently in is the function where the breakpoint was
+  // requested.
 }
 
 void 
-tree_breakpoint::visit_octave_user_function_header (octave_user_function& cmd)
+tree_breakpoint::visit_octave_user_function_header (octave_user_function&)
 {
-  // Do nothing
+  // Do nothing.
 }
 
 void 
-tree_breakpoint::visit_octave_user_function_trailer (octave_user_function& cmd)
+tree_breakpoint::visit_octave_user_function_trailer (octave_user_function&)
 {
-  // Do nothing
+  // Do nothing.
 }
 
 void 
@@ -482,13 +483,13 @@
 }
 
 void
-tree_breakpoint::visit_plot_limits (plot_limits& cmd)
+tree_breakpoint::visit_plot_limits (plot_limits&)
 {
   // Do nothing.  This case will be handled in visit_tree_plot_command.
 }
 
 void 
-tree_breakpoint::visit_plot_range (plot_range& cmd)
+tree_breakpoint::visit_plot_range (plot_range&)
 {
   // Do nothing.  This case will be handled in visit_tree_plot_command.
 }
@@ -596,31 +597,31 @@
 }
 
 void 
-tree_breakpoint::visit_subplot (subplot& cmd)
+tree_breakpoint::visit_subplot (subplot&)
 {
   // Do nothing.  This case will be handled in visit_tree_plot_command.
 }
 
 void
-tree_breakpoint::visit_subplot_axes (subplot_axes& cmd)
+tree_breakpoint::visit_subplot_axes (subplot_axes&)
 {
   // Do nothing.  This caser will be handled in visit_tree_plot_command.
 }
 
 void
-tree_breakpoint::visit_subplot_list (subplot_list& cmd)
+tree_breakpoint::visit_subplot_list (subplot_list&)
 {
   // Do nothing.  This case will be handled in visit_tree_plot_command.
 }
 
 void 
-tree_breakpoint::visit_subplot_style (subplot_style& cmd)
+tree_breakpoint::visit_subplot_style (subplot_style&)
 {
   // Do nothing.  This case will be handled in visit_tree_plot_command.
 }
 
 void
-tree_breakpoint::visit_subplot_using (subplot_using& cmd)
+tree_breakpoint::visit_subplot_using (subplot_using&)
 {
   // Do nothing.  This case will be handled in visit_tree_plot_command.
 }
--- a/src/pt-check.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/pt-check.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -486,7 +486,7 @@
 }
 
 void
-tree_checker::visit_subplot_axes (subplot_axes& cmd)
+tree_checker::visit_subplot_axes (subplot_axes&)
 {
 }
 
--- a/src/utils.cc	Tue Nov 25 04:29:47 2003 +0000
+++ b/src/utils.cc	Tue Nov 25 05:41:36 2003 +0000
@@ -227,7 +227,7 @@
 // should be considered fatal; return 1 if this is ok.
 
 int
-empty_arg (const char *name, int nr, int nc)
+empty_arg (const char * /* name */, int nr, int nc)
 {
   return (nr == 0 || nc == 0);
 }