Mercurial > hg > octave-terminal
changeset 14844:5bc9b9cb4362
maint: Use Octave coding conventions for cuddled parenthesis in retval assignments.
* hello.cc, Array-util.cc, CNDArray.cc, CSparse.cc, Sparse.cc, dNDArray.cc,
dSparse.cc, fCNDArray.cc, fNDArray.cc, lo-specfun.cc, list_primes.m,
rectangle_lw.m, sinetone.m, amd.cc, bsxfun.cc, ccolamd.cc, eigs.cc, lu.cc,
qz.cc, spparms.cc, oct-stream.cc: Use Octave coding conventions for cuddled
parenthesis in retval assignments.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Fri, 06 Jul 2012 14:00:25 -0700 |
parents | 7d4f87c75dbb |
children | 460a3c6d8bf1 |
files | examples/hello.cc liboctave/Array-util.cc liboctave/CNDArray.cc liboctave/CSparse.cc liboctave/Sparse.cc liboctave/dNDArray.cc liboctave/dSparse.cc liboctave/fCNDArray.cc liboctave/fNDArray.cc liboctave/lo-specfun.cc scripts/miscellaneous/list_primes.m scripts/signal/private/rectangle_lw.m scripts/signal/sinetone.m src/DLD-FUNCTIONS/amd.cc src/DLD-FUNCTIONS/bsxfun.cc src/DLD-FUNCTIONS/ccolamd.cc src/DLD-FUNCTIONS/eigs.cc src/DLD-FUNCTIONS/lu.cc src/DLD-FUNCTIONS/qz.cc src/DLD-FUNCTIONS/spparms.cc src/oct-stream.cc |
diffstat | 21 files changed, 81 insertions(+), 81 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/hello.cc +++ b/examples/hello.cc @@ -89,9 +89,9 @@ for (int i = 0; i < nargin; i++) { - octave_value tmp = args (i); + octave_value tmp = args(i); tmp.print (octave_stdout); - retval (nargin-i-1) = tmp; + retval(nargin-i-1) = tmp; } return retval;
--- a/liboctave/Array-util.cc +++ b/liboctave/Array-util.cc @@ -236,7 +236,7 @@ Array<octave_idx_type> retval (a.dims ()); for (octave_idx_type i = 0; i < a.length (); i++) - retval (i) = a(i).elem (0); + retval(i) = a(i).elem (0); return retval; } @@ -247,7 +247,7 @@ Array<idx_vector> retval (dim_vector (len, 1)); for (octave_idx_type i = 0; i < len; i++) - retval (i) = tmp[i]; + retval(i) = tmp[i]; return retval; }
--- a/liboctave/CNDArray.cc +++ b/liboctave/CNDArray.cc @@ -245,7 +245,7 @@ F77_FUNC (zfftf, ZFFTF) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i]; + retval((i + k*npts)*stride + j*dist) = tmp[i]; } } @@ -292,7 +292,7 @@ F77_FUNC (zfftb, ZFFTB) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i] / + retval((i + k*npts)*stride + j*dist) = tmp[i] / static_cast<double> (npts); } } @@ -333,12 +333,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftf, ZFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -381,12 +381,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftb, ZFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<double> (npts); } } @@ -429,12 +429,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftf, ZFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -476,12 +476,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftb, ZFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<double> (npts); } }
--- a/liboctave/CSparse.cc +++ b/liboctave/CSparse.cc @@ -1639,7 +1639,7 @@ } for (octave_idx_type i = 0; i < nc; i++) - retval (perm[i], j) = work[i]; + retval(perm[i], j) = work[i]; } if (calc_cond) @@ -2162,7 +2162,7 @@ } for (octave_idx_type i = 0; i < nc; i++) - retval (perm[i], j) = work[i]; + retval(perm[i], j) = work[i]; } if (calc_cond) @@ -2695,7 +2695,7 @@ } for (octave_idx_type i = 0; i < nc; i++) - retval (i, j) = work[i]; + retval(i, j) = work[i]; } if (calc_cond) @@ -3259,7 +3259,7 @@ } for (octave_idx_type i = 0; i < nc; i++) - retval (i, j) = work[i]; + retval(i, j) = work[i]; } if (calc_cond)
--- a/liboctave/Sparse.cc +++ b/liboctave/Sparse.cc @@ -2603,7 +2603,7 @@ { for (octave_idx_type j = 0, nc = cols (); j < nc; j++) for (octave_idx_type i = cidx(j), iu = cidx(j+1); i < iu; i++) - retval (ridx(i), j) = data (i); + retval(ridx(i), j) = data (i); } return retval;
--- a/liboctave/dNDArray.cc +++ b/liboctave/dNDArray.cc @@ -286,7 +286,7 @@ F77_FUNC (zfftf, ZFFTF) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i]; + retval((i + k*npts)*stride + j*dist) = tmp[i]; } } @@ -333,7 +333,7 @@ F77_FUNC (zfftb, ZFFTB) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i] / + retval((i + k*npts)*stride + j*dist) = tmp[i] / static_cast<double> (npts); } } @@ -374,12 +374,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftf, ZFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -422,12 +422,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftb, ZFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<double> (npts); } } @@ -470,12 +470,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftf, ZFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -517,12 +517,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (zfftb, ZFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<double> (npts); } }
--- a/liboctave/dSparse.cc +++ b/liboctave/dSparse.cc @@ -2783,7 +2783,7 @@ } for (octave_idx_type i = 0; i < nc; i++) - retval (i, j) = work[i]; + retval(i, j) = work[i]; } if (calc_cond) @@ -3349,7 +3349,7 @@ } for (octave_idx_type i = 0; i < nc; i++) - retval (i, j) = cwork[i]; + retval(i, j) = cwork[i]; } if (calc_cond) @@ -5176,7 +5176,7 @@ } for (octave_idx_type i = 0; i < b_nr; i++) - retval (i, j) = Complex (Bx[i], Bz[i]); + retval(i, j) = Complex (Bx[i], Bz[i]); } } } @@ -5310,7 +5310,7 @@ F77_CHAR_ARG_LEN (1))); for (octave_idx_type i = 0; i < nr; i++) - retval (i, j) = Complex (Bx[i], Bz[i]); + retval(i, j) = Complex (Bx[i], Bz[i]); } } } @@ -6487,7 +6487,7 @@ } for (octave_idx_type i = 0; i < b_nr; i++) - retval (i, j) = Complex (Xx[i], Xz[i]); + retval(i, j) = Complex (Xx[i], Xz[i]); } UMFPACK_DNAME (report_info) (control, info);
--- a/liboctave/fCNDArray.cc +++ b/liboctave/fCNDArray.cc @@ -242,7 +242,7 @@ F77_FUNC (cfftf, CFFTF) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i]; + retval((i + k*npts)*stride + j*dist) = tmp[i]; } } @@ -289,7 +289,7 @@ F77_FUNC (cfftb, CFFTB) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i] / + retval((i + k*npts)*stride + j*dist) = tmp[i] / static_cast<float> (npts); } } @@ -330,12 +330,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftf, CFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -378,12 +378,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftb, CFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<float> (npts); } } @@ -426,12 +426,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftf, CFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -473,12 +473,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftb, CFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<float> (npts); } }
--- a/liboctave/fNDArray.cc +++ b/liboctave/fNDArray.cc @@ -246,7 +246,7 @@ F77_FUNC (cfftf, CFFTF) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i]; + retval((i + k*npts)*stride + j*dist) = tmp[i]; } } @@ -293,7 +293,7 @@ F77_FUNC (cfftb, CFFTB) (npts, tmp, pwsave); for (octave_idx_type i = 0; i < npts; i++) - retval ((i + k*npts)*stride + j*dist) = tmp[i] / + retval((i + k*npts)*stride + j*dist) = tmp[i] / static_cast<float> (npts); } } @@ -334,12 +334,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftf, CFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -382,12 +382,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftb, CFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<float> (npts); } } @@ -430,12 +430,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftf, CFFTF) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l]; + retval((l + k*npts)*stride + j*dist) = prow[l]; } } @@ -477,12 +477,12 @@ octave_quit (); for (octave_idx_type l = 0; l < npts; l++) - prow[l] = retval ((l + k*npts)*stride + j*dist); + prow[l] = retval((l + k*npts)*stride + j*dist); F77_FUNC (cfftb, CFFTB) (npts, prow, pwsave); for (octave_idx_type l = 0; l < npts; l++) - retval ((l + k*npts)*stride + j*dist) = prow[l] / + retval((l + k*npts)*stride + j*dist) = prow[l] / static_cast<float> (npts); } }
--- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -1986,7 +1986,7 @@ ierr.resize (dv); for (octave_idx_type i = 0; i < nel; i++) - retval (i) = airy (z(i), deriv, scaled, ierr(i)); + retval(i) = airy (z(i), deriv, scaled, ierr(i)); return retval; } @@ -2001,7 +2001,7 @@ ierr.resize (dv); for (octave_idx_type i = 0; i < nel; i++) - retval (i) = biry (z(i), deriv, scaled, ierr(i)); + retval(i) = biry (z(i), deriv, scaled, ierr(i)); return retval; } @@ -2116,7 +2116,7 @@ ierr.resize (dv); for (octave_idx_type i = 0; i < nel; i++) - retval (i) = airy (z(i), deriv, scaled, ierr(i)); + retval(i) = airy (z(i), deriv, scaled, ierr(i)); return retval; } @@ -2131,7 +2131,7 @@ ierr.resize (dv); for (octave_idx_type i = 0; i < nel; i++) - retval (i) = biry (z(i), deriv, scaled, ierr(i)); + retval(i) = biry (z(i), deriv, scaled, ierr(i)); return retval; }
--- a/scripts/miscellaneous/list_primes.m +++ b/scripts/miscellaneous/list_primes.m @@ -51,8 +51,8 @@ endif retval = zeros (1, n); - retval (1) = 2; - retval (2) = 3; + retval(1) = 2; + retval(2) = 3; n = n - 2; i = 3; @@ -75,7 +75,7 @@ endwhile if (is_prime) - retval (i++) = p; + retval(i++) = p; n--; endif p = p + 2;
--- a/scripts/signal/private/rectangle_lw.m +++ b/scripts/signal/private/rectangle_lw.m @@ -34,6 +34,6 @@ retval = zeros (n, 1); t = floor (1 / b); - retval (1:t, 1) = ones (t, 1); + retval(1:t, 1) = ones (t, 1); endfunction
--- a/scripts/signal/sinetone.m +++ b/scripts/signal/sinetone.m @@ -58,7 +58,7 @@ retval = zeros (ns, n); for k = 1:n - retval (:, k) = ampl(k) * sin (2 * pi * (1:ns) / rate * freq(k))'; + retval(:, k) = ampl(k) * sin (2 * pi * (1:ns) / rate * freq(k))'; endfor endfunction
--- a/src/DLD-FUNCTIONS/amd.cc +++ b/src/DLD-FUNCTIONS/amd.cc @@ -190,7 +190,7 @@ for (octave_idx_type i = 0; i < n_col; i++) Pout.xelem (i) = P[i] + 1; - retval (0) = Pout; + retval(0) = Pout; } } }
--- a/src/DLD-FUNCTIONS/bsxfun.cc +++ b/src/DLD-FUNCTIONS/bsxfun.cc @@ -630,7 +630,7 @@ #define BSXEND(T) \ (have_ ## T) \ - retval (0) = result_ ## T; + retval(0) = result_ ## T; if BSXEND(NDArray) else if BSXEND(ComplexNDArray)
--- a/src/DLD-FUNCTIONS/ccolamd.cc +++ b/src/DLD-FUNCTIONS/ccolamd.cc @@ -304,7 +304,7 @@ for (octave_idx_type i = 0; i < n_col; i++) out_perm(i) = p [i] + 1; - retval (0) = out_perm; + retval(0) = out_perm; // print stats if spumoni > 0 if (spumoni > 0) @@ -536,7 +536,7 @@ for (octave_idx_type i = 0; i < n_col; i++) out_perm(i) = perm [i] + 1; - retval (0) = out_perm; + retval(0) = out_perm; // Return the stats vector if (nargout == 2)
--- a/src/DLD-FUNCTIONS/eigs.cc +++ b/src/DLD-FUNCTIONS/eigs.cc @@ -613,7 +613,7 @@ } if (nargout < 2) - retval (0) = eig_val; + retval(0) = eig_val; else { retval(2) = double (info); @@ -646,7 +646,7 @@ } if (nargout < 2) - retval (0) = eig_val; + retval(0) = eig_val; else { retval(2) = double (info); @@ -694,7 +694,7 @@ } if (nargout < 2) - retval (0) = eig_val; + retval(0) = eig_val; else { retval(2) = double (info); @@ -740,7 +740,7 @@ } if (nargout < 2) - retval (0) = eig_val; + retval(0) = eig_val; else { retval(2) = double (info);
--- a/src/DLD-FUNCTIONS/lu.cc +++ b/src/DLD-FUNCTIONS/lu.cc @@ -226,7 +226,7 @@ SparseLU fact (m, Qinit, thres, false, true); if (nargout < 2) - retval (0) = fact.Y (); + retval(0) = fact.Y (); else { PermMatrix P = fact.Pr_mat (); @@ -246,7 +246,7 @@ SparseLU fact (m, Qinit, thres, false, true); if (vecout) - retval (2) = fact.Pr_vec (); + retval(2) = fact.Pr_vec (); else retval(2) = fact.Pr_mat (); @@ -296,7 +296,7 @@ SparseComplexLU fact (m, Qinit, thres, false, true); if (nargout < 2) - retval (0) = fact.Y (); + retval(0) = fact.Y (); else { PermMatrix P = fact.Pr_mat (); @@ -316,7 +316,7 @@ SparseComplexLU fact (m, Qinit, thres, false, true); if (vecout) - retval (2) = fact.Pr_vec (); + retval(2) = fact.Pr_vec (); else retval(2) = fact.Pr_mat ();
--- a/src/DLD-FUNCTIONS/qz.cc +++ b/src/DLD-FUNCTIONS/qz.cc @@ -1196,7 +1196,7 @@ if (complex_case) { #ifdef DEBUG - std::cout << "qz: retval (1) = cbb = " << std::endl; + std::cout << "qz: retval(1) = cbb = " << std::endl; octave_print_internal (std::cout, cbb, 0); std::cout << std::endl << "qz: retval(0) = caa = " <<std::endl; octave_print_internal (std::cout, caa, 0); @@ -1208,7 +1208,7 @@ else { #ifdef DEBUG - std::cout << "qz: retval (1) = bb = " << std::endl; + std::cout << "qz: retval(1) = bb = " << std::endl; octave_print_internal (std::cout, bb, 0); std::cout << std::endl << "qz: retval(0) = aa = " <<std::endl; octave_print_internal (std::cout, aa, 0);
--- a/src/DLD-FUNCTIONS/spparms.cc +++ b/src/DLD-FUNCTIONS/spparms.cc @@ -113,8 +113,8 @@ retval(0) = octave_sparse_params::get_vals (); else if (nargout == 2) { - retval (1) = octave_sparse_params::get_vals (); - retval (0) = octave_sparse_params::get_keys (); + retval(1) = octave_sparse_params::get_vals (); + retval(0) = octave_sparse_params::get_keys (); } else error ("spparms: too many output arguments"); @@ -138,7 +138,7 @@ if (xisnan (val)) error ("spparms: KEY not recognized"); else - retval (0) = val; + retval(0) = val; } } else