# HG changeset patch # User Rik # Date 1383195314 25200 # Node ID fffd0c0ca2dc99d8ebc0ecb43b923104522b4dc7 # Parent ef4fc092c86b8b60660e03edf4cf2e65eee875b0 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. diff -r ef4fc092c86b -r fffd0c0ca2dc libinterp/corefcn/rand.cc --- 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); diff -r ef4fc092c86b -r fffd0c0ca2dc liboctave/array/CSparse.cc --- 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++) { diff -r ef4fc092c86b -r fffd0c0ca2dc liboctave/array/dSparse.cc --- 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) */