From 4e05a55e373bd315e721d534a1711fec4c0054c5 Mon Sep 17 00:00:00 2001 From: Julian T Date: Mon, 12 Oct 2020 16:26:42 +0200 Subject: Moved to linux kernel inspired clang-format --- sem3/osc/mm1/mm2/tprog.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'sem3/osc/mm1/mm2/tprog.c') diff --git a/sem3/osc/mm1/mm2/tprog.c b/sem3/osc/mm1/mm2/tprog.c index bb04778..82c9fb2 100644 --- a/sem3/osc/mm1/mm2/tprog.c +++ b/sem3/osc/mm1/mm2/tprog.c @@ -19,26 +19,26 @@ void timer_handler(int signum) /* Calculate new alarm */ tv->tv_sec *= SPEED; if (tv->tv_sec == 0) { - /* If tv_usec is 0 set i to 1 sec otherwise half it */ - if (tv->tv_usec == 0) { - tv->tv_usec = 999999; - } else if (tv->tv_usec > ENDUSEC) { - tv->tv_usec *= SPEED; - if (tv->tv_usec < ENDUSEC) { - tv->tv_usec = ENDUSEC; - } - } else { - /* Return letting the timer be set to ENDUSEC */ - return; - } + /* If tv_usec is 0 set i to 1 sec otherwise half it */ + if (tv->tv_usec == 0) { + tv->tv_usec = 999999; + } else if (tv->tv_usec > ENDUSEC) { + tv->tv_usec *= SPEED; + if (tv->tv_usec < ENDUSEC) { + tv->tv_usec = ENDUSEC; + } + } else { + /* Return letting the timer be set to ENDUSEC */ + return; + } } printf("Set to %d and %d\n", timer.it_value.tv_sec, timer.it_value.tv_usec); /* Set alarm */ int err = setitimer(ITIMER_REAL, &timer, NULL); if (err) { - printf("Hey we got an error guys\n"); - exit(1); + printf("Hey we got an error guys\n"); + exit(1); } } -- cgit v1.2.3