# HG changeset patch # User Rik # Date 1649172838 25200 # Node ID c9788d7f6e6593840655847eeef0fc5700b7e0b0 # Parent 360d330cc30ef0edcf5dec2222cb8fdc6831d5f2 maint: Use "fcn" as preferred abbreviation for "function" in libinterp/. * __eigs__.cc, bsxfun.cc, cellfun.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, error.cc, graphics.cc, graphics.in.h, gzfstream.h, ls-hdf5.cc, lsode.cc, max.cc, oct-opengl.h, quad.cc, strfns.cc, utils.cc, utils.h, variables.cc, __ode15__.cc, gzip.cc, cdef-manager.cc, ov-fcn-handle.cc, ov-java.cc, ov-usr-fcn.cc, bp-table.cc, bp-table.h, lex.h, lex.ll, oct-parse.yy, pt-eval.cc: Replace "func", "fun", "fn" in documentation and variable names with "fcn". diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/__eigs__.cc --- a/libinterp/corefcn/__eigs__.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/__eigs__.cc Tue Apr 05 08:33:58 2022 -0700 @@ -195,7 +195,7 @@ SparseComplexMatrix ascm, bscm, bsct; int b_arg = 0; bool have_b = false; - bool have_a_fun = false; + bool have_a_fcn = false; bool a_is_complex = false; bool b_is_complex = false; bool symmetric = false; @@ -234,7 +234,7 @@ n = args(1).nint_value (); arg_offset = 1; - have_a_fun = true; + have_a_fcn = true; } else { @@ -343,7 +343,7 @@ } // isreal is ignored if A is not a function - if (have_a_fun) + if (have_a_fcn) { tmp = map.getfield ("isreal"); if (tmp.is_defined ()) @@ -398,7 +398,7 @@ error ("eigs: incorrect number of arguments"); // Test undeclared (no issym) matrix inputs for symmetry - if (! sym_tested && ! have_a_fun) + if (! sym_tested && ! have_a_fcn) { if (a_is_complex) { @@ -452,7 +452,7 @@ ComplexMatrix eig_vec; ComplexColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsComplexNonSymmetricFunc @@ -520,7 +520,7 @@ ComplexMatrix eig_vec; ComplexColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsComplexNonSymmetricFunc @@ -574,7 +574,7 @@ Matrix eig_vec; ColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsRealSymmetricFunc @@ -624,7 +624,7 @@ ComplexMatrix eig_vec; ComplexColumnVector eig_val; - if (have_a_fun) + if (have_a_fcn) { if (b_is_sparse) nconv = EigsRealNonSymmetricFunc diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/besselj.cc --- a/libinterp/corefcn/besselj.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/besselj.cc Tue Apr 05 08:33:58 2022 -0700 @@ -83,7 +83,7 @@ while (0) octave_value_list -do_bessel (enum bessel_type type, const char *fn, +do_bessel (enum bessel_type type, const char *fcn, const octave_value_list& args, int nargout) { int nargin = args.length (); @@ -112,7 +112,7 @@ scaled = opt_arg.bool_value (); if (rpt_error) - error ("%s: OPT must be 0 (or false) or 1 (or true)", fn); + error ("%s: OPT must be 0 (or false) or 1 (or true)", fcn); } octave_value alpha_arg = args(0); @@ -122,11 +122,11 @@ { if (alpha_arg.is_scalar_type ()) { - float alpha = args(0).xfloat_value ("%s: ALPHA must be a scalar or matrix", fn); + float alpha = args(0).xfloat_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fn); + FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fcn); octave_idx_type ierr; octave_value result; @@ -139,7 +139,7 @@ } else { - FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fn); + FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -161,10 +161,10 @@ if (args0_is_row_vector && args1_is_col_vector) { - FloatRowVector ralpha = args(0).xfloat_row_vector_value ("%s: ALPHA must be a scalar or matrix", fn); + FloatRowVector ralpha = args(0).xfloat_row_vector_value ("%s: ALPHA must be a scalar or matrix", fcn); FloatComplexColumnVector cx - = x_arg.xfloat_complex_column_vector_value ("%s: X must be a scalar or matrix", fn); + = x_arg.xfloat_complex_column_vector_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -177,11 +177,11 @@ } else { - FloatNDArray alpha = args(0).xfloat_array_value ("%s: ALPHA must be a scalar or matrix", fn); + FloatNDArray alpha = args(0).xfloat_array_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fn); + FloatComplex x = x_arg.xfloat_complex_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -194,7 +194,7 @@ } else { - FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fn); + FloatComplexNDArray x = x_arg.xfloat_complex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -212,11 +212,11 @@ { if (alpha_arg.is_scalar_type ()) { - double alpha = args(0).xdouble_value ("%s: ALPHA must be a scalar or matrix", fn); + double alpha = args(0).xdouble_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fn); + Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fcn); octave_idx_type ierr; octave_value result; @@ -229,7 +229,7 @@ } else { - ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fn); + ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -251,10 +251,10 @@ if (args0_is_row_vector && args1_is_col_vector) { - RowVector ralpha = args(0).xrow_vector_value ("%s: ALPHA must be a scalar or matrix", fn); + RowVector ralpha = args(0).xrow_vector_value ("%s: ALPHA must be a scalar or matrix", fcn); ComplexColumnVector cx - = x_arg.xcomplex_column_vector_value ("%s: X must be a scalar or matrix", fn); + = x_arg.xcomplex_column_vector_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -267,11 +267,11 @@ } else { - NDArray alpha = args(0).xarray_value ("%s: ALPHA must be a scalar or matrix", fn); + NDArray alpha = args(0).xarray_value ("%s: ALPHA must be a scalar or matrix", fcn); if (x_arg.is_scalar_type ()) { - Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fn); + Complex x = x_arg.xcomplex_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; @@ -284,7 +284,7 @@ } else { - ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fn); + ComplexNDArray x = x_arg.xcomplex_array_value ("%s: X must be a scalar or matrix", fcn); Array ierr; octave_value result; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/bsxfun.cc --- a/libinterp/corefcn/bsxfun.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/bsxfun.cc Tue Apr 05 08:33:58 2022 -0700 @@ -343,16 +343,16 @@ if (args.length () != 3) print_usage (); - octave_value func = args(0); - if (func.is_string ()) + octave_value fcn = args(0); + if (fcn.is_string ()) { - std::string name = func.string_value (); + std::string name = fcn.string_value (); symbol_table& symtab = interp.get_symbol_table (); - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error ("bsxfun: invalid function name: %s", name.c_str ()); } else if (! (args(0).is_function_handle () || args(0).is_inline_function ())) @@ -363,14 +363,14 @@ const octave_value A = args(1); const octave_value B = args(2); - if (func.is_builtin_function () - || (func.is_function_handle () && ! A.isobject () && ! B.isobject ())) + if (fcn.is_builtin_function () + || (fcn.is_function_handle () && ! A.isobject () && ! B.isobject ())) { // This may break if the default behavior is overridden. But if you // override arithmetic operators for builtin classes, you should expect // mayhem anyway (constant folding etc). Querying is_overloaded() may // not be exactly what we need here. - octave_function *fcn_val = func.function_value (); + octave_function *fcn_val = fcn.function_value (); if (fcn_val) { octave_value tmp = maybe_optimized_builtin (fcn_val->name (), A, B); @@ -414,14 +414,14 @@ octave_value_list inputs (2); inputs(0) = A; inputs(1) = B; - retval = feval (func, inputs, 1); + retval = feval (fcn, inputs, 1); } else if (dvc.numel () < 1) { octave_value_list inputs (2); inputs(0) = A.resize (dvc); inputs(1) = B.resize (dvc); - retval = feval (func, inputs, 1); + retval = feval (fcn, inputs, 1); } else { @@ -463,7 +463,7 @@ if (maybe_update_column (Bc, B, dvb, dvc, i, idxB)) inputs(1) = Bc; - octave_value_list tmp = feval (func, inputs, 1); + octave_value_list tmp = feval (fcn, inputs, 1); #define BSXINIT(T, CLS, EXTRACTOR) \ (result_type == CLS) \ @@ -756,7 +756,7 @@ ## Test automatic bsxfun % %!test -%! funs = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ... +%! fcns = {@plus, @minus, @times, @rdivide, @ldivide, @power, @max, @min, ... %! @rem, @mod, @atan2, @hypot, @eq, @ne, @lt, @le, @gt, @ge, ... %! @and, @or, @xor }; %! @@ -772,28 +772,28 @@ %! x = rand (3) * 10-5; %! y = rand (3,1) * 10-5; %! -%! for i=1:length (funs) +%! for i=1:length (fcns) %! for j = 1:length (float_types) %! for k = 1:length (int_types) %! -%! fun = funs{i}; +%! fcn = fcns{i}; %! f_type = float_types{j}; %! i_type = int_types{k}; %! -%! assert (bsxfun (fun, f_type (x), i_type (y)), ... -%! fun (f_type(x), i_type (y))); -%! assert (bsxfun (fun, f_type (y), i_type (x)), ... -%! fun (f_type(y), i_type (x))); +%! assert (bsxfun (fcn, f_type (x), i_type (y)), ... +%! fcn (f_type(x), i_type (y))); +%! assert (bsxfun (fcn, f_type (y), i_type (x)), ... +%! fcn (f_type(y), i_type (x))); %! -%! assert (bsxfun (fun, i_type (x), i_type (y)), ... -%! fun (i_type (x), i_type (y))); -%! assert (bsxfun (fun, i_type (y), i_type (x)), ... -%! fun (i_type (y), i_type (x))); +%! assert (bsxfun (fcn, i_type (x), i_type (y)), ... +%! fcn (i_type (x), i_type (y))); +%! assert (bsxfun (fcn, i_type (y), i_type (x)), ... +%! fcn (i_type (y), i_type (x))); %! -%! assert (bsxfun (fun, f_type (x), f_type (y)), ... -%! fun (f_type (x), f_type (y))); -%! assert (bsxfun (fun, f_type(y), f_type(x)), ... -%! fun (f_type (y), f_type (x))); +%! assert (bsxfun (fcn, f_type (x), f_type (y)), ... +%! fcn (f_type (x), f_type (y))); +%! assert (bsxfun (fcn, f_type(y), f_type(x)), ... +%! fcn (f_type (y), f_type (x))); %! endfor %! endfor %! endfor diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/cellfun.cc --- a/libinterp/corefcn/cellfun.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/cellfun.cc Tue Apr 05 08:33:58 2022 -0700 @@ -71,7 +71,7 @@ get_output_list (error_system& es, octave_idx_type count, octave_idx_type nargout, const octave_value_list& inputlist, - octave_value& func, + octave_value& fcn, octave_value& error_handler) { octave_value_list tmp; @@ -80,7 +80,7 @@ try { - tmp = feval (func, inputlist, nargout); + tmp = feval (fcn, inputlist, nargout); } catch (const execution_exception& ee) { @@ -277,7 +277,7 @@ @deftypefnx {} {@var{A} =} cellfun (@var{fcn}, @var{C}) @deftypefnx {} {@var{A} =} cellfun (@var{fcn}, @var{C1}, @var{C2}, @dots{}) @deftypefnx {} {[@var{A1}, @var{A2}, @dots{}] =} cellfun (@dots{}) -@deftypefnx {} {@var{A} =} cellfun (@dots{}, "ErrorHandler", @var{errfunc}) +@deftypefnx {} {@var{A} =} cellfun (@dots{}, "ErrorHandler", @var{errfcn}) @deftypefnx {} {@var{A} =} cellfun (@dots{}, "UniformOutput", @var{val}) Evaluate the function named "@var{fcn}" on the elements of the cell array @@ -366,16 +366,16 @@ @end group @end example -Given the parameter @qcode{"ErrorHandler"}, then @var{errfunc} defines a +Given the parameter @qcode{"ErrorHandler"}, then @var{errfcn} defines a function to call in case @var{fcn} generates an error. The form of the function is @example -function [@dots{}] = errfunc (@var{s}, @dots{}) +function [@dots{}] = errfcn (@var{s}, @dots{}) @end example @noindent -where there is an additional input argument to @var{errfunc} relative to +where there is an additional input argument to @var{errfcn} relative to @var{fcn}, given by @var{s}. This is a structure with the elements @qcode{"identifier"}, @qcode{"message"}, and @qcode{"index"} giving respectively the error identifier, the error message, and the index into the @@ -418,11 +418,11 @@ octave_value_list retval; int nargout1 = (nargout < 1 ? 1 : nargout); - octave_value func = args(0); + octave_value fcn = args(0); symbol_table& symtab = interp.get_symbol_table (); - if (func.is_string ()) + if (fcn.is_string ()) { retval = try_cellfun_internal_ops (args, nargin); @@ -434,18 +434,18 @@ std::string name = args(0).string_value (); if (! valid_identifier (name)) - func = get_function_handle (interp, args(0), "x"); + fcn = get_function_handle (interp, args(0), "x"); else { - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error ("cellfun: invalid function NAME: %s", name.c_str ()); } } - if (! func.is_function_handle () && ! func.is_inline_function () - && ! func.is_function ()) + if (! fcn.is_function_handle () && ! fcn.is_inline_function () + && ! fcn.is_function ()) error ("cellfun: argument NAME must be a string or function handle"); bool uniform_output = true; @@ -457,7 +457,7 @@ // more specific function class, so this can result in fewer polymorphic // function calls as the function gets called for each value of the array. { - if (func.is_function_handle () || func.is_inline_function ()) + if (fcn.is_function_handle () || fcn.is_inline_function ()) { // FIXME: instead of checking for overloaded functions as we did // previously but is no longer possible, we could check whether @@ -467,7 +467,7 @@ goto nevermind; } - std::string name = func.function_value () -> name (); + std::string name = fcn.function_value () -> name (); octave_value f = symtab.find_function (name); if (f.is_defined ()) @@ -490,7 +490,7 @@ // Okay, we tried, doesn't work, let's do the best we can instead // and avoid polymorphic calls for each element of the array. - func = f; + fcn = f; } } @@ -560,7 +560,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); int tmp_numel = tmp.length (); @@ -646,7 +646,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); if (nargout > 0 && tmp.length () < nargout) @@ -1060,7 +1060,7 @@ @deftypefnx {} {@var{B} =} arrayfun (@var{fcn}, @var{A1}, @var{A2}, @dots{}) @deftypefnx {} {[@var{B1}, @var{B2}, @dots{}] =} arrayfun (@var{fcn}, @var{A}, @dots{}) @deftypefnx {} {@var{B} =} arrayfun (@dots{}, "UniformOutput", @var{val}) -@deftypefnx {} {@var{B} =} arrayfun (@dots{}, "ErrorHandler", @var{errfunc}) +@deftypefnx {} {@var{B} =} arrayfun (@dots{}, "ErrorHandler", @var{errfcn}) Execute a function on each element of an array. @@ -1140,23 +1140,23 @@ @end group @end example -If the parameter @var{errfunc} after a further string input argument +If the parameter @var{errfcn} after a further string input argument @qcode{"ErrorHandler"} is another string, a function handle, an inline -function, or an anonymous function, then @var{errfunc} defines a function to +function, or an anonymous function, then @var{errfcn} defines a function to call in the case that @var{fcn} generates an error. The definition of the function must be of the form @example -function [@dots{}] = errfunc (@var{s}, @dots{}) +function [@dots{}] = errfcn (@var{s}, @dots{}) @end example @noindent -where there is an additional input argument to @var{errfunc} relative to +where there is an additional input argument to @var{errfcn} relative to @var{fcn}, given by @var{s}. This is a structure with the elements @qcode{"identifier"}, @qcode{"message"}, and @qcode{"index"} giving, respectively, the error identifier, the error message, and the index of the array elements that caused the error. The size of the output argument of -@var{errfunc} must have the same size as the output argument of @var{fcn}, +@var{errfcn} must have the same size as the output argument of @var{fcn}, otherwise a real error is thrown. For example: @example @@ -1182,22 +1182,22 @@ octave_value_list retval; int nargout1 = (nargout < 1 ? 1 : nargout); bool symbol_table_lookup = false; - octave_value func = args(0); + octave_value fcn = args(0); symbol_table& symtab = interp.get_symbol_table (); - if (func.is_string ()) + if (fcn.is_string ()) { // See if we can convert the string into a function. std::string name = args(0).string_value (); if (! valid_identifier (name)) - func = get_function_handle (interp, args(0), "x"); + fcn = get_function_handle (interp, args(0), "x"); else { - func = symtab.find_function (name); + fcn = symtab.find_function (name); - if (func.is_undefined ()) + if (fcn.is_undefined ()) error_with_id ("Octave:invalid-input-arg", "arrayfun: invalid function NAME: %s", name.c_str ()); @@ -1206,8 +1206,8 @@ } } - if (func.is_function_handle () || func.is_inline_function () - || func.is_function ()) + if (fcn.is_function_handle () || fcn.is_inline_function () + || fcn.is_function ()) { // The following is an optimization because the symbol table can give a // more specific function class, so this can result in fewer polymorphic @@ -1215,7 +1215,7 @@ if (! symbol_table_lookup) { - if (func.is_function_handle () || func.class_name () == "inline") + if (fcn.is_function_handle () || fcn.class_name () == "inline") { // FIXME: instead of checking for overloaded functions as // we did previously but is no longer possible, we could @@ -1227,10 +1227,10 @@ } octave_value f - = symtab.find_function (func.function_value () -> name ()); + = symtab.find_function (fcn.function_value () -> name ()); if (f.is_defined ()) - func = f; + fcn = f; } nevermind: @@ -1301,7 +1301,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); if (nargout > 0 && tmp.length () < nargout) @@ -1393,7 +1393,7 @@ } const octave_value_list tmp - = get_output_list (es, count, nargout, inputlist, func, + = get_output_list (es, count, nargout, inputlist, fcn, error_handler); if (nargout > 0 && tmp.length () < nargout) diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/daspk.cc --- a/libinterp/corefcn/daspk.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/daspk.cc Tue Apr 05 08:33:58 2022 -0700 @@ -367,11 +367,11 @@ double tzero = out_times (0); - DAEFunc func (daspk_user_function); + DAEFunc fcn (daspk_user_function); if (daspk_jac.is_defined ()) - func.set_jacobian_function (daspk_user_jacobian); + fcn.set_jacobian_function (daspk_user_jacobian); - DASPK dae (state, deriv, tzero, func); + DASPK dae (state, deriv, tzero, fcn); dae.set_options (daspk_opts); Matrix output; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/dasrt.cc --- a/libinterp/corefcn/dasrt.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/dasrt.cc Tue Apr 05 08:33:58 2022 -0700 @@ -432,7 +432,7 @@ if (dasrt_fcn.is_undefined ()) error ("dasrt: FCN argument is not a valid function name or handle"); - DAERTFunc func (dasrt_user_f); + DAERTFunc fcn (dasrt_user_f); argp++; @@ -457,7 +457,7 @@ { argp++; - func.set_constraint_function (dasrt_user_cf); + fcn.set_constraint_function (dasrt_user_cf); } } @@ -485,11 +485,11 @@ } if (dasrt_jac.is_defined ()) - func.set_jacobian_function (dasrt_user_j); + fcn.set_jacobian_function (dasrt_user_j); DASRT_result output; - DASRT dae = DASRT (state, stateprime, tzero, func); + DASRT dae = DASRT (state, stateprime, tzero, fcn); dae.set_options (dasrt_opts); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/dassl.cc --- a/libinterp/corefcn/dassl.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/dassl.cc Tue Apr 05 08:33:58 2022 -0700 @@ -367,11 +367,11 @@ double tzero = out_times (0); - DAEFunc func (dassl_user_function); + DAEFunc fcn (dassl_user_function); if (dassl_jac.is_defined ()) - func.set_jacobian_function (dassl_user_jacobian); + fcn.set_jacobian_function (dassl_user_jacobian); - DASSL dae (state, deriv, tzero, func); + DASSL dae (state, deriv, tzero, fcn); dae.set_options (dassl_opts); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/data.cc --- a/libinterp/corefcn/data.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/data.cc Tue Apr 05 08:33:58 2022 -0700 @@ -4626,14 +4626,14 @@ ## n to be a 1x0 vector (returns 0x0) but not a 0x1 vector. Octave supports ## any vector and therefore must support 0x1, 1x0, and 0x0x1 (but not 0x1x1). %!test <*47298> -%! funcs = {@zeros, @ones, @inf, @nan, @NA, @i, @pi, @e}; -%! for idx = 1:numel (funcs) -%! func = funcs{idx}; -%! assert (func (zeros (1, 0)), zeros (0, 0)); -%! assert (func (zeros (0, 1)), zeros (0, 0)); -%! assert (func (zeros (0, 1, 1)), zeros (0, 0)); -%! fail ([func2str(func) " ([])"]); -%! fail ([func2str(func) " (zeros (0, 0, 1))"]); +%! fcns = {@zeros, @ones, @inf, @nan, @NA, @i, @pi, @e}; +%! for idx = 1:numel (fcns) +%! fcn = fcns{idx}; +%! assert (fcn (zeros (1, 0)), zeros (0, 0)); +%! assert (fcn (zeros (0, 1)), zeros (0, 0)); +%! assert (fcn (zeros (0, 1, 1)), zeros (0, 0)); +%! fail ([func2str(fcn) " ([])"]); +%! fail ([func2str(fcn) " (zeros (0, 0, 1))"]); %! endfor */ @@ -7665,7 +7665,7 @@ } static octave_value_list -do_accumarray_minmax_fun (const octave_value_list& args, +do_accumarray_minmax_fcn (const octave_value_list& args, bool ismin) { int nargin = args.length (); @@ -7740,7 +7740,7 @@ } catch (const index_exception& ie) { - error ("do_accumarray_minmax_fun: invalid index %s", ie.what ()); + error ("do_accumarray_minmax_fcn: invalid index %s", ie.what ()); } return retval; @@ -7752,7 +7752,7 @@ Undocumented internal function. @end deftypefn */) { - return do_accumarray_minmax_fun (args, true); + return do_accumarray_minmax_fcn (args, true); } DEFUN (__accumarray_max__, args, , @@ -7761,7 +7761,7 @@ Undocumented internal function. @end deftypefn */) { - return do_accumarray_minmax_fun (args, false); + return do_accumarray_minmax_fcn (args, false); } template diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/debug.cc --- a/libinterp/corefcn/debug.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/debug.cc Tue Apr 05 08:33:58 2022 -0700 @@ -78,13 +78,13 @@ DEFMETHOD (dbstop, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} dbstop @var{func} -@deftypefnx {} {} dbstop @var{func} @var{line} -@deftypefnx {} {} dbstop @var{func} @var{line1} @var{line2} @dots{} +@deftypefn {} {} dbstop @var{fcn} +@deftypefnx {} {} dbstop @var{fcn} @var{line} +@deftypefnx {} {} dbstop @var{fcn} @var{line1} @var{line2} @dots{} @deftypefnx {} {} dbstop @var{line1} @dots{} -@deftypefnx {} {} dbstop in @var{func} -@deftypefnx {} {} dbstop in @var{func} at @var{line} -@deftypefnx {} {} dbstop in @var{func} at @var{line} if "@var{condition}" +@deftypefnx {} {} dbstop in @var{fcn} +@deftypefnx {} {} dbstop in @var{fcn} at @var{line} +@deftypefnx {} {} dbstop in @var{fcn} at @var{line} if "@var{condition}" @deftypefnx {} {} dbstop in @var{class} at @var{method} @deftypefnx {} {} dbstop if @var{event} @deftypefnx {} {} dbstop if @var{event} @var{ID} @@ -93,16 +93,16 @@ Set breakpoints for the built-in debugger. -@var{func} is the name of a function on the current @code{path}. When -already in debug mode the @var{func} argument can be omitted and the current +@var{fcn} is the name of a function on the current @code{path}. When +already in debug mode the @var{fcn} argument can be omitted and the current function will be used. Breakpoints at subfunctions are set with the scope operator @samp{>}. For example, If @file{file.m} has a subfunction -@code{func2}, then a breakpoint in @code{func2} can be specified by -@code{file>func2}. +@code{fcn2}, then a breakpoint in @code{fcn2} can be specified by +@code{file>fcn2}. @var{line} is the line number at which to break. If @var{line} is not specified, it defaults to the first executable line in the file -@file{func.m}. Multiple lines can be specified in a single command; when +@file{fcn.m}. Multiple lines can be specified in a single command; when function syntax is used, the lines may also be passed as a single vector argument (@code{[@var{line1}, @var{line2}, @dots{}]}). @@ -255,26 +255,26 @@ DEFMETHOD (dbclear, interp, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} dbclear @var{func} -@deftypefnx {} {} dbclear @var{func} @var{line} -@deftypefnx {} {} dbclear @var{func} @var{line1} @var{line2} @dots{} +@deftypefn {} {} dbclear @var{fcn} +@deftypefnx {} {} dbclear @var{fcn} @var{line} +@deftypefnx {} {} dbclear @var{fcn} @var{line1} @var{line2} @dots{} @deftypefnx {} {} dbclear @var{line} @dots{} @deftypefnx {} {} dbclear all -@deftypefnx {} {} dbclear in @var{func} -@deftypefnx {} {} dbclear in @var{func} at @var{line} +@deftypefnx {} {} dbclear in @var{fcn} +@deftypefnx {} {} dbclear in @var{fcn} at @var{line} @deftypefnx {} {} dbclear if @var{event} -@deftypefnx {} {} dbclear ("@var{func}") -@deftypefnx {} {} dbclear ("@var{func}", @var{line}) -@deftypefnx {} {} dbclear ("@var{func}", @var{line1}, @var{line2}, @dots{}) -@deftypefnx {} {} dbclear ("@var{func}", @var{line1}, @dots{}) +@deftypefnx {} {} dbclear ("@var{fcn}") +@deftypefnx {} {} dbclear ("@var{fcn}", @var{line}) +@deftypefnx {} {} dbclear ("@var{fcn}", @var{line1}, @var{line2}, @dots{}) +@deftypefnx {} {} dbclear ("@var{fcn}", @var{line1}, @dots{}) @deftypefnx {} {} dbclear (@var{line}, @dots{}) @deftypefnx {} {} dbclear ("all") -Delete a breakpoint at line number @var{line} in the function @var{func}. +Delete a breakpoint at line number @var{line} in the function @var{fcn}. Arguments are @table @var -@item func +@item fcn Function name as a string variable. When already in debug mode this argument can be omitted and the current function will be used. @@ -347,8 +347,8 @@ @table @asis @item name -The name of the function with a breakpoint. A subfunction, say @code{func2} -within an m-file, say @file{file.m}, is specified as @code{file>func2}. +The name of the function with a breakpoint. A subfunction, say @code{fcn2} +within an m-file, say @file{file.m}, is specified as @code{file>fcn2}. @item file The name of the m-file where the function code is located. @@ -483,9 +483,9 @@ for (const auto& fnm_bp_p : bp_list) { std::string filename = fnm_bp_p.first; - const char *sub_fun = strchr (filename.c_str (), '>'); - if (sub_fun) - filename = filename.substr(0, sub_fun - filename.c_str ()); + const char *sub_fcn = strchr (filename.c_str (), '>'); + if (sub_fcn) + filename = filename.substr(0, sub_fcn - filename.c_str ()); octave_value path_name; path_name = octave::sys::canonicalize_file_name (help_sys.which (filename)); @@ -602,10 +602,10 @@ @deftypefnx {} {} dbtype @var{lineno} @deftypefnx {} {} dbtype @var{startl:endl} @deftypefnx {} {} dbtype @var{startl:end} -@deftypefnx {} {} dbtype @var{func} -@deftypefnx {} {} dbtype @var{func} @var{lineno} -@deftypefnx {} {} dbtype @var{func} @var{startl:endl} -@deftypefnx {} {} dbtype @var{func} @var{startl:end} +@deftypefnx {} {} dbtype @var{fcn} +@deftypefnx {} {} dbtype @var{fcn} @var{lineno} +@deftypefnx {} {} dbtype @var{fcn} @var{startl:endl} +@deftypefnx {} {} dbtype @var{fcn} @var{startl:end} Display a script file with line numbers. When called with no arguments in debugging mode, display the script file @@ -639,7 +639,7 @@ break; - case 1: // (dbtype start:end) || (dbtype func) || (dbtype lineno) + case 1: // (dbtype start:end) || (dbtype fcn) || (dbtype lineno) { std::string arg = argv[1]; @@ -671,11 +671,11 @@ start, end); } } - else // (dbtype func) || (dbtype lineno) + else // (dbtype fcn) || (dbtype lineno) { int line = atoi (arg.c_str ()); - if (line == 0) // (dbtype func) + if (line == 0) // (dbtype fcn) { dbg_fcn = tw.get_user_code (arg); @@ -700,7 +700,7 @@ } break; - case 2: // (dbtype func start:end) || (dbtype func start) + case 2: // (dbtype fcn start:end) || (dbtype fcn start) { dbg_fcn = tw.get_user_code (argv[1]); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/error.cc --- a/libinterp/corefcn/error.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/error.cc Tue Apr 05 08:33:58 2022 -0700 @@ -125,10 +125,10 @@ va_end (args); } -typedef void (*error_fun)(const char *, const char *, ...); +typedef void (*error_fcn)(const char *, const char *, ...); static std::string -handle_message (error_fun f, const char *id, const char *msg, +handle_message (error_fcn f, const char *id, const char *msg, const octave_value_list& args, bool have_fmt) { std::string retval; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/graphics.cc Tue Apr 05 08:33:58 2022 -0700 @@ -14318,7 +14318,7 @@ octave_value get_property_from_handle (double handle, const std::string& property, - const std::string& func) + const std::string& fcn) { gh_manager& gh_mgr = octave::__get_gh_manager__ ("get_property_from_handle"); @@ -14327,14 +14327,14 @@ graphics_object go = gh_mgr.get_object (handle); if (! go) - error ("%s: invalid handle (= %g)", func.c_str (), handle); + error ("%s: invalid handle (= %g)", fcn.c_str (), handle); return go.get (caseless_str (property)); } bool set_property_in_handle (double handle, const std::string& property, - const octave_value& arg, const std::string& func) + const octave_value& arg, const std::string& fcn) { gh_manager& gh_mgr = octave::__get_gh_manager__ ("set_property_in_handle"); @@ -14343,7 +14343,7 @@ graphics_object go = gh_mgr.get_object (handle); if (! go) - error ("%s: invalid handle (= %g)", func.c_str (), handle); + error ("%s: invalid handle (= %g)", fcn.c_str (), handle); go.set (caseless_str (property), arg); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/graphics.in.h Tue Apr 05 08:33:58 2022 -0700 @@ -6566,10 +6566,10 @@ OCTINTERP_API octave_value get_property_from_handle (double handle, const std::string& property, - const std::string& func); + const std::string& fcn); OCTINTERP_API bool set_property_in_handle (double handle, const std::string& property, - const octave_value& arg, const std::string& func); + const octave_value& arg, const std::string& fcn); // --------------------------------------------------------------------- diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/gzfstream.h --- a/libinterp/corefcn/gzfstream.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/gzfstream.h Tue Apr 05 08:33:58 2022 -0700 @@ -469,7 +469,7 @@ private: // Underlying manipulator function gzofstream& - (*func)(gzofstream&, T1, T2); + (*fcn)(gzofstream&, T1, T2); // Arguments for manipulator function T1 val1; @@ -490,14 +490,14 @@ gzomanip2::gzomanip2 (gzofstream &(*f)(gzofstream&, T1, T2), T1 v1, T2 v2) - : func(f), val1(v1), val2(v2) + : fcn(f), val1(v1), val2(v2) { } // Insertor applies underlying manipulator function to stream template inline gzofstream& operator<<(gzofstream& s, const gzomanip2& m) -{ return (*m.func)(s, m.val1, m.val2); } +{ return (*m.fcn)(s, m.val1, m.val2); } // Insert this onto stream to simplify setting of compression level inline gzomanip2 diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/ls-hdf5.cc --- a/libinterp/corefcn/ls-hdf5.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/ls-hdf5.cc Tue Apr 05 08:33:58 2022 -0700 @@ -307,17 +307,17 @@ // HDF5 doesn't print out all sorts of error messages if we // call H5Aopen for a non-existing attribute - H5E_auto_t err_func; - void *err_func_data; + H5E_auto_t err_fcn; + void *err_fcn_data; // turn off error reporting temporarily, but save the error // reporting function: #if defined (HAVE_HDF5_18) - H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); + H5Eget_auto (octave_H5E_DEFAULT, &err_fcn, &err_fcn_data); H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else - H5Eget_auto (&err_func, &err_func_data); + H5Eget_auto (&err_fcn, &err_fcn_data); H5Eset_auto (nullptr, nullptr); #endif @@ -332,9 +332,9 @@ // restore error reporting: #if defined (HAVE_HDF5_18) - H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); + H5Eset_auto (octave_H5E_DEFAULT, err_fcn, err_fcn_data); #else - H5Eset_auto (err_func, err_func_data); + H5Eset_auto (err_fcn, err_fcn_data); #endif return retval; @@ -355,17 +355,17 @@ // HDF5 doesn't print out all sorts of error messages if we // call H5Aopen for a non-existing attribute - H5E_auto_t err_func; - void *err_func_data; + H5E_auto_t err_fcn; + void *err_fcn_data; // turn off error reporting temporarily, but save the error // reporting function: #if defined (HAVE_HDF5_18) - H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); + H5Eget_auto (octave_H5E_DEFAULT, &err_fcn, &err_fcn_data); H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else - H5Eget_auto (&err_func, &err_func_data); + H5Eget_auto (&err_fcn, &err_fcn_data); H5Eset_auto (nullptr, nullptr); #endif @@ -384,9 +384,9 @@ // restore error reporting: #if defined (HAVE_HDF5_18) - H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); + H5Eset_auto (octave_H5E_DEFAULT, err_fcn, err_fcn_data); #else - H5Eset_auto (err_func, err_func_data); + H5Eset_auto (err_fcn, err_fcn_data); #endif return retval; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/lsode.cc --- a/libinterp/corefcn/lsode.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/lsode.cc Tue Apr 05 08:33:58 2022 -0700 @@ -379,12 +379,12 @@ double tzero = out_times (0); - ODEFunc func (lsode_user_function); + ODEFunc fcn (lsode_user_function); if (lsode_jac.is_defined ()) - func.set_jacobian_function (lsode_user_jacobian); + fcn.set_jacobian_function (lsode_user_jacobian); - LSODE ode (state, tzero, func); + LSODE ode (state, tzero, fcn); ode.set_options (lsode_opts); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/max.cc --- a/libinterp/corefcn/max.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/max.cc Tue Apr 05 08:33:58 2022 -0700 @@ -248,7 +248,7 @@ octave_value_list retval (nargout > 1 ? 2 : 1); - const char *func = (ismin ? "min" : "max"); + const char *fcn = (ismin ? "min" : "max"); if (nargin == 3 || nargin == 1) { @@ -259,10 +259,10 @@ dim = args(2).int_value (true) - 1; if (dim < 0) - error ("%s: DIM must be a valid dimension", func); + error ("%s: DIM must be a valid dimension", fcn); if (! args(1).isempty ()) - warning ("%s: second argument is ignored", func); + warning ("%s: second argument is ignored", fcn); } switch (arg.builtin_type ()) @@ -348,7 +348,7 @@ break; default: - err_wrong_type_arg (func, arg); + err_wrong_type_arg (fcn, arg); } } else @@ -425,7 +425,7 @@ // break; default: - error ("%s: cannot compute %s (%s, %s)", func, func, + error ("%s: cannot compute %s (%s, %s)", fcn, fcn, argx.type_name ().c_str (), argy.type_name ().c_str ()); } @@ -925,7 +925,7 @@ if (nargin < 1 || nargin > 2) print_usage (); - const char *func = (ismin ? "cummin" : "cummax"); + const char *fcn = (ismin ? "cummin" : "cummax"); octave_value arg = args(0); int dim = -1; @@ -934,7 +934,7 @@ dim = args(1).int_value (true) - 1; if (dim < 0) - error ("%s: DIM must be a valid dimension", func); + error ("%s: DIM must be a valid dimension", fcn); } octave_value_list retval; @@ -985,7 +985,7 @@ break; default: - err_wrong_type_arg (func, arg); + err_wrong_type_arg (fcn, arg); } return retval; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/oct-opengl.h --- a/libinterp/corefcn/oct-opengl.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/oct-opengl.h Tue Apr 05 08:33:58 2022 -0700 @@ -70,9 +70,9 @@ // class that does nothing. This makes the implementation of // other things that rely on this class slightly simpler. - virtual void glAlphaFunc (GLenum func, GLclampf ref) + virtual void glAlphaFunc (GLenum fcn, GLclampf ref) { - ::glAlphaFunc (func, ref); + ::glAlphaFunc (fcn, ref); } virtual void glBegin (GLenum mode) @@ -160,9 +160,9 @@ ::glDeleteTextures (n, textures); } - virtual void glDepthFunc (GLenum func) + virtual void glDepthFunc (GLenum fcn) { - ::glDepthFunc (func); + ::glDepthFunc (fcn); } virtual void glDisable (GLenum cap) diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/quad.cc --- a/libinterp/corefcn/quad.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/quad.cc Tue Apr 05 08:33:58 2022 -0700 @@ -134,7 +134,7 @@ @deftypefn {} {@var{q} =} quad (@var{f}, @var{a}, @var{b}) @deftypefnx {} {@var{q} =} quad (@var{f}, @var{a}, @var{b}, @var{tol}) @deftypefnx {} {@var{q} =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing}) -@deftypefnx {} {[@var{q}, @var{ier}, @var{nfun}, @var{err}] =} quad (@dots{}) +@deftypefnx {} {[@var{q}, @var{ier}, @var{nfev}, @var{err}] =} quad (@dots{}) Numerically evaluate the integral of @var{f} from @var{a} to @var{b} using Fortran routines from @w{@sc{quadpack}}. @@ -161,7 +161,7 @@ @var{ier} contains an integer error code (0 indicates a successful integration). -@var{nfun} indicates the number of function evaluations that were +@var{nfev} indicates the number of function evaluations that were made. @var{err} contains an estimate of the error in the solution. @@ -220,7 +220,7 @@ } octave_idx_type ier = 0; - octave_idx_type nfun = 0; + octave_idx_type nfev = 0; float abserr = 0.0; float val = 0.0; bool have_sing = false; @@ -262,7 +262,7 @@ FloatIndefQuad iq (quad_float_user_function, bound, indef_type); iq.set_options (quad_opts); - val = iq.float_integrate (ier, nfun, abserr); + val = iq.float_integrate (ier, nfev, abserr); } else { @@ -270,13 +270,13 @@ { FloatDefQuad dq (quad_float_user_function, a, b, sing); dq.set_options (quad_opts); - val = dq.float_integrate (ier, nfun, abserr); + val = dq.float_integrate (ier, nfev, abserr); } else { FloatDefQuad dq (quad_float_user_function, a, b); dq.set_options (quad_opts); - val = dq.float_integrate (ier, nfun, abserr); + val = dq.float_integrate (ier, nfev, abserr); } } break; @@ -286,7 +286,7 @@ break; } - retval = ovl (val, ier, nfun, abserr); + retval = ovl (val, ier, nfev, abserr); } else @@ -316,7 +316,7 @@ } octave_idx_type ier = 0; - octave_idx_type nfun = 0; + octave_idx_type nfev = 0; double abserr = 0.0; double val = 0.0; bool have_sing = false; @@ -357,7 +357,7 @@ { IndefQuad iq (quad_user_function, bound, indef_type); iq.set_options (quad_opts); - val = iq.integrate (ier, nfun, abserr); + val = iq.integrate (ier, nfev, abserr); } else { @@ -365,13 +365,13 @@ { DefQuad dq (quad_user_function, a, b, sing); dq.set_options (quad_opts); - val = dq.integrate (ier, nfun, abserr); + val = dq.integrate (ier, nfev, abserr); } else { DefQuad dq (quad_user_function, a, b); dq.set_options (quad_opts); - val = dq.integrate (ier, nfun, abserr); + val = dq.integrate (ier, nfev, abserr); } } break; @@ -381,7 +381,7 @@ break; } - retval = ovl (val, ier, nfun, abserr); + retval = ovl (val, ier, nfev, abserr); } return retval; @@ -393,17 +393,17 @@ %!endfunction %!test -%! [v, ier, nfun, err] = quad ("__f", 0, 5); +%! [v, ier, nfev, err] = quad ("__f", 0, 5); %! assert (ier, 0); %! assert (v, 17.5, sqrt (eps)); -%! assert (nfun > 0); +%! assert (nfev > 0); %! assert (err < sqrt (eps)); %!test -%! [v, ier, nfun, err] = quad ("__f", single (0), single (5)); +%! [v, ier, nfev, err] = quad ("__f", single (0), single (5)); %! assert (ier, 0); %! assert (v, 17.5, sqrt (eps ("single"))); -%! assert (nfun > 0); +%! assert (nfev > 0); %! assert (err < sqrt (eps ("single"))); %!function y = __f (x) @@ -411,43 +411,43 @@ %!endfunction %!test -%! [v, ier, nfun, err] = quad ("__f", 0.001, 3); +%! [v, ier, nfev, err] = quad ("__f", 0.001, 3); %! assert (ier == 0 || ier == 1); %! assert (v, 1.98194120273598, sqrt (eps)); -%! assert (nfun > 0); +%! assert (nfev > 0); %!test -%! [v, ier, nfun, err] = quad (@__f, 0.001, 3); +%! [v, ier, nfev, err] = quad (@__f, 0.001, 3); %! assert (ier == 0 || ier == 1); %! assert (v, 1.98194120273598, sqrt (eps)); -%! assert (nfun > 0); +%! assert (nfev > 0); %!test %! fstr = "x .* sin (1 ./ x) .* sqrt (abs (1 - x))"; -%! [v, ier, nfun, err] = quad (fstr, 0.001, 3); +%! [v, ier, nfev, err] = quad (fstr, 0.001, 3); %! assert (ier == 0 || ier == 1); %! assert (v, 1.98194120273598, sqrt (eps)); -%! assert (nfun > 0); +%! assert (nfev > 0); %!test %! anon_fcn = @(x) x .* sin (1 ./ x) .* sqrt (abs (1 - x)); -%! [v, ier, nfun, err] = quad (anon_fcn, 0.001, 3); +%! [v, ier, nfev, err] = quad (anon_fcn, 0.001, 3); %! assert (ier == 0 || ier == 1); %! assert (v, 1.98194120273598, sqrt (eps)); -%! assert (nfun > 0); +%! assert (nfev > 0); %!test %! inline_fcn = inline ("x .* sin (1 ./ x) .* sqrt (abs (1 - x))", "x"); -%! [v, ier, nfun, err] = quad (inline_fcn, 0.001, 3); +%! [v, ier, nfev, err] = quad (inline_fcn, 0.001, 3); %! assert (ier == 0 || ier == 1); %! assert (v, 1.98194120273598, sqrt (eps)); -%! assert (nfun > 0); +%! assert (nfev > 0); %!test -%! [v, ier, nfun, err] = quad ("__f", single (0.001), single (3)); +%! [v, ier, nfev, err] = quad ("__f", single (0.001), single (3)); %! assert (ier == 0 || ier == 1); %! assert (v, 1.98194120273598, sqrt (eps ("single"))); -%! assert (nfun > 0); +%! assert (nfev > 0); %!error quad () %!error quad ("__f", 1, 2, 3, 4, 5) diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/strfns.cc Tue Apr 05 08:33:58 2022 -0700 @@ -319,7 +319,7 @@ */ static octave_value -do_strcmp_fun (const octave_value& arg0, const octave_value& arg1, +do_strcmp_fcn (const octave_value& arg0, const octave_value& arg1, octave_idx_type n, const char *fcn_name, bool (*array_op) (const Array&, const Array&, octave_idx_type), @@ -526,7 +526,7 @@ // These are required so that they match the same signature as strncmp -// and strncmpi and can therefore be used in do_strcmp_fun. +// and strncmpi and can therefore be used in do_strcmp_fcn. template static bool @@ -560,7 +560,7 @@ if (args.length () != 2) print_usage (); - return ovl (do_strcmp_fun (args(0), args(1), 0, "strcmp", + return ovl (do_strcmp_fcn (args(0), args(1), 0, "strcmp", strcmp_ignore_n, strcmp_ignore_n)); } @@ -651,7 +651,7 @@ octave_idx_type n = args(2).idx_type_value (); if (n > 0) - return ovl (do_strcmp_fun (args(0), args(1), n, "strncmp", + return ovl (do_strcmp_fcn (args(0), args(1), n, "strncmp", string::strncmp, string::strncmp)); else @@ -698,7 +698,7 @@ if (args.length () != 2) print_usage (); - return ovl (do_strcmp_fun (args(0), args(1), 0, "strcmpi", + return ovl (do_strcmp_fcn (args(0), args(1), 0, "strcmpi", strcmpi_ignore_n, strcmpi_ignore_n)); } @@ -732,7 +732,7 @@ octave_idx_type n = args(2).idx_type_value (); if (n > 0) - return ovl (do_strcmp_fun (args(0), args(1), n, "strncmpi", + return ovl (do_strcmp_fcn (args(0), args(1), n, "strncmpi", string::strncmpi, string::strncmpi)); else diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/utils.cc Tue Apr 05 08:33:58 2022 -0700 @@ -1658,8 +1658,8 @@ */ octave_value_list - do_simple_cellfun (octave_value_list (*fun) (const octave_value_list&, int), - const char *fun_name, const octave_value_list& args, + do_simple_cellfun (octave_value_list (*fcn) (const octave_value_list&, int), + const char *fcn_name, const octave_value_list& args, int nargout) { octave_value_list new_args = args; @@ -1693,7 +1693,7 @@ dims = ccells[i].dims (); } else if (dims != ccells[i].dims ()) - error ("%s: cell arguments must have matching sizes", fun_name); + error ("%s: cell arguments must have matching sizes", fcn_name); } } @@ -1708,10 +1708,10 @@ octave_quit (); - const octave_value_list tmp = fun (new_args, nargout); + const octave_value_list tmp = fcn (new_args, nargout); if (tmp.length () < nargout) - error ("%s: do_simple_cellfun: internal error", fun_name); + error ("%s: do_simple_cellfun: internal error", fcn_name); for (int i = 0; i < nargout; i++) rcells[i](j) = tmp(i); @@ -1726,12 +1726,12 @@ } octave_value - do_simple_cellfun (octave_value_list (*fun) (const octave_value_list&, int), - const char *fun_name, const octave_value_list& args) + do_simple_cellfun (octave_value_list (*fcn) (const octave_value_list&, int), + const char *fcn_name, const octave_value_list& args) { octave_value retval; - const octave_value_list tmp = do_simple_cellfun (fun, fun_name, args, 1); + const octave_value_list tmp = do_simple_cellfun (fcn, fcn_name, args, 1); if (tmp.length () > 0) retval = tmp(0); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/utils.h --- a/libinterp/corefcn/utils.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/utils.h Tue Apr 05 08:33:58 2022 -0700 @@ -181,14 +181,14 @@ extern OCTINTERP_API octave_value_list - do_simple_cellfun (octave_value_list (*fun) (const octave_value_list&, int), - const char *fun_name, const octave_value_list& args, + do_simple_cellfun (octave_value_list (*fcn) (const octave_value_list&, int), + const char *fcn_name, const octave_value_list& args, int nargout); extern OCTINTERP_API octave_value - do_simple_cellfun (octave_value_list (*fun) (const octave_value_list&, int), - const char *fun_name, const octave_value_list& args); + do_simple_cellfun (octave_value_list (*fcn) (const octave_value_list&, int), + const char *fcn_name, const octave_value_list& args); OCTAVE_NAMESPACE_END diff -r 360d330cc30e -r c9788d7f6e65 libinterp/corefcn/variables.cc --- a/libinterp/corefcn/variables.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/corefcn/variables.cc Tue Apr 05 08:33:58 2022 -0700 @@ -1430,11 +1430,11 @@ restore_var (Vmissing_function_hook); // Clear the variable prior to calling the function. - const std::string func_name = Vmissing_function_hook; + const std::string fcn_name = Vmissing_function_hook; Vmissing_function_hook.clear (); // Call. - octave_value_list tmp = octave::feval (func_name, octave_value (name), 1); + octave_value_list tmp = octave::feval (fcn_name, octave_value (name), 1); if (tmp.length () == 1 && tmp(0).is_string ()) return tmp(0).string_value (); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/dldfcn/__ode15__.cc --- a/libinterp/dldfcn/__ode15__.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/dldfcn/__ode15__.cc Tue Apr 05 08:33:58 2022 -0700 @@ -169,22 +169,22 @@ //Default IDA (void) - : m_t0 (0.0), m_y0 (), m_yp0 (), m_havejac (false), m_havejacfun (false), - m_havejacsparse (false), m_mem (nullptr), m_num (), m_ida_fun (), + : m_t0 (0.0), m_y0 (), m_yp0 (), m_havejac (false), m_havejacfcn (false), + m_havejacsparse (false), m_mem (nullptr), m_num (), m_ida_fcn (), m_ida_jac (), m_dfdy (nullptr), m_dfdyp (nullptr), m_spdfdy (nullptr), - m_spdfdyp (nullptr), m_fun (nullptr), m_jacfun (nullptr), - m_jacspfun (nullptr), m_jacdcell (nullptr), m_jacspcell (nullptr), + m_spdfdyp (nullptr), m_fcn (nullptr), m_jacfcn (nullptr), + m_jacspfcn (nullptr), m_jacdcell (nullptr), m_jacspcell (nullptr), m_sunJacMatrix (nullptr), m_sunLinearSolver (nullptr) { } IDA (realtype t, ColumnVector y, ColumnVector yp, const octave_value& ida_fcn, DAERHSFuncIDA daefun) - : m_t0 (t), m_y0 (y), m_yp0 (yp), m_havejac (false), m_havejacfun (false), - m_havejacsparse (false), m_mem (nullptr), m_num (), m_ida_fun (ida_fcn), + : m_t0 (t), m_y0 (y), m_yp0 (yp), m_havejac (false), m_havejacfcn (false), + m_havejacsparse (false), m_mem (nullptr), m_num (), m_ida_fcn (ida_fcn), m_ida_jac (), m_dfdy (nullptr), m_dfdyp (nullptr), m_spdfdy (nullptr), - m_spdfdyp (nullptr), m_fun (daefun), m_jacfun (nullptr), - m_jacspfun (nullptr), m_jacdcell (nullptr), m_jacspcell (nullptr), + m_spdfdyp (nullptr), m_fcn (daefun), m_jacfcn (nullptr), + m_jacspfcn (nullptr), m_jacdcell (nullptr), m_jacspcell (nullptr), m_sunJacMatrix (nullptr), m_sunLinearSolver (nullptr) { } @@ -202,10 +202,10 @@ IDA& set_jacobian (const octave_value& jac, DAEJacFuncDense j) { - m_jacfun = j; + m_jacfcn = j; m_ida_jac = jac; m_havejac = true; - m_havejacfun = true; + m_havejacfcn = true; m_havejacsparse = false; return *this; @@ -214,10 +214,10 @@ IDA& set_jacobian (const octave_value& jac, DAEJacFuncSparse j) { - m_jacspfun = j; + m_jacspfcn = j; m_ida_jac = jac; m_havejac = true; - m_havejacfun = true; + m_havejacfcn = true; m_havejacsparse = true; return *this; @@ -230,7 +230,7 @@ m_dfdy = dy; m_dfdyp = dyp; m_havejac = true; - m_havejacfun = false; + m_havejacfcn = false; m_havejacsparse = false; return *this; @@ -244,7 +244,7 @@ m_spdfdy = dy; m_spdfdyp = dyp; m_havejac = true; - m_havejacfun = false; + m_havejacfcn = false; m_havejacsparse = true; return *this; @@ -358,19 +358,19 @@ ColumnVector m_y0; ColumnVector m_yp0; bool m_havejac; - bool m_havejacfun; + bool m_havejacfcn; bool m_havejacsparse; void *m_mem; octave_f77_int_type m_num; - octave_value m_ida_fun; + octave_value m_ida_fcn; octave_value m_ida_jac; Matrix *m_dfdy; Matrix *m_dfdyp; SparseMatrix *m_spdfdy; SparseMatrix *m_spdfdyp; - DAERHSFuncIDA m_fun; - DAEJacFuncDense m_jacfun; - DAEJacFuncSparse m_jacspfun; + DAERHSFuncIDA m_fcn; + DAEJacFuncDense m_jacfcn; + DAEJacFuncSparse m_jacspfcn; DAEJacCellDense m_jacdcell; DAEJacCellSparse m_jacspcell; # if defined (HAVE_SUNDIALS_SUNCONTEXT) @@ -397,7 +397,7 @@ ColumnVector yp = IDA::NVecToCol (yyp, m_num); - ColumnVector res = (*m_fun) (y, yp, t, m_ida_fun); + ColumnVector res = (*m_fcn) (y, yp, t, m_ida_fcn); realtype *puntrr = nv_data_s (rr); @@ -487,8 +487,8 @@ Matrix jac; - if (m_havejacfun) - jac = (*m_jacfun) (y, yp, t, cj, m_ida_jac); + if (m_havejacfcn) + jac = (*m_jacfcn) (y, yp, t, cj, m_ida_jac); else jac = (*m_jacdcell) (m_dfdy, m_dfdyp, cj); @@ -510,8 +510,8 @@ SparseMatrix jac; - if (m_havejacfun) - jac = (*m_jacspfun) (y, yp, t, cj, m_ida_jac); + if (m_havejacfcn) + jac = (*m_jacspfcn) (y, yp, t, cj, m_ida_jac); else jac = (*m_jacspcell) (m_spdfdy, m_spdfdyp, cj); @@ -1149,14 +1149,14 @@ bool havejacsparse = options.getfield ("havejacsparse").bool_value (); - bool havejacfun = options.getfield ("havejacfun").bool_value (); + bool havejacfcn = options.getfield ("havejacfcn").bool_value (); Matrix ida_dfdy, ida_dfdyp; SparseMatrix ida_spdfdy, ida_spdfdyp; if (havejac) { - if (havejacfun) + if (havejacfcn) { octave_value ida_jac = options.getfield ("Jacobian"); @@ -1278,7 +1278,7 @@ DEFUN_DLD (__ode15__, args, , doc: /* -*- texinfo -*- -@deftypefn {} {@var{t}, @var{y} =} __ode15__ (@var{fun}, @var{tspan}, @var{y0}, @var{yp0}, @var{options}, @var{num_event_args}) +@deftypefn {} {@var{t}, @var{y} =} __ode15__ (@var{fcn}, @var{tspan}, @var{y0}, @var{yp0}, @var{ode_opt}, @var{num_event_args}) Undocumented internal function. @end deftypefn */) { @@ -1289,11 +1289,11 @@ if (args.length () != 6) print_usage (); - // Check odefun + // Check ODE function octave_value ida_fcn = args(0); if (! ida_fcn.is_function_handle ()) - error ("__ode15__: odefun must be a function handle"); + error ("__ode15__: FCN must be a function handle"); // Check input tspan ColumnVector tspan @@ -1301,7 +1301,7 @@ octave_idx_type numt = tspan.numel (); - realtype t0 = tspan (0); + realtype t0 = tspan(0); if (numt < 2) error ("__ode15__: TRANGE must contain at least 2 elements"); @@ -1310,23 +1310,23 @@ // input y0 and yp0 ColumnVector y0 - = args(2).xvector_value ("__ode15__: initial state y0 must be a vector"); + = args(2).xvector_value ("__ode15__: initial state Y0 must be a vector"); ColumnVector yp0 - = args(3).xvector_value ("__ode15__: initial state yp0 must be a vector"); + = args(3).xvector_value ("__ode15__: initial state YP0 must be a vector"); if (y0.numel () != yp0.numel ()) - error ("__ode15__: initial state y0 and yp0 must have the same length"); + error ("__ode15__: initial state Y0 and YP0 must have the same length"); else if (y0.numel () < 1) - error ("__ode15__: initial state yp0 must be a vector or a scalar"); + error ("__ode15__: initial state YP0 must be a vector or a scalar"); if (! args(4).isstruct ()) - error ("__ode15__: OPTS argument must be a structure"); + error ("__ode15__: ODE_OPT argument must be a structure"); octave_scalar_map options - = args(4).xscalar_map_value ("__ode15__: OPTS argument must be a scalar structure"); + = args(4).xscalar_map_value ("__ode15__: ODE_OPT argument must be a scalar structure"); // Provided number of arguments in the ode callback function octave_idx_type num_event_args diff -r 360d330cc30e -r c9788d7f6e65 libinterp/dldfcn/audiodevinfo.cc --- a/libinterp/dldfcn/audiodevinfo.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/dldfcn/audiodevinfo.cc Tue Apr 05 08:33:58 2022 -0700 @@ -538,8 +538,8 @@ void init (void); void init_fn (void); void set_y (const octave_value& y); - void set_y (octave_function *fn); - void set_y (std::string fn); + void set_y (octave_function *fcn); + void set_y (std::string fcn); Matrix& get_y (void); RowVector get_left (void) const; RowVector get_right (void) const; @@ -1004,9 +1004,9 @@ } void -audioplayer::set_y (octave_function *fn) +audioplayer::set_y (octave_function *fcn) { - octave_callback_function = fn; + octave_callback_function = fcn; channels = 2; reset_end_sample (); } diff -r 360d330cc30e -r c9788d7f6e65 libinterp/dldfcn/gzip.cc --- a/libinterp/dldfcn/gzip.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/dldfcn/gzip.cc Tue Apr 05 08:33:58 2022 -0700 @@ -577,7 +577,7 @@ template static octave_value_list - xzip (const std::string& func_name, const octave_value_list& args) + xzip (const std::string& fcn_name, const octave_value_list& args) { const octave_idx_type nargin = args.length (); if (nargin < 1 || nargin > 2) @@ -585,7 +585,7 @@ const Array source_patterns = args(0).xcellstr_value ("%s: FILES must be a character array or cellstr", - func_name.c_str ()); + fcn_name.c_str ()); if (nargin == 1) return octave_value (Cell (xzip (source_patterns))); else // nargin == 2 diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/cdef-manager.cc --- a/libinterp/octave-value/cdef-manager.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/cdef-manager.cc Tue Apr 05 08:33:58 2022 -0700 @@ -172,7 +172,7 @@ return retval; } -#define META_CLASS_CMP(OP, CLSA, CLSB, FUN) \ +#define META_CLASS_CMP(OP, CLSA, CLSB, FCN) \ static octave_value_list \ class_ ## OP (const octave_value_list& args, int /* nargout */) \ { \ @@ -189,7 +189,7 @@ \ cdef_class clsb = to_cdef (args(1)); \ \ - retval(0) = FUN (CLSA, CLSB); \ + retval(0) = FCN (CLSA, CLSB); \ \ return retval; \ } diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/ov-dld-fcn.h --- a/libinterp/octave-value/ov-dld-fcn.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/ov-dld-fcn.h Tue Apr 05 08:33:58 2022 -0700 @@ -63,9 +63,9 @@ // No copying! - octave_dld_function (const octave_dld_function& fn) = delete; + octave_dld_function (const octave_dld_function& fcn) = delete; - octave_dld_function& operator = (const octave_dld_function& fn) = delete; + octave_dld_function& operator = (const octave_dld_function& fcn) = delete; ~octave_dld_function (void); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/ov-fcn-handle.cc --- a/libinterp/octave-value/ov-fcn-handle.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/ov-fcn-handle.cc Tue Apr 05 08:33:58 2022 -0700 @@ -1683,10 +1683,10 @@ if (file_name.substr (0, oct_home.size ()) == oct_home) file_name = file_name.substr (oct_home.size ()); - octave_value subfun = fcn->find_subfunction (m_name); - - if (subfun.is_defined ()) - m_fcn = subfun; + octave_value subfcn = fcn->find_subfunction (m_name); + + if (subfcn.is_defined ()) + m_fcn = subfcn; } } } @@ -2215,7 +2215,7 @@ std::istringstream nm_is (m_name.substr (anl)); nm_is >> len; - // Anonymous functons don't have names. We just used this + // Anonymous functions don't have names. We just used this // string as temporary storage to pass the number of local // variable values. @@ -2521,16 +2521,16 @@ // HDF5 doesn't print out all sorts of error messages if we // call H5Aopen for a non-existing attribute - H5E_auto_t err_func; - void *err_func_data; + H5E_auto_t err_fcn; + void *err_fcn_data; // turn off error reporting temporarily, but save the error // reporting function: #if defined (HAVE_HDF5_18) - H5Eget_auto (octave_H5E_DEFAULT, &err_func, &err_func_data); + H5Eget_auto (octave_H5E_DEFAULT, &err_fcn, &err_fcn_data); H5Eset_auto (octave_H5E_DEFAULT, nullptr, nullptr); #else - H5Eget_auto (&err_func, &err_func_data); + H5Eget_auto (&err_fcn, &err_fcn_data); H5Eset_auto (nullptr, nullptr); #endif @@ -2546,9 +2546,9 @@ // restore error reporting: #if defined (HAVE_HDF5_18) - H5Eset_auto (octave_H5E_DEFAULT, err_func, err_func_data); + H5Eset_auto (octave_H5E_DEFAULT, err_fcn, err_fcn_data); #else - H5Eset_auto (err_func, err_func_data); + H5Eset_auto (err_fcn, err_fcn_data); #endif // Set up temporary scope to use for evaluating the text that @@ -3542,7 +3542,7 @@ // temporary scope to use for evaluating the text that defines // the anonymous function. Here we want // - // str2fun ("@(args) expr") + // str2func ("@(args) expr") // // to behave the same as if // @@ -3587,7 +3587,7 @@ */ /* -%!function y = __testrecursionfunc (f, x, n) +%!function y = __testrecursionfcn (f, x, n) %! if (nargin < 3) %! n = 0; %! endif @@ -3595,11 +3595,11 @@ %! y = f (x); %! else %! n++; -%! y = __testrecursionfunc (@(x) f (2*x), x, n); +%! y = __testrecursionfcn (@(x) f (2*x), x, n); %! endif %!endfunction %! -%!assert (__testrecursionfunc (@(x) x, 1), 8) +%!assert (__testrecursionfcn (@(x) x, 1), 8) */ DEFUN (is_function_handle, args, , diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/ov-java.cc --- a/libinterp/octave-value/ov-java.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/ov-java.cc Tue Apr 05 08:33:58 2022 -0700 @@ -2028,10 +2028,10 @@ } JNIEXPORT jboolean JNICALL -Java_org_octave_Octave_call (JNIEnv *env, jclass, jstring funcName, +Java_org_octave_Octave_call (JNIEnv *env, jclass, jstring fcnName, jobjectArray argin, jobjectArray argout) { - std::string fname = jstring_to_string (env, funcName); + std::string fname = jstring_to_string (env, fcnName); int nargout = env->GetArrayLength (argout); int nargin = env->GetArrayLength (argin); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/ov-mex-fcn.h --- a/libinterp/octave-value/ov-mex-fcn.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/ov-mex-fcn.h Tue Apr 05 08:33:58 2022 -0700 @@ -63,9 +63,9 @@ // No copying! - octave_mex_function (const octave_mex_function& fn) = delete; + octave_mex_function (const octave_mex_function& fcn) = delete; - octave_mex_function& operator = (const octave_mex_function& fn) = delete; + octave_mex_function& operator = (const octave_mex_function& fcn) = delete; ~octave_mex_function (void); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/ov-usr-fcn.cc --- a/libinterp/octave-value/ov-usr-fcn.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.cc Tue Apr 05 08:33:58 2022 -0700 @@ -410,35 +410,35 @@ return m_scope.subfunctions (); } -// Find definition of final subfunction in list of subfuns: +// Find definition of final subfunction in list of subfcns: // // sub1>sub2>...>subN octave_value -octave_user_function::find_subfunction (const std::string& subfuns_arg) const +octave_user_function::find_subfunction (const std::string& subfcns_arg) const { - std::string subfuns = subfuns_arg; + std::string subfcns = subfcns_arg; - std::string first_fun = subfuns; + std::string first_fcn = subfcns; - std::size_t pos = subfuns.find ('>'); + std::size_t pos = subfcns.find ('>'); if (pos == std::string::npos) - subfuns = ""; + subfcns = ""; else { - first_fun = subfuns.substr (0, pos-1); - subfuns = subfuns.substr (pos+1); + first_fcn = subfcns.substr (0, pos-1); + subfcns = subfcns.substr (pos+1); } - octave_value ov_fcn = m_scope.find_subfunction (first_fun); + octave_value ov_fcn = m_scope.find_subfunction (first_fcn); - if (subfuns.empty ()) + if (subfcns.empty ()) return ov_fcn; octave_user_function *fcn = ov_fcn.user_function_value (); - return fcn->find_subfunction (subfuns); + return fcn->find_subfunction (subfcns); } bool @@ -692,25 +692,25 @@ if (nargin == 1) { - octave_value func = args(0); + octave_value fcn = args(0); - if (func.is_string ()) + if (fcn.is_string ()) { symbol_table& symtab = interp.get_symbol_table (); - std::string name = func.string_value (); - func = symtab.find_function (name); - if (func.is_undefined ()) + std::string name = fcn.string_value (); + fcn = symtab.find_function (name); + if (fcn.is_undefined ()) error ("nargin: invalid function name: %s", name.c_str ()); } - octave_function *fcn_val = func.function_value (true); + octave_function *fcn_val = fcn.function_value (true); if (! fcn_val) error ("nargin: FCN must be a string or function handle"); - octave_user_function *fcn = fcn_val->user_function_value (true); + octave_user_function *ufcn = fcn_val->user_function_value (true); - if (! fcn) + if (! ufcn) { // Matlab gives up for histc, so maybe it's ok that we // give up sometimes too? @@ -720,10 +720,10 @@ type.c_str ()); } - tree_parameter_list *m_param_list = fcn->parameter_list (); + tree_parameter_list *m_param_list = ufcn->parameter_list (); retval = (m_param_list ? m_param_list->length () : 0); - if (fcn->takes_varargs ()) + if (ufcn->takes_varargs ()) retval = -1 - retval; } else @@ -803,36 +803,36 @@ if (nargin == 1) { - octave_value func = args(0); + octave_value fcn = args(0); - if (func.is_string ()) + if (fcn.is_string ()) { symbol_table& symtab = interp.get_symbol_table (); - std::string name = func.string_value (); - func = symtab.find_function (name); - if (func.is_undefined ()) + std::string name = fcn.string_value (); + fcn = symtab.find_function (name); + if (fcn.is_undefined ()) error ("nargout: invalid function name: %s", name.c_str ()); } - if (func.is_inline_function ()) + if (fcn.is_inline_function ()) return ovl (1); - if (func.is_function_handle ()) + if (fcn.is_function_handle ()) { - octave_fcn_handle *fh = func.fcn_handle_value (); + octave_fcn_handle *fh = fcn.fcn_handle_value (); if (fh->is_anonymous ()) return ovl (-1); } - octave_function *fcn_val = func.function_value (true); + octave_function *fcn_val = fcn.function_value (true); if (! fcn_val) error ("nargout: FCN must be a string or function handle"); - octave_user_function *fcn = fcn_val->user_function_value (true); + octave_user_function *ufcn = fcn_val->user_function_value (true); - if (! fcn) + if (! ufcn) { // Matlab gives up for histc, so maybe it's ok that we // give up sometimes too? @@ -842,11 +842,11 @@ type.c_str ()); } - tree_parameter_list *m_ret_list = fcn->return_list (); + tree_parameter_list *m_ret_list = ufcn->return_list (); retval = (m_ret_list ? m_ret_list->length () : 0); - if (fcn->takes_var_return ()) + if (ufcn->takes_var_return ()) retval = -1 - retval; } else diff -r 360d330cc30e -r c9788d7f6e65 libinterp/octave-value/ov-usr-fcn.h --- a/libinterp/octave-value/ov-usr-fcn.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/octave-value/ov-usr-fcn.h Tue Apr 05 08:33:58 2022 -0700 @@ -216,9 +216,9 @@ // No copying! - octave_user_function (const octave_user_function& fn) = delete; + octave_user_function (const octave_user_function& fcn) = delete; - octave_user_function& operator = (const octave_user_function& fn) = delete; + octave_user_function& operator = (const octave_user_function& fcn) = delete; ~octave_user_function (void); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/parse-tree/bp-table.cc --- a/libinterp/parse-tree/bp-table.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/parse-tree/bp-table.cc Tue Apr 05 08:33:58 2022 -0700 @@ -338,13 +338,13 @@ void bp_table::parse_dbfunction_params (const char *who, const octave_value_list& args, - std::string& func_name, + std::string& fcn_name, std::string& class_name, bp_table::bp_lines& lines, std::string& cond) { int nargin = args.length (); - func_name = ""; + fcn_name = ""; class_name = ""; lines = bp_table::bp_lines (); @@ -395,10 +395,10 @@ switch (tok) { case dbstop_in: - func_name = args(pos).string_value (); + fcn_name = args(pos).string_value (); if (seen_in) error ("%s: Too many function names specified -- %s", - who, func_name.c_str ()); + who, fcn_name.c_str ()); else if (seen_at || seen_if) error ("%s: function name must come before line number and 'if'", who); @@ -426,9 +426,9 @@ if (atoi (arg.c_str ()) == 0) { // We have class and function names but already - // stored the class name in func_name. - class_name = func_name; - func_name = arg; + // stored the class name in fcn_name. + class_name = fcn_name; + fcn_name = arg; pos++; break; } @@ -438,7 +438,7 @@ { // It was a line number. Get function name from debugger. if (m_evaluator.in_debug_repl ()) - func_name = m_evaluator.get_user_code ()->profiler_name (); + fcn_name = m_evaluator.get_user_code ()->profiler_name (); else error ("%s: function name must come before line number " "and 'if'", who); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/parse-tree/bp-table.h --- a/libinterp/parse-tree/bp-table.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/parse-tree/bp-table.h Tue Apr 05 08:33:58 2022 -0700 @@ -210,7 +210,7 @@ void parse_dbfunction_params (const char *who, const octave_value_list& args, - std::string& func_name, + std::string& fcn_name, std::string& class_name, bp_table::bp_lines& lines, std::string& cond); diff -r 360d330cc30e -r c9788d7f6e65 libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/parse-tree/lex.h Tue Apr 05 08:33:58 2022 -0700 @@ -294,7 +294,7 @@ m_bracketflag (0), m_braceflag (0), m_looping (0), - m_defining_func (0), + m_defining_fcn (0), m_looking_at_function_handle (0), m_block_comment_nesting_level (0), m_command_arg_paren_count (0), @@ -451,7 +451,7 @@ int m_looping; // nonzero means we're in the middle of defining a function. - int m_defining_func; + int m_defining_fcn; // nonzero means we are parsing a function handle. int m_looking_at_function_handle; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/parse-tree/lex.ll Tue Apr 05 08:33:58 2022 -0700 @@ -699,7 +699,7 @@ curr_lexer->m_looking_for_object_index = false; curr_lexer->m_at_beginning_of_statement = false; - if (curr_lexer->m_defining_func + if (curr_lexer->m_defining_fcn && ! curr_lexer->m_parsed_function_name.top ()) curr_lexer->m_looking_at_return_list = true; else @@ -2256,7 +2256,7 @@ m_bracketflag = 0; m_braceflag = 0; m_looping = 0; - m_defining_func = 0; + m_defining_fcn = 0; m_looking_at_function_handle = 0; m_block_comment_nesting_level = 0; m_command_arg_paren_count = 0; @@ -2697,7 +2697,7 @@ case end_kw: if (inside_any_object_index () - || (m_defining_func + || (m_defining_fcn && ! (m_looking_at_return_list || m_parsed_function_name.top ()))) { @@ -2849,7 +2849,7 @@ break; case function_kw: - m_defining_func++; + m_defining_fcn++; m_parsed_function_name.push (false); if (! m_force_script && m_token_count == 0 && input_from_file ()) diff -r 360d330cc30e -r c9788d7f6e65 libinterp/parse-tree/oct-parse.yy --- a/libinterp/parse-tree/oct-parse.yy Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/parse-tree/oct-parse.yy Tue Apr 05 08:33:58 2022 -0700 @@ -2099,12 +2099,12 @@ { OCTAVE_YYUSE ($3); - lexer.m_defining_func++; + lexer.m_defining_fcn++; lexer.m_parsed_function_name.push (false); } method_decl1 { - lexer.m_defining_func--; + lexer.m_defining_fcn--; lexer.m_parsed_function_name.pop (); $$ = parser.finish_classdef_external_method ($5, $2, $1); @@ -4271,7 +4271,7 @@ m_curr_fcn_depth--; m_function_scopes.pop (); - m_lexer.m_defining_func--; + m_lexer.m_defining_fcn--; m_lexer.m_parsed_function_name.pop (); m_lexer.m_looking_at_return_list = false; m_lexer.m_looking_at_parameter_list = false; diff -r 360d330cc30e -r c9788d7f6e65 libinterp/parse-tree/pt-eval.cc --- a/libinterp/parse-tree/pt-eval.cc Tue Apr 05 01:06:00 2022 -0400 +++ b/libinterp/parse-tree/pt-eval.cc Tue Apr 05 08:33:58 2022 -0700 @@ -4420,13 +4420,13 @@ octave_map tree_evaluator::get_autoload_map (void) const { - Cell func_names (dim_vector (m_autoload_map.size (), 1)); + Cell fcn_names (dim_vector (m_autoload_map.size (), 1)); Cell file_names (dim_vector (m_autoload_map.size (), 1)); octave_idx_type i = 0; for (const auto& fcn_fname : m_autoload_map) { - func_names(i) = fcn_fname.first; + fcn_names(i) = fcn_fname.first; file_names(i) = fcn_fname.second; i++; @@ -4434,7 +4434,7 @@ octave_map m; - m.assign ("function", func_names); + m.assign ("function", fcn_names); m.assign ("file", file_names); return m;