From: Taylor R Campbell Date: Sun, 10 Apr 2011 21:17:29 +0000 (+0000) Subject: Use do { ... } while (0) for command macros in uxproc.c. X-Git-Tag: 20110426-Gtk~2^2~3 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b9717273c8ff40fc1c8b5a06acddf7f638e86451;p=mit-scheme.git Use do { ... } while (0) for command macros in uxproc.c. Omit needless curly braces in subprocess_death. --- diff --git a/src/microcode/uxproc.c b/src/microcode/uxproc.c index 9412805e2..a3c17a6bf 100644 --- a/src/microcode/uxproc.c +++ b/src/microcode/uxproc.c @@ -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) /* 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))); } }