From 6d5a04005dd1dff12ebfe2e3a56912ec26718f3f Mon Sep 17 00:00:00 2001 From: NRK Date: Tue, 31 May 2022 17:25:14 +0600 Subject: code-style: cleanup includes * rm unused include * move to main.c, it's the only file that needs it. * move TV_* macros to main.c * let *.c files explicitly include what they need instead of including them at nsxiv.h --- main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 64710f2..10f7440 100644 --- a/main.c +++ b/main.c @@ -23,6 +23,8 @@ #include "config.h" #include +#include +#include #include #include #include @@ -33,12 +35,20 @@ #include #include #include +#include #include #include #define MODMASK(mask) ((mask) & USED_MODMASK) #define BAR_SEP " " +#define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \ + ((t1)->tv_usec - (t2)->tv_usec) / 1000) +#define TV_ADD_MSEC(tv,t) { \ + (tv)->tv_sec += (t) / 1000; \ + (tv)->tv_usec += (t) % 1000 * 1000; \ +} + typedef struct { struct timeval when; bool active; -- cgit v1.2.3-54-g00ecf