changeset 20952:072559bd31f2

maint: Eliminate useless statements after error(). * ov-base-diag.cc, ov-base-int.cc, ov-base-sparse.cc, ov-bool-mat.cc, ov-cx-mat.cc, ov-fcn-handle.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-perm.cc, ov-re-mat.cc, ov-str-mat.cc, ov-struct.cc: maint: Eliminate useless statements after error().
author Rik <rik@octave.org>
date Sun, 20 Dec 2015 07:42:17 -0800
parents 793886a00c3b
children 758b71e964ce
files libinterp/octave-value/ov-base-diag.cc libinterp/octave-value/ov-base-int.cc libinterp/octave-value/ov-base-sparse.cc libinterp/octave-value/ov-bool-mat.cc libinterp/octave-value/ov-cx-mat.cc libinterp/octave-value/ov-fcn-handle.cc libinterp/octave-value/ov-flt-cx-mat.cc libinterp/octave-value/ov-flt-re-mat.cc libinterp/octave-value/ov-perm.cc libinterp/octave-value/ov-re-mat.cc libinterp/octave-value/ov-str-mat.cc libinterp/octave-value/ov-struct.cc
diffstat 12 files changed, 33 insertions(+), 132 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/octave-value/ov-base-diag.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-base-diag.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -528,10 +528,7 @@
         }
     }
   else
-    {
-      error ("load: failed to extract number of rows and columns");
-      success = false;
-    }
+    error ("load: failed to extract number of rows and columns");
 
   return success;
 }
--- a/libinterp/octave-value/ov-base-int.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-base-int.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -230,10 +230,7 @@
           this->matrix = tmp;
         }
       else
-        {
-          error ("load: failed to extract number of rows and columns");
-          success = false;
-        }
+        error ("load: failed to extract number of rows and columns");
     }
   else
     error ("load: failed to extract number of dimensions");
--- a/libinterp/octave-value/ov-base-sparse.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-base-sparse.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -464,10 +464,7 @@
       matrix = tmp;
     }
   else
-    {
-      error ("load: failed to extract number of rows and columns");
-      success = false;
-    }
+    error ("load: failed to extract number of rows and columns");
 
   return success;
 }
--- a/libinterp/octave-value/ov-bool-mat.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-bool-mat.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -258,23 +258,14 @@
                           matrix = btmp;
                         }
                       else
-                        {
-                          error ("load: failed to load matrix constant");
-                          success = false;
-                        }
+                        error ("load: failed to load matrix constant");
                     }
                 }
               else
-                {
-                  error ("load: failed to extract dimensions");
-                  success = false;
-                }
+                error ("load: failed to extract dimensions");
             }
           else
-            {
-              error ("load: failed to extract number of dimensions");
-              success = false;
-            }
+            error ("load: failed to extract number of dimensions");
         }
       else if (kw == "rows")
         {
@@ -297,10 +288,7 @@
                       matrix = btmp;
                     }
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else if (nr == 0 || nc == 0)
                 matrix = boolMatrix (nr, nc);
--- a/libinterp/octave-value/ov-cx-mat.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-cx-mat.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -390,22 +390,13 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else
-                {
-                  error ("load: failed to read dimensions");
-                  success = false;
-                }
+                error ("load: failed to read dimensions");
             }
           else
-            {
-              error ("load: failed to extract number of dimensions");
-              success = false;
-            }
+            error ("load: failed to extract number of dimensions");
         }
       else if (kw == "rows")
         {
@@ -421,10 +412,7 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else if (nr == 0 || nc == 0)
                 matrix = ComplexMatrix (nr, nc);
--- a/libinterp/octave-value/ov-fcn-handle.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-fcn-handle.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -279,10 +279,7 @@
               fcn = octave_value (new octave_fcn_handle (tmp, nm));
             }
           else
-            {
-              error ("function handle points to non-existent function");
-              success = false;
-            }
+            error ("function handle points to non-existent function");
         }
       else
         {
@@ -309,10 +306,7 @@
               fcn = octave_value (new octave_fcn_handle (tmp, nm));
             }
           else
-            {
-              error ("function handle points to non-existent function");
-              success = false;
-            }
+            error ("function handle points to non-existent function");
         }
     }
   else
@@ -332,10 +326,7 @@
               fcn = octave_value (new octave_fcn_handle (tmp, nm));
             }
           else
-            {
-              error ("function handle points to non-existent function");
-              success = false;
-            }
+            error ("function handle points to non-existent function");
         }
       else
         {
--- a/libinterp/octave-value/ov-flt-cx-mat.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-flt-cx-mat.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -364,22 +364,13 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else
-                {
-                  error ("load: failed to read dimensions");
-                  success = false;
-                }
+                error ("load: failed to read dimensions");
             }
           else
-            {
-              error ("load: failed to extract number of dimensions");
-              success = false;
-            }
+            error ("load: failed to extract number of dimensions");
         }
       else if (kw == "rows")
         {
@@ -395,10 +386,7 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else if (nr == 0 || nc == 0)
                 matrix = FloatComplexMatrix (nr, nc);
--- a/libinterp/octave-value/ov-flt-re-mat.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-flt-re-mat.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -391,22 +391,13 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else
-                {
-                  error ("load: failed to read dimensions");
-                  success = false;
-                }
+                error ("load: failed to read dimensions");
             }
           else
-            {
-              error ("load: failed to extract number of dimensions");
-              success = false;
-            }
+            error ("load: failed to extract number of dimensions");
         }
       else if (kw == "rows")
         {
@@ -422,10 +413,7 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else if (nr == 0 || nc == 0)
                 matrix = FloatMatrix (nr, nc);
--- a/libinterp/octave-value/ov-perm.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-perm.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -308,10 +308,7 @@
         }
     }
   else
-    {
-      error ("load: failed to extract size & orientation");
-      success = false;
-    }
+    error ("load: failed to extract size & orientation");
 
   return success;
 }
--- a/libinterp/octave-value/ov-re-mat.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-re-mat.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -493,22 +493,13 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else
-                {
-                  error ("load: failed to read dimensions");
-                  success = false;
-                }
+                error ("load: failed to read dimensions");
             }
           else
-            {
-              error ("load: failed to extract number of dimensions");
-              success = false;
-            }
+            error ("load: failed to extract number of dimensions");
         }
       else if (kw == "rows")
         {
@@ -524,10 +515,7 @@
                   if (is)
                     matrix = tmp;
                   else
-                    {
-                      error ("load: failed to load matrix constant");
-                      success = false;
-                    }
+                    error ("load: failed to load matrix constant");
                 }
               else if (nr == 0 || nc == 0)
                 matrix = Matrix (nr, nc);
--- a/libinterp/octave-value/ov-str-mat.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-str-mat.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -386,10 +386,7 @@
                 }
             }
           else
-            {
-              error ("load: failed to extract matrix size");
-              success = false;
-            }
+            error ("load: failed to extract matrix size");
         }
       else if (kw == "elements")
         {
@@ -440,10 +437,7 @@
               matrix = chm;
             }
           else
-            {
-              error ("load: failed to extract number of string elements");
-              success = false;
-            }
+            error ("load: failed to extract number of string elements");
         }
       else if (kw == "length")
         {
--- a/libinterp/octave-value/ov-struct.cc	Sat Dec 19 13:59:32 2015 -0500
+++ b/libinterp/octave-value/ov-struct.cc	Sun Dec 20 07:42:17 2015 -0800
@@ -755,10 +755,7 @@
           if (is)
             map = m;
           else
-            {
-              error ("load: failed to load structure");
-              success = false;
-            }
+            error ("load: failed to load structure");
         }
       else if (len == 0)
         map = octave_map (dv);
@@ -877,10 +874,7 @@
       if (is)
         map = m;
       else
-        {
-          error ("load: failed to load structure");
-          success = false;
-        }
+        error ("load: failed to load structure");
     }
   else if (len == 0)
     map = octave_map (dv);
@@ -1403,10 +1397,7 @@
           if (is)
             map = m;
           else
-            {
-              error ("load: failed to load structure");
-              success = false;
-            }
+            error ("load: failed to load structure");
         }
       else if (len == 0)
         map = octave_scalar_map ();
@@ -1487,10 +1478,7 @@
       if (is)
         map = m;
       else
-        {
-          error ("load: failed to load structure");
-          success = false;
-        }
+        error ("load: failed to load structure");
     }
   else if (len == 0)
     map = octave_scalar_map ();