Mercurial > octave
changeset 28946:ef2b0a00daef
maint: Don't declare nargin in C++ files if it is used only once.
* __betainc__.cc, __expint__.cc, __gammainc__.cc, dirfns.cc,
strfns.cc:
Don't declare nargin in C++ files if it is used only once.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 16 Oct 2020 09:48:16 -0700 |
parents | 6e460773bdda |
children | b73a54c31152 |
files | libinterp/corefcn/__betainc__.cc libinterp/corefcn/__expint__.cc libinterp/corefcn/__gammainc__.cc libinterp/corefcn/dirfns.cc libinterp/corefcn/strfns.cc |
diffstat | 5 files changed, 7 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/__betainc__.cc Fri Oct 16 09:27:56 2020 -0700 +++ b/libinterp/corefcn/__betainc__.cc Fri Oct 16 09:48:16 2020 -0700 @@ -37,9 +37,7 @@ Continued fraction for incomplete beta function. @end deftypefn */) { - int nargin = args.length (); - - if (nargin != 3) + if (args.length () != 3) print_usage (); bool is_single = (args(0).is_single_type () || args(1).is_single_type ()
--- a/libinterp/corefcn/__expint__.cc Fri Oct 16 09:27:56 2020 -0700 +++ b/libinterp/corefcn/__expint__.cc Fri Oct 16 09:48:16 2020 -0700 @@ -37,9 +37,7 @@ Continued fraction expansion for the exponential integral. @end deftypefn */) { - int nargin = args.length (); - - if (nargin != 1) + if (args.length () != 1) print_usage (); octave_value_list retval;
--- a/libinterp/corefcn/__gammainc__.cc Fri Oct 16 09:27:56 2020 -0700 +++ b/libinterp/corefcn/__gammainc__.cc Fri Oct 16 09:48:16 2020 -0700 @@ -36,9 +36,7 @@ Continued fraction for incomplete gamma function. @end deftypefn */) { - int nargin = args.length (); - - if (nargin != 2) + if (args.length () != 2) print_usage (); bool is_single = args(0).is_single_type () || args(1).is_single_type ();
--- a/libinterp/corefcn/dirfns.cc Fri Oct 16 09:27:56 2020 -0700 +++ b/libinterp/corefcn/dirfns.cc Fri Oct 16 09:48:16 2020 -0700 @@ -701,9 +701,7 @@ @seealso{filesep} @end deftypefn */) { - int nargin = args.length (); - - if (nargin > 0) + if (args.length () > 0) print_usage (); return ovl (octave::directory_path::path_sep_str ());
--- a/libinterp/corefcn/strfns.cc Fri Oct 16 09:27:56 2020 -0700 +++ b/libinterp/corefcn/strfns.cc Fri Oct 16 09:48:16 2020 -0700 @@ -881,9 +881,7 @@ @seealso{native2unicode, __unicode2native__} @end deftypefn */) { - int nargin = args.length (); - - if (nargin != 2) + if (args.length () != 2) print_usage (); if (args(0).is_string ()) @@ -934,9 +932,7 @@ @seealso{unicode2native, __native2unicode__} @end deftypefn */) { - int nargin = args.length (); - - if (nargin != 2) + if (args.length () != 2) print_usage (); std::string tmp = args(1).string_value (); @@ -1001,9 +997,7 @@ @end deftypefn */) { - int nargin = args.length (); - - if (nargin != 1) + if (args.length () != 1) print_usage (); charNDArray str = args(0).xchar_array_value ("STR must be a string");