aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main.c b/main.c
index ed11a9b..18db413 100644
--- a/main.c
+++ b/main.c
@@ -144,7 +144,7 @@ void set_timeout(timeout_f handler, int time, bool overwrite) {
if (timeouts[i].handler == handler) {
if (!timeouts[i].active || overwrite) {
gettimeofday(&timeouts[i].when, 0);
- MSEC_ADD_TO_TIMEVAL(time, &timeouts[i].when);
+ tv_add_msec(&timeouts[i].when, time);
timeouts[i].active = true;
}
return;
@@ -170,7 +170,7 @@ bool check_timeouts(struct timeval *t) {
gettimeofday(&now, 0);
while (i < ARRLEN(timeouts)) {
if (timeouts[i].active) {
- tdiff = TIMEDIFF(&timeouts[i].when, &now);
+ tdiff = tv_diff(&timeouts[i].when, &now);
if (tdiff <= 0) {
timeouts[i].active = false;
if (timeouts[i].handler)
@@ -183,7 +183,7 @@ bool check_timeouts(struct timeval *t) {
i++;
}
if (tmin > 0 && t)
- MSEC_TO_TIMEVAL(tmin, t);
+ tv_set_msec(t, tmin);
return tmin > 0;
}