Use do { ... } while (0) for command macros in uxproc.c.
authorTaylor R Campbell <campbell@mumble.net>
Sun, 10 Apr 2011 21:17:29 +0000 (21:17 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Sun, 10 Apr 2011 21:35:12 +0000 (21:35 +0000)
Omit needless curly braces in subprocess_death.

src/microcode/uxproc.c

index 9412805e297c15ab844538440c6f4322517ff0d3..a3c17a6bf34c78cdb4115798eb440505dad47198 100644 (file)
@@ -57,19 +57,19 @@ static Tprocess foreground_child_process;
 static long process_tick;
 static long sync_tick;
 
-#define NEW_RAW_STATUS(process, status, reason)                                \
+#define NEW_RAW_STATUS(process, status, reason) do                     \
 {                                                                      \
   (PROCESS_RAW_STATUS (process)) = (status);                           \
   (PROCESS_RAW_REASON (process)) = (reason);                           \
   (PROCESS_TICK (process)) = (++process_tick);                         \
-}
+} while (0)
 
-#define PROCESS_STATUS_SYNC(process)                                   \
+#define PROCESS_STATUS_SYNC(process) do                                        \
 {                                                                      \
   (PROCESS_STATUS (process)) = (PROCESS_RAW_STATUS (process));         \
   (PROCESS_REASON (process)) = (PROCESS_RAW_REASON (process));         \
   (PROCESS_SYNC_TICK (process)) = (PROCESS_TICK (process));            \
-}
+} while (0)
 \f
 /* This macro should only be used when
    (scheme_jc_status == process_jc_status_jc). */
@@ -719,20 +719,14 @@ subprocess_death (pid_t pid, int * status)
   if (process != NO_PROCESS)
     {
       if (WIFEXITED (*status))
-       {
-         NEW_RAW_STATUS
-           (process, process_status_exited, (WEXITSTATUS (*status)));
-       }
+       NEW_RAW_STATUS
+         (process, process_status_exited, (WEXITSTATUS (*status)));
       else if (WIFSTOPPED (*status))
-       {
-         NEW_RAW_STATUS
-           (process, process_status_stopped, (WSTOPSIG (*status)));
-       }
+       NEW_RAW_STATUS
+         (process, process_status_stopped, (WSTOPSIG (*status)));
       else if (WIFSIGNALED (*status))
-       {
-         NEW_RAW_STATUS
-           (process, process_status_signalled, (WTERMSIG (*status)));
-       }
+       NEW_RAW_STATUS
+         (process, process_status_signalled, (WTERMSIG (*status)));
     }
 }