aboutsummaryrefslogtreecommitdiffstats
path: root/nsxiv.h
diff options
context:
space:
mode:
authorN-R-K <nrk@disroot.org>2022-05-12 16:47:46 +0200
committerGitHub <noreply@github.com>2022-05-12 16:47:46 +0200
commit633a4f66d98e46755effb71d6cd3f8a681c4818c (patch)
tree5c402e1f6a93871203c845a98934e307c09ae713 /nsxiv.h
parent3a22e6a6c5ad10e8c5cb9abb3615d2a8867d63e9 (diff)
downloadnsxiv-633a4f66d98e46755effb71d6cd3f8a681c4818c.tar.zst
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.
Diffstat (limited to 'nsxiv.h')
-rw-r--r--nsxiv.h6
1 files changed, 0 insertions, 6 deletions
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; \