changeset 28895:41c54377d67f

maint: remove unnecessary checks on nargout in m-files. * lightangle.m, shrinkfaces.m, polyeig.m: Remove unnecessary checks on nargout in m-files now that interpreter does this automatically.
author Rik <rik@octave.org>
date Sun, 11 Oct 2020 18:15:34 -0700
parents 61bdb3e2f6a1
children 90fea9cc9caa
files scripts/plot/draw/lightangle.m scripts/plot/draw/shrinkfaces.m scripts/polynomial/polyeig.m
diffstat 3 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/lightangle.m	Sat Oct 10 20:06:12 2020 -0700
+++ b/scripts/plot/draw/lightangle.m	Sun Oct 11 18:15:34 2020 -0700
@@ -165,8 +165,8 @@
 ## Test input validation
 %!error <Invalid call> lightangle ()
 %!error <Invalid call> lightangle (1, 2, 3, 4)
+%!error <Invalid call> [a, b, c] = lightangle (45, 30)
 %!error <Invalid call> [a, b] = lightangle (45, 30)
-%!error <Invalid call> [a, b, c] = lightangle (45, 30)
 %!error <HL must be a handle to a light object> lightangle (0)
 %!error <H must be a handle to an axes or light object> lightangle (0, 90, 45)
 %!error <AZ and EL must be numeric scalars> lightangle ([1 2], 0)
--- a/scripts/plot/draw/shrinkfaces.m	Sat Oct 10 20:06:12 2020 -0700
+++ b/scripts/plot/draw/shrinkfaces.m	Sun Oct 11 18:15:34 2020 -0700
@@ -73,7 +73,7 @@
 
 function [nf, nv] = shrinkfaces (varargin)
 
-  if (nargin < 1 || nargin > 3 || nargout > 2)
+  if (nargin < 1 || nargin > 3)
     print_usage ();
   endif
 
@@ -231,8 +231,8 @@
 %!assert (norm (nfv2.vertices - vertices), 0, 2*eps)
 
 ## Test input validation
-%!error shrinkfaces ()
-%!error shrinkfaces (1,2,3,4)
+%!error <Invalid call> shrinkfaces ()
+%!error <Invalid call> shrinkfaces (1,2,3,4)
 %!error [a,b,c] = shrinkfaces (1)
 %!error <scale factor must be a positive scalar> shrinkfaces (nfv, ones (2))
 %!error <scale factor must be a positive scalar> shrinkfaces (nfv, 0)
--- a/scripts/polynomial/polyeig.m	Sat Oct 10 20:06:12 2020 -0700
+++ b/scripts/polynomial/polyeig.m	Sun Oct 11 18:15:34 2020 -0700
@@ -49,7 +49,7 @@
 
 function [z, v] = polyeig (varargin)
 
-  if (nargin < 1 || nargout > 2)
+  if (nargin < 1)
     print_usage ();
   endif
 
@@ -105,8 +105,7 @@
 %! assert (norm (d), 0.0);
 
 ## Test input validation
-%!error polyeig ()
-%!error [a,b,c] = polyeig (1)
+%!error <Invalid call> polyeig ()
 %!error <coefficients must be square matrices> polyeig (ones (3,2))
 %!error <coefficients must have the same dimensions>
 %! polyeig (ones (3,3), ones (2,2))