From b9717273c8ff40fc1c8b5a06acddf7f638e86451 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 10 Apr 2011 21:17:29 +0000 Subject: [PATCH] Use do { ... } while (0) for command macros in uxproc.c. Omit needless curly braces in subprocess_death. --- src/microcode/uxproc.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) 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))); } } -- 2.25.1