changeset 13219:cf5ebc0e47e4

fix warnings for unused but set variables and shadowed variables * quadcc.cc (Fquadcc): Delete unused variable err_excess. * find.cc (find_nonzero_elem_idx (const PermMatrix&, int, octave_idx_type, int)): Delete unused variable end_nc. * eigs.cc (Feigs): Delete unused variable bmat. * conv2.cc (Fconvn): Delete unused variable separable. * colamd.cc (Fetree, Fsymamd): Delete unused variable nnz. * ccolamd.cc (Fcsymamd): Delete unused variable nnz. * pt-pr-code.cc (tree_print_code::visit_index_expression): Delete unused variable expr_has_parens. * pt-mat.cc (tree_matrix::rvalue1): Delete unused variables all_complex_p and all_strings_p (tm_const::init): Eliminate shadowed variables. * gl-render.cc (opengl_renderer::draw_image): Delete unused variable ok.
author John W. Eaton <jwe@octave.org>
date Sun, 25 Sep 2011 16:52:23 -0400
parents 01b7a60e2ff0
children 410de573089a
files src/DLD-FUNCTIONS/ccolamd.cc src/DLD-FUNCTIONS/colamd.cc src/DLD-FUNCTIONS/conv2.cc src/DLD-FUNCTIONS/eigs.cc src/DLD-FUNCTIONS/find.cc src/DLD-FUNCTIONS/quadcc.cc src/gl-render.cc src/pt-mat.cc src/pt-pr-code.cc
diffstat 9 files changed, 13 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/ccolamd.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/DLD-FUNCTIONS/ccolamd.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -453,7 +453,7 @@
             }
         }
 
-      octave_idx_type n_row, n_col, nnz;
+      octave_idx_type n_row, n_col;
       octave_idx_type *ridx, *cidx;
       SparseMatrix sm;
       SparseComplexMatrix scm;
@@ -465,7 +465,6 @@
               scm = args(0).sparse_complex_matrix_value ();
               n_row = scm.rows ();
               n_col = scm.cols ();
-              nnz = scm.nnz ();
               ridx = scm.xridx ();
               cidx = scm.xcidx ();
             }
@@ -474,7 +473,6 @@
               sm = args(0).sparse_matrix_value ();
               n_row = sm.rows ();
               n_col = sm.cols ();
-              nnz = sm.nnz ();
               ridx = sm.xridx ();
               cidx = sm.xcidx ();
             }
@@ -488,7 +486,6 @@
 
           n_row = sm.rows ();
           n_col = sm.cols ();
-          nnz = sm.nnz ();
           ridx = sm.xridx ();
           cidx = sm.xcidx ();
         }
--- a/src/DLD-FUNCTIONS/colamd.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/DLD-FUNCTIONS/colamd.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -544,7 +544,7 @@
         octave_stdout << "symamd: dense row/col fraction: "
                       << knobs [COLAMD_DENSE_ROW] << std::endl;
 
-      octave_idx_type n_row, n_col, nnz;
+      octave_idx_type n_row, n_col;
       octave_idx_type *ridx, *cidx;
       SparseMatrix sm;
       SparseComplexMatrix scm;
@@ -556,7 +556,6 @@
               scm = args(0).sparse_complex_matrix_value ();
               n_row = scm.rows ();
               n_col = scm.cols ();
-              nnz = scm.nnz ();
               ridx = scm.xridx ();
               cidx = scm.xcidx ();
             }
@@ -565,7 +564,6 @@
               sm = args(0).sparse_matrix_value ();
               n_row = sm.rows ();
               n_col = sm.cols ();
-              nnz = sm.nnz ();
               ridx = sm.xridx ();
               cidx = sm.xcidx ();
             }
@@ -579,7 +577,6 @@
 
           n_row = sm.rows ();
           n_col = sm.cols ();
-          nnz = sm.nnz ();
           ridx = sm.xridx ();
           cidx = sm.xcidx ();
         }
@@ -668,7 +665,7 @@
     print_usage ();
   else
     {
-      octave_idx_type n_row, n_col, nnz;
+      octave_idx_type n_row, n_col;
       octave_idx_type *ridx, *cidx;
       bool is_sym = true;
       SparseMatrix sm;
@@ -681,7 +678,6 @@
               scm = args(0).sparse_complex_matrix_value ();
               n_row = scm.rows ();
               n_col = scm.cols ();
-              nnz = scm.nnz ();
               ridx = scm.xridx ();
               cidx = scm.xcidx ();
             }
@@ -690,7 +686,6 @@
               sm = args(0).sparse_matrix_value ();
               n_row = sm.rows ();
               n_col = sm.cols ();
-              nnz = sm.nnz ();
               ridx = sm.xridx ();
               cidx = sm.xcidx ();
             }
--- a/src/DLD-FUNCTIONS/conv2.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/DLD-FUNCTIONS/conv2.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -262,7 +262,6 @@
   octave_value tmp;
   int nargin = args.length ();
   std::string shape = "full"; //default
-  bool separable = false;
   convn_type ct;
 
   if (nargin < 2 || nargin > 3)
@@ -274,8 +273,6 @@
     {
       if (args(2).is_string ())
         shape = args(2).string_value ();
-      else
-        separable = true;
     }
 
   if (shape == "full")
--- a/src/DLD-FUNCTIONS/eigs.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/DLD-FUNCTIONS/eigs.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -335,7 +335,6 @@
   ColumnVector resid;
   ComplexColumnVector cresid;
   octave_idx_type info = 1;
-  char bmat = 'I';
 
   warned_imaginary = false;
 
@@ -427,7 +426,6 @@
         {
           b_arg = 1+arg_offset;
           have_b = true;
-          bmat = 'G';
           b_is_complex = true;
           arg_offset++;
         }
@@ -435,7 +433,6 @@
         {
           b_arg = 1+arg_offset;
           have_b = true;
-          bmat = 'G';
           arg_offset++;
         }
     }
--- a/src/DLD-FUNCTIONS/find.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/DLD-FUNCTIONS/find.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -232,26 +232,23 @@
   octave_value_list retval ((nargout == 0 ? 1 : nargout), Matrix ());
 
   octave_idx_type nc = v.cols();
-  octave_idx_type start_nc, end_nc, count;
+  octave_idx_type start_nc, count;
 
   // Determine the range to search.
   if (n_to_find < 0 || n_to_find >= nc)
     {
       start_nc = 0;
-      end_nc = nc;
       n_to_find = nc;
       count = nc;
     }
   else if (direction > 0)
     {
       start_nc = 0;
-      end_nc = n_to_find;
       count = n_to_find;
     }
   else
     {
       start_nc = nc - n_to_find;
-      end_nc = nc;
       count = n_to_find;
     }
 
--- a/src/DLD-FUNCTIONS/quadcc.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/DLD-FUNCTIONS/quadcc.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -1569,7 +1569,7 @@
 
   /* Actual variables (as opposed to constants above). */
   double m, h, ml, hl, mr, hr, temp;
-  double igral, err, igral_final, err_final, err_excess;
+  double igral, err, igral_final, err_final;
   int nivals, neval = 0;
   int i, j, d, split, t;
   int nnans, nans[33];
@@ -1766,7 +1766,6 @@
   /* Initialize some global values. */
   igral_final = 0.0;
   err_final = 0.0;
-  err_excess = 0.0;
 
 
   /* Main loop. */
--- a/src/gl-render.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/gl-render.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -2449,7 +2449,6 @@
   octave_value cdata = props.get_color_data ();
   dim_vector dv (cdata.dims ());
   int h = dv(0), w = dv(1);
-  bool ok = true;
 
   Matrix x = props.get_xdata ().matrix_value ();
   Matrix y = props.get_ydata ().matrix_value ();
@@ -2593,16 +2592,11 @@
           draw_pixels (j1-j0, i1-i0, GL_RGB, GL_UNSIGNED_BYTE, a);
         }
       else
-        {
-          ok = false;
-          warning ("opengl_texture::draw: invalid image data type (expected double, uint16, or uint8)");
-        }
+        warning ("opengl_texture::draw: invalid image data type (expected double, uint16, or uint8)");
     }
   else
-    {
-      ok = false;
-      warning ("opengl_texture::draw: invalid image size (expected n*m*3 or n*m)");
-    }
+    warning ("opengl_texture::draw: invalid image size (expected n*m*3 or n*m)");
+
   glPixelZoom (1, 1);
 }
 
--- a/src/pt-mat.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/pt-mat.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -612,25 +612,23 @@
 
   if (! error_state)
     {
-      iterator p = begin ();
-
       if (any_cell && ! any_class && ! first_elem_is_struct)
         {
-          for (iterator p = begin (); p != end (); p++)
+          for (iterator q = begin (); q != end (); q++)
             {
               octave_quit ();
 
-              p->cellify ();
+              q->cellify ();
             }
         }
 
       first_elem = true;
 
-      for (iterator p = begin (); p != end (); p++)
+      for (iterator q = begin (); q != end (); q++)
         {
           octave_quit ();
 
-          tm_row_const elt = *p;
+          tm_row_const elt = *q;
 
           octave_idx_type this_elt_nr = elt.rows ();
           octave_idx_type this_elt_nc = elt.cols ();
@@ -940,12 +938,10 @@
 {
   octave_value retval = Matrix ();
 
-  bool all_strings_p = false;
   bool all_sq_strings_p = false;
   bool all_dq_strings_p = false;
   bool all_empty_p = false;
   bool all_real_p = false;
-  bool all_complex_p = false;
   bool any_sparse_p = false;
   bool any_class_p = false;
   bool frc_str_conv = false;
@@ -955,12 +951,10 @@
   if (tmp && ! tmp.empty ())
     {
       dim_vector dv = tmp.dims ();
-      all_strings_p = tmp.all_strings_p ();
       all_sq_strings_p = tmp.all_sq_strings_p ();
       all_dq_strings_p = tmp.all_dq_strings_p ();
       all_empty_p = tmp.all_empty_p ();
       all_real_p = tmp.all_real_p ();
-      all_complex_p = tmp.all_complex_p ();
       any_sparse_p = tmp.any_sparse_p ();
       any_class_p = tmp.any_class_p ();
       frc_str_conv = tmp.some_strings_p ();
--- a/src/pt-pr-code.cc	Sun Sep 25 15:06:10 2011 -0400
+++ b/src/pt-pr-code.cc	Sun Sep 25 16:52:23 2011 -0400
@@ -529,16 +529,10 @@
 
   print_parens (expr, "(");
 
-  bool expr_has_parens = false;
-
   tree_expression *e = expr.expression ();
 
   if (e)
-    {
-      e->accept (*this);
-
-      expr_has_parens = e->is_postfix_indexed ();
-    }
+    e->accept (*this);
 
   std::list<tree_argument_list *> arg_lists = expr.arg_lists ();
   std::string type_tags = expr.type_tags ();