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--;
--- 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);
--- 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";