# HG changeset patch # User Rik # Date 1343275101 25200 # Node ID dd4ad69e4ab9ef46d2ecdfc991493a5f38af952c # Parent 005cb78e1dd127981b0090d10eacdf3763ee0978 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 diff --git a/scripts/miscellaneous/gzip.m b/scripts/miscellaneous/gzip.m --- 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); diff --git a/scripts/plot/findfigs.m b/scripts/plot/findfigs.m --- 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 diff --git a/scripts/plot/hdl2struct.m b/scripts/plot/hdl2struct.m --- 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--; diff --git a/src/graphics.cc b/src/graphics.cc --- a/src/graphics.cc +++ b/src/graphics.cc @@ -6833,9 +6833,9 @@ v(1) += delta_el; - if(v(1) > 90) + if (v(1) > 90) v(1) = 90; - if(v(1) < -90) + if (v(1) < -90) v(1) = -90; v(0) = fmod (v(0) - delta_az + 720,360); diff --git a/src/ov-class.cc b/src/ov-class.cc --- a/src/ov-class.cc +++ b/src/ov-class.cc @@ -1277,7 +1277,7 @@ if ( val(0).is_object () ) { dbgstr = "blork"; - if( key == val(0).class_name () ) + if ( key == val(0).class_name () ) { might_have_inheritance = true; dbgstr = "cork";