diff scripts/image/imformats.m @ 28563:5a07c798eb08

avoid function call input or output argument number mismatch Don't call functions with more inputs or outputs than they are defined to accept. For example, always define graphics callback functions to accept at least two arguments. To avoid creating unused variable names, they may be defined as ignored (~). * importdata.m: Call fileparts with three outputs, not four. * inputParser.m: Define default validation function with ignored input. * odemergeopts.m: Accept additional SOLVER argument. * annotation.m, legend.m, movfun.m, bug-55321.tst: Define callback functions with two inputs. * annotation.m (addbasemenu): Also accept varargin. * graphics.cc: Fix tests. * pkg/private/install.m: Don't pass extra global_install argument to getarchdir. * sparse/private/__alltohandles__.m: Define function handles with two inputs where needed.
author John W. Eaton <jwe@octave.org>
date Sat, 11 Jul 2020 10:15:57 -0400
parents a4268efb7334
children 28de41192f3c
line wrap: on
line diff
--- a/scripts/image/imformats.m	Sat Jul 11 09:34:44 2020 -0400
+++ b/scripts/image/imformats.m	Sat Jul 11 10:15:57 2020 -0400
@@ -372,7 +372,7 @@
 %! unwind_protect
 %!   fmt = imformats ("jpg"); # take jpg as template
 %!   fmt.ext = "new_fmt";
-%!   fmt.read = @() true ();
+%!   fmt.read = @(~) true ();
 %!   imformats ("add", fmt);
 %!   assert (imread (fname), true);
 %! unwind_protect_cleanup
@@ -391,7 +391,7 @@
 %! unwind_protect
 %!   fmt = imformats ("jpg"); # take jpg as template
 %!   fmt.ext = "new_fmt1";
-%!   fmt.read = @() true();
+%!   fmt.read = @(~) true();
 %!   fmt(2) = fmt(1);
 %!   fmt(2).ext = "new_fmt2";
 %!   imformats ("add", fmt);