changeset 21137:623fc7d08cc6

maint: Clean up compile warnings in liboctave from cset 7cac4e7458f2. * Sparse.h (range_error): Mark function with OCTAVE_NORETURN attribute. * Sparse.h (read_sparse_matrix): "return is" at end of fcn. * dSparse.cc (tinverse): Delete unused inverse_singular label. * idx-vector.h (as_array, sort_idx): Mark function with OCTAVE_NORETURN. * Quad.h (do_integrate): Mark unreachable do_integrate combinations with OCTAVE_NORETURN.
author Rik <rik@octave.org>
date Sat, 23 Jan 2016 17:44:57 -0800
parents 7cac4e7458f2
children e2fca7d79169
files liboctave/array/Sparse.h liboctave/array/dSparse.cc liboctave/array/idx-vector.h liboctave/numeric/Quad.h
diffstat 4 files changed, 22 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/array/Sparse.h	Sat Jan 23 13:52:03 2016 -0800
+++ b/liboctave/array/Sparse.h	Sat Jan 23 17:44:57 2016 -0800
@@ -294,14 +294,18 @@
 
   octave_idx_type compute_index (const Array<octave_idx_type>& ra_idx) const;
 
-  T range_error (const char *fcn, octave_idx_type n) const;
-  T& range_error (const char *fcn, octave_idx_type n);
+  OCTAVE_NORETURN T range_error (const char *fcn, octave_idx_type n) const;
+  OCTAVE_NORETURN T& range_error (const char *fcn, octave_idx_type n);
 
-  T range_error (const char *fcn, octave_idx_type i, octave_idx_type j) const;
-  T& range_error (const char *fcn, octave_idx_type i, octave_idx_type j);
+  OCTAVE_NORETURN T range_error (const char *fcn,
+                                 octave_idx_type i, octave_idx_type j) const;
+  OCTAVE_NORETURN T& range_error (const char *fcn,
+                                  octave_idx_type i, octave_idx_type j);
 
-  T range_error (const char *fcn, const Array<octave_idx_type>& ra_idx) const;
-  T& range_error (const char *fcn, const Array<octave_idx_type>& ra_idx);
+  OCTAVE_NORETURN T range_error (const char *fcn,
+                                 const Array<octave_idx_type>& ra_idx) const;
+  OCTAVE_NORETURN T& range_error (const char *fcn,
+                                  const Array<octave_idx_type>& ra_idx);
 
   // No checking, even for multiple references, ever.
 
@@ -775,6 +779,8 @@
       for (octave_idx_type j = jold; j < nc; j++)
         a.cidx (j+1) = ii;
     }
+
+  return is;
 }
 
 #endif
--- a/liboctave/array/dSparse.cc	Sat Jan 23 13:52:03 2016 -0800
+++ b/liboctave/array/dSparse.cc	Sat Jan 23 17:44:57 2016 -0800
@@ -1143,9 +1143,6 @@
     }
 
   return retval;
-
-inverse_singular:
-  return SparseMatrix ();
 }
 
 SparseMatrix
--- a/liboctave/array/idx-vector.h	Sat Jan 23 13:52:03 2016 -0800
+++ b/liboctave/array/idx-vector.h	Sat Jan 23 17:44:57 2016 -0800
@@ -103,7 +103,7 @@
     // i/o
     virtual std::ostream& print (std::ostream& os) const = 0;
 
-    virtual Array<octave_idx_type> as_array (void);
+    OCTAVE_NORETURN virtual Array<octave_idx_type> as_array (void);
 
     octave_refcount<int> count;
 
@@ -137,7 +137,7 @@
     idx_base_rep *sort_uniq_clone (bool = false)
     { count++; return this; }
 
-    idx_base_rep *sort_idx (Array<octave_idx_type>&);
+    OCTAVE_NORETURN idx_base_rep *sort_idx (Array<octave_idx_type>&);
 
     bool is_colon_equiv (octave_idx_type) const { return true; }
 
--- a/liboctave/numeric/Quad.h	Sat Jan 23 13:52:03 2016 -0800
+++ b/liboctave/numeric/Quad.h	Sat Jan 23 17:44:57 2016 -0800
@@ -143,8 +143,8 @@
   double do_integrate (octave_idx_type& ier, octave_idx_type& neval,
                        double& abserr);
 
-  float do_integrate (octave_idx_type& ier, octave_idx_type& neval,
-                      float& abserr);
+  OCTAVE_NORETURN float do_integrate (octave_idx_type& ier,
+                                      octave_idx_type& neval, float& abserr);
 
 private:
 
@@ -173,8 +173,8 @@
   double do_integrate (octave_idx_type& ier, octave_idx_type& neval,
                        double& abserr);
 
-  float do_integrate (octave_idx_type& ier, octave_idx_type& neval,
-                      float& abserr);
+OCTAVE_NORETURN float do_integrate (octave_idx_type& ier,
+                                    octave_idx_type& neval, float& abserr);
 
 private:
 
@@ -206,8 +206,8 @@
 
   ~FloatDefQuad (void) { }
 
-  double do_integrate (octave_idx_type& ier, octave_idx_type& neval,
-                       double& abserr);
+  OCTAVE_NORETURN double do_integrate (octave_idx_type& ier,
+                                       octave_idx_type& neval, double& abserr);
 
   float do_integrate (octave_idx_type& ier, octave_idx_type& neval,
                       float& abserr);
@@ -236,8 +236,8 @@
 
   ~FloatIndefQuad (void) { }
 
-  double do_integrate (octave_idx_type& ier, octave_idx_type& neval,
-                       double& abserr);
+  OCTAVE_NORETURN double do_integrate (octave_idx_type& ier,
+                                       octave_idx_type& neval, double& abserr);
 
   float do_integrate (octave_idx_type& ier, octave_idx_type& neval,
                       float& abserr);