diff libinterp/corefcn/__dispatch__.cc @ 20617:ba2b07c13913

use new string_value method to handle value extraction errors * __dispatch__.cc, balance.cc, colloc.cc, conv2.cc, data.cc, debug.cc, graphics.cc, input.cc, matrix_type.cc, oct-hist.cc, schur.cc, spparms.cc, symtab.cc, sysdep.cc, toplev.cc, utils.cc: Use new string_value method.
author John W. Eaton <jwe@octave.org>
date Fri, 09 Oct 2015 10:06:39 -0400
parents 610c74748518
children
line wrap: on
line diff
--- a/libinterp/corefcn/__dispatch__.cc	Thu Oct 08 19:00:51 2015 -0400
+++ b/libinterp/corefcn/__dispatch__.cc	Fri Oct 09 10:06:39 2015 -0400
@@ -46,39 +46,17 @@
 
   int nargin = args.length ();
 
-  std::string f, r, t;
-
   if (nargin > 0 && nargin < 4)
     {
-      f = args(0).string_value ();
+      std::string f, r, t;
 
-      if (error_state)
-        {
-          error ("__dispatch__: first argument must be a function name");
-          return retval;
-        }
+      f = args(0).string_value ("__dispatch__: first argument must be a function name");
 
       if (nargin > 1)
-        {
-          r = args(1).string_value ();
-
-          if (error_state)
-            {
-              error ("__dispatch__: second argument must be a function name");
-              return retval;
-            }
-        }
+        r = args(1).string_value ("__dispatch__: second argument must be a function name");
 
       if (nargin > 2)
-        {
-          t = args(2).string_value ();
-
-          if (error_state)
-            {
-              error ("__dispatch__: third argument must be a type name");
-              return retval;
-            }
-        }
+        t = args(2).string_value ("__dispatch__: third argument must be a type name");
 
       if (nargin == 1)
         {