Mercurial > hg > octave-lojdl
changeset 15017:dd4ad69e4ab9
maint: Fix a few Octave coding convention violations.
* gzip.m, findfigs.m, hdl2struct.m: Use parentheses around if block test.
* graphics.cc, ov-class.cc: Use space after if and before first parenthesis
author | Rik <rik@octave.org> |
---|---|
date | Wed, 25 Jul 2012 20:58:21 -0700 |
parents | 005cb78e1dd1 |
children | 3d8ace26c5b4 |
files | scripts/miscellaneous/gzip.m scripts/plot/findfigs.m scripts/plot/hdl2struct.m src/graphics.cc src/ov-class.cc |
diffstat | 5 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/miscellaneous/gzip.m +++ b/scripts/miscellaneous/gzip.m @@ -51,10 +51,10 @@ %! mkdir (dirname); %! entry = gzip (filename, dirname); %! [path, basename, extension] = fileparts (filename); -%! if ! strcmp (entry, [dirname, filesep, basename, extension, ".gz"]) +%! if (! strcmp (entry, [dirname, filesep, basename, extension, ".gz"])) %! error ("gzipped file does not match expected name!"); %! endif -%! if ! exist (entry, "file") +%! if (! exist (entry, "file")) %! error ("gzipped file cannot be found!"); %! endif %! gunzip (entry);
--- a/scripts/plot/findfigs.m +++ b/scripts/plot/findfigs.m @@ -47,7 +47,7 @@ screensize(3:4) -= margin; for i = 1:numel (figh) - if strcmp (get (figh(i), "visible"), "on") + if (strcmp (get (figh(i), "visible"), "on")) units = get (figh(i), "units"); unwind_protect
--- a/scripts/plot/hdl2struct.m +++ b/scripts/plot/hdl2struct.m @@ -33,7 +33,7 @@ endif hiddenh = get (0, "showhiddenhandles"); - if strcmp (hiddenh, "on") + if (strcmp (hiddenh, "on")) set (0, "showhiddenhandles", "off"); endif @@ -82,7 +82,7 @@ if (strcmp (main.type, "axes")) par = main.parent; lg = findobj (par, "-depth", 1, "tag", "legend"); - if !isempty (lg) + if (! isempty (lg)) idx = arrayfun (@(x) get(x).userdata.handle(end) == h, lg); lg = lg(find (idx)); endif @@ -150,7 +150,7 @@ prop = fields{nflds}; val = obj.(fields{nflds}); ii++; - if !any (strcmp (prop, forbid)) + if (! any (strcmp (prop, forbid))) prpstr.(prop) = val; endif nflds--;