From f345d55d3a21af84557fb8e12afdee3275784a6f Mon Sep 17 00:00:00 2001 From: Intel A80486DX2-66 Date: Tue, 20 Feb 2024 19:47:40 +0300 Subject: [PATCH] C: clock-malfunction-imitation.c: reformat macros --- .../experiments/clock-malfunction-imitation.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/c-programming/experiments/clock-malfunction-imitation.c b/c-programming/experiments/clock-malfunction-imitation.c index ee6ec50..59353a5 100644 --- a/c-programming/experiments/clock-malfunction-imitation.c +++ b/c-programming/experiments/clock-malfunction-imitation.c @@ -16,20 +16,20 @@ #define SECOND_PRECISION 1L #define TIME_BEFORE_ACCIDENT 2UL -#define TEST_LABEL(s) { \ - printf("Test: %s\n", s); \ - fflush(stdout); \ -} +#define TEST_LABEL(s) do { \ + printf("Test: %s\n", s); \ + fflush(stdout); \ +} while (0) #define CLOCK_FUN_BEGIN \ - static unsigned ticks_before_accident = TIME_BEFORE_ACCIDENT; \ - time_t y; + static unsigned ticks_before_accident = TIME_BEFORE_ACCIDENT; \ + time_t y; #define CLOCK_FUN_END \ - if (x != NULL) { \ - *x = y; \ - } \ - return y; + if (x != NULL) \ + *x = y; \ + \ + return y; time_t clock_change_time(time_t* x); time_t clock_exponential_growth(time_t* x);