Mercurial > hg > octave-nkf
changeset 8810:c9e1db15035b
eliminate unnecessary casts
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 18 Feb 2009 17:46:07 -0500 |
parents | 732cb0236488 |
children | 20dfb885f877 |
files | src/ChangeLog src/DLD-FUNCTIONS/find.cc src/DLD-FUNCTIONS/quad.cc src/DLD-FUNCTIONS/time.cc src/toplev.cc |
diffstat | 5 files changed, 17 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,9 @@ 2009-02-18 John W. Eaton <jwe@octave.org> + + * DLD-FUNCTIONS/find.cc (find_nonzero_elem_idx): Likewise. + * DLD-FUNCTIONS/time.cc (strptime): Likewise. + * DLD-FUNCTIONS/quad.cc (Fquad): Eliminate unnecessary cast. + * toplev.cc (run_command_and_return_output): Likewise. * strfns.cc (Fstrvcat): Use octave_idx_type and size_t instead of int as needed.
--- a/src/DLD-FUNCTIONS/find.cc +++ b/src/DLD-FUNCTIONS/find.cc @@ -62,7 +62,7 @@ { OCTAVE_QUIT; - if (nda(k) != static_cast<T> (0.0)) + if (nda(k) != T ()) { end_el = k; if (start_el == -1) @@ -125,7 +125,7 @@ { OCTAVE_QUIT; - if (nda(k) != static_cast<T> (0.0)) + if (nda(k) != T ()) { idx(count) = k + 1; @@ -276,10 +276,10 @@ OCTAVE_QUIT; if (direction < 0 && i < nz - count) continue; - i_idx (cx) = static_cast<double> (v.ridx(i) + 1); - j_idx (cx) = static_cast<double> (j + 1); - idx (cx) = j * nr + v.ridx(i) + 1; - val (cx) = v.data(i); + i_idx(cx) = static_cast<double> (v.ridx(i) + 1); + j_idx(cx) = static_cast<double> (j + 1); + idx(cx) = j * nr + v.ridx(i) + 1; + val(cx) = v.data(i); cx++; if (cx == count) break;
--- a/src/DLD-FUNCTIONS/quad.cc +++ b/src/DLD-FUNCTIONS/quad.cc @@ -352,8 +352,8 @@ } retval(3) = abserr; - retval(2) = static_cast<double> (nfun); - retval(1) = static_cast<double> (ier); + retval(2) = nfun; + retval(1) = ier; retval(0) = val; } @@ -460,8 +460,8 @@ } retval(3) = abserr; - retval(2) = static_cast<double> (nfun); - retval(1) = static_cast<double> (ier); + retval(2) = nfun; + retval(1) = ier; retval(0) = val; }