# HG changeset patch # User Rik # Date 1386223998 28800 # Node ID 8e056300994bd0cc8aaf3da435c806cb6346fc39 # Parent 938f0133904329073b558294303380909c36b920 Follow coding convention of defining and initializing only 1 variable per line in liboctave. * liboctave/array/Array-b.cc, liboctave/array/Array-util.cc, liboctave/array/Array.cc, liboctave/array/CDiagMatrix.cc, liboctave/array/CMatrix.cc, liboctave/array/CSparse.cc, liboctave/array/MDiagArray2.cc, liboctave/array/MatrixType.cc, liboctave/array/PermMatrix.cc, liboctave/array/Sparse.cc, liboctave/array/Sparse.h, liboctave/array/boolSparse.cc, liboctave/array/dDiagMatrix.cc, liboctave/array/dMatrix.cc, liboctave/array/dSparse.cc, liboctave/array/dim-vector.cc, liboctave/array/fCDiagMatrix.cc, liboctave/array/fCMatrix.cc, liboctave/array/fDiagMatrix.cc, liboctave/array/fMatrix.cc, liboctave/array/idx-vector.cc, liboctave/array/idx-vector.h, liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxQR.cc, liboctave/numeric/base-qr.cc, liboctave/numeric/bsxfun-defs.cc, liboctave/numeric/bsxfun.h, liboctave/numeric/dbleLU.cc, liboctave/numeric/dbleQR.cc, liboctave/numeric/fCmplxLU.cc, liboctave/numeric/fCmplxQR.cc, liboctave/numeric/floatLU.cc, liboctave/numeric/floatQR.cc, liboctave/numeric/lo-specfun.cc, liboctave/numeric/oct-convn.cc, liboctave/numeric/oct-norm.cc, liboctave/numeric/sparse-dmsolve.cc, liboctave/operators/mx-inlines.cc, liboctave/operators/mx-op-defs.h, liboctave/util/caseless-str.h, liboctave/util/kpse.cc, liboctave/util/lo-utils.cc, liboctave/util/oct-binmap.h, liboctave/util/oct-cmplx.h, liboctave/util/oct-inttypes.cc, liboctave/util/oct-inttypes.h, liboctave/util/oct-sort.cc: Follow coding convention of defining and initializing only 1 variable per line in liboctave. diff -r 938f01339043 -r 8e056300994b liboctave/array/Array-b.cc --- a/liboctave/array/Array-b.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/Array-b.cc Wed Dec 04 22:13:18 2013 -0800 @@ -52,7 +52,8 @@ // FIXME: This is essentially a simple bucket sort. // Can it be efficiently done by std::partition? OCTAVE_LOCAL_BUFFER (octave_idx_type, jdx, nel); - octave_idx_type k = 0, l = 0; + octave_idx_type k = 0; + octave_idx_type l = 0; for (octave_idx_type i = 0; i < nel; i++) { if (data[i] == desc) diff -r 938f01339043 -r 8e056300994b liboctave/array/Array-util.cc --- a/liboctave/array/Array-util.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/Array-util.cc Wed Dec 04 22:13:18 2013 -0800 @@ -423,9 +423,11 @@ dim_vector zero_dims_inquire (const Array& ia, const dim_vector& rhdv) { - int ial = ia.length (), rhdvl = rhdv.length (); + int ial = ia.length (); + int rhdvl = rhdv.length (); dim_vector rdv = dim_vector::alloc (ial); - bool *scalar = new bool [ial], *colon = new bool [ial]; + bool *scalar = new bool [ial]; + bool *colon = new bool [ial]; // Mark scalars and colons, count non-scalar indices. int nonsc = 0; bool all_colons = true; @@ -479,7 +481,8 @@ zero_dims_inquire (const idx_vector& i, const idx_vector& j, const dim_vector& rhdv) { - bool icol = i.is_colon (), jcol = j.is_colon (); + bool icol = i.is_colon (); + bool jcol = j.is_colon (); dim_vector rdv; if (icol && jcol && rhdv.length () == 2) { @@ -563,10 +566,12 @@ else if (all_ranges && clen != 0) { // All ranges case - the result is a range. - octave_idx_type start = 0, step = 0; + octave_idx_type start = 0; + octave_idx_type step = 0; for (octave_idx_type i = len - 1; i >= 0; i--) { - octave_idx_type xstart = idxa(i)(0), xstep = idxa(i)(1) - xstart; + octave_idx_type xstart = idxa(i)(0); + octave_idx_type xstep = idxa(i)(1) - xstart; start = start * dvx(i) + xstart; step = step * dvx(i) + xstep; } @@ -597,7 +602,8 @@ Array ind2sub (const dim_vector& dv, const idx_vector& idx) { - octave_idx_type len = idx.length (0), n = dv.length (); + octave_idx_type len = idx.length (0); + octave_idx_type n = dv.length (); Array retval (dim_vector (n, 1)); octave_idx_type numel = dv.numel (); diff -r 938f01339043 -r 8e056300994b liboctave/array/Array.cc --- a/liboctave/array/Array.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/Array.cc Wed Dec 04 22:13:18 2013 -0800 @@ -270,7 +270,9 @@ Array Array::page (octave_idx_type k) const { - octave_idx_type r = dimensions(0), c = dimensions (1), p = r*c; + octave_idx_type r = dimensions(0); + octave_idx_type c = dimensions(1); + octave_idx_type p = r*c; #ifdef BOUNDS_CHECKING if (k < 0 || k > dimensions.numel (2)) gripe_index_out_of_range (3, 3, k+1, dimensions.numel (2)); @@ -393,7 +395,8 @@ { if (lev == 0) { - octave_idx_type step = stride[0], len = dim[0]; + octave_idx_type step = stride[0]; + octave_idx_type len = dim[0]; if (step == 1) { copy_or_memcpy (len, src, dest); @@ -411,7 +414,8 @@ dest = blk_trans (src, dest, dim[1], dim[0]); else { - octave_idx_type step = stride[lev], len = dim[lev]; + octave_idx_type step = stride[lev]; + octave_idx_type len = dim[lev]; for (octave_idx_type i = 0, j = 0; i < len; i++, j+= step) dest = do_permute (src + i * step, dest, lev-1); } @@ -568,7 +572,8 @@ dest += idx[0].index (src, dim[0], dest); else { - octave_idx_type nn = idx[lev].length (dim[lev]), d = cdim[lev]; + octave_idx_type nn = idx[lev].length (dim[lev]); + octave_idx_type d = cdim[lev]; for (octave_idx_type i = 0; i < nn; i++) dest = do_index (src + d*idx[lev].xelem (i), dest, lev-1); } @@ -584,7 +589,8 @@ src += idx[0].assign (src, dim[0], dest); else { - octave_idx_type nn = idx[lev].length (dim[lev]), d = cdim[lev]; + octave_idx_type nn = idx[lev].length (dim[lev]); + octave_idx_type d = cdim[lev]; for (octave_idx_type i = 0; i < nn; i++) src = do_assign (src, dest + d*idx[lev].xelem (i), lev-1); } @@ -600,7 +606,8 @@ idx[0].fill (val, dim[0], dest); else { - octave_idx_type nn = idx[lev].length (dim[lev]), d = cdim[lev]; + octave_idx_type nn = idx[lev].length (dim[lev]); + octave_idx_type d = cdim[lev]; for (octave_idx_type i = 0; i < nn; i++) do_fill (val, dest + d*idx[lev].xelem (i), lev-1); } @@ -655,7 +662,8 @@ sext = cext + n; dext = sext + n; - octave_idx_type sld = ld, dld = ld; + octave_idx_type sld = ld; + octave_idx_type dld = ld; for (int j = 0; j < n; j++) { cext[j] = std::min (ndv(i+j), odv(i+j)); @@ -680,7 +688,9 @@ } else { - octave_idx_type sd = sext[lev-1], dd = dext[lev-1], k; + octave_idx_type sd = sext[lev-1]; + octave_idx_type dd = dext[lev-1]; + octave_idx_type k; for (k = 0; k < cext[lev]; k++) do_resize_fill (src + k * sd, dest + k * dd, rfv, lev - 1); @@ -771,7 +781,8 @@ { // Get dimensions, allowing Fortran indexing in the 2nd dim. dim_vector dv = dimensions.redim (2); - octave_idx_type r = dv(0), c = dv(1); + octave_idx_type r = dv(0); + octave_idx_type c = dv(1); Array retval; if (i.is_colon () && j.is_colon ()) @@ -786,7 +797,9 @@ if (j.extent (c) != c) gripe_index_out_of_range (2, 2, j.extent (c), c); // throws - octave_idx_type n = numel (), il = i.length (r), jl = j.length (c); + octave_idx_type n = numel (); + octave_idx_type il = i.length (r); + octave_idx_type jl = j.length (c); idx_vector ii (i); @@ -957,7 +970,8 @@ Array tmp = Array (dv); T *dest = tmp.fortran_vec (); - octave_idx_type n0 = std::min (n, nx), n1 = n - n0; + octave_idx_type n0 = std::min (n, nx); + octave_idx_type n1 = n - n0; copy_or_memcpy (n0, data (), dest); fill_or_memset (n1, rfv, dest + n0); @@ -975,14 +989,17 @@ { if (r >= 0 && c >= 0 && ndims () == 2) { - octave_idx_type rx = rows (), cx = columns (); + octave_idx_type rx = rows (); + octave_idx_type cx = columns (); if (r != rx || c != cx) { Array tmp = Array (dim_vector (r, c)); T *dest = tmp.fortran_vec (); - octave_idx_type r0 = std::min (r, rx), r1 = r - r0; - octave_idx_type c0 = std::min (c, cx), c1 = c - c0; + octave_idx_type r0 = std::min (r, rx); + octave_idx_type r1 = r - r0; + octave_idx_type c0 = std::min (c, cx); + octave_idx_type c1 = c - c0; const T *src = data (); if (r == rx) { @@ -1042,7 +1059,8 @@ Array tmp = *this; if (resize_ok) { - octave_idx_type n = numel (), nx = i.extent (n); + octave_idx_type n = numel (); + octave_idx_type nx = i.extent (n); if (n != nx) { if (i.is_scalar ()) @@ -1067,8 +1085,10 @@ if (resize_ok) { dim_vector dv = dimensions.redim (2); - octave_idx_type r = dv(0), c = dv(1); - octave_idx_type rx = i.extent (r), cx = j.extent (c); + octave_idx_type r = dv(0); + octave_idx_type c = dv(1); + octave_idx_type rx = i.extent (r); + octave_idx_type cx = j.extent (c); if (r != rx || c != cx) { if (i.is_scalar () && j.is_scalar ()) @@ -1119,7 +1139,8 @@ void Array::assign (const idx_vector& i, const Array& rhs, const T& rfv) { - octave_idx_type n = numel (), rhl = rhs.numel (); + octave_idx_type n = numel (); + octave_idx_type rhl = rhs.numel (); if (rhl == 1 || i.length (n) == rhl) { @@ -1190,7 +1211,8 @@ } bool isfill = rhs.numel () == 1; - octave_idx_type il = i.length (rdv(0)), jl = j.length (rdv(1)); + octave_idx_type il = i.length (rdv(0)); + octave_idx_type jl = j.length (rdv(1)); rhdv.chop_all_singletons (); bool match = (isfill || (rhdv.length () == 2 && il == rhdv(0) && jl == rhdv(1))); @@ -1228,7 +1250,9 @@ else { // The actual work. - octave_idx_type n = numel (), r = dv (0), c = dv (1); + octave_idx_type n = numel (); + octave_idx_type r = dv(0); + octave_idx_type c = dv(1); idx_vector ii (i); const T* src = rhs.data (); @@ -1299,10 +1323,13 @@ } // Check whether LHS and RHS match, up to singleton dims. - bool match = true, all_colons = true, isfill = rhs.numel () == 1; + bool match = true; + bool all_colons = true; + bool isfill = rhs.numel () == 1; rhdv.chop_all_singletons (); - int j = 0, rhdvl = rhdv.length (); + int j = 0; + int rhdvl = rhdv.length (); for (int i = 0; i < ial; i++) { all_colons = all_colons && ia(i).is_colon_equiv (rdv(i)); @@ -1427,7 +1454,9 @@ if (i.is_cont_range (n, l, u)) { // Special case deleting a contiguous range. - octave_idx_type nd = n + l - u, dl = 1, du = 1; + octave_idx_type nd = n + l - u; + octave_idx_type dl = 1; + octave_idx_type du = 1; dim_vector rdv = dimensions; rdv(dim) = nd; for (int k = 0; k < dim; k++) dl *= dimensions(k); @@ -1776,7 +1805,8 @@ { // copy and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i]; @@ -1820,7 +1850,8 @@ // gather and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i*stride + offset]; @@ -1898,7 +1929,8 @@ { // copy and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i]; @@ -1956,7 +1988,8 @@ // gather and partition out NaNs. // FIXME: impact on integer types noticeable? - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; for (octave_idx_type i = 0; i < ns; i++) { T tmp = ov[i*stride + offset]; @@ -2056,7 +2089,8 @@ octave_sort lsort (safe_comparator (mode, *this, true)); - octave_idx_type r = rows (), c = cols (); + octave_idx_type r = rows (); + octave_idx_type c = cols (); idx = Array (dim_vector (r, 1)); @@ -2072,7 +2106,8 @@ { octave_sort lsort; - octave_idx_type r = rows (), c = cols (); + octave_idx_type r = rows (); + octave_idx_type c = cols (); if (r <= 1 || c == 0) return mode ? mode : ASCENDING; @@ -2086,7 +2121,8 @@ octave_idx_type i; for (i = 0; i < cols (); i++) { - T l = elem (0, i), u = elem (rows () - 1, i); + T l = elem (0, i); + T u = elem (rows () - 1, i); if (compare (l, u)) { if (mode == DESCENDING) @@ -2150,7 +2186,8 @@ Array Array::lookup (const Array& values, sortmode mode) const { - octave_idx_type n = numel (), nval = values.numel (); + octave_idx_type n = numel (); + octave_idx_type nval = values.numel (); octave_sort lsort; Array idx (values.dims ()); @@ -2194,7 +2231,8 @@ Array::nnz (void) const { const T *src = data (); - octave_idx_type nel = nelem (), retval = 0; + octave_idx_type nel = nelem (); + octave_idx_type retval = 0; const T zero = T (); for (octave_idx_type i = 0; i < nel; i++) if (src[i] != zero) @@ -2233,7 +2271,8 @@ if (backward) { // Do the search as a series of successive single-element searches. - octave_idx_type k = 0, l = nel - 1; + octave_idx_type k = 0; + octave_idx_type l = nel - 1; for (; k < n; k++) { for (; l >= 0 && src[l] == zero; l--) ; @@ -2250,7 +2289,8 @@ else { // Do the search as a series of successive single-element searches. - octave_idx_type k = 0, l = 0; + octave_idx_type k = 0; + octave_idx_type l = 0; for (; k < n; k++) { for (; l != nel && src[l] == zero; l++) ; @@ -2369,7 +2409,8 @@ for (octave_idx_type j = 0; j < iter; j++) { - octave_idx_type kl = 0, ku = ns; + octave_idx_type kl = 0; + octave_idx_type ku = ns; if (stride == 1) { diff -r 938f01339043 -r 8e056300994b liboctave/array/CDiagMatrix.cc --- a/liboctave/array/CDiagMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/CDiagMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -448,7 +448,8 @@ ComplexDiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -549,7 +550,8 @@ ComplexDiagMatrix::rcond (void) const { ColumnVector av = extract_diag (0).map (std::abs); - double amx = av.max (), amn = av.min (); + double amx = av.max (); + double amn = av.min (); return amx == 0 ? 0.0 : amn / amx; } diff -r 938f01339043 -r 8e056300994b liboctave/array/CMatrix.cc --- a/liboctave/array/CMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/CMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -3771,8 +3771,10 @@ { ComplexMatrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; - bool cja = transa == blas_conj_trans, cjb = transb == blas_conj_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; + bool cja = transa == blas_conj_trans; + bool cjb = transb == blas_conj_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3828,8 +3830,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = ComplexMatrix (a_nr, b_nc, 0.0); Complex *c = retval.fortran_vec (); diff -r 938f01339043 -r 8e056300994b liboctave/array/CSparse.cc --- a/liboctave/array/CSparse.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/CSparse.cc Wed Dec 04 22:13:18 2013 -0800 @@ -160,7 +160,8 @@ SparseComplexMatrix::SparseComplexMatrix (const ComplexDiagMatrix& a) : MSparse (a.rows (), a.cols (), a.length ()) { - octave_idx_type j = 0, l = a.length (); + octave_idx_type j = 0; + octave_idx_type l = a.length (); for (octave_idx_type i = 0; i < l; i++) { cidx (i) = j; @@ -777,7 +778,8 @@ if (calccond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nr; i++) { double tmp = std::abs (v[i]); @@ -1321,7 +1323,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = std::abs (data (i)); @@ -1412,7 +1415,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = std::abs (data (i)); @@ -1473,7 +1477,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nr; i++) { double tmp = std::abs (data (i)); @@ -1564,7 +1569,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = std::abs (data (i)); diff -r 938f01339043 -r 8e056300994b liboctave/array/MDiagArray2.cc --- a/liboctave/array/MDiagArray2.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/MDiagArray2.cc Wed Dec 04 22:13:18 2013 -0800 @@ -38,7 +38,8 @@ bool retval = this->rows () == this->cols (); if (retval) { - octave_idx_type len = this->length (), i = 0; + octave_idx_type len = this->length (); + octave_idx_type i = 0; for (; i < len; i++) if (DiagArray2::elem (i, i) != val) break; retval = i == len; diff -r 938f01339043 -r 8e056300994b liboctave/array/MatrixType.cc --- a/liboctave/array/MatrixType.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/MatrixType.cc Wed Dec 04 22:13:18 2013 -0800 @@ -91,7 +91,8 @@ { for (octave_idx_type i = 0; i < j; i++) { - double aij = a.elem (i,j), aji = a.elem (j,i); + double aij = a.elem (i,j); + double aji = a.elem (j,i); lower = lower && (aij == zero); upper = upper && (aji == zero); hermitian = hermitian && (aij == aji @@ -149,7 +150,8 @@ { for (octave_idx_type i = 0; i < j; i++) { - std::complex aij = a.elem (i,j), aji = a.elem (j,i); + std::complex aij = a.elem (i,j); + std::complex aji = a.elem (j,i); lower = lower && (aij == zero); upper = upper && (aji == zero); hermitian = hermitian && (aij == std::conj (aji) diff -r 938f01339043 -r 8e056300994b liboctave/array/PermMatrix.cc --- a/liboctave/array/PermMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/PermMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -119,7 +119,8 @@ for (octave_idx_type i = 0; i < len; i++) { - octave_idx_type j = p[i], k = q[i]; + octave_idx_type j = p[i]; + octave_idx_type k = q[i]; if (j != i) { p[k] = p[i]; @@ -191,7 +192,8 @@ PermMatrix operator *(const PermMatrix& a, const PermMatrix& b) { - const Array ia = a.pvec (), ib = b.pvec (); + const Array ia = a.pvec (); + const Array ib = b.pvec (); PermMatrix r; octave_idx_type n = a.columns (); if (n != b.rows ()) diff -r 938f01339043 -r 8e056300994b liboctave/array/Sparse.cc --- a/liboctave/array/Sparse.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/Sparse.cc Wed Dec 04 22:13:18 2013 -0800 @@ -144,7 +144,8 @@ { if (remove_zeros) { - octave_idx_type i = 0, k = 0; + octave_idx_type i = 0; + octave_idx_type k = 0; for (octave_idx_type j = 1; j <= ncols; j++) { octave_idx_type u = c[j]; @@ -303,7 +304,9 @@ dimensions = dim_vector (nr, nc); - octave_idx_type n = a.numel (), rl = r.length (nr), cl = c.length (nc); + octave_idx_type n = a.numel (); + octave_idx_type rl = r.length (nr); + octave_idx_type cl = c.length (nc); bool a_scalar = n == 1; if (a_scalar) { @@ -361,7 +364,8 @@ octave_quit (); - octave_idx_type k = -1, l = -1; + octave_idx_type k = -1; + octave_idx_type l = -1; if (sum_terms) { @@ -395,8 +399,10 @@ } else { - idx_vector rr = r, cc = c; - const octave_idx_type *rd = rr.raw (), *cd = cc.raw (); + idx_vector rr = r; + idx_vector cc = c; + const octave_idx_type *rd = rr.raw (); + const octave_idx_type *cd = cc.raw (); OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, ci, nc+1, 0); ci[0] = 0; // Bin counts of column indices. @@ -425,7 +431,8 @@ for (octave_idx_type j = 0; j < nc; j++) { std::sort (sidx + ci[j], sidx + ci[j+1]); - octave_idx_type l = -1, nzj = 0; + octave_idx_type l = -1; + octave_idx_type nzj = 0; // Count. for (octave_idx_type i = ci[j]; i < ci[j+1]; i++) { @@ -490,7 +497,8 @@ octave_quit (); - const octave_idx_type *rd = rs.raw (), *rdi = rsi.data (); + const octave_idx_type *rd = rs.raw (); + const octave_idx_type *rdi = rsi.data (); // Count unique indices. octave_idx_type new_nz = 1; for (octave_idx_type i = 1; i < n; i++) @@ -537,8 +545,10 @@ } else { - idx_vector rr = r, cc = c; - const octave_idx_type *rd = rr.raw (), *cd = cc.raw (); + idx_vector rr = r; + idx_vector cc = c; + const octave_idx_type *rd = rr.raw (); + const octave_idx_type *cd = cc.raw (); OCTAVE_LOCAL_BUFFER_INIT (octave_idx_type, ci, nc+1, 0); ci[0] = 0; // Bin counts of column indices. @@ -572,7 +582,8 @@ for (octave_idx_type j = 0; j < nc; j++) { std::sort (spairs + ci[j], spairs + ci[j+1]); - octave_idx_type l = -1, nzj = 0; + octave_idx_type l = -1; + octave_idx_type nzj = 0; // Count. for (octave_idx_type i = ci[j]; i < ci[j+1]; i++) { @@ -901,7 +912,8 @@ void Sparse::resize1 (octave_idx_type n) { - octave_idx_type nr = rows (), nc = cols (); + octave_idx_type nr = rows (); + octave_idx_type nc = cols (); if (nr == 0) resize (1, std::max (nc, n)); @@ -950,7 +962,8 @@ if (r < rows ()) { - octave_idx_type i = 0, k = 0; + octave_idx_type i = 0; + octave_idx_type k = 0; for (octave_idx_type j = 1; j <= rep->ncols; j++) { octave_idx_type u = xcidx (j); @@ -1183,7 +1196,9 @@ OCTAVE_LOCAL_BUFFER (T, data_new, nz); idx_vector sidx = idx.sorted (true); const octave_idx_type *sj = sidx.raw (); - octave_idx_type sl = sidx.length (nel), nz_new = 0, j = 0; + octave_idx_type sl = sidx.length (nel); + octave_idx_type nz_new = 0; + octave_idx_type j = 0; for (octave_idx_type i = 0; i < nz; i++) { octave_idx_type r = tmp.ridx (i); @@ -1488,7 +1503,8 @@ ? idx.as_array ().transpose () : idx.as_array ()); - octave_idx_type new_nr = idxa.rows (), new_nc = idxa.cols (); + octave_idx_type new_nr = idxa.rows (); + octave_idx_type new_nc = idxa.cols (); // Lookup. // FIXME: Could specialize for sorted idx? @@ -1536,7 +1552,9 @@ else if (idx.is_cont_range (nel, lb, ub)) { // Special-case a contiguous range. - octave_idx_type lbi = cidx (lb), ubi = cidx (ub), new_nz = ubi - lbi; + octave_idx_type lbi = cidx (lb); + octave_idx_type ubi = cidx (ub); + octave_idx_type new_nz = ubi - lbi; retval = Sparse (1, ub - lb, new_nz); copy_or_memcpy (new_nz, data () + lbi, retval.data ()); fill_or_memset (new_nz, static_cast (0), @@ -1621,7 +1639,9 @@ else if (idx_j.is_cont_range (nc, lb, ub)) { // Special-case a contiguous range. - octave_idx_type lbi = cidx (lb), ubi = cidx (ub), new_nz = ubi - lbi; + octave_idx_type lbi = cidx (lb); + octave_idx_type ubi = cidx (ub); + octave_idx_type new_nz = ubi - lbi; retval = Sparse (nr, ub - lb, new_nz); copy_or_memcpy (new_nz, data () + lbi, retval.data ()); copy_or_memcpy (new_nz, ridx () + lbi, retval.ridx ()); @@ -1752,7 +1772,8 @@ octave_idx_type jj = idx_j(j); octave_idx_type lj = cidx (jj); octave_idx_type nzj = cidx (jj+1) - cidx (jj); - octave_idx_type li = retval.xcidx (j), uj = lj + nzj - 1; + octave_idx_type li = retval.xcidx (j); + octave_idx_type uj = lj + nzj - 1; for (octave_idx_type i = 0; i < nzj; i++) { retval.xdata (li + i) = data (uj - i); // Copy in reverse order. @@ -1859,7 +1880,8 @@ // Look-up indices first. octave_idx_type li = lblookup (ridx (), nz, lb); octave_idx_type ui = lblookup (ridx (), nz, ub); - octave_idx_type rnz = rhs.nnz (), new_nz = nz - (ui - li) + rnz; + octave_idx_type rnz = rhs.nnz (); + octave_idx_type new_nz = nz - (ui - li) + rnz; if (new_nz >= nz && new_nz <= capacity ()) { @@ -2039,8 +2061,10 @@ else if (idx_j.is_cont_range (nc, lb, ub)) { // Special-case a contiguous range. - octave_idx_type li = cidx (lb), ui = cidx (ub); - octave_idx_type rnz = rhs.nnz (), new_nz = nz - (ui - li) + rnz; + octave_idx_type li = cidx (lb); + octave_idx_type ui = cidx (ub); + octave_idx_type rnz = rhs.nnz (); + octave_idx_type new_nz = nz - (ui - li) + rnz; if (new_nz >= nz && new_nz <= capacity ()) { @@ -2129,7 +2153,9 @@ // Merge columns. for (octave_idx_type i = 0; i < nc; i++) { - octave_idx_type l = xcidx (i), u = xcidx (i+1), j = jsav[i]; + octave_idx_type l = xcidx (i); + octave_idx_type u = xcidx (i+1); + octave_idx_type j = jsav[i]; if (j >= 0) { // from rhs @@ -2605,7 +2631,8 @@ if (spi.is_empty ()) continue; - octave_idx_type kl = spi.cidx (j), ku = spi.cidx (j+1); + octave_idx_type kl = spi.cidx (j); + octave_idx_type ku = spi.cidx (j+1); for (octave_idx_type k = kl; k < ku; k++, l++) { retval.xridx (l) = spi.ridx (k) + rcum; diff -r 938f01339043 -r 8e056300994b liboctave/array/Sparse.h --- a/liboctave/array/Sparse.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/Sparse.h Wed Dec 04 22:13:18 2013 -0800 @@ -300,13 +300,15 @@ T& xelem (octave_idx_type n) { - octave_idx_type i = n % rows (), j = n / rows (); + octave_idx_type i = n % rows (); + octave_idx_type j = n / rows (); return xelem (i, j); } T xelem (octave_idx_type n) const { - octave_idx_type i = n % rows (), j = n / rows (); + octave_idx_type i = n % rows (); + octave_idx_type j = n / rows (); return xelem (i, j); } diff -r 938f01339043 -r 8e056300994b liboctave/array/boolSparse.cc --- a/liboctave/array/boolSparse.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/boolSparse.cc Wed Dec 04 22:13:18 2013 -0800 @@ -143,7 +143,9 @@ SparseBoolMatrix::any (int dim) const { Sparse retval; - octave_idx_type nr = rows (), nc = cols (), nz = nnz (); + octave_idx_type nr = rows (); + octave_idx_type nc = cols (); + octave_idx_type nz = nnz (); if (dim == -1) dim = (nr == 1 && nc != 1) ? 1 : 0; @@ -188,7 +190,9 @@ SparseBoolMatrix::sum (int dim) const { Sparse retval; - octave_idx_type nr = rows (), nc = cols (), nz = nnz (); + octave_idx_type nr = rows (); + octave_idx_type nc = cols (); + octave_idx_type nz = nnz (); if (dim == -1) dim = (nr == 1 && nc != 1) ? 1 : 0; diff -r 938f01339043 -r 8e056300994b liboctave/array/dDiagMatrix.cc --- a/liboctave/array/dDiagMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/dDiagMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -329,7 +329,8 @@ DiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -364,7 +365,8 @@ DiagMatrix::rcond (void) const { ColumnVector av = extract_diag (0).map (fabs); - double amx = av.max (), amn = av.min (); + double amx = av.max (); + double amn = av.min (); return amx == 0 ? 0.0 : amn / amx; } diff -r 938f01339043 -r 8e056300994b liboctave/array/dMatrix.cc --- a/liboctave/array/dMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/dMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -2012,7 +2012,9 @@ static Matrix stack_complex_matrix (const ComplexMatrix& cm) { - octave_idx_type m = cm.rows (), n = cm.cols (), nel = m*n; + octave_idx_type m = cm.rows (); + octave_idx_type n = cm.cols (); + octave_idx_type nel = m*n; Matrix retval (m, 2*n); const Complex *cmd = cm.data (); double *rd = retval.fortran_vec (); @@ -2027,7 +2029,9 @@ static ComplexMatrix unstack_complex_matrix (const Matrix& sm) { - octave_idx_type m = sm.rows (), n = sm.cols () / 2, nel = m*n; + octave_idx_type m = sm.rows (); + octave_idx_type n = sm.cols () / 2; + octave_idx_type nel = m*n; ComplexMatrix retval (m, n); const double *smd = sm.data (); Complex *rd = retval.fortran_vec (); @@ -3186,7 +3190,8 @@ { Matrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3221,8 +3226,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = Matrix (a_nr, b_nc); double *c = retval.fortran_vec (); diff -r 938f01339043 -r 8e056300994b liboctave/array/dSparse.cc --- a/liboctave/array/dSparse.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/dSparse.cc Wed Dec 04 22:13:18 2013 -0800 @@ -165,7 +165,8 @@ SparseMatrix::SparseMatrix (const DiagMatrix& a) : MSparse (a.rows (), a.cols (), a.length ()) { - octave_idx_type j = 0, l = a.length (); + octave_idx_type j = 0; + octave_idx_type l = a.length (); for (octave_idx_type i = 0; i < l; i++) { cidx (i) = j; @@ -877,7 +878,8 @@ if (calccond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nr; i++) { double tmp = fabs (v[i]); @@ -1412,7 +1414,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -1502,7 +1505,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -1562,7 +1566,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); @@ -1652,7 +1657,8 @@ if (calc_cond) { - double dmax = 0., dmin = octave_Inf; + double dmax = 0.; + double dmin = octave_Inf; for (octave_idx_type i = 0; i < nm; i++) { double tmp = fabs (data (i)); diff -r 938f01339043 -r 8e056300994b liboctave/array/dim-vector.cc --- a/liboctave/array/dim-vector.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/dim-vector.cc Wed Dec 04 22:13:18 2013 -0800 @@ -176,7 +176,8 @@ bool dim_vector::concat (const dim_vector& dvb, int dim) { - int orig_nd = ndims (), ndb = dvb.ndims (); + int orig_nd = ndims (); + int ndb = dvb.ndims (); int new_nd = dim < ndb ? ndb : dim + 1; if (new_nd > orig_nd) resize (new_nd, 1); diff -r 938f01339043 -r 8e056300994b liboctave/array/fCDiagMatrix.cc --- a/liboctave/array/fCDiagMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/fCDiagMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -452,7 +452,8 @@ FloatComplexDiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -553,7 +554,8 @@ FloatComplexDiagMatrix::rcond (void) const { FloatColumnVector av = extract_diag (0).map (std::abs); - float amx = av.max (), amn = av.min (); + float amx = av.max (); + float amn = av.min (); return amx == 0 ? 0.0f : amn / amx; } diff -r 938f01339043 -r 8e056300994b liboctave/array/fCMatrix.cc --- a/liboctave/array/fCMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/fCMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -3795,8 +3795,10 @@ { FloatComplexMatrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; - bool cja = transa == blas_conj_trans, cjb = transb == blas_conj_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; + bool cja = transa == blas_conj_trans; + bool cjb = transb == blas_conj_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3852,8 +3854,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = FloatComplexMatrix (a_nr, b_nc, 0.0); FloatComplex *c = retval.fortran_vec (); diff -r 938f01339043 -r 8e056300994b liboctave/array/fDiagMatrix.cc --- a/liboctave/array/fDiagMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/fDiagMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -329,7 +329,8 @@ FloatDiagMatrix c (a_nr, b_nc); - octave_idx_type len = c.length (), lenm = len < a_nc ? len : a_nc; + octave_idx_type len = c.length (); + octave_idx_type lenm = len < a_nc ? len : a_nc; for (octave_idx_type i = 0; i < lenm; i++) c.dgxelem (i) = a.dgelem (i) * b.dgelem (i); @@ -364,7 +365,8 @@ FloatDiagMatrix::rcond (void) const { FloatColumnVector av = extract_diag (0).map (fabsf); - float amx = av.max (), amn = av.min (); + float amx = av.max (); + float amn = av.min (); return amx == 0 ? 0.0f : amn / amx; } diff -r 938f01339043 -r 8e056300994b liboctave/array/fMatrix.cc --- a/liboctave/array/fMatrix.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/fMatrix.cc Wed Dec 04 22:13:18 2013 -0800 @@ -2026,7 +2026,9 @@ static FloatMatrix stack_complex_matrix (const FloatComplexMatrix& cm) { - octave_idx_type m = cm.rows (), n = cm.cols (), nel = m*n; + octave_idx_type m = cm.rows (); + octave_idx_type n = cm.cols (); + octave_idx_type nel = m*n; FloatMatrix retval (m, 2*n); const FloatComplex *cmd = cm.data (); float *rd = retval.fortran_vec (); @@ -2041,7 +2043,9 @@ static FloatComplexMatrix unstack_complex_matrix (const FloatMatrix& sm) { - octave_idx_type m = sm.rows (), n = sm.cols () / 2, nel = m*n; + octave_idx_type m = sm.rows (); + octave_idx_type n = sm.cols () / 2; + octave_idx_type nel = m*n; FloatComplexMatrix retval (m, n); const float *smd = sm.data (); FloatComplex *rd = retval.fortran_vec (); @@ -3203,7 +3207,8 @@ { FloatMatrix retval; - bool tra = transa != blas_no_trans, trb = transb != blas_no_trans; + bool tra = transa != blas_no_trans; + bool trb = transb != blas_no_trans; octave_idx_type a_nr = tra ? a.cols () : a.rows (); octave_idx_type a_nc = tra ? a.rows () : a.cols (); @@ -3238,8 +3243,10 @@ } else { - octave_idx_type lda = a.rows (), tda = a.cols (); - octave_idx_type ldb = b.rows (), tdb = b.cols (); + octave_idx_type lda = a.rows (); + octave_idx_type tda = a.cols (); + octave_idx_type ldb = b.rows (); + octave_idx_type tdb = b.cols (); retval = FloatMatrix (a_nr, b_nc); float *c = retval.fortran_vec (); diff -r 938f01339043 -r 8e056300994b liboctave/array/idx-vector.cc --- a/liboctave/array/idx-vector.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/idx-vector.cc Wed Dec 04 22:13:18 2013 -0800 @@ -595,7 +595,8 @@ for (octave_idx_type i = 0; i < len; i++) { - octave_idx_type j = data[i], k = cnt[j]++; + octave_idx_type j = data[i]; + octave_idx_type k = cnt[j]++; new_data[k] = j; idx_data[k] = i; } @@ -836,7 +837,8 @@ { // (i:k:end,:) reduces to a range if i <= k and k divides n. idx_range_rep * r = dynamic_cast (rep); - octave_idx_type s = r->get_start (), l = r->length (n); + octave_idx_type s = r->get_start (); + octave_idx_type l = r->length (n); octave_idx_type t = r->get_step (); if (l*t == n) { @@ -860,7 +862,8 @@ idx_range_rep * rj = dynamic_cast (j.rep); if (rj->get_step () == 1) { - octave_idx_type sj = rj->get_start (), lj = rj->length (nj); + octave_idx_type sj = rj->get_start (); + octave_idx_type lj = rj->length (nj); *this = new idx_range_rep (sj * n, lj * n, 1, DIRECT); reduced = true; } @@ -873,7 +876,8 @@ idx_scalar_rep * r = dynamic_cast (rep); idx_range_rep * rj = dynamic_cast (j.rep); octave_idx_type k = r->get_data (); - octave_idx_type sj = rj->get_start (), lj = rj->length (nj); + octave_idx_type sj = rj->get_start (); + octave_idx_type lj = rj->length (nj); octave_idx_type tj = rj->get_step (); *this = new idx_range_rep (n * sj + k, lj, n * tj, DIRECT); reduced = true; @@ -885,10 +889,12 @@ // (i:k:end,p:q) reduces to a range if i <= k and k divides n. // (ones (1, m), ones (1, n)) reduces to (ones (1, m*n)) idx_range_rep * r = dynamic_cast (rep); - octave_idx_type s = r->get_start (), l = r->length (n); + octave_idx_type s = r->get_start (); + octave_idx_type l = r->length (n); octave_idx_type t = r->get_step (); idx_range_rep * rj = dynamic_cast (j.rep); - octave_idx_type sj = rj->get_start (), lj = rj->length (nj); + octave_idx_type sj = rj->get_start (); + octave_idx_type lj = rj->length (nj); octave_idx_type tj = rj->get_step (); if ((l*t == n && tj == 1) || (t == 0 && tj == 0)) { @@ -922,7 +928,8 @@ // (i:d:j,k) reduces to a range. idx_range_rep * r = dynamic_cast (rep); idx_scalar_rep * rj = dynamic_cast (j.rep); - octave_idx_type s = r->get_start (), l = r->length (nj); + octave_idx_type s = r->get_start (); + octave_idx_type l = r->length (nj); octave_idx_type t = r->get_step (); octave_idx_type k = rj->get_data (); *this = new idx_range_rep (n * k + s, l, t, DIRECT); @@ -989,7 +996,8 @@ case class_mask: { idx_mask_rep * r = dynamic_cast (rep); - octave_idx_type ext = r->extent (0), len = r->length (0); + octave_idx_type ext = r->extent (0); + octave_idx_type len = r->length (0); if (ext == len) { l = 0; @@ -1062,7 +1070,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); octave_idx_type i, j; if (step == 1) for (i = start, j = start + len; i < j; i++) *data++ = i; @@ -1116,7 +1125,8 @@ if (idx_class () == class_mask) { idx_mask_rep * r = dynamic_cast (rep); - octave_idx_type nz = r->length (0), ext = r->extent (0); + octave_idx_type nz = r->length (0); + octave_idx_type ext = r->extent (0); Array mask (dim_vector (n, 1)); const bool *data = r->get_data (); bool *ndata = mask.fortran_vec (); @@ -1207,7 +1217,8 @@ { idx_mask_rep * r = dynamic_cast (rep); const bool *data = r->get_data (); - octave_idx_type ext = r->extent (0), len = r->length (0); + octave_idx_type ext = r->extent (0); + octave_idx_type len = r->length (0); octave_idx_type *idata = new octave_idx_type [len]; for (octave_idx_type i = 0, j = 0; i < ext; i++) diff -r 938f01339043 -r 8e056300994b liboctave/array/idx-vector.h --- a/liboctave/array/idx-vector.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/array/idx-vector.h Wed Dec 04 22:13:18 2013 -0800 @@ -637,7 +637,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); const T *ssrc = src + start; if (step == 1) copy_or_memcpy (len, ssrc, dest); @@ -710,7 +711,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); T *sdest = dest + start; if (step == 1) copy_or_memcpy (len, src, sdest); @@ -781,7 +783,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); T *sdest = dest + start; if (step == 1) std::fill (sdest, sdest + len, val); @@ -850,7 +853,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); octave_idx_type i, j; if (step == 1) for (i = start, j = start + len; i < j; i++) body (i); @@ -921,7 +925,8 @@ case class_range: { idx_range_rep * r = dynamic_cast (rep); - octave_idx_type start = r->get_start (), step = r->get_step (); + octave_idx_type start = r->get_start (); + octave_idx_type step = r->get_step (); octave_idx_type i, j; if (step == 1) for (i = start, j = start + len; i < j && body (i); i++) ; @@ -954,7 +959,8 @@ { idx_mask_rep * r = dynamic_cast (rep); const bool *data = r->get_data (); - octave_idx_type ext = r->extent (0), j = 0; + octave_idx_type ext = r->extent (0); + octave_idx_type j = 0; for (octave_idx_type i = 0; i < ext; i++) { if (data[i]) diff -r 938f01339043 -r 8e056300994b liboctave/numeric/CmplxLU.cc --- a/liboctave/numeric/CmplxLU.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/CmplxLU.cc Wed Dec 04 22:13:18 2013 -0800 @@ -100,7 +100,8 @@ if (u.length () == m && v.length () == n) { - ComplexColumnVector utmp = u, vtmp = v; + ComplexColumnVector utmp = u; + ComplexColumnVector vtmp = v; F77_XFCN (zlu1up, ZLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); } @@ -124,7 +125,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + ComplexColumnVector utmp = u.column (i); + ComplexColumnVector vtmp = v.column (i); F77_XFCN (zlu1up, ZLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -149,7 +151,8 @@ if (u.length () == m && v.length () == n) { - ComplexColumnVector utmp = u, vtmp = v; + ComplexColumnVector utmp = u; + ComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (Complex, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (zlup1up, ZLUP1UP, (m, n, l.fortran_vec (), @@ -180,7 +183,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + ComplexColumnVector utmp = u.column (i); + ComplexColumnVector vtmp = v.column (i); F77_XFCN (zlup1up, ZLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/CmplxQR.cc --- a/liboctave/numeric/CmplxQR.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/CmplxQR.cc Wed Dec 04 22:13:18 2013 -0800 @@ -137,7 +137,8 @@ void ComplexQR::form (octave_idx_type n, ComplexMatrix& afact, Complex *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -213,7 +214,8 @@ if (u.length () == m && v.length () == n) { - ComplexColumnVector utmp = u, vtmp = v; + ComplexColumnVector utmp = u; + ComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (Complex, w, k); OCTAVE_LOCAL_BUFFER (double, rw, k); F77_XFCN (zqr1up, ZQR1UP, (m, n, k, q.fortran_vec (), @@ -238,7 +240,8 @@ OCTAVE_LOCAL_BUFFER (double, rw, k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + ComplexColumnVector utmp = u.column (i); + ComplexColumnVector vtmp = v.column (i); F77_XFCN (zqr1up, ZQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/base-qr.cc --- a/liboctave/numeric/base-qr.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/base-qr.cc Wed Dec 04 22:13:18 2013 -0800 @@ -30,8 +30,10 @@ base_qr::base_qr (const qr_type& q_arg, const qr_type& r_arg) : q (q_arg), r (r_arg) { - octave_idx_type q_nr = q.rows (), q_nc = q.columns (); - octave_idx_type r_nr = r.rows (), r_nc = r.columns (); + octave_idx_type q_nr = q.rows (); + octave_idx_type q_nc = q.columns (); + octave_idx_type r_nr = r.rows (); + octave_idx_type r_nc = r.columns (); if (! (q_nc == r_nr && (q_nr == q_nc || (q_nr > q_nc && r_nr == r_nc)))) { diff -r 938f01339043 -r 8e056300994b liboctave/numeric/bsxfun-defs.cc --- a/liboctave/numeric/bsxfun-defs.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/bsxfun-defs.cc Wed Dec 04 22:13:18 2013 -0800 @@ -41,14 +41,16 @@ void (*op_vs) (size_t, R *, const X *, Y)) { int nd = std::max (x.ndims (), y.ndims ()); - dim_vector dvx = x.dims ().redim (nd), dvy = y.dims ().redim (nd); + dim_vector dvx = x.dims ().redim (nd); + dim_vector dvy = y.dims ().redim (nd); // Construct the result dimensions. dim_vector dvr; dvr.resize (nd); for (int i = 0; i < nd; i++) { - octave_idx_type xk = dvx(i), yk = dvy(i); + octave_idx_type xk = dvx(i); + octave_idx_type yk = dvy(i); if (xk == 1) dvr(i) = yk; else if (yk == 1 || xk == yk) @@ -84,7 +86,8 @@ else { // Determine the type of the low-level loop. - bool xsing = false, ysing = false; + bool xsing = false; + bool ysing = false; if (ldr == 1) { xsing = dvx(start) == 1; @@ -95,7 +98,8 @@ start++; } } - dim_vector cdvx = dvx.cumulative (), cdvy = dvy.cumulative (); + dim_vector cdvx = dvx.cumulative (); + dim_vector cdvy = dvy.cumulative (); // Nullify singleton dims to achieve a spread effect. for (int i = std::max (start, octave_idx_type (1)); i < nd; i++) { @@ -139,7 +143,8 @@ void (*op_vv) (size_t, R *, const X *), void (*op_vs) (size_t, R *, X)) { - dim_vector dvr = r.dims (), dvx = x.dims (); + dim_vector dvr = r.dims (); + dim_vector dvx = x.dims (); octave_idx_type nd = r.ndims (); dvx.redim (nd); diff -r 938f01339043 -r 8e056300994b liboctave/numeric/bsxfun.h --- a/liboctave/numeric/bsxfun.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/bsxfun.h Wed Dec 04 22:13:18 2013 -0800 @@ -38,7 +38,8 @@ { for (int i = 0; i < std::min (dx.length (), dy.length ()); i++) { - octave_idx_type xk = dx(i), yk = dy(i); + octave_idx_type xk = dx(i); + octave_idx_type yk = dy(i); // Check the three conditions for valid bsxfun dims if (! ( (xk == yk) || (xk == 1 && yk > 1) || (xk > 1 && yk == 1))) return false; @@ -59,13 +60,15 @@ is_valid_inplace_bsxfun (const std::string& name, const dim_vector& dr, const dim_vector& dx) { - octave_idx_type drl = dr.length (), dxl = dx.length (); + octave_idx_type drl = dr.length (); + octave_idx_type dxl = dx.length (); if (drl < dxl) return false; for (int i = 0; i < drl; i++) { - octave_idx_type rk = dr(i), xk = dx(i); + octave_idx_type rk = dr(i); + octave_idx_type xk = dx(i); // Only two valid canditions to check; can't stretch rk if (! ( (rk == xk) || (rk > 1 && xk == 1))) diff -r 938f01339043 -r 8e056300994b liboctave/numeric/dbleLU.cc --- a/liboctave/numeric/dbleLU.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/dbleLU.cc Wed Dec 04 22:13:18 2013 -0800 @@ -99,7 +99,8 @@ if (u.length () == m && v.length () == n) { - ColumnVector utmp = u, vtmp = v; + ColumnVector utmp = u; + ColumnVector vtmp = v; F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); } @@ -123,7 +124,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ColumnVector utmp = u.column (i), vtmp = v.column (i); + ColumnVector utmp = u.column (i); + ColumnVector vtmp = v.column (i); F77_XFCN (dlu1up, DLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -147,7 +149,8 @@ if (u.length () == m && v.length () == n) { - ColumnVector utmp = u, vtmp = v; + ColumnVector utmp = u; + ColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (double, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (dlup1up, DLUP1UP, (m, n, l.fortran_vec (), @@ -178,7 +181,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ColumnVector utmp = u.column (i), vtmp = v.column (i); + ColumnVector utmp = u.column (i); + ColumnVector vtmp = v.column (i); F77_XFCN (dlup1up, DLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/dbleQR.cc --- a/liboctave/numeric/dbleQR.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/dbleQR.cc Wed Dec 04 22:13:18 2013 -0800 @@ -138,7 +138,8 @@ void QR::form (octave_idx_type n, Matrix& afact, double *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -214,7 +215,8 @@ if (u.length () == m && v.length () == n) { - ColumnVector utmp = u, vtmp = v; + ColumnVector utmp = u; + ColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (double, w, 2*k); F77_XFCN (dqr1up, DQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, @@ -236,7 +238,8 @@ OCTAVE_LOCAL_BUFFER (double, w, 2*k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - ColumnVector utmp = u.column (i), vtmp = v.column (i); + ColumnVector utmp = u.column (i); + ColumnVector vtmp = v.column (i); F77_XFCN (dqr1up, DQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/fCmplxLU.cc --- a/liboctave/numeric/fCmplxLU.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/fCmplxLU.cc Wed Dec 04 22:13:18 2013 -0800 @@ -100,7 +100,8 @@ if (u.length () == m && v.length () == n) { - FloatComplexColumnVector utmp = u, vtmp = v; + FloatComplexColumnVector utmp = u; + FloatComplexColumnVector vtmp = v; F77_XFCN (clu1up, CLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); } @@ -125,7 +126,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatComplexColumnVector utmp = u.column (i); + FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (clu1up, CLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -150,7 +152,8 @@ if (u.length () == m && v.length () == n) { - FloatComplexColumnVector utmp = u, vtmp = v; + FloatComplexColumnVector utmp = u; + FloatComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (FloatComplex, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (clup1up, CLUP1UP, (m, n, l.fortran_vec (), @@ -182,7 +185,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatComplexColumnVector utmp = u.column (i); + FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (clup1up, CLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/fCmplxQR.cc --- a/liboctave/numeric/fCmplxQR.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/fCmplxQR.cc Wed Dec 04 22:13:18 2013 -0800 @@ -140,7 +140,8 @@ void FloatComplexQR::form (octave_idx_type n, FloatComplexMatrix& afact, FloatComplex *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -217,7 +218,8 @@ if (u.length () == m && v.length () == n) { - FloatComplexColumnVector utmp = u, vtmp = v; + FloatComplexColumnVector utmp = u; + FloatComplexColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (FloatComplex, w, k); OCTAVE_LOCAL_BUFFER (float, rw, k); F77_XFCN (cqr1up, CQR1UP, (m, n, k, q.fortran_vec (), @@ -243,7 +245,8 @@ OCTAVE_LOCAL_BUFFER (float, rw, k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatComplexColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatComplexColumnVector utmp = u.column (i); + FloatComplexColumnVector vtmp = v.column (i); F77_XFCN (cqr1up, CQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/floatLU.cc --- a/liboctave/numeric/floatLU.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/floatLU.cc Wed Dec 04 22:13:18 2013 -0800 @@ -99,7 +99,8 @@ if (u.length () == m && v.length () == n) { - FloatColumnVector utmp = u, vtmp = v; + FloatColumnVector utmp = u; + FloatColumnVector vtmp = v; F77_XFCN (slu1up, SLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -124,7 +125,8 @@ { for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatColumnVector utmp = u.column (i); + FloatColumnVector vtmp = v.column (i); F77_XFCN (slu1up, SLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec ())); @@ -149,7 +151,8 @@ if (u.length () == m && v.length () == n) { - FloatColumnVector utmp = u, vtmp = v; + FloatColumnVector utmp = u; + FloatColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (float, w, m); for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment F77_XFCN (slup1up, SLUP1UP, (m, n, l.fortran_vec (), @@ -180,7 +183,8 @@ for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatColumnVector utmp = u.column (i); + FloatColumnVector vtmp = v.column (i); F77_XFCN (slup1up, SLUP1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k, ipvt.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/floatQR.cc --- a/liboctave/numeric/floatQR.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/floatQR.cc Wed Dec 04 22:13:18 2013 -0800 @@ -136,7 +136,8 @@ void FloatQR::form (octave_idx_type n, FloatMatrix& afact, float *tau, qr_type_t qr_type) { - octave_idx_type m = afact.rows (), min_mn = std::min (m, n); + octave_idx_type m = afact.rows (); + octave_idx_type min_mn = std::min (m, n); octave_idx_type info; if (qr_type == qr_type_raw) @@ -212,7 +213,8 @@ if (u.length () == m && v.length () == n) { - FloatColumnVector utmp = u, vtmp = v; + FloatColumnVector utmp = u; + FloatColumnVector vtmp = v; OCTAVE_LOCAL_BUFFER (float, w, 2*k); F77_XFCN (sqr1up, SQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, @@ -234,7 +236,8 @@ OCTAVE_LOCAL_BUFFER (float, w, 2*k); for (volatile octave_idx_type i = 0; i < u.cols (); i++) { - FloatColumnVector utmp = u.column (i), vtmp = v.column (i); + FloatColumnVector utmp = u.column (i); + FloatColumnVector vtmp = v.column (i); F77_XFCN (sqr1up, SQR1UP, (m, n, k, q.fortran_vec (), m, r.fortran_vec (), k, utmp.fortran_vec (), vtmp.fortran_vec (), diff -r 938f01339043 -r 8e056300994b liboctave/numeric/lo-specfun.cc --- a/liboctave/numeric/lo-specfun.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/lo-specfun.cc Wed Dec 04 22:13:18 2013 -0800 @@ -2696,7 +2696,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x, a(i), err); + result(i) = gammainc (x, a(i), err); if (err) goto done; @@ -2722,7 +2722,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a, err); + result(i) = gammainc (x(i), a, err); if (err) goto done; @@ -2752,7 +2752,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a(i), err); + result(i) = gammainc (x(i), a(i), err); if (err) goto done; @@ -2901,7 +2901,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x, a(i), err); + result(i) = gammainc (x, a(i), err); if (err) goto done; @@ -2927,7 +2927,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a, err); + result(i) = gammainc (x(i), a, err); if (err) goto done; @@ -2957,7 +2957,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - result (i) = gammainc (x(i), a(i), err); + result(i) = gammainc (x(i), a(i), err); if (err) goto done; diff -r 938f01339043 -r 8e056300994b liboctave/numeric/oct-convn.cc --- a/liboctave/numeric/oct-convn.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/oct-convn.cc Wed Dec 04 22:13:18 2013 -0800 @@ -116,7 +116,8 @@ return MArray (); int nd = std::max (a.ndims (), b.ndims ()); - const dim_vector adims = a.dims ().redim (nd), bdims = b.dims ().redim (nd); + const dim_vector adims = a.dims ().redim (nd); + const dim_vector bdims = b.dims ().redim (nd); dim_vector cdims = dim_vector::alloc (nd); for (int i = 0; i < nd; i++) diff -r 938f01339043 -r 8e056300994b liboctave/numeric/oct-norm.cc --- a/liboctave/numeric/oct-norm.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/oct-norm.cc Wed Dec 04 22:13:18 2013 -0800 @@ -327,7 +327,9 @@ for (octave_idx_type i = 0; i < nsamp; i++) { octave_quit (); - R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); + R fi = i*M_PI/nsamp; + R lambda1 = cos (fi); + R mu1 = sin (fi); R lmnr = std::pow (std::pow (std::abs (lambda1), p) + std::pow (std::abs (mu1), p), 1/p); lambda1 /= lmnr; mu1 /= lmnr; @@ -358,7 +360,9 @@ for (octave_idx_type i = 0; i < nsamp; i++) { octave_quit (); - R fi = i*M_PI/nsamp, lambda1 = cos (fi), mu1 = sin (fi); + R fi = i*M_PI/nsamp; + R lambda1 = cos (fi); + R mu1 = sin (fi); R lmnr = std::pow (std::pow (std::abs (lambda1), p) + std::pow (std::abs (mu1), p), 1/p); lambda1 /= lmnr; mu1 /= lmnr; @@ -415,7 +419,8 @@ // the OSE part VectorT y(m.rows (), 1, 0), z(m.rows (), 1); typedef typename VectorT::element_type RR; - RR lambda = 0, mu = 1; + RR lambda = 0; + RR mu = 1; for (octave_idx_type k = 0; k < m.columns (); k++) { octave_quit (); diff -r 938f01339043 -r 8e056300994b liboctave/numeric/sparse-dmsolve.cc --- a/liboctave/numeric/sparse-dmsolve.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/numeric/sparse-dmsolve.cc Wed Dec 04 22:13:18 2013 -0800 @@ -43,7 +43,8 @@ octave_idx_type cend, octave_idx_type maxnz = -1, bool lazy = false) { - octave_idx_type nr = rend - rst, nc = cend - cst; + octave_idx_type nr = rend - rst; + octave_idx_type nc = cend - cst; maxnz = (maxnz < 0 ? A.nnz () : maxnz); octave_idx_type nz; diff -r 938f01339043 -r 8e056300994b liboctave/operators/mx-inlines.cc --- a/liboctave/operators/mx-inlines.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/operators/mx-inlines.cc Wed Dec 04 22:13:18 2013 -0800 @@ -365,7 +365,8 @@ void (*op2) (size_t, R *, const X *, Y) throw (), const char *opname) { - dim_vector dx = x.dims (), dy = y.dims (); + dim_vector dx = x.dims (); + dim_vector dy = y.dims (); if (dx == dy) { Array r (dx); @@ -410,7 +411,8 @@ void (*op1) (size_t, R *, X) throw (), const char *opname) { - dim_vector dr = r.dims (), dx = x.dims (); + dim_vector dr = r.dims (); + dim_vector dx = x.dims (); if (dr == dx) { op (r.length (), r.fortran_vec (), x.data ()); @@ -856,7 +858,8 @@ { \ if (! n) return; \ T tmp = v[0]; \ - octave_idx_type i = 1, j = 0; \ + octave_idx_type i = 1; \ + octave_idx_type j = 0; \ if (xisnan (tmp)) \ { \ for (; i < n && xisnan (v[i]); i++) ; \ @@ -876,7 +879,8 @@ { \ if (! n) return; \ T tmp = v[0]; octave_idx_type tmpi = 0; \ - octave_idx_type i = 1, j = 0; \ + octave_idx_type i = 1; \ + octave_idx_type j = 0; \ if (xisnan (tmp)) \ { \ for (; i < n && xisnan (v[i]); i++) ; \ @@ -1330,7 +1334,9 @@ inline void twosum_accum (T& s, T& e, const T& x) { - T s1 = s + x, t = s1 - s, e1 = (s - (s1 - t)) + (x - t); + T s1 = s + x; + T t = s1 - s; + T e1 = (s - (s1 - t)) + (x - t); s = s1; e += e1; } @@ -1339,7 +1345,8 @@ inline T mx_inline_xsum (const T *v, octave_idx_type n) { - T s = 0, e = 0; + T s = 0; + T e = 0; for (octave_idx_type i = 0; i < n; i++) twosum_accum (s, e, v[i]); diff -r 938f01339043 -r 8e056300994b liboctave/operators/mx-op-defs.h --- a/liboctave/operators/mx-op-defs.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/operators/mx-op-defs.h Wed Dec 04 22:13:18 2013 -0800 @@ -599,7 +599,8 @@ #define PMM_MULTIPLY_OP(PM, M) \ M operator * (const PM& p, const M& x) \ { \ - octave_idx_type nr = x.rows (), nc = x.columns (); \ + octave_idx_type nr = x.rows (); \ + octave_idx_type nc = x.columns (); \ M result; \ if (p.columns () != nr) \ gripe_nonconformant ("operator *", p.rows (), p.columns (), nr, nc); \ @@ -620,7 +621,8 @@ #define MPM_MULTIPLY_OP(M, PM) \ M operator * (const M& x, const PM& p) \ { \ - octave_idx_type nr = x.rows (), nc = x.columns (); \ + octave_idx_type nr = x.rows (); \ + octave_idx_type nc = x.columns (); \ M result; \ if (p.rows () != nc) \ gripe_nonconformant ("operator *", nr, nc, p.rows (), p.columns ()); \ diff -r 938f01339043 -r 8e056300994b liboctave/util/caseless-str.h --- a/liboctave/util/caseless-str.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/caseless-str.h Wed Dec 04 22:13:18 2013 -0800 @@ -54,7 +54,8 @@ while (p1 != end () && p2 != s.end ()) { - char lp1 = std::tolower (*p1), lp2 = std::tolower (*p2); + char lp1 = std::tolower (*p1); + char lp2 = std::tolower (*p2); if ( lp1 > lp2 ) return false; diff -r 938f01339043 -r 8e056300994b liboctave/util/kpse.cc --- a/liboctave/util/kpse.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/kpse.cc Wed Dec 04 22:13:18 2013 -0800 @@ -1612,7 +1612,10 @@ static int brace_gobbler (const std::string& text, int& indx, int satisfy) { - int c = 0, level = 0, quoted = 0, pass_next = 0; + int c = 0; + int level = 0; + int quoted = 0; + int pass_next = 0; size_t text_len = text.length (); diff -r 938f01339043 -r 8e056300994b liboctave/util/lo-utils.cc --- a/liboctave/util/lo-utils.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/lo-utils.cc Wed Dec 04 22:13:18 2013 -0800 @@ -322,7 +322,8 @@ std::complex octave_read_cx_fp_value (std::istream& is) { - T re = 0.0, im = 0.0; + T re = 0.0; + T im = 0.0; std::complex cx = 0.0; diff -r 938f01339043 -r 8e056300994b liboctave/util/oct-binmap.h --- a/liboctave/util/oct-binmap.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/oct-binmap.h Wed Dec 04 22:13:18 2013 -0800 @@ -167,7 +167,8 @@ Array binmap (const Array& xa, const Array& ya, F fcn, const char *name) { - dim_vector xad = xa.dims (), yad = ya.dims (); + dim_vector xad = xa.dims (); + dim_vector yad = ya.dims (); if (xa.numel () == 1) return binmap (xa(0), ya, fcn); else if (ya.numel () == 1) @@ -268,7 +269,8 @@ if (fz == U ()) { // Sparsity-preserving function. Do it efficiently. - octave_idx_type nr = xs.rows (), nc = xs.cols (); + octave_idx_type nr = xs.rows (); + octave_idx_type nc = xs.cols (); Sparse retval (nr, nc); octave_idx_type nz = 0; @@ -276,11 +278,14 @@ for (octave_idx_type j = 0; j < nc; j++) { octave_quit (); - octave_idx_type ix = xs.cidx (j), iy = ys.cidx (j); - octave_idx_type ux = xs.cidx (j+1), uy = ys.cidx (j+1); + octave_idx_type ix = xs.cidx (j); + octave_idx_type iy = ys.cidx (j); + octave_idx_type ux = xs.cidx (j+1); + octave_idx_type uy = ys.cidx (j+1); while (ix != ux || iy != uy) { - octave_idx_type rx = xs.ridx (ix), ry = ys.ridx (ix); + octave_idx_type rx = xs.ridx (ix); + octave_idx_type ry = ys.ridx (ix); ix += rx <= ry; iy += ry <= rx; nz++; @@ -297,11 +302,14 @@ for (octave_idx_type j = 0; j < nc; j++) { octave_quit (); - octave_idx_type ix = xs.cidx (j), iy = ys.cidx (j); - octave_idx_type ux = xs.cidx (j+1), uy = ys.cidx (j+1); + octave_idx_type ix = xs.cidx (j); + octave_idx_type iy = ys.cidx (j); + octave_idx_type ux = xs.cidx (j+1); + octave_idx_type uy = ys.cidx (j+1); while (ix != ux || iy != uy) { - octave_idx_type rx = xs.ridx (ix), ry = ys.ridx (ix); + octave_idx_type rx = xs.ridx (ix); + octave_idx_type ry = ys.ridx (ix); if (rx == ry) { retval.xridx (nz) = rx; diff -r 938f01339043 -r 8e056300994b liboctave/util/oct-cmplx.h --- a/liboctave/util/oct-cmplx.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/oct-cmplx.h Wed Dec 04 22:13:18 2013 -0800 @@ -40,10 +40,12 @@ template \ inline bool operator OP (const std::complex& a, const std::complex& b) \ { \ - FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ + FLOAT_TRUNCATE const T ax = std::abs (a); \ + FLOAT_TRUNCATE const T bx = std::abs (b); \ if (ax == bx) \ { \ - FLOAT_TRUNCATE const T ay = std::arg (a), by = std::arg (b); \ + FLOAT_TRUNCATE const T ay = std::arg (a); \ + FLOAT_TRUNCATE const T by = std::arg (b); \ return ay OP by; \ } \ else \ @@ -52,7 +54,8 @@ template \ inline bool operator OP (const std::complex& a, T b) \ { \ - FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ + FLOAT_TRUNCATE const T ax = std::abs (a); \ + FLOAT_TRUNCATE const T bx = std::abs (b); \ if (ax == bx) \ { \ FLOAT_TRUNCATE const T ay = std::arg (a); \ @@ -64,7 +67,8 @@ template \ inline bool operator OP (T a, const std::complex& b) \ { \ - FLOAT_TRUNCATE const T ax = std::abs (a), bx = std::abs (b); \ + FLOAT_TRUNCATE const T ax = std::abs (a); \ + FLOAT_TRUNCATE const T bx = std::abs (b); \ if (ax == bx) \ { \ FLOAT_TRUNCATE const T by = std::arg (b); \ diff -r 938f01339043 -r 8e056300994b liboctave/util/oct-inttypes.cc --- a/liboctave/util/oct-inttypes.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/oct-inttypes.cc Wed Dec 04 22:13:18 2013 -0800 @@ -280,7 +280,8 @@ octave_int_arith_base::mul_internal (uint64_t x, uint64_t y) { // Get upper words - uint64_t ux = x >> 32, uy = y >> 32; + uint64_t ux = x >> 32; + uint64_t uy = y >> 32; uint64_t res; if (ux) { @@ -288,21 +289,25 @@ goto overflow; else { - uint64_t ly = static_cast (y), uxly = ux*ly; + uint64_t ly = static_cast (y); + uint64_t uxly = ux*ly; if (uxly >> 32) goto overflow; uxly <<= 32; // never overflows - uint64_t lx = static_cast (x), lxly = lx*ly; + uint64_t lx = static_cast (x); + uint64_t lxly = lx*ly; res = add (uxly, lxly); } } else if (uy) { - uint64_t lx = static_cast (x), uylx = uy*lx; + uint64_t lx = static_cast (x); + uint64_t uylx = uy*lx; if (uylx >> 32) goto overflow; uylx <<= 32; // never overflows - uint64_t ly = static_cast (y), lylx = ly*lx; + uint64_t ly = static_cast (y); + uint64_t lylx = ly*lx; res = add (uylx, lylx); } else @@ -330,11 +335,13 @@ // (as above) and impose the sign. // FIXME: can we do something faster if we HAVE_FAST_INT_OPS? - uint64_t usx = octave_int_abs (x), usy = octave_int_abs (y); + uint64_t usx = octave_int_abs (x); + uint64_t usy = octave_int_abs (y); bool positive = (x < 0) == (y < 0); // Get upper words - uint64_t ux = usx >> 32, uy = usy >> 32; + uint64_t ux = usx >> 32; + uint64_t uy = usy >> 32; uint64_t res; if (ux) { @@ -342,11 +349,13 @@ goto overflow; else { - uint64_t ly = static_cast (usy), uxly = ux*ly; + uint64_t ly = static_cast (usy); + uint64_t uxly = ux*ly; if (uxly >> 32) goto overflow; uxly <<= 32; // never overflows - uint64_t lx = static_cast (usx), lxly = lx*ly; + uint64_t lx = static_cast (usx); + uint64_t lxly = lx*ly; res = uxly + lxly; if (res < uxly) goto overflow; @@ -354,11 +363,13 @@ } else if (uy) { - uint64_t lx = static_cast (usx), uylx = uy*lx; + uint64_t lx = static_cast (usx); + uint64_t uylx = uy*lx; if (uylx >> 32) goto overflow; uylx <<= 32; // never overflows - uint64_t ly = static_cast (usy), lylx = ly*lx; + uint64_t ly = static_cast (usy); + uint64_t lylx = ly*lx; res = uylx + lylx; if (res < uylx) goto overflow; @@ -496,11 +507,14 @@ static void umul128 (uint64_t x, uint64_t y, uint32_t w[4]) { - uint64_t lx = static_cast (x), ux = x >> 32; - uint64_t ly = static_cast (y), uy = y >> 32; + uint64_t lx = static_cast (x); + uint64_t ux = x >> 32; + uint64_t ly = static_cast (y); + uint64_t uy = y >> 32; uint64_t a = lx * ly; w[0] = a; a >>= 32; - uint64_t uxly = ux*ly, uylx = uy*lx; + uint64_t uxly = ux*ly; + uint64_t uylx = uy*lx; a += static_cast (uxly); uxly >>= 32; a += static_cast (uylx); uylx >>= 32; w[1] = a; a >>= 32; diff -r 938f01339043 -r 8e056300994b liboctave/util/oct-inttypes.h --- a/liboctave/util/oct-inttypes.h Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/oct-inttypes.h Wed Dec 04 22:13:18 2013 -0800 @@ -81,7 +81,8 @@ class NM \ { \ public: \ - static const bool ltval = (0 OP 1), gtval = (1 OP 0); \ + static const bool ltval = (0 OP 1); \ + static const bool gtval = (1 OP 0); \ template \ static bool op (T x, T y) { return x OP y; } \ } @@ -92,7 +93,8 @@ class NM \ { \ public: \ - static const bool ltval = value, gtval = value; \ + static const bool ltval = value; \ + static const bool gtval = value; \ template \ static bool op (T, T) { return value; } \ } @@ -268,7 +270,9 @@ // An exhaustive test whether the max and/or min check can be omitted. static const bool t_is_signed = std::numeric_limits::is_signed; static const bool s_is_signed = std::numeric_limits::is_signed; - static const int t_size = sizeof (T), s_size = sizeof (S); + static const int t_size = sizeof (T); + static const int s_size = sizeof (S); + static const bool omit_chk_min = (! s_is_signed || (t_is_signed && t_size >= s_size)); static const bool omit_chk_max = @@ -420,7 +424,8 @@ { if (y != 0) { - T z = x / y, w = x % y; + T z = x / y; + T w = x % y; if (w >= y-w) z += 1; return z; } @@ -610,7 +615,8 @@ // compiler from interfering. Also, the signed operations on small types // actually return int. T u = static_cast (x) + static_cast (y); - T ux = u ^ x, uy = u ^ y; + T ux = u ^ x; + T uy = u ^ y; if ((ux & uy) < 0) { u = octave_int_base::max_val () + __signbit (~u); @@ -651,7 +657,8 @@ // compiler from interfering. Also, the signed operations on small types // actually return int. T u = static_cast (x) - static_cast (y); - T ux = u ^ x, uy = u ^ ~y; + T ux = u ^ x; + T uy = u ^ ~y; if ((ux & uy) < 0) { u = octave_int_base::max_val () + __signbit (~u); @@ -1237,7 +1244,8 @@ octave_int xmax (const octave_int& x, const octave_int& y) { - const T xv = x.value (), yv = y.value (); + const T xv = x.value (); + const T yv = y.value (); return octave_int (xv >= yv ? xv : yv); } @@ -1245,7 +1253,8 @@ octave_int xmin (const octave_int& x, const octave_int& y) { - const T xv = x.value (), yv = y.value (); + const T xv = x.value (); + const T yv = y.value (); return octave_int (xv <= yv ? xv : yv); } diff -r 938f01339043 -r 8e056300994b liboctave/util/oct-sort.cc --- a/liboctave/util/oct-sort.cc Wed Dec 04 18:56:47 2013 -0800 +++ b/liboctave/util/oct-sort.cc Wed Dec 04 22:13:18 2013 -0800 @@ -158,7 +158,8 @@ for (; start < nel; ++start) { /* set l to where *start belongs */ - octave_idx_type l = 0, r = start; + octave_idx_type l = 0; + octave_idx_type r = start; T pivot = data[start]; /* Invariants: * pivot >= all in [lo, l). @@ -202,7 +203,8 @@ for (; start < nel; ++start) { /* set l to where *start belongs */ - octave_idx_type l = 0, r = start; + octave_idx_type l = 0; + octave_idx_type r = start; T pivot = data[start]; /* Invariants: * pivot >= all in [lo, l). @@ -1694,7 +1696,8 @@ { // Not the final column. assert (n > 1); - const T *hi = lo + n, *lst = lo; + const T *hi = lo + n; + const T *lst = lo; for (lo++; lo < hi; lo++) { if (comp (*lst, *lo)) @@ -1756,7 +1759,8 @@ octave_sort::lookup (const T *data, octave_idx_type nel, const T& value, Comp comp) { - octave_idx_type lo = 0, hi = nel; + octave_idx_type lo = 0; + octave_idx_type hi = nel; while (lo < hi) { @@ -1834,7 +1838,8 @@ { if (rev) { - octave_idx_type i = 0, j = nvalues - 1; + octave_idx_type i = 0; + octave_idx_type j = nvalues - 1; if (nvalues > 0 && nel > 0) { @@ -1856,7 +1861,8 @@ } else { - octave_idx_type i = 0, j = 0; + octave_idx_type i = 0; + octave_idx_type j = 0; if (nvalues > 0 && nel > 0) {