diff libinterp/octave-value/ov-re-mat.cc @ 20797:492738d32c60

eliminate return statements after calls to print_usage * ov-bool-mat.cc, ov-cell.cc, ov-class.cc, ov-classdef.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-flt-re-mat.cc, ov-java.cc, ov-null-mat.cc, ov-oncleanup.cc, ov-re-mat.cc, ov-struct.cc, ov-type-conv.h, ov-typeinfo.cc, ov-usr-fcn.cc, ov.cc: Eliminate return statements after calls to print_usage.
author John W. Eaton <jwe@octave.org>
date Thu, 03 Dec 2015 14:59:30 -0500
parents f90c8372b7ba
children 1142cf6abc0d
line wrap: on
line diff
--- a/libinterp/octave-value/ov-re-mat.cc	Fri Dec 04 10:03:38 2015 -0800
+++ b/libinterp/octave-value/ov-re-mat.cc	Thu Dec 03 14:59:30 2015 -0500
@@ -987,50 +987,48 @@
   // inside their own scopes, and we don't declare retval here to
   // avoid a shadowed declaration warning.
 
-  if (args.length () == 1)
+  if (args.length () != 1)
+    print_usage ();
+
+  if (args(0).is_perm_matrix ())
     {
-      if (args(0).is_perm_matrix ())
-        {
-          OCTAVE_TYPE_CONV_BODY3 (double, octave_perm_matrix, octave_scalar);
-        }
-      else if (args(0).is_diag_matrix ())
+      OCTAVE_TYPE_CONV_BODY3 (double, octave_perm_matrix, octave_scalar);
+    }
+  else if (args(0).is_diag_matrix ())
+    {
+      if (args(0).is_complex_type ())
         {
-          if (args(0).is_complex_type ())
-            {
-              OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_diag_matrix,
-                                      octave_complex);
-            }
-          else
-            {
-              OCTAVE_TYPE_CONV_BODY3 (double, octave_diag_matrix,
-                                      octave_scalar);
-            }
-        }
-      else if (args(0).is_sparse_type ())
-        {
-          if (args(0).is_complex_type ())
-            {
-              OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_complex_matrix,
-                                      octave_complex);
-            }
-          else
-            {
-              OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_matrix,
-                                      octave_scalar);
-            }
-        }
-      else if (args(0).is_complex_type ())
-        {
-          OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_matrix,
+          OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_diag_matrix,
                                   octave_complex);
         }
       else
         {
-          OCTAVE_TYPE_CONV_BODY3 (double, octave_matrix, octave_scalar);
+          OCTAVE_TYPE_CONV_BODY3 (double, octave_diag_matrix,
+                                  octave_scalar);
         }
     }
+  else if (args(0).is_sparse_type ())
+    {
+      if (args(0).is_complex_type ())
+        {
+          OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_complex_matrix,
+                                  octave_complex);
+        }
+      else
+        {
+          OCTAVE_TYPE_CONV_BODY3 (double, octave_sparse_matrix,
+                                  octave_scalar);
+        }
+    }
+  else if (args(0).is_complex_type ())
+    {
+      OCTAVE_TYPE_CONV_BODY3 (double, octave_complex_matrix,
+                              octave_complex);
+    }
   else
-    print_usage ();
+    {
+      OCTAVE_TYPE_CONV_BODY3 (double, octave_matrix, octave_scalar);
+    }
 
   return octave_value ();
 }