# HG changeset patch # User Rik # Date 1450126769 28800 # Node ID 384ff5aa9437fcb83d89d541cf4111f70acfcc33 # Parent c07bee629973c176e9a492c2576b62b1e05de645 2015 Code Sprint: Eliminate useless return statements after error (). * data.cc, graphics.cc, graphics.in.h, ls-mat4.cc, ls-mat5.cc, oct-fstrm.cc, oct-stream.cc, oct-strstrm.cc, __delaunayn__.cc, ov-base-int.cc, ov-classdef.h, ov-complex.cc, ov-cx-sparse.cc, ov-fcn-inline.cc, ov-float.cc, ov-flt-complex.cc, ov-java.cc, ov-range.cc, ov-re-sparse.cc, ov-scalar.cc, ov-struct.cc, ov-usr-fcn.cc, ov.cc, op-cm-cm.cc, op-cm-m.cc, op-cm-scm.cc, op-cm-sm.cc, op-fcm-fcm.cc, op-fcm-fm.cc, op-fm-fcm.cc, op-fm-fm.cc, op-m-cm.cc, op-m-m.cc, op-m-scm.cc, op-m-sm.cc, op-scm-cm.cc, op-scm-m.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-m.cc, op-sm-scm.cc, op-sm-sm.cc, pt-exp.cc: Eliminate useless return statements after error (). diff --git a/libinterp/corefcn/data.cc b/libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc +++ b/libinterp/corefcn/data.cc @@ -2061,11 +2061,7 @@ for (int i = 1; i < args.length (); i++) { if (! (dv.*concat_rule) (args(i).dims (), dim)) - { - // Dimensions do not match. - error ("cat: dimension mismatch"); - return retval; - } + error ("cat: dimension mismatch"); } // The lines below might seem crazy, since we take a copy @@ -5349,10 +5345,7 @@ Array new_size = args(1).octave_idx_type_vector_value (); if (new_size.numel () < 2) - { - error ("reshape: SIZE must have 2 or more dimensions"); - return retval; - } + error ("reshape: SIZE must have 2 or more dimensions"); new_dims = dim_vector::alloc (new_size.numel ()); @@ -6725,10 +6718,7 @@ else if (mode == "descend") smode = DESCENDING; else - { error ("__sort_rows_idx__: MODE must be either \"ascend\" or \"descend\""); - return retval; - } } octave_value arg = args(0); @@ -7671,10 +7661,7 @@ { octave_idx_type k = rep(1, i); if (k < 0) - { - error ("repelems: second row must contain non-negative numbers"); - return retval; - } + error ("repelems: second row must contain non-negative numbers"); l += k; } @@ -7736,10 +7723,7 @@ { octave_idx_type rx = rm(i); if (static_cast (rx) != rm(i)) - { - error ("repelems: R must be a matrix of integers"); - return retval; - } + error ("repelems: R must be a matrix of integers"); r(i) = rx; } diff --git a/libinterp/corefcn/graphics.cc b/libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc +++ b/libinterp/corefcn/graphics.cc @@ -2997,12 +2997,9 @@ all_props.find (pname); if (it == all_props.end ()) - { - error ("get_property: unknown property \"%s\"", pname.c_str ()); - return property (); - } - else - return it->second; + error ("get_property: unknown property \"%s\"", pname.c_str ()); + + return it->second; } void @@ -11653,10 +11650,7 @@ graphics_handle handle = gh_manager::lookup (h); if (! handle.ok ()) - { - error ("__zoom__: invalid handle"); - return retval; - } + error ("__zoom__: invalid handle"); graphics_object ax = gh_manager::get_object (handle); diff --git a/libinterp/corefcn/graphics.in.h b/libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h +++ b/libinterp/corefcn/graphics.in.h @@ -64,28 +64,24 @@ virtual ~base_scaler (void) { } - virtual Matrix scale (const Matrix& m) const + virtual Matrix scale (const Matrix&) const { error ("invalid axis scale"); - return m; - } - - virtual NDArray scale (const NDArray& m) const + } + + virtual NDArray scale (const NDArray&) const { error ("invalid axis scale"); - return m; - } - - virtual double scale (double d) const + } + + virtual double scale (double) const { error ("invalid axis scale"); - return d; - } - - virtual double unscale (double d) const + } + + virtual double unscale (double) const { error ("invalid axis scale"); - return d; } virtual base_scaler* clone () const @@ -316,20 +312,17 @@ virtual octave_value get (void) const { error ("get: invalid property \"%s\"", name.c_str ()); - return octave_value (); } virtual std::string values_as_string (void) const { error ("values_as_string: invalid property \"%s\"", name.c_str ()); - return std::string (); } virtual Cell values_as_cell (void) const { error ("values_as_cell: invalid property \"%s\"", name.c_str ()); - return Cell (); } base_property& operator = (const octave_value& val) @@ -404,7 +397,6 @@ virtual bool do_set (const octave_value&) { error ("set: invalid property \"%s\"", name.c_str ()); - return false; } private: @@ -2736,7 +2728,6 @@ else { error ("base_graphics_object::get: invalid graphics object"); - return octave_value (); } } @@ -2747,7 +2738,6 @@ else { error ("base_graphics_object::get: invalid graphics object"); - return octave_value (); } } @@ -2758,7 +2748,6 @@ virtual octave_value get_defaults (void) const { error ("base_graphics_object::get_defaults: invalid graphics object"); - return octave_value (); } virtual property_list get_defaults_list (void) const @@ -2771,13 +2760,11 @@ virtual octave_value get_factory_defaults (void) const { error ("base_graphics_object::get_factory_defaults: invalid graphics object"); - return octave_value (); } virtual property_list get_factory_defaults_list (void) const { error ("base_graphics_object::get_factory_defaults_list: invalid graphics object"); - return property_list (); } virtual bool has_readonly_property (const caseless_str& pname) const @@ -2798,7 +2785,6 @@ else { error ("base_graphics_object::get_parent: invalid graphics object"); - return graphics_handle (); } } @@ -2809,7 +2795,6 @@ else { error ("base_graphics_object::get_handle: invalid graphics object"); - return graphics_handle (); } } @@ -2852,14 +2837,12 @@ { static base_properties properties; error ("base_graphics_object::get_properties: invalid graphics object"); - return properties; } virtual const base_properties& get_properties (void) const { static base_properties properties; error ("base_graphics_object::get_properties: invalid graphics object"); - return properties; } virtual void update_axis_limits (const std::string& axis_type); @@ -2889,7 +2872,6 @@ else { error ("base_graphics_object::get_toolkit: invalid graphics object"); - return graphics_toolkit (); } } diff --git a/libinterp/corefcn/ls-mat4.cc b/libinterp/corefcn/ls-mat4.cc --- a/libinterp/corefcn/ls-mat4.cc +++ b/libinterp/corefcn/ls-mat4.cc @@ -399,9 +399,10 @@ return retval; } +// FIXME: With short-circuiting error(), no need for goto in code data_read_error: error ("load: trouble reading binary file '%s'", filename.c_str ()); - return retval; + } // Save the data from TC along with the corresponding NAME on stream OS diff --git a/libinterp/corefcn/ls-mat5.cc b/libinterp/corefcn/ls-mat5.cc --- a/libinterp/corefcn/ls-mat5.cc +++ b/libinterp/corefcn/ls-mat5.cc @@ -1465,9 +1465,9 @@ return retval; +// FIXME: With short-circuiting error(), no need for goto in code data_read_error: error ("load: trouble reading binary file '%s'", filename.c_str ()); - return std::string (); skip_ahead: warning ("load: skipping over '%s'", retval.c_str ()); @@ -2682,8 +2682,8 @@ skip_to_next: return true; +// FIXME: With short-circuiting error(), no need for goto in code error_cleanup: error ("save: error while writing '%s' to MAT file", name.c_str ()); - return false; } diff --git a/libinterp/corefcn/oct-fstrm.cc b/libinterp/corefcn/oct-fstrm.cc --- a/libinterp/corefcn/oct-fstrm.cc +++ b/libinterp/corefcn/oct-fstrm.cc @@ -65,7 +65,6 @@ octave_fstream::seek (off_t, int) { error ("fseek: invalid_operation"); - return -1; } // Return current stream position. @@ -74,7 +73,6 @@ octave_fstream::tell (void) { error ("ftell: invalid_operation"); - return -1; } // Return nonzero if EOF has been reached on this stream. diff --git a/libinterp/corefcn/oct-stream.cc b/libinterp/corefcn/oct-stream.cc --- a/libinterp/corefcn/oct-stream.cc +++ b/libinterp/corefcn/oct-stream.cc @@ -2609,8 +2609,6 @@ default: error ("%s: invalid format specifier", who.c_str ()); - return -1; - break; } } diff --git a/libinterp/corefcn/oct-strstrm.cc b/libinterp/corefcn/oct-strstrm.cc --- a/libinterp/corefcn/oct-strstrm.cc +++ b/libinterp/corefcn/oct-strstrm.cc @@ -32,7 +32,6 @@ octave_base_strstream::seek (off_t, int) { error ("fseek: invalid operation"); - return -1; } // Return current stream position. @@ -41,7 +40,6 @@ octave_base_strstream::tell (void) { error ("ftell: invalid operation"); - return -1; } octave_stream diff --git a/libinterp/dldfcn/__delaunayn__.cc b/libinterp/dldfcn/__delaunayn__.cc --- a/libinterp/dldfcn/__delaunayn__.cc +++ b/libinterp/dldfcn/__delaunayn__.cc @@ -74,10 +74,7 @@ int maxval = std::numeric_limits::max (); if (dim > maxval || n > maxval) - { - error ("%s: dimension too large for Qhull", who); - return false; - } + error ("%s: dimension too large for Qhull", who); } return true; diff --git a/libinterp/octave-value/ov-base-int.cc b/libinterp/octave-value/ov-base-int.cc --- a/libinterp/octave-value/ov-base-int.cc +++ b/libinterp/octave-value/ov-base-int.cc @@ -508,11 +508,9 @@ octave_base_int_scalar::load_ascii (std::istream& is) { is >> this->scalar; - if (!is) - { - error ("load: failed to load scalar constant"); - return false; - } + if (! is) + error ("load: failed to load scalar constant"); + return true; } diff --git a/libinterp/octave-value/ov-classdef.h b/libinterp/octave-value/ov-classdef.h --- a/libinterp/octave-value/ov-classdef.h +++ b/libinterp/octave-value/ov-classdef.h @@ -412,13 +412,10 @@ { Cell val = map.contents (pname); - if (val.numel () > 0) - return val(0, 0); - else - { + if (val.numel () < 1) error ("get: unknown slot: %s", pname.c_str ()); - return octave_value (); - } + + return val(0, 0); } octave_value_list @@ -547,7 +544,6 @@ int /* nargout */) { error ("subsref: invalid meta object"); - return octave_value_list (); } virtual void meta_release (void) { } @@ -1510,27 +1506,19 @@ inline cdef_object to_cdef (const octave_value& val) { - if (val.type_name () == "object") - return dynamic_cast (val.internal_rep ())->get_object (); - else - { - error ("cannot convert `%s' into `object'", val.type_name().c_str ()); - return cdef_object (); - } + if (val.type_name () != "object") + error ("cannot convert `%s' into `object'", val.type_name().c_str ()); + + return dynamic_cast (val.internal_rep ())->get_object (); } inline cdef_object& to_cdef_ref (const octave_value& val) { - static cdef_object empty; + if (val.type_name () != "object") + error ("cannot convert `%s' into `object'", val.type_name().c_str ()); - if (val.type_name () == "object") - return dynamic_cast (val.internal_rep ())->get_object_ref (); - else - { - error ("cannot convert `%s' into `object'", val.type_name().c_str ()); - return empty; - } + return dynamic_cast (val.internal_rep ())->get_object_ref (); } inline cdef_object diff --git a/libinterp/octave-value/ov-complex.cc b/libinterp/octave-value/ov-complex.cc --- a/libinterp/octave-value/ov-complex.cc +++ b/libinterp/octave-value/ov-complex.cc @@ -311,11 +311,8 @@ { scalar = octave_read_value (is); - if (!is) - { - error ("load: failed to load complex scalar constant"); - return false; - } + if (! is) + error ("load: failed to load complex scalar constant"); return true; } diff --git a/libinterp/octave-value/ov-cx-sparse.cc b/libinterp/octave-value/ov-cx-sparse.cc --- a/libinterp/octave-value/ov-cx-sparse.cc +++ b/libinterp/octave-value/ov-cx-sparse.cc @@ -308,10 +308,7 @@ swap_bytes<4> (&tmp); if (tmp != -2) - { - error ("load: only 2-D sparse matrices are supported"); - return false; - } + error ("load: only 2-D sparse matrices are supported"); if (! is.read (reinterpret_cast (&nr), 4)) return false; diff --git a/libinterp/octave-value/ov-fcn-inline.cc b/libinterp/octave-value/ov-fcn-inline.cc --- a/libinterp/octave-value/ov-fcn-inline.cc +++ b/libinterp/octave-value/ov-fcn-inline.cc @@ -780,30 +780,22 @@ else if (nargin == 2 && args(1).is_numeric_type ()) { if (! args(1).is_scalar_type ()) - { - error ("inline: N must be an integer"); - return retval; - } + error ("inline: N must be an integer"); int n = args(1).int_value ("inline: N must be an integer"); - if (n >= 0) - { - fargs.resize (n+1); + if (n < 0) + error ("inline: N must be a positive integer or zero"); - fargs(0) = "x"; + fargs.resize (n+1); - for (int i = 1; i < n+1; i++) - { - std::ostringstream buf; - buf << "P" << i; - fargs(i) = buf.str (); - } - } - else + fargs(0) = "x"; + + for (int i = 1; i < n+1; i++) { - error ("inline: N must be a positive integer or zero"); - return retval; + std::ostringstream buf; + buf << "P" << i; + fargs(i) = buf.str (); } } else diff --git a/libinterp/octave-value/ov-float.cc b/libinterp/octave-value/ov-float.cc --- a/libinterp/octave-value/ov-float.cc +++ b/libinterp/octave-value/ov-float.cc @@ -147,11 +147,8 @@ octave_float_scalar::load_ascii (std::istream& is) { scalar = octave_read_value (is); - if (!is) - { - error ("load: failed to load scalar constant"); - return false; - } + if (! is) + error ("load: failed to load scalar constant"); return true; } diff --git a/libinterp/octave-value/ov-flt-complex.cc b/libinterp/octave-value/ov-flt-complex.cc --- a/libinterp/octave-value/ov-flt-complex.cc +++ b/libinterp/octave-value/ov-flt-complex.cc @@ -255,11 +255,8 @@ { scalar = octave_read_value (is); - if (!is) - { - error ("load: failed to load complex scalar constant"); - return false; - } + if (! is) + error ("load: failed to load complex scalar constant"); return true; } diff --git a/libinterp/octave-value/ov-java.cc b/libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc +++ b/libinterp/octave-value/ov-java.cc @@ -2089,7 +2089,6 @@ return retval; #else error ("__java_init__: Octave was not compiled with Java interface"); - return octave_value (); #endif } @@ -2458,7 +2457,6 @@ return SET_INTERNAL_VARIABLE (java_unsigned_autoconversion); #else error ("java_unsigned_autoconversion: Octave was not compiled with Java interface"); - return octave_value (); #endif } @@ -2481,7 +2479,6 @@ return SET_INTERNAL_VARIABLE (debug_java); #else error ("debug_java: Octave was not compiled with Java interface"); - return octave_value (); #endif } diff --git a/libinterp/octave-value/ov-range.cc b/libinterp/octave-value/ov-range.cc --- a/libinterp/octave-value/ov-range.cc +++ b/libinterp/octave-value/ov-range.cc @@ -472,11 +472,8 @@ double base, limit, inc; is >> base >> limit >> inc; - if (!is) - { - error ("load: failed to load range constant"); - return false; - } + if (! is) + error ("load: failed to load range constant"); if (inc != 0) range = Range (base, limit, inc); diff --git a/libinterp/octave-value/ov-re-sparse.cc b/libinterp/octave-value/ov-re-sparse.cc --- a/libinterp/octave-value/ov-re-sparse.cc +++ b/libinterp/octave-value/ov-re-sparse.cc @@ -339,10 +339,7 @@ swap_bytes<4> (&tmp); if (tmp != -2) - { - error ("load: only 2-D sparse matrices are supported"); - return false; - } + error ("load: only 2-D sparse matrices are supported"); if (! is.read (reinterpret_cast (&nr), 4)) return false; diff --git a/libinterp/octave-value/ov-scalar.cc b/libinterp/octave-value/ov-scalar.cc --- a/libinterp/octave-value/ov-scalar.cc +++ b/libinterp/octave-value/ov-scalar.cc @@ -162,11 +162,9 @@ octave_scalar::load_ascii (std::istream& is) { scalar = octave_read_value (is); - if (!is) - { - error ("load: failed to load scalar constant"); - return false; - } + + if (! is) + error ("load: failed to load scalar constant"); return true; } diff --git a/libinterp/octave-value/ov-struct.cc b/libinterp/octave-value/ov-struct.cc --- a/libinterp/octave-value/ov-struct.cc +++ b/libinterp/octave-value/ov-struct.cc @@ -280,10 +280,7 @@ octave_value t_rhs = rhs; if (idx.front ().empty ()) - { - error ("missing index in indexed assignment"); - return retval; - } + error ("missing index in indexed assignment"); if (n > 1 && ! (type.length () == 2 && type[0] == '(' && type[1] == '.')) { @@ -1168,10 +1165,7 @@ octave_value retval; if (idx.front ().empty ()) - { - error ("missing index in indexed assignment"); - return retval; - } + error ("missing index in indexed assignment"); if (type[0] == '.') { @@ -1755,10 +1749,7 @@ for (int i = 0; i < nargin; i += 2) { if (! args(i).is_string () || i + 1 >= nargin) - { - error ("struct: additional arguments must occur as \"field\", VALUE pairs"); - return retval; - } + error ("struct: additional arguments must occur as \"field\", VALUE pairs"); } // Check that the dimensions of the values correspond. @@ -2009,16 +2000,10 @@ print_usage (); if (! args(0).is_cell ()) - { - error ("cell2struct: argument CELL must be of type cell"); - return retval; - } + error ("cell2struct: argument CELL must be of type cell"); if (! (args(1).is_cellstr () || args(1).is_char_matrix ())) - { - error ("cell2struct: FIELDS must be a cell array of strings or a character matrix"); - return retval; - } + error ("cell2struct: FIELDS must be a cell array of strings or a character matrix"); const Cell vals = args(0).cell_value (); const Array fields = args(1).cellstr_value (); @@ -2029,28 +2014,19 @@ if (nargin == 3) { - if (args(2).is_real_scalar ()) - dim = nargin == 2 ? 0 : args(2).int_value () - 1; - else - { - error ("cell2struct: DIM must be a real scalar"); - return retval; - } + if (! args(2).is_real_scalar ()) + error ("cell2struct: DIM must be a real scalar"); + + dim = nargin == 2 ? 0 : args(2).int_value () - 1; } if (dim < 0) - { - error ("cell2struct: DIM must be a valid dimension"); - return retval; - } + error ("cell2struct: DIM must be a valid dimension"); ext = vals.ndims () > dim ? vals.dims ()(dim) : 1; if (ext != fields.numel ()) - { - error ("cell2struct: number of FIELDS does not match dimension"); - return retval; - } + error ("cell2struct: number of FIELDS does not match dimension"); int nd = std::max (dim+1, vals.ndims ()); // result dimensions. diff --git a/libinterp/octave-value/ov-usr-fcn.cc b/libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc +++ b/libinterp/octave-value/ov-usr-fcn.cc @@ -115,11 +115,7 @@ octave_user_script::subsref (const std::string&, const std::list&, int) { - octave_value_list retval; - error ("invalid use of script %s in index expression", file_name.c_str ()); - - return retval; } octave_value_list @@ -505,10 +501,7 @@ call_depth++; if (call_depth >= Vmax_recursion_depth) - { - error ("max_recursion_depth exceeded"); - return retval; - } + error ("max_recursion_depth exceeded"); // Save old and set current symbol table context, for // eval_undefined_error(). @@ -841,10 +834,7 @@ std::string name = func.string_value (); func = symbol_table::find_function (name); if (func.is_undefined ()) - { - error ("nargin: invalid function name: %s", name.c_str ()); - return retval; - } + error ("nargin: invalid function name: %s", name.c_str ()); } octave_function *fcn_val = func.function_value (); @@ -952,10 +942,7 @@ std::string name = func.string_value (); func = symbol_table::find_function (name); if (func.is_undefined ()) - { - error ("nargout: invalid function name: %s", name.c_str ()); - return retval; - } + error ("nargout: invalid function name: %s", name.c_str ()); } if (func.is_inline_function ()) @@ -1048,12 +1035,9 @@ static bool isargout1 (int nargout, const Matrix& ignored, double k) { if (k != xround (k) || k <= 0) - { - error ("isargout: K must be a positive integer"); - return false; - } - else - return (k == 1 || k <= nargout) && ! val_in_table (ignored, k); + error ("isargout: K must be a positive integer"); + + return (k == 1 || k <= nargout) && ! val_in_table (ignored, k); } DEFUN (isargout, args, , diff --git a/libinterp/octave-value/ov.cc b/libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc +++ b/libinterp/octave-value/ov.cc @@ -2970,10 +2970,7 @@ else if (item == ".") type_string[k] = '.'; else - { - error ("%s: invalid indexing type '%s'", name, item.c_str ()); - return; - } + error ("%s: invalid indexing type '%s'", name, item.c_str ()); octave_value_list idx_item; @@ -2993,10 +2990,7 @@ } } else - { - error ("%s: subs(%d) must be a string or cell array", name, k+1); - return; - } + error ("%s: subs(%d) must be a string or cell array", name, k+1); idx.push_back (idx_item); } diff --git a/libinterp/operators/op-cm-cm.cc b/libinterp/operators/op-cm-cm.cc --- a/libinterp/operators/op-cm-cm.cc +++ b/libinterp/operators/op-cm-cm.cc @@ -89,7 +89,6 @@ DEFBINOPX (pow, complex_matrix, complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, complex_matrix, complex_matrix) diff --git a/libinterp/operators/op-cm-m.cc b/libinterp/operators/op-cm-m.cc --- a/libinterp/operators/op-cm-m.cc +++ b/libinterp/operators/op-cm-m.cc @@ -73,7 +73,6 @@ DEFBINOPX (pow, complex_matrix, matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, complex_matrix, matrix) diff --git a/libinterp/operators/op-cm-scm.cc b/libinterp/operators/op-cm-scm.cc --- a/libinterp/operators/op-cm-scm.cc +++ b/libinterp/operators/op-cm-scm.cc @@ -75,7 +75,6 @@ DEFBINOPX (pow, complex_matrix, sparse_complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, complex_matrix, sparse_complex_matrix) diff --git a/libinterp/operators/op-cm-sm.cc b/libinterp/operators/op-cm-sm.cc --- a/libinterp/operators/op-cm-sm.cc +++ b/libinterp/operators/op-cm-sm.cc @@ -74,7 +74,6 @@ DEFBINOPX (pow, complex_matrix, sparse_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, complex_matrix, sparse_matrix) diff --git a/libinterp/operators/op-fcm-fcm.cc b/libinterp/operators/op-fcm-fcm.cc --- a/libinterp/operators/op-fcm-fcm.cc +++ b/libinterp/operators/op-fcm-fcm.cc @@ -90,7 +90,6 @@ DEFBINOPX (pow, float_complex_matrix, float_complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, float_complex_matrix, float_complex_matrix) diff --git a/libinterp/operators/op-fcm-fm.cc b/libinterp/operators/op-fcm-fm.cc --- a/libinterp/operators/op-fcm-fm.cc +++ b/libinterp/operators/op-fcm-fm.cc @@ -79,7 +79,6 @@ DEFBINOPX (pow, float_complex_matrix, float_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, float_complex_matrix, float_matrix) diff --git a/libinterp/operators/op-fm-fcm.cc b/libinterp/operators/op-fm-fcm.cc --- a/libinterp/operators/op-fm-fcm.cc +++ b/libinterp/operators/op-fm-fcm.cc @@ -78,7 +78,6 @@ DEFBINOPX (pow, float_matrix, float_complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, float_matrix, float_complex_matrix) diff --git a/libinterp/operators/op-fm-fm.cc b/libinterp/operators/op-fm-fm.cc --- a/libinterp/operators/op-fm-fm.cc +++ b/libinterp/operators/op-fm-fm.cc @@ -77,7 +77,6 @@ DEFBINOPX (pow, float_matrix, float_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, float_matrix, float_matrix) diff --git a/libinterp/operators/op-m-cm.cc b/libinterp/operators/op-m-cm.cc --- a/libinterp/operators/op-m-cm.cc +++ b/libinterp/operators/op-m-cm.cc @@ -74,7 +74,6 @@ DEFBINOPX (pow, matrix, complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, matrix, complex_matrix) diff --git a/libinterp/operators/op-m-m.cc b/libinterp/operators/op-m-m.cc --- a/libinterp/operators/op-m-m.cc +++ b/libinterp/operators/op-m-m.cc @@ -76,7 +76,6 @@ DEFBINOPX (pow, matrix, matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, matrix, matrix) diff --git a/libinterp/operators/op-m-scm.cc b/libinterp/operators/op-m-scm.cc --- a/libinterp/operators/op-m-scm.cc +++ b/libinterp/operators/op-m-scm.cc @@ -75,7 +75,6 @@ DEFBINOPX (pow, matrix, sparse_complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, matrix, sparse_complex_matrix) diff --git a/libinterp/operators/op-m-sm.cc b/libinterp/operators/op-m-sm.cc --- a/libinterp/operators/op-m-sm.cc +++ b/libinterp/operators/op-m-sm.cc @@ -73,7 +73,6 @@ DEFBINOPX (pow, matrix, sparse_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, matrix, sparse_matrix) diff --git a/libinterp/operators/op-scm-cm.cc b/libinterp/operators/op-scm-cm.cc --- a/libinterp/operators/op-scm-cm.cc +++ b/libinterp/operators/op-scm-cm.cc @@ -62,7 +62,6 @@ DEFBINOPX (pow, sparse_complex_matrix, complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_complex_matrix, complex_matrix) diff --git a/libinterp/operators/op-scm-m.cc b/libinterp/operators/op-scm-m.cc --- a/libinterp/operators/op-scm-m.cc +++ b/libinterp/operators/op-scm-m.cc @@ -63,7 +63,6 @@ DEFBINOPX (pow, sparse_complex_matrix, matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_complex_matrix, matrix) diff --git a/libinterp/operators/op-scm-scm.cc b/libinterp/operators/op-scm-scm.cc --- a/libinterp/operators/op-scm-scm.cc +++ b/libinterp/operators/op-scm-scm.cc @@ -123,7 +123,6 @@ DEFBINOPX (pow, sparse_complex_matrix, sparse_complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_complex_matrix, sparse_complex_matrix) diff --git a/libinterp/operators/op-scm-sm.cc b/libinterp/operators/op-scm-sm.cc --- a/libinterp/operators/op-scm-sm.cc +++ b/libinterp/operators/op-scm-sm.cc @@ -73,7 +73,6 @@ DEFBINOPX (pow, sparse_complex_matrix, sparse_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_complex_matrix, sparse_matrix) diff --git a/libinterp/operators/op-sm-cm.cc b/libinterp/operators/op-sm-cm.cc --- a/libinterp/operators/op-sm-cm.cc +++ b/libinterp/operators/op-sm-cm.cc @@ -62,7 +62,6 @@ DEFBINOPX (pow, sparse_matrix, complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_matrix, complex_matrix) diff --git a/libinterp/operators/op-sm-m.cc b/libinterp/operators/op-sm-m.cc --- a/libinterp/operators/op-sm-m.cc +++ b/libinterp/operators/op-sm-m.cc @@ -60,7 +60,6 @@ DEFBINOPX (pow, sparse_matrix, matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_matrix, matrix) diff --git a/libinterp/operators/op-sm-scm.cc b/libinterp/operators/op-sm-scm.cc --- a/libinterp/operators/op-sm-scm.cc +++ b/libinterp/operators/op-sm-scm.cc @@ -73,7 +73,6 @@ DEFBINOPX (pow, sparse_matrix, sparse_complex_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_matrix, sparse_complex_matrix) diff --git a/libinterp/operators/op-sm-sm.cc b/libinterp/operators/op-sm-sm.cc --- a/libinterp/operators/op-sm-sm.cc +++ b/libinterp/operators/op-sm-sm.cc @@ -97,7 +97,6 @@ DEFBINOPX (pow, sparse_matrix, sparse_matrix) { error ("can't do A ^ B for A and B both matrices"); - return octave_value (); } DEFBINOP (ldiv, sparse_matrix, sparse_matrix) diff --git a/libinterp/parse-tree/pt-exp.cc b/libinterp/parse-tree/pt-exp.cc --- a/libinterp/parse-tree/pt-exp.cc +++ b/libinterp/parse-tree/pt-exp.cc @@ -55,14 +55,12 @@ tree_expression::rvalue1 (int) { error ("invalid rvalue function called in expression"); - return octave_value (); } octave_value_list tree_expression::rvalue (int) { error ("invalid rvalue function called in expression"); - return octave_value_list (); } octave_value_list @@ -75,7 +73,6 @@ tree_expression::lvalue (void) { error ("invalid lvalue function called in expression"); - return octave_lvalue (); } std::string