diff libinterp/corefcn/toplev.cc @ 21055:5e00ed38a58b

maint: Replace if/error/else paradigm with just if/error. * __ilu__.cc, data.cc, file-io.cc, graphics.cc, graphics.in.h, ls-mat5.cc, lu.cc, octave-link.cc, regexp.cc, schur.cc, spparms.cc, sub2ind.cc, syscalls.cc, toplev.cc, variables.cc, xpow.cc, audiodevinfo.cc, ccolamd.cc, ov-builtin.cc, ov-classdef.cc, ov-intx.h, ov-lazy-idx.cc, ov-mex-fcn.cc, op-int.h, lex.ll, oct-parse.in.yy, pt-binop.cc, pt-cbinop.cc, pt-const.cc, pt-decl.h, pt-fcn-handle.cc, pt-unop.cc, CollocWt.cc: Replace if/error/else paradigm with just if/error.
author Rik <rik@octave.org>
date Wed, 13 Jan 2016 11:02:22 -0800
parents 93748bcaec17
children 49852ff04747
line wrap: on
line diff
--- a/libinterp/corefcn/toplev.cc	Tue Jan 12 21:45:58 2016 +0100
+++ b/libinterp/corefcn/toplev.cc	Wed Jan 13 11:02:22 2016 -0800
@@ -838,27 +838,25 @@
 
   if (! quit_allowed)
     error ("quit: not supported in embedded mode");
-  else
+
+  if (args.length () > 0)
     {
-      if (args.length () > 0)
-        {
-          int tmp = args(0).nint_value ();
+      int tmp = args(0).nint_value ();
 
-          exit_status = tmp;
-        }
+      exit_status = tmp;
+    }
 
-      // Instead of simply calling exit, we simulate an interrupt
-      // with a request to exit cleanly so that no matter where the
-      // call to quit occurs, we will run the unwind_protect stack,
-      // clear the OCTAVE_LOCAL_BUFFER allocations, etc. before
-      // exiting.
+  // Instead of simply calling exit, we simulate an interrupt
+  // with a request to exit cleanly so that no matter where the
+  // call to quit occurs, we will run the unwind_protect stack,
+  // clear the OCTAVE_LOCAL_BUFFER allocations, etc. before
+  // exiting.
 
-      quitting_gracefully = true;
+  quitting_gracefully = true;
 
-      octave_interrupt_state = -1;
+  octave_interrupt_state = -1;
 
-      octave_throw_interrupt_exception ();
-    }
+  octave_throw_interrupt_exception ();
 
   return retval;
 }
@@ -1078,9 +1076,7 @@
         error ("system: fork failed -- can't create child process");
       else if (pid == 0)
         {
-          // FIXME: should probably replace this
-          // call with something portable.
-
+          // FIXME: should probably replace this call with something portable.
           execl (SHELL_PATH, "sh", "-c", cmd_str.c_str (),
                  static_cast<void *> (0));
 
@@ -1098,12 +1094,10 @@
 
       if (! CreateProcess (0, xcmd_str, 0, 0, FALSE, 0, 0, 0, &si, &pi))
         error ("system: CreateProcess failed -- can't create child process");
-      else
-        {
-          retval(0) = pi.dwProcessId;
-          CloseHandle (pi.hProcess);
-          CloseHandle (pi.hThread);
-        }
+
+      retval(0) = pi.dwProcessId;
+      CloseHandle (pi.hProcess);
+      CloseHandle (pi.hThread);
 #else
       error ("system: asynchronous system calls are not supported");
 #endif