changeset 31548:c8ad083a5802 stable

maint: Clean up m-files before Octave 8.1 release. * external.txi, oop.txi, Table.h, documentation.cc, gui-preferences-ed.h, lo-specfun.cc, range.tst : Eliminate triple newlines. * Map.m, MemoizedFunction.m, delaunayn.m, inputParser.m, __publish_latex_output__.m, publish.m, unpack.m, fminbnd.m, __add_default_menu__.m, gammainc.m, gallery.m, hadamard.m, weboptions.m: Add newline after keyword "function" or before keyword "endfunction" for readability. * getaudiodata.m, pkg.m : Add semicolon to end of line for error() statement. * movegui.m: Combine mutliple calls to set() into one for performance. * __unimplemented__.m (missing_functions): Remove missing functions that have been implemented. * __vectorize__.m, check_default_input.m, betaincinv.m, gammaincinv.m: Remove semicolon at end of line with "function" declaration. * weboptions.m: Remove semicolon at end of line with "if" keyword. * integrate_adaptive.m, factor.m: Use keyword "endif" rather than bare "end".
author Rik <rik@octave.org>
date Fri, 25 Nov 2022 21:23:54 -0800
parents fd8c0df759bb
children ed7b17c7ddf3
files doc/interpreter/external.txi doc/interpreter/oop.txi libgui/graphics/Table.h libgui/src/documentation.cc libgui/src/gui-preferences-ed.h liboctave/numeric/lo-specfun.cc scripts/+containers/Map.m scripts/+matlab/+lang/MemoizedFunction.m scripts/audio/@audiorecorder/getaudiodata.m scripts/geometry/delaunayn.m scripts/gui/movegui.m scripts/help/__unimplemented__.m scripts/legacy/__vectorize__.m scripts/miscellaneous/inputParser.m scripts/miscellaneous/private/__publish_latex_output__.m scripts/miscellaneous/publish.m scripts/miscellaneous/unpack.m scripts/ode/private/check_default_input.m scripts/ode/private/integrate_adaptive.m scripts/optimization/fminbnd.m scripts/pkg/pkg.m scripts/plot/util/private/__add_default_menu__.m scripts/specfun/betaincinv.m scripts/specfun/factor.m scripts/specfun/gammainc.m scripts/specfun/gammaincinv.m scripts/special-matrix/gallery.m scripts/special-matrix/hadamard.m scripts/web/weboptions.m test/range.tst
diffstat 30 files changed, 51 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/external.txi	Fri Nov 25 16:32:51 2022 +0100
+++ b/doc/interpreter/external.txi	Fri Nov 25 21:23:54 2022 -0800
@@ -2081,7 +2081,6 @@
 @end example
 
 
-
 @node Set up the JVM
 @subsection Set up the JVM
 @cindex memory, limitations on JVM
@@ -2174,7 +2173,6 @@
 @seealso{javamem}
 
 
-
 @node Java Interface Functions
 @subsection Java Interface Functions
 
--- a/doc/interpreter/oop.txi	Fri Nov 25 16:32:51 2022 +0100
+++ b/doc/interpreter/oop.txi	Fri Nov 25 21:23:54 2022 -0800
@@ -816,8 +816,6 @@
 @end group
 @end example
 
-
-
 In contrast to old style classes, the @code{properties}-@code{endproperties}
 block as well as the @code{methods}-@code{endmethods} block can be used to
 define properties and methods of the class.  Because both blocks are empty,
--- a/libgui/graphics/Table.h	Fri Nov 25 16:32:51 2022 +0100
+++ b/libgui/graphics/Table.h	Fri Nov 25 21:23:54 2022 -0800
@@ -96,8 +96,6 @@
                                octave_value new_value, octave_value edit_data, octave_value error);
     void checkBoxClicked (int row, int col, QCheckBox* checkBox);
 
-
-
   };
 
 }
--- a/libgui/src/documentation.cc	Fri Nov 25 16:32:51 2022 +0100
+++ b/libgui/src/documentation.cc	Fri Nov 25 21:23:54 2022 -0800
@@ -984,8 +984,6 @@
     return retval;
   }
 
-
-
   //
   // The documentation browser
   //
--- a/libgui/src/gui-preferences-ed.h	Fri Nov 25 16:32:51 2022 +0100
+++ b/libgui/src/gui-preferences-ed.h	Fri Nov 25 21:23:54 2022 -0800
@@ -165,8 +165,6 @@
 const gui_pref
 ed_show_hscroll_bar ("editor/show_hscroll_bar", QVariant (true));
 
-
-
 // Octave comment strings
 
 const gui_pref
--- a/liboctave/numeric/lo-specfun.cc	Fri Nov 25 16:32:51 2022 +0100
+++ b/liboctave/numeric/lo-specfun.cc	Fri Nov 25 21:23:54 2022 -0800
@@ -125,8 +125,6 @@
       return retval;
     }
 
-
-
     Complex
     airy (const Complex& z, bool deriv, bool scaled, octave_idx_type& ierr)
     {
--- a/scripts/+containers/Map.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/+containers/Map.m	Fri Nov 25 21:23:54 2022 -0800
@@ -230,6 +230,7 @@
       else
         error ("containers.Map: incorrect number of inputs specified");
       endif
+
     endfunction
 
     function keySet = keys (this)
@@ -241,6 +242,7 @@
 
       keySet = fieldnames (this.map).';  # compatibility requires row vector
       keySet = decode_keys (this, keySet);
+
     endfunction
 
     function valueSet = values (this, keySet)
@@ -271,6 +273,7 @@
           end_try_catch
         endfor
       endif
+
     endfunction
 
     function tf = isKey (this, keySet)
@@ -299,6 +302,7 @@
       endif
       keySet = encode_keys (this, keySet(in));
       tf(in) = isfield (this.map, keySet);
+
     endfunction
 
     function this = remove (this, keySet)
@@ -327,6 +331,7 @@
       keySet = encode_keys (this, keySet(in));
       in = isfield (this.map, keySet);
       this.map = rmfield (this.map, keySet(in));
+
     endfunction
 
     function varargout = size (this, n)
@@ -359,6 +364,7 @@
           varargout = { 1 };
         endif
       endif
+
     endfunction
 
     function len = length (this)
@@ -369,6 +375,7 @@
       ## @end deftypefn
 
       len = double (this.Count);
+
     endfunction
 
     function tf = isempty (this)
--- a/scripts/+matlab/+lang/MemoizedFunction.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/+matlab/+lang/MemoizedFunction.m	Fri Nov 25 21:23:54 2022 -0800
@@ -202,10 +202,12 @@
 endclassdef
 
 function cache = init_cache ()
+
   cache = struct ("Inputs",      {{}},
                   "Nargout",     [],
                   "Outputs",     {{}},
                   "HitCount",    [],
                   "TotalHits",   0,
                   "TotalMisses", 0);
+
 endfunction
--- a/scripts/audio/@audiorecorder/getaudiodata.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/audio/@audiorecorder/getaudiodata.m	Fri Nov 25 21:23:54 2022 -0800
@@ -56,7 +56,7 @@
       case "uint8"
         data = uint8 ((data + 1.0) * 0.5 * (2.0 ^ 8 - 1));
       otherwise
-        error ('@audiorecorder/getaudiodata: invalid DATATYPE "%s"', datatype)
+        error ('@audiorecorder/getaudiodata: invalid DATATYPE "%s"', datatype);
     endswitch
   endif
 
--- a/scripts/geometry/delaunayn.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/geometry/delaunayn.m	Fri Nov 25 21:23:54 2022 -0800
@@ -171,6 +171,7 @@
     endif
 
   endif
+
 endfunction
 
 
--- a/scripts/gui/movegui.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/gui/movegui.m	Fri Nov 25 21:23:54 2022 -0800
@@ -199,8 +199,7 @@
   endif
 
   ## Move figure
-  set (h, "units", "pixels");
-  set (h, "position", fpos);
+  set (h, "units", "pixels", "position", fpos);
   set (h, "units", units_fig);
 
 endfunction
--- a/scripts/help/__unimplemented__.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/help/__unimplemented__.m	Fri Nov 25 21:23:54 2022 -0800
@@ -578,6 +578,7 @@
 endfunction
 
 function rlist = missing_functions ()
+
   persistent list = {
   "addboundary",
   "addcats",
@@ -659,7 +660,6 @@
   "circumcenter",
   "circumcenters",
   "classUnderlying",
-  "clearAllMemoizedCaches",
   "clearCache",
   "clearpoints",
   "clipboard",
@@ -981,7 +981,6 @@
   "MaximizeCommandWindow",
   "maxk",
   "memmapfile",
-  "memoize",
   "MemoizedFunction",
   "mergecats",
   "meta.abstractDetails",
@@ -1251,7 +1250,6 @@
   "uiconfirm",
   "uidropdown",
   "uieditfield",
-  "uifigure",
   "uigauge",
   "uigetpref",
   "uiimport",
@@ -1275,7 +1273,6 @@
   "uitree",
   "uitreenode",
   "undocheckout",
-  "uniquetol",
   "unloadlibrary",
   "unmesh",
   "unregisterallevents",
--- a/scripts/legacy/__vectorize__.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/legacy/__vectorize__.m	Fri Nov 25 21:23:54 2022 -0800
@@ -33,7 +33,7 @@
 ## anyway, and most expressions will probably be short.  It may also be
 ## buggy.  Well, don't use this function!
 
-function new_expr = __vectorize__ (expr);
+function new_expr = __vectorize__ (expr)
 
   new_expr = "";
 
--- a/scripts/miscellaneous/inputParser.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/miscellaneous/inputParser.m	Fri Nov 25 21:23:54 2022 -0800
@@ -236,6 +236,7 @@
       endif
       this.validate_name ("Required", name);
       this.Required{end+1} = struct ("name", name, "val", val);
+
     endfunction
 
     function addOptional (this, name, def, val = inputParser.def_val)
@@ -279,6 +280,7 @@
         def = {def};
       endif
       this.Optional{end+1} = struct ("name", name, "def", def, "val", val);
+
     endfunction
 
     function addParamValue (this, name, def, val = inputParser.def_val)
@@ -298,6 +300,7 @@
         print_usage ();
       endif
       this.addParameter (name, def, val);
+
     endfunction
 
     function addParameter (this, name, def, varargin)
@@ -348,6 +351,7 @@
       this.validate_name ("Parameter", name);
       this.Parameter.(name).def = def;
       this.Parameter.(name).val = val;
+
     endfunction
 
     function addSwitch (this, name)
@@ -376,6 +380,7 @@
       endif
       this.validate_name ("Switch", name);
       this.Switch.(name).def = false;
+
     endfunction
 
     function parse (this, varargin)
--- a/scripts/miscellaneous/private/__publish_latex_output__.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/miscellaneous/private/__publish_latex_output__.m	Fri Nov 25 21:23:54 2022 -0800
@@ -213,6 +213,7 @@
 endfunction
 
 function outstr = do_section (str)
+
   outstr = sprintf ("%s\n",
 "",
 "",
@@ -220,6 +221,7 @@
 ['\addcontentsline{toc}{section}{' str '}'],
 ['\subsection*{' str '}'],
 "");
+
 endfunction
 
 function outstr = do_preformatted_code (str)
--- a/scripts/miscellaneous/publish.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/miscellaneous/publish.m	Fri Nov 25 21:23:54 2022 -0800
@@ -451,6 +451,7 @@
     endif
 
     return;
+
   endfunction
   ## Checks line of cellstring to be a paragraph line
   is_paragraph = @(cstr) is_publish_markup (cstr, 1);
--- a/scripts/miscellaneous/unpack.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/miscellaneous/unpack.m	Fri Nov 25 21:23:54 2022 -0800
@@ -318,6 +318,7 @@
   files = char (output(2:end));
   ## Trim constant width prefix and return cell array.
   files = cellstr (files(:,14:end));
+
 endfunction
 
 function output = __parse_tar__ (output)
--- a/scripts/ode/private/check_default_input.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/ode/private/check_default_input.m	Fri Nov 25 21:23:54 2022 -0800
@@ -23,7 +23,7 @@
 ##
 ########################################################################
 
-function fcn = check_default_input (fcn, trange, solver, y0, yp0);
+function fcn = check_default_input (fcn, trange, solver, y0, yp0)
 
   if (nargin < 4)
     print_usage ();
--- a/scripts/ode/private/integrate_adaptive.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/ode/private/integrate_adaptive.m	Fri Nov 25 21:23:54 2022 -0800
@@ -218,7 +218,7 @@
         iout += iadd;
         output_x(:, iout) = ode_x(:, istep);
         output_t(iout) = ode_t(istep);
-      end
+      endif
 
       ## Call OutputFcn
       if ((options.haveoutputfunction) && (iadd > 0))
--- a/scripts/optimization/fminbnd.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/optimization/fminbnd.m	Fri Nov 25 21:23:54 2022 -0800
@@ -289,6 +289,7 @@
 
 ## A hack for printing a formatted table
 function print_formatted_table (table)
+
   printf ("\n Fcn-count     x          f(x)         Procedure\n");
   for row=table
     printf ("%5.5s        %7.7s    %8.8s\t%s\n",
@@ -296,6 +297,7 @@
             num2str (row.fx,"%.6f"), row.procedure);
   endfor
   printf ("\n");
+
 endfunction
 
 ## Print either a success termination message or bad news
--- a/scripts/pkg/pkg.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/pkg/pkg.m	Fri Nov 25 21:23:54 2022 -0800
@@ -760,7 +760,7 @@
       localflag = any (strcmp (varargin, "-local"));
       if (globalflag || localflag)
         if (globalflag && localflag)
-          error ("pkg: cannot specify both global and local options.")
+          error ("pkg: cannot specify both global and local options.");
         elseif (globalflag)
           [~, installed_pkgs_lst] = installed_packages (local_list, global_list);
         else
--- a/scripts/plot/util/private/__add_default_menu__.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/plot/util/private/__add_default_menu__.m	Fri Nov 25 21:23:54 2022 -0800
@@ -273,6 +273,7 @@
 endfunction
 
 function init_mouse_tools (hf)
+
   set (hf, "__pan_mode__", struct ("Enable", "off",
                                    "Motion", "both",
                                    "FigureHandle", hf),
@@ -283,6 +284,7 @@
                                     "Motion", "both",
                                     "Direction", "in",
                                     "FigureHandle", hf));
+
 endfunction
 
 function guimode_cb (h, ~)
--- a/scripts/specfun/betaincinv.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/specfun/betaincinv.m	Fri Nov 25 21:23:54 2022 -0800
@@ -209,7 +209,7 @@
 
 endfunction
 
-function x = newton_method (F, JF, x, a, b, y);
+function x = newton_method (F, JF, x, a, b, y)
 
   Bln = betaln (a, b);
   ## Exclude special values that have been already computed.
--- a/scripts/specfun/factor.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/specfun/factor.m	Fri Nov 25 21:23:54 2022 -0800
@@ -126,7 +126,7 @@
       ## recursion.
       if (! isprime (pr))
         pr = factor (pr);
-      end
+      endif
 
       [pf, q] = reducefactors (q, pf, pr);
       ## q is now divided by all occurrences of factor(s) pr.
--- a/scripts/specfun/gammainc.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/specfun/gammainc.m	Fri Nov 25 21:23:54 2022 -0800
@@ -246,15 +246,18 @@
 
 ## x == 0, a == 0.
 function y = gammainc_00 (tail)
+
   if (strcmp (tail, "upper") || strcmp (tail, "scaledupper"))
     y = 0;
   else
     y = 1;
   endif
+
 endfunction
 
 ## x == 0.
 function y = gammainc_x0 (tail)
+
   if (strcmp (tail, "lower"))
     y = 0;
   elseif (strcmp (tail, "upper") || strcmp (tail, "scaledlower"))
@@ -262,10 +265,12 @@
   else
     y = Inf;
   endif
+
 endfunction
 
 ## x == Inf.
 function y = gammainc_x_inf (tail)
+
   if (strcmp (tail, "lower"))
     y = 1;
   elseif (strcmp (tail, "upper") || strcmp (tail, "scaledupper"))
@@ -273,10 +278,12 @@
   else
     y = Inf;
   endif
+
 endfunction
 
 ## a == Inf.
 function y = gammainc_a_inf (tail)
+
   if (strcmp (tail, "lower"))
     y = 0;
   elseif (strcmp (tail, "upper") || strcmp (tail, "scaledlower"))
@@ -284,10 +291,12 @@
   else
     y = Inf;
   endif
+
 endfunction
 
 ## a == 0.
 function y = gammainc_a0 (x, tail)
+
   if (strcmp (tail, "lower"))
     y = 1;
   elseif (strcmp (tail, "scaledlower"))
@@ -295,6 +304,7 @@
   else
     y = 0;
   endif
+
 endfunction
 
 ## a == 1.
--- a/scripts/specfun/gammaincinv.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/specfun/gammaincinv.m	Fri Nov 25 21:23:54 2022 -0800
@@ -255,7 +255,7 @@
 endfunction
 
 ## subfunction: Newton's Method
-function x = newton_method (F, JF, y, a, x0, tol, maxit);
+function x = newton_method (F, JF, y, a, x0, tol, maxit)
 
   l = numel (y);
   res = -F (y, a, x0) ./ JF (a, x0);
--- a/scripts/special-matrix/gallery.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/special-matrix/gallery.m	Fri Nov 25 21:23:54 2022 -0800
@@ -1213,6 +1213,7 @@
 endfunction
 
 function c = gcdmat (n)
+
   if (nargin != 1)
     error ("gallery: 1 argument is required for gcdmat matrix");
   elseif (! isscalar (n) || ! isnumeric (n) || fix (n) != n)
--- a/scripts/special-matrix/hadamard.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/special-matrix/hadamard.m	Fri Nov 25 21:23:54 2022 -0800
@@ -166,6 +166,7 @@
        1 -1 1 1 -1 1 1 -1 -1 -1 1 -1 1 1 1 -1 1 1 1 -1 -1 1 -1 -1 1 -1 -1 -1
        1 1 1 -1 -1 1 -1 -1 1 -1 1 -1 1 1 -1 1 -1 1 -1 1 -1 -1 1 1 -1 -1 -1 1
        1 -1 1 1 -1 -1 1 1 -1 -1 -1 1 -1 -1 1 1 -1 1 1 1 -1 -1 1 1 -1 -1 1 -1];
+
 endfunction
 
 
--- a/scripts/web/weboptions.m	Fri Nov 25 16:32:51 2022 +0100
+++ b/scripts/web/weboptions.m	Fri Nov 25 21:23:54 2022 -0800
@@ -251,7 +251,7 @@
     endfunction
 
     function f = set.CharacterEncoding (f, value)
-      if (! any (strcmpi (value, {"UTF-8", 'US-ASCII', "auto"})));
+      if (! any (strcmpi (value, {"UTF-8", 'US-ASCII', "auto"})))
         error ("weboptions: Invalid CharacterEncoding value");
       else
         f.CharacterEncoding = value;
@@ -259,7 +259,7 @@
     endfunction
 
     function f = set.UserAgent (f, value)
-      if (! ischar (value) && ! isrow (value));
+      if (! ischar (value) && ! isrow (value))
         error ("weboptions: UserAgent must be a string");
       else
         f.UserAgent = value;
@@ -308,6 +308,7 @@
     endfunction
 
     function f = set.HeaderFields (f, value)
+
       if (! isempty (value))
         if (! iscellstr (value) || ! ismatrix (value))
           error ("weboptions: HeaderFields must be array of strings or a cell array");
@@ -316,6 +317,7 @@
         endif
       endif
       f.HeaderFields = value;
+
     endfunction
 
     function f = set.ContentType (f, value)
@@ -336,6 +338,7 @@
     endfunction
 
     function f = set.RequestMethod (f, value)
+
       if (! isempty (value))
         if (! any (strcmpi (value, {"auto", "get", "put", "post",...
                                     "delete", "patch"})))
@@ -343,6 +346,7 @@
         endif
       endif
       f.RequestMethod = value;
+
     endfunction
 
     function f = set.ArrayFormat (f, value)
--- a/test/range.tst	Fri Nov 25 16:32:51 2022 +0100
+++ b/test/range.tst	Fri Nov 25 21:23:54 2022 -0800
@@ -79,9 +79,6 @@
 %!assert ([ r ; uint32(z)          ], uint32 (expect))
 %!assert ([ r ; uint64(z)          ], uint64 (expect))
 
-
-
-
 ## Test corner cases of ranges (base and limit)
 
 %!shared r, rrev, rneg