diff libinterp/dldfcn/__magick_read__.cc @ 20704:571508c1ed06

eliminate more uses of error_state * ov.h, ov.cc (octave_value::xall_strings): New extractor. * bitfcns.cc, data.cc, ellipj.cc, fftn.cc, file-io.cc, filter.cc, find.cc, graphics.cc, input.cc, load-path.cc, luinc.cc, matrix_type.cc, oct-stream.cc, ordschur.cc, psi.cc, rand.cc, spparms.cc, strfns.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, utils.cc, variables.cc, __glpk__.cc, __magick_read__.cc, amd.cc, ov-cell.cc, ov-fcn-inline.cc, ov-struct.cc: Eliminate more uses of error_state. * system.tst: Update tests.
author John W. Eaton <jwe@octave.org>
date Sat, 14 Nov 2015 15:18:05 -0500
parents 85e5efae848a
children 131b4af8b5d8
line wrap: on
line diff
--- a/libinterp/dldfcn/__magick_read__.cc	Sat Nov 14 12:07:38 2015 -0500
+++ b/libinterp/dldfcn/__magick_read__.cc	Sat Nov 14 15:18:05 2015 -0500
@@ -748,12 +748,7 @@
       return output;
     }
 
-  const octave_scalar_map options = args(1).scalar_map_value ();
-  if (error_state)
-    {
-      error ("__magick_read__: OPTIONS must be a struct");
-      return output;
-    }
+  const octave_scalar_map options = args(1).xscalar_map_value ("__magick_read__: OPTIONS must be a struct");
 
   std::vector<Magick::Image> imvec;
   read_file (args(0).string_value (), imvec);
@@ -1405,22 +1400,12 @@
       return retval;
     }
   const std::string filename = args(0).string_value ();
-  const std::string ext      = args(1).string_value ();
+  const std::string ext = args(1).string_value ();
 
-  const octave_scalar_map options = args(4).scalar_map_value ();
-  if (error_state)
-    {
-      error ("__magick_write__: OPTIONS must be a struct");
-      return retval;
-    }
+  const octave_scalar_map options = args(4).xscalar_map_value ("__magick_write__: OPTIONS must be a struct");
 
   const octave_value img  = args(2);
-  const Matrix       cmap = args(3).matrix_value ();
-  if (error_state)
-    {
-      error ("__magick_write__: invalid IMG or MAP");
-      return retval;
-    }
+  const Matrix cmap = args(3).xmatrix_value ("__magick_write__: invalid MAP");
 
   std::vector<Magick::Image> imvec;