Mercurial > octave
changeset 24634:ab2321d4ba03
maint: strip trailing whitespace from source files
* genpropdoc.m, Canvas.cc, data.cc, dlmread.cc, gl-render.cc,
oct-stream.cc, ov-flt-cx-mat.cc, toascii.m, isequal.m, isequaln.m,
setappdata.m, grid.m, legend.m, colorbar.m, findobj.m, bounds.m,
corrcoef.m, erase.m, isstring.m, mkoctfile.in.cc:
Strip trailing whitespace.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 22 Jan 2018 02:17:46 -0500 |
parents | 428780eec08a |
children | b708857d634e |
files | doc/interpreter/genpropdoc.m libgui/graphics/Canvas.cc libinterp/corefcn/data.cc libinterp/corefcn/dlmread.cc libinterp/corefcn/gl-render.cc libinterp/corefcn/oct-stream.cc libinterp/octave-value/ov-flt-cx-mat.cc scripts/deprecated/toascii.m scripts/general/isequal.m scripts/general/isequaln.m scripts/gui/setappdata.m scripts/plot/appearance/grid.m scripts/plot/appearance/legend.m scripts/plot/draw/colorbar.m scripts/plot/util/findobj.m scripts/statistics/bounds.m scripts/statistics/corrcoef.m scripts/strings/erase.m scripts/strings/isstring.m src/mkoctfile.in.cc |
diffstat | 20 files changed, 62 insertions(+), 62 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/interpreter/genpropdoc.m Sun Jan 21 10:39:19 2018 -0500 +++ b/doc/interpreter/genpropdoc.m Mon Jan 22 02:17:46 2018 -0500 @@ -144,7 +144,7 @@ indicates whether the interrupting callback is queued (@qcode{\"queue\"} \ (default)) or discarded (@qcode{\"cancel\"}).\n\ @xref{Callbacks, , @w{Callbacks section}}."; - + case "buttondownfcn" s.doc = "__fcnmsg__"; s.valid = valid_fcn; @@ -188,7 +188,7 @@ and callbacks that make use of @code{drawnow}, @code{figure}, @code{waitfor}, \ @code{getframe} or @code{pause} functions are eventually interrupted.\n\ @xref{Callbacks, , @w{Callbacks section}}."; - + case "parent" s.doc = "Handle of the parent graphics object."; s.valid = valid_handle; @@ -203,7 +203,7 @@ object is configured to accept mouse clicks the @qcode{\"hittest\"} property \ will determine how they are processed. \ @xref{XREF__objname__hittest, , @w{hittest property}}."; - + case "selected" case "selectionhighlight" case "tag" @@ -246,7 +246,7 @@ case "hittest" s.doc = doc_unused; - + case "pickableparts" s.doc = doc_unused;
--- a/libgui/graphics/Canvas.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/libgui/graphics/Canvas.cc Mon Jan 22 02:17:46 2018 -0500 @@ -627,7 +627,7 @@ graphics_object currentObj, axesObj; - // Retrieve selected object. + // Retrieve selected object. select_object (obj, event, currentObj, axesObj); // currentObj may be invalid if, e.g., all objects under the mouse @@ -659,14 +659,14 @@ { // Update the figure "currentobject" auto& fprop = Utils::properties<figure> (figObj); - + if (currentObj.get_properties ().handlevisibility_is ("on")) fprop.set_currentobject (currentObj.get_handle () .as_octave_value ()); else fprop.set_currentobject (Matrix ()); - - // Update figure "selectiontype" and "currentpoint" + + // Update figure "selectiontype" and "currentpoint" gh_manager::post_set ( figObj.get_handle (), "selectiontype", Utils::figureSelectionType (event, isdblclick), false); @@ -987,10 +987,10 @@ double factor = (event->delta () > 0 ? 0.1 : -0.1); - if (event->modifiers () == Qt::NoModifier + if (event->modifiers () == Qt::NoModifier && mode != "horizontal") ap.pan ("vertical", factor); - else if (event->modifiers () == Qt::ShiftModifier + else if (event->modifiers () == Qt::ShiftModifier && mode != "vertical") ap.pan ("horizontal", factor); }
--- a/libinterp/corefcn/data.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/libinterp/corefcn/data.cc Mon Jan 22 02:17:46 2018 -0500 @@ -5184,7 +5184,7 @@ %!assert (numel (linspace (0, 1, 2-eps)), 1) %!assert (linspace (10, 20, 2.1), [10 20]) %!assert (linspace (10, 20, 2.9), [10 20]) -%!assert (1 ./ linspace (-0, 0, 4), [-Inf, Inf, Inf, Inf]) +%!assert (1 ./ linspace (-0, 0, 4), [-Inf, Inf, Inf, Inf]) %!error linspace () %!error linspace (1, 2, 3, 4)
--- a/libinterp/corefcn/dlmread.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/libinterp/corefcn/dlmread.cc Mon Jan 22 02:17:46 2018 -0500 @@ -533,7 +533,7 @@ %! unlink (file); %! end_unwind_protect -%!testif ; ! ismac () +%!testif ; ! ismac () %! file = tempname (); %! unwind_protect %! fid = fopen (file, "wt");
--- a/libinterp/corefcn/gl-render.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/libinterp/corefcn/gl-render.cc Mon Jan 22 02:17:46 2018 -0500 @@ -625,7 +625,7 @@ opengl_renderer::opengl_renderer (void) : toolkit (), xform (), xmin (), xmax (), ymin (), ymax (), zmin (), zmax (), xZ1 (), xZ2 (), marker_id (), filled_marker_id (), - camera_pos (), camera_dir (), interpreter ("none"), txt_renderer (), + camera_pos (), camera_dir (), interpreter ("none"), txt_renderer (), selecting (false) { // This constructor will fail if we don't have OpenGL or if the data @@ -1391,7 +1391,7 @@ int xstate = props.get_xstate (); if (xstate != AXE_DEPTH_DIR - && (props.is_visible () + && (props.is_visible () || (selecting && props.pickableparts_is ("all")))) { int zstate = props.get_zstate (); @@ -1574,7 +1574,7 @@ int ystate = props.get_ystate (); if (ystate != AXE_DEPTH_DIR && props.is_visible () - && (props.is_visible () + && (props.is_visible () || (selecting && props.pickableparts_is ("all")))) { int zstate = props.get_zstate (); @@ -1756,7 +1756,7 @@ int zstate = props.get_zstate (); if (zstate != AXE_DEPTH_DIR && props.is_visible () - && (props.is_visible () + && (props.is_visible () || (selecting && props.pickableparts_is ("all")))) { bool xySym = props.get_xySym ();
--- a/libinterp/corefcn/oct-stream.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/libinterp/corefcn/oct-stream.cc Mon Jan 22 02:17:46 2018 -0500 @@ -3733,7 +3733,7 @@ { std::string delim = delim_list(j).string_value (); if (delim.length () == 1) - whitespace.erase (std::remove (whitespace.begin (), + whitespace.erase (std::remove (whitespace.begin (), whitespace.end (), delim[0]), whitespace.end ());
--- a/libinterp/octave-value/ov-flt-cx-mat.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/libinterp/octave-value/ov-flt-cx-mat.cc Mon Jan 22 02:17:46 2018 -0500 @@ -710,7 +710,7 @@ case umap_xtolower: case umap_xtoupper: return matrix; - + #define ARRAY_METHOD_MAPPER(UMAP, FCN) \ case umap_ ## UMAP: \ return octave_value (matrix.FCN ())
--- a/scripts/deprecated/toascii.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/deprecated/toascii.m Mon Jan 22 02:17:46 2018 -0500 @@ -23,15 +23,15 @@ ## Use @code{double} instead. ## ## Return ASCII representation of @var{s} in a matrix. -## +## ## For example: -## +## ## @example ## @group ## toascii ("ASCII" ## @result{} [ 65, 83, 67, 73, 73 ] ## @end group -## +## ## @end example ## @seealso{double, char} ## @end deftypefn
--- a/scripts/general/isequal.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/general/isequal.m Mon Jan 22 02:17:46 2018 -0500 @@ -159,7 +159,7 @@ t = (x == y); else - error ("isequal: Impossible to reach code. File a bug report."); + error ("isequal: Impossible to reach code. File a bug report."); endif @@ -246,7 +246,7 @@ ## Convert to char (space) for faster processing with strcmp (time). idx = 1; x = char (x); - while (t && idx <= nvarargin) + while (t && idx <= nvarargin) t = strcmp (x, char (varargin{idx})); idx += 1; endwhile @@ -270,7 +270,7 @@ t = all (cellfun ("eq", {x}, varargin)); else - error ("isequal: Impossible to reach code. File a bug report."); + error ("isequal: Impossible to reach code. File a bug report."); endif @@ -375,7 +375,7 @@ %!assert (isequal (struct ("a",1,"b",2), struct ("a",1,"b",2), %! struct ("b",2,"a",1)), true) %!assert (isequal (struct ("a","abc","b",2), struct ("a","abc","b",2)), true) -%!assert (isequal (struct ("a","abc","b",2), struct ("a","abc","b",2), +%!assert (isequal (struct ("a","abc","b",2), struct ("a","abc","b",2), %! struct ("a","abc","b",2)), true) ## recursive structure
--- a/scripts/general/isequaln.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/general/isequaln.m Mon Jan 22 02:17:46 2018 -0500 @@ -165,7 +165,7 @@ t = (x == y); else - error ("isequaln: Impossible to reach code. File a bug report."); + error ("isequaln: Impossible to reach code. File a bug report."); endif @@ -256,7 +256,7 @@ ## Convert to char (space) for faster processing with strcmp (time). idx = 1; x = char (x); - while (t && idx <= nvarargin) + while (t && idx <= nvarargin) t = strcmp (x, char (varargin{idx})); idx += 1; endwhile @@ -280,7 +280,7 @@ t = all (cellfun ("eq", {x}, varargin)); else - error ("isequaln: Impossible to reach code. File a bug report."); + error ("isequaln: Impossible to reach code. File a bug report."); endif
--- a/scripts/gui/setappdata.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/gui/setappdata.m Mon Jan 22 02:17:46 2018 -0500 @@ -67,7 +67,7 @@ varargin = cell (1, 2*numel (names)); varargin(1:2:end) = names; varargin(2:2:end) = values; - + elseif (! all (cellfun ("isclass", varargin(1:2:end), "char"))) error ("setappdata: NAME must be a string or cellstr"); endif
--- a/scripts/plot/appearance/grid.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/plot/appearance/grid.m Mon Jan 22 02:17:46 2018 -0500 @@ -176,13 +176,13 @@ %! set (gca, "xminorgrid", "on"); %! set (gca, "yminorgrid", "on"); %! title ({"major grid disabled", -%! "minor grid displayed at major ticks"}); +%! "minor grid displayed at major ticks"}); %! subplot (1,2,2) %! semilogy (1:100); %! set (gca, "xminorgrid", "on"); %! set (gca, "yminorgrid", "on"); %! title ({"major grid disabled", -%! "minor grid displayed at major ticks"}); +%! "minor grid displayed at major ticks"}); %!demo %! clf;
--- a/scripts/plot/appearance/legend.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/plot/appearance/legend.m Mon Jan 22 02:17:46 2018 -0500 @@ -200,7 +200,7 @@ textpos = "default"; box = "default"; delete_leg = false; - find_leg_hdl = (nargs == 0); # possibly overridden + find_leg_hdl = (nargs == 0); # possibly overridden propvals = {}; ## Process old way of specifying location with a number rather than a string. @@ -656,7 +656,7 @@ "fontsize", [], "fontweight", [] "interpreter", [], ... "color", [] }; propvals = get (hlegend, legprops); - txtprops(2:2:end) = propvals; + txtprops(2:2:end) = propvals; ## Add text labels to the axes first and check their extents nentries = numel (hplots); @@ -989,7 +989,7 @@ htdel = findall (ca(1), "-depth", 1, "tag", "deletelegend", "type", "text"); if (isempty (htdel)) - htdel = text (0, 0, "", "parent", ca(1), "tag", "deletelegend", + htdel = text (0, 0, "", "parent", ca(1), "tag", "deletelegend", "visible", "off", "handlevisibility", "off", "xliminclude", "off", "yliminclude", "off", "zliminclude", "off"); @@ -1775,7 +1775,7 @@ %! text (4.5, 80, "Right Axis", "parent", hax(2)); %! hleg = legend ("show"); %! assert (get (hleg, "string"), {"data1", "data2"}); -%! fail ("legend ('foo', 'bar', 'baz')", "warning", "ignoring extra labels"); +%! fail ("legend ('foo', 'bar', 'baz')", "warning", "ignoring extra labels"); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect @@ -1785,17 +1785,17 @@ %! hf = figure ("visible", "off"); %! unwind_protect %! hax = gca (); -%! fail ("legend ('foobar')", "warning", "plot data is empty"); +%! fail ("legend ('foobar')", "warning", "plot data is empty"); %! ht = text (0.5, 0.5, "Hello World"); -%! fail ("legend ('foobar')", "warning", "plot data is empty"); +%! fail ("legend ('foobar')", "warning", "plot data is empty"); %! lastwarn (""); # clear warning %! hleg = legend (); %! assert (isempty (hleg) && isempty (lastwarn ())); -%! fail ("legend ('foobar')", "warning", "plot data is empty"); +%! fail ("legend ('foobar')", "warning", "plot data is empty"); %! hln = line ([0 1], [0 1]); -%! fail ("legend ('foo', 'bar')", "warning", "ignoring extra labels"); +%! fail ("legend ('foo', 'bar')", "warning", "ignoring extra labels"); %! plot (rand (2, 21)); -%! fail ("legend ()", "warning", "labeling only first 20 data objects"); +%! fail ("legend ()", "warning", "labeling only first 20 data objects"); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect @@ -1805,8 +1805,8 @@ %! hf = figure ("visible", "off"); %! unwind_protect %! plot (1:10); -%! fail ("legend ('location','best')", "warning", "'best' not yet implemented"); -%! fail ("legend ('location','bestoutside')", "warning", "'best' not yet implemented"); +%! fail ("legend ('location','best')", "warning", "'best' not yet implemented"); +%! fail ("legend ('location','bestoutside')", "warning", "'best' not yet implemented"); %! unwind_protect_cleanup %! close (hf); %! end_unwind_protect
--- a/scripts/plot/draw/colorbar.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/plot/draw/colorbar.m Mon Jan 22 02:17:46 2018 -0500 @@ -310,13 +310,13 @@ set (hi, "xdata", [0,1], "ydata", [cmin, cmax], "cdata", [1 : clen]'); if (mirror) set (hcb, "xtick", [], "xlim", [-0.5, 1.5], - "ytickmode", "auto", "ylim", cext, + "ytickmode", "auto", "ylim", cext, "yaxislocation", "right", "label", get (hcb, "ylabel"), "__vertical__", vertical, "layer", "top", args{:}); else set (hcb, "xtick", [], "xlim", [-0.5, 1.5], - "ytickmode", "auto", "ylim", cext, + "ytickmode", "auto", "ylim", cext, "yaxislocation", "left", "label", get (hcb, "ylabel"), "__vertical__", vertical, "layer", "top", args{:}); @@ -325,13 +325,13 @@ set (hi, "xdata", [cmin, cmax], "ydata", [0,1], "cdata", [1 : clen]); if (mirror) set (hcb, "ytick", [], "ylim", [-0.5, 1.5], - "xtickmode", "auto", "xlim", cext, + "xtickmode", "auto", "xlim", cext, "xaxislocation", "top", "label", get (hcb, "xlabel"), "__vertical__", vertical, "layer", "top", args{:}); else set (hcb, "ytick", [], "ylim", [-0.5, 1.5], - "xtickmode", "auto", "xlim", cext, + "xtickmode", "auto", "xlim", cext, "xaxislocation", "bottom", "label", get (hcb, "xlabel"), "__vertical__", vertical, "layer", "top", args{:});
--- a/scripts/plot/util/findobj.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/plot/util/findobj.m Mon Jan 22 02:17:46 2018 -0500 @@ -72,7 +72,7 @@ ## property values, where property values that match ## @code{regexp (@var{prop_value}, @var{pattern})} are returned. ## -## Finally, objects which have a property name can be found with the +## Finally, objects which have a property name can be found with the ## @qcode{"-property"} option. For example, code to locate objects with a ## @qcode{"meshstyle"} property is ##
--- a/scripts/statistics/bounds.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/statistics/bounds.m Mon Jan 22 02:17:46 2018 -0500 @@ -73,13 +73,13 @@ if (nanflag) nanflag = strcmp (nanflag, "includenan"); endif - + s = min (x, [], dim); l = max (x, [], dim); if (nanflag) - nanidx = any (isnan (x), dim); - s(nanidx) = NaN; - l(nanidx) = NaN; + nanidx = any (isnan (x), dim); + s(nanidx) = NaN; + l(nanidx) = NaN; endif endfunction
--- a/scripts/statistics/corrcoef.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/statistics/corrcoef.m Mon Jan 22 02:17:46 2018 -0500 @@ -163,7 +163,7 @@ endif r(i,j) = r(j,i) = corr (xi, xj); if (calc_pval) - df = m - 2; + df = m - 2; stat = sqrt (df) * r(i,j) / sqrt (1 - r(i,j)^2); cdf = tcdf (stat, df); p(i,j) = p(j,i) = 2 * min (cdf, 1 - cdf);
--- a/scripts/strings/erase.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/strings/erase.m Mon Jan 22 02:17:46 2018 -0500 @@ -53,8 +53,8 @@ ## @result{} "b" ## @end example ## -## See @code{strrep} for processing overlaps. -## +## See @code{strrep} for processing overlaps. +## ## @seealso{strrep, regexprep} ## @end deftypefn @@ -66,9 +66,9 @@ if (nargin != 2) print_usage (); endif - + ischarmatrix = false; - if (ischar (str)) + if (ischar (str)) if (rows (str) > 1) ## Convert to cell. Can't use cellstr which trims spaces. str = mat2cell (str, ones (1, rows (str))); @@ -78,7 +78,7 @@ error ("erase: STR must be a string or cell array of strings"); endif - if (ischar (ptn)) + if (ischar (ptn)) if (rows (ptn) > 1) warning ("Octave:erase:chararray", "erase: using character array for PTN is not recommended, consider cell array of strings instead"); @@ -137,7 +137,7 @@ %!error erase () %!error erase ("a") %!error erase ("a", "b", "c") -%!error <STR must be a string> erase ([1], "foo") -%!error <PTN must be a string> erase ("foo", [1]) +%!error <STR must be a string> erase ([1], "foo") +%!error <PTN must be a string> erase ("foo", [1]) %!warning <using character array for PTN is not recommended> %! erase ("a", ["a";"b"]);
--- a/scripts/strings/isstring.m Sun Jan 21 10:39:19 2018 -0500 +++ b/scripts/strings/isstring.m Mon Jan 22 02:17:46 2018 -0500 @@ -46,7 +46,7 @@ %!assert (isstring ([]), false) %!assert (isstring (1), false) %!assert (isstring ('a'), false) -## FIXME: when string arrays are implemented, this should return true. +## FIXME: when string arrays are implemented, this should return true. #%!assert (isstring ("b"), true) %!assert (isstring ({'a'}), false) %!assert (isstring ({"b"}), false)
--- a/src/mkoctfile.in.cc Sun Jan 21 10:39:19 2018 -0500 +++ b/src/mkoctfile.in.cc Mon Jan 22 02:17:46 2018 -0500 @@ -632,9 +632,9 @@ } else if (starts_with (arg, "-")) { - // Pass through any unrecognized options + // Pass through any unrecognized options. pass_on_options += (' ' + arg); - // Check for an additional argument following the option + // Check for an additional argument following the option. if (i < argc-1) { arg = argv[i+1];