diff libinterp/corefcn/dassl.cc @ 20957:9db35d2042be

maint: eliminate special cases of statements after error. * daspk.cc: Eliminate DASPK_ABORT, DASPK_ABORT1, DASPK_ABORT2 macros. * dasrt.cc: Eliminate DASRT_ABORT, DASRT_ABORT1, DASRT_ABORT2 macros. * dassl.cc: Eliminate DASSL_ABORT, DASSL_ABORT1, DASSL_ABORT2 macros. libinterp/corefcn/graphics.cc (Fdrawnow): Reverse order and call gh_manager::unlock() before call to error(). * variables.cc (Fmlock): Adjust indentation. * __glpk__.cc (glpk): Add FIXME note about unreachable code. * __init_fltk__.cc (F__fltk_check__, F__init_fltk__): Place return statement within #ifdef HAVE_FLTK block. * ov-fcn-handle.cc (load_hdf5): eliminate useless statements after error. * ov-java.cc (F__java_exit__): Place return statement within #ifdef HAVE_JAVA block. * octave.cc (octave_process_command_line): Issue warning, which will return, and then call octave_print_terse_usage_and_exit. * lex.ll: Add FIXME notes about unreachable code. * oct-parse.in.yy (source_file): Eliminate useless return after error.
author Rik <rik@octave.org>
date Sun, 20 Dec 2015 15:31:53 -0800
parents 48b2ad5ee801
children 1edf15793cac
line wrap: on
line diff
--- a/libinterp/corefcn/dassl.cc	Sun Dec 20 13:26:17 2015 -0800
+++ b/libinterp/corefcn/dassl.cc	Sun Dec 20 15:31:53 2015 -0800
@@ -157,25 +157,6 @@
   return retval;
 }
 
-#define DASSL_ABORT() \
-  return retval
-
-#define DASSL_ABORT1(msg) \
-  do \
-    { \
-      error ("dassl: " msg); \
-      DASSL_ABORT (); \
-    } \
-  while (0)
-
-#define DASSL_ABORT2(fmt, arg) \
-  do \
-    { \
-      error ("dassl: " fmt, arg); \
-      DASSL_ABORT (); \
-    } \
-  while (0)
-
 DEFUN (dassl, args, nargout,
        "-*- texinfo -*-\n\
 @deftypefn {} {[@var{x}, @var{xdot}, @var{istate}, @var{msg}] =} dassl (@var{fcn}, @var{x_0}, @var{xdot_0}, @var{t}, @var{t_crit})\n\
@@ -294,7 +275,7 @@
   call_depth++;
 
   if (call_depth > 1)
-    DASSL_ABORT1 ("invalid recursive call");
+    error ("dassl: invalid recursive call");
 
   std::string fcn_name, fname, jac_name, jname;
   dassl_fcn = 0;
@@ -344,7 +325,7 @@
             }
         }
       else
-        DASSL_ABORT1 ("incorrect number of elements in cell array");
+        error ("dassl: incorrect number of elements in cell array");
     }
 
   if (! dassl_fcn && ! f_arg.is_cell ())
@@ -402,7 +383,7 @@
     }
 
   if (! dassl_fcn)
-    DASSL_ABORT ();
+    return retval;
 
   ColumnVector state = args(1).xvector_value ("dassl: initial state X_0 must be a vector");
 
@@ -420,7 +401,7 @@
     }
 
   if (state.numel () != deriv.numel ())
-    DASSL_ABORT1 ("X and XDOT_0 must have the same size");
+    error ("dassl: X and XDOT_0 must have the same size");
 
   double tzero = out_times (0);