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	Wed Feb 18 15:05:06 2009 -0500
+++ b/src/ChangeLog	Wed Feb 18 17:46:07 2009 -0500
@@ -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	Wed Feb 18 15:05:06 2009 -0500
+++ b/src/DLD-FUNCTIONS/find.cc	Wed Feb 18 17:46:07 2009 -0500
@@ -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	Wed Feb 18 15:05:06 2009 -0500
+++ b/src/DLD-FUNCTIONS/quad.cc	Wed Feb 18 17:46:07 2009 -0500
@@ -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;
 	}
 
--- a/src/DLD-FUNCTIONS/time.cc	Wed Feb 18 15:05:06 2009 -0500
+++ b/src/DLD-FUNCTIONS/time.cc	Wed Feb 18 17:46:07 2009 -0500
@@ -505,7 +505,7 @@
 	    {
 	      octave_strptime t (str, fmt);
 
-	      retval(1) = static_cast<double> (t.characters_converted ());
+	      retval(1) = t.characters_converted ();
 	      retval(0) = octave_value (mk_tm_map (t));
 	    }
 	  else
--- a/src/toplev.cc	Wed Feb 18 15:05:06 2009 -0500
+++ b/src/toplev.cc	Wed Feb 18 17:46:07 2009 -0500
@@ -778,7 +778,7 @@
 	  else
 	    cmd_status = 127;
 
-	  retval(0) = (double) cmd_status;
+	  retval(0) = cmd_status;
 	  retval(1) = output_buf.str ();
 	}