diff libinterp/octave-value/ov.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 b6f2909e7f94
children 1142cf6abc0d
line wrap: on
line diff
--- a/libinterp/octave-value/ov.cc	Fri Dec 04 10:03:38 2015 -0800
+++ b/libinterp/octave-value/ov.cc	Thu Dec 03 14:59:30 2015 -0500
@@ -2927,14 +2927,10 @@
 @seealso{whos}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-  if (args.length () == 1)
-    retval = args(0).byte_size ();
-  else
+  if (args.length () != 1)
     print_usage ();
 
-  return retval;
+  return octave_value (args(0).byte_size ());
 }
 
 /*
@@ -3048,22 +3044,20 @@
 {
   octave_value_list retval;
 
-  if (args.length () == 2)
-    {
-      std::string type;
-      std::list<octave_value_list> idx;
-
-      decode_subscripts ("subsref", args(1), type, idx);
-
-      octave_value arg0 = args(0);
-
-      if (type.empty ())
-        retval = arg0;
-      else
-        retval = arg0.subsref (type, idx, nargout);
-    }
+  if (args.length () != 2)
+    print_usage ();
+
+  std::string type;
+  std::list<octave_value_list> idx;
+
+  decode_subscripts ("subsref", args(1), type, idx);
+
+  octave_value arg0 = args(0);
+
+  if (type.empty ())
+    retval = arg0;
   else
-    print_usage ();
+    retval = arg0.subsref (type, idx, nargout);
 
   return retval;
 }
@@ -3103,30 +3097,28 @@
 {
   octave_value retval;
 
-  if (args.length () == 3)
+  if (args.length () != 3)
+    print_usage ();
+
+  std::string type;
+  std::list<octave_value_list> idx;
+
+  decode_subscripts ("subsasgn", args(1), type, idx);
+
+  if (type.empty ())
     {
-      std::string type;
-      std::list<octave_value_list> idx;
-
-      decode_subscripts ("subsasgn", args(1), type, idx);
-
-      if (type.empty ())
-        {
-          // Regularize a null matrix if stored into a variable.
-
-          retval = args(2).storable_value ();
-        }
-      else
-        {
-          octave_value arg0 = args(0);
-
-          arg0.make_unique ();
-
-          retval= arg0.subsasgn (type, idx, args(2));
-        }
+      // Regularize a null matrix if stored into a variable.
+
+      retval = args(2).storable_value ();
     }
   else
-    print_usage ();
+    {
+      octave_value arg0 = args(0);
+
+      arg0.make_unique ();
+
+      retval= arg0.subsasgn (type, idx, args(2));
+    }
 
   return retval;
 }
@@ -3205,14 +3197,10 @@
 @seealso{is_dq_string, ischar}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-  if (args.length () == 1)
-    retval = args(0).is_sq_string ();
-  else
+  if (args.length () != 1)
     print_usage ();
 
-  return retval;
+  return octave_value (args(0).is_sq_string ());
 }
 
 /*
@@ -3232,14 +3220,10 @@
 @seealso{is_sq_string, ischar}\n\
 @end deftypefn")
 {
-  octave_value retval;
-
-  if (args.length () == 1)
-    retval = args(0).is_dq_string ();
-  else
+  if (args.length () != 1)
     print_usage ();
 
-  return retval;
+  return octave_value (args(0).is_dq_string ());
 }
 
 /*