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);