From 633a4f66d98e46755effb71d6cd3f8a681c4818c Mon Sep 17 00:00:00 2001 From: N-R-K Date: Thu, 12 May 2022 14:47:46 +0000 Subject: check_timeouts: avoid unnecessary conversions (#273) before we were using select, which expected `struct timeval` as arg. so we needed to do ms -> timeval conversions. but now since we're using poll, which accepts milisec as arg, there's no need to do ms -> timeval -> ms. instead have check_timeouts directly return ms. --- nsxiv.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'nsxiv.h') diff --git a/nsxiv.h b/nsxiv.h index f9f5600..55041bd 100644 --- a/nsxiv.h +++ b/nsxiv.h @@ -44,12 +44,6 @@ #define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \ ((t1)->tv_usec - (t2)->tv_usec) / 1000) -#define TV_TO_MS(tv) (((tv)->tv_sec * 1000) + ((tv)->tv_usec / 1000)) - -#define TV_SET_MSEC(tv,t) { \ - (tv)->tv_sec = (t) / 1000; \ - (tv)->tv_usec = (t) % 1000 * 1000; \ -} #define TV_ADD_MSEC(tv,t) { \ (tv)->tv_sec += (t) / 1000; \ -- cgit v1.2.3-54-g00ecf