changeset 17812:fffd0c0ca2dc

maint: A few Octave coding convention tweaks * libinterp/corefcn/rand.cc: Use space before parentheses in %!test function call. * liboctave/array/CSparse.cc: Change "found [...]" to "found[...]". * liboctave/array/dSparse.cc: Change "found [...]" to "found[...]". Use space before parentheses in %!test function call.
author Rik <rik@octave.org>
date Wed, 30 Oct 2013 21:55:14 -0700
parents ef4fc092c86b
children 0a887758d1cc
files libinterp/corefcn/rand.cc liboctave/array/CSparse.cc liboctave/array/dSparse.cc
diffstat 3 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/rand.cc	Wed Oct 30 19:18:25 2013 -0400
+++ b/libinterp/corefcn/rand.cc	Wed Oct 30 21:55:14 2013 -0700
@@ -1245,7 +1245,7 @@
 %!assert (length (randperm (20,10)), 10)
 
 ## Test biggish N (bug #39378)
-%!assert (length (randperm(30000^2, 100000)), 100000);
+%!assert (length (randperm (30000^2, 100000)), 100000)
 
 %!test
 %! rand ("seed", 0);
--- a/liboctave/array/CSparse.cc	Wed Oct 30 19:18:25 2013 -0400
+++ b/liboctave/array/CSparse.cc	Wed Oct 30 21:55:14 2013 -0700
@@ -345,16 +345,16 @@
       OCTAVE_LOCAL_BUFFER (octave_idx_type, found, nr);
 
       for (octave_idx_type i = 0; i < nr; i++)
-        found [i] = 0;
+        found[i] = 0;
 
       for (octave_idx_type j = 0; j < nc; j++)
         for (octave_idx_type i = cidx(j); i < cidx(j+1); i++)
-          if (found [ridx (i)] == -j)
-            found [ridx (i)] = -j - 1;
+          if (found[ridx (i)] == -j)
+            found[ridx (i)] = -j - 1;
 
       for (octave_idx_type i = 0; i < nr; i++)
-        if (found [i] > -nc && found [i] < 0)
-          idx_arg.elem (i) = -found [i];
+        if (found[i] > -nc && found[i] < 0)
+          idx_arg.elem (i) = -found[i];
 
       for (octave_idx_type j = 0; j < nc; j++)
         {
@@ -502,16 +502,16 @@
       OCTAVE_LOCAL_BUFFER (octave_idx_type, found, nr);
 
       for (octave_idx_type i = 0; i < nr; i++)
-        found [i] = 0;
+        found[i] = 0;
 
       for (octave_idx_type j = 0; j < nc; j++)
         for (octave_idx_type i = cidx(j); i < cidx(j+1); i++)
-          if (found [ridx (i)] == -j)
-            found [ridx (i)] = -j - 1;
+          if (found[ridx (i)] == -j)
+            found[ridx (i)] = -j - 1;
 
       for (octave_idx_type i = 0; i < nr; i++)
-        if (found [i] > -nc && found [i] < 0)
-          idx_arg.elem (i) = -found [i];
+        if (found[i] > -nc && found[i] < 0)
+          idx_arg.elem (i) = -found[i];
 
       for (octave_idx_type j = 0; j < nc; j++)
         {
--- a/liboctave/array/dSparse.cc	Wed Oct 30 19:18:25 2013 -0400
+++ b/liboctave/array/dSparse.cc	Wed Oct 30 21:55:14 2013 -0700
@@ -357,16 +357,16 @@
       OCTAVE_LOCAL_BUFFER (octave_idx_type, found, nr);
 
       for (octave_idx_type i = 0; i < nr; i++)
-        found [i] = 0;
+        found[i] = 0;
 
       for (octave_idx_type j = 0; j < nc; j++)
         for (octave_idx_type i = cidx(j); i < cidx(j+1); i++)
-          if (found [ridx (i)] == -j)
-            found [ridx (i)] = -j - 1;
+          if (found[ridx (i)] == -j)
+            found[ridx (i)] = -j - 1;
 
       for (octave_idx_type i = 0; i < nr; i++)
-        if (found [i] > -nc && found [i] < 0)
-          idx_arg.elem (i) = -found [i];
+        if (found[i] > -nc && found[i] < 0)
+          idx_arg.elem (i) = -found[i];
 
       for (octave_idx_type j = 0; j < nc; j++)
         {
@@ -508,16 +508,16 @@
       OCTAVE_LOCAL_BUFFER (octave_idx_type, found, nr);
 
       for (octave_idx_type i = 0; i < nr; i++)
-        found [i] = 0;
+        found[i] = 0;
 
       for (octave_idx_type j = 0; j < nc; j++)
         for (octave_idx_type i = cidx(j); i < cidx(j+1); i++)
-          if (found [ridx (i)] == -j)
-            found [ridx (i)] = -j - 1;
+          if (found[ridx (i)] == -j)
+            found[ridx (i)] = -j - 1;
 
       for (octave_idx_type i = 0; i < nr; i++)
-        if (found [i] > -nc && found [i] < 0)
-          idx_arg.elem (i) = -found [i];
+        if (found[i] > -nc && found[i] < 0)
+          idx_arg.elem (i) = -found[i];
 
       for (octave_idx_type j = 0; j < nc; j++)
         {
@@ -677,8 +677,8 @@
 
 /*
 
-%!assert(nnz(real(sparse([1i,1]))),1)
-%!assert(nnz(real(sparse([1i,1]))),1)
+%!assert (nnz (real (sparse ([1i,1]))), 1)
+%!assert (nnz (real (sparse ([1i,1]))), 1)
 
 */