diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2019-08-09 11:09:27 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2019-08-09 11:18:39 +0200 |
| commit | 820498b2158e0b05421ce0922f203a0699927fa8 (patch) | |
| tree | 3bf6d1089b762535ec5e59738d47ae2d2f54750f /shared/n-acd/src/util/timer.c | |
| parent | 1bd9f376796563dfb5016bada66c78b203f41d33 (diff) | |
| parent | 488dda3930545969f5644b57cfca81e21df031c3 (diff) | |
Merge remote-tracking branch 'salsa/master'
Diffstat (limited to 'shared/n-acd/src/util/timer.c')
| -rw-r--r-- | shared/n-acd/src/util/timer.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/shared/n-acd/src/util/timer.c b/shared/n-acd/src/util/timer.c index 07dbf34e..3c9570a1 100644 --- a/shared/n-acd/src/util/timer.c +++ b/shared/n-acd/src/util/timer.c @@ -4,6 +4,7 @@ #include <assert.h> #include <c-rbtree.h> +#include <c-stdaux.h> #include <errno.h> #include <stdlib.h> #include <sys/timerfd.h> @@ -30,7 +31,7 @@ int timer_init(Timer *timer) { } void timer_deinit(Timer *timer) { - assert(c_rbtree_is_empty(&timer->tree)); + c_assert(c_rbtree_is_empty(&timer->tree)); if (timer->fd >= 0) { close(timer->fd); @@ -43,8 +44,7 @@ void timer_now(Timer *timer, uint64_t *nowp) { int r; r = clock_gettime(timer->clock, &ts); - assert(r >= 0); - (void)r; + c_assert(r >= 0); *nowp = ts.tv_sec * UINT64_C(1000000000) + ts.tv_nsec; } @@ -60,7 +60,7 @@ void timer_rearm(Timer *timer) { */ timeout = c_rbnode_entry(c_rbtree_first(&timer->tree), Timeout, node); - assert(!timeout || timeout->timeout); + c_assert(!timeout || timeout->timeout); time = timeout ? timeout->timeout : 0; @@ -74,8 +74,7 @@ void timer_rearm(Timer *timer) { }, }, NULL); - assert(r >= 0); - (void)r; + c_assert(r >= 0); timer->scheduled_timeout = time; } @@ -134,8 +133,7 @@ int timer_pop_timeout(Timer *timer, uint64_t until, Timeout **timeoutp) { } void timeout_schedule(Timeout *timeout, Timer *timer, uint64_t time) { - - assert(time); + c_assert(time); /* * In case @timeout was already scheduled, remove it from the |