nsxiv6d5a040
code-style: cleanup includes
* rm unused include <sys/types.h> * move <sys/time.h> 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
+16 −16
7 files changed
- M commands.c +1 −0
- M image.c +0 −1
- M main.c +10 −0
- M nsxiv.h +1 −13
- M options.c +1 −0
- M thumbs.c +1 −1
- M util.c +2 −1
| @@ -20,6 +20,7 @@ | |||
| 20 | 20 | #include "nsxiv.h" | |
| 21 | 21 | ||
| 22 | 22 | #include <stdlib.h> | |
| 23 | + | #include <stdio.h> | |
| 23 | 24 | #include <string.h> | |
| 24 | 25 | #include <unistd.h> | |
| 25 | 26 | #include <sys/wait.h> | |
| @@ -26,7 +26,6 @@ | |||
| 26 | 26 | #include <stdlib.h> | |
| 27 | 27 | #include <string.h> | |
| 28 | 28 | #include <sys/stat.h> | |
| 29 | − | #include <sys/types.h> | |
| 30 | 29 | #include <unistd.h> | |
| 31 | 30 | ||
| 32 | 31 | #if HAVE_LIBEXIF | |
| @@ -23,6 +23,8 @@ | |||
| 23 | 23 | #include "config.h" | |
| 24 | 24 | ||
| 25 | 25 | #include <stdlib.h> | |
| 26 | + | #include <stdarg.h> | |
| 27 | + | #include <stdio.h> | |
| 26 | 28 | #include <string.h> | |
| 27 | 29 | #include <fcntl.h> | |
| 28 | 30 | #include <unistd.h> | |
| @@ -33,12 +35,20 @@ | |||
| 33 | 35 | #include <sys/stat.h> | |
| 34 | 36 | #include <sys/wait.h> | |
| 35 | 37 | #include <time.h> | |
| 38 | + | #include <sys/time.h> | |
| 36 | 39 | #include <X11/keysym.h> | |
| 37 | 40 | #include <X11/XF86keysym.h> | |
| 38 | 41 | ||
| 39 | 42 | #define MODMASK(mask) ((mask) & USED_MODMASK) | |
| 40 | 43 | #define BAR_SEP " " | |
| 41 | 44 | ||
| 45 | + | #define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \ | |
| 46 | + | ((t1)->tv_usec - (t2)->tv_usec) / 1000) | |
| 47 | + | #define TV_ADD_MSEC(tv,t) { \ | |
| 48 | + | (tv)->tv_sec += (t) / 1000; \ | |
| 49 | + | (tv)->tv_usec += (t) % 1000 * 1000; \ | |
| 50 | + | } | |
| 51 | + | ||
| 42 | 52 | typedef struct { | |
| 43 | 53 | struct timeval when; | |
| 44 | 54 | bool active; | |
| @@ -20,11 +20,8 @@ | |||
| 20 | 20 | #ifndef NSXIV_H | |
| 21 | 21 | #define NSXIV_H | |
| 22 | 22 | ||
| 23 | − | #include <stdarg.h> | |
| 23 | + | #include <stddef.h> | |
| 24 | 24 | #include <stdbool.h> | |
| 25 | − | #include <stdio.h> | |
| 26 | − | #include <sys/time.h> | |
| 27 | − | #include <sys/types.h> | |
| 28 | 25 | #include <Imlib2.h> | |
| 29 | 26 | #include <X11/Xlib.h> | |
| 30 | 27 | ||
| @@ -39,17 +36,8 @@ | |||
| 39 | 36 | #define ABS(a) ((a) > 0 ? (a) : -(a)) | |
| 40 | 37 | ||
| 41 | 38 | #define ARRLEN(a) (sizeof(a) / sizeof((a)[0])) | |
| 42 | − | ||
| 43 | 39 | #define STREQ(s1,s2) (strcmp((s1), (s2)) == 0) | |
| 44 | 40 | ||
| 45 | − | #define TV_DIFF(t1,t2) (((t1)->tv_sec - (t2)->tv_sec ) * 1000 + \ | |
| 46 | − | ((t1)->tv_usec - (t2)->tv_usec) / 1000) | |
| 47 | − | ||
| 48 | − | #define TV_ADD_MSEC(tv,t) { \ | |
| 49 | − | (tv)->tv_sec += (t) / 1000; \ | |
| 50 | − | (tv)->tv_usec += (t) % 1000 * 1000; \ | |
| 51 | − | } | |
| 52 | − | ||
| 53 | 41 | typedef enum { | |
| 54 | 42 | MODE_ALL, | |
| 55 | 43 | MODE_IMAGE, | |
| @@ -21,6 +21,7 @@ | |||
| 21 | 21 | #include "version.h" | |
| 22 | 22 | ||
| 23 | 23 | #include <stdlib.h> | |
| 24 | + | #include <stdio.h> | |
| 24 | 25 | #include <string.h> | |
| 25 | 26 | #include <unistd.h> | |
| 26 | 27 | ||
| @@ -22,9 +22,9 @@ | |||
| 22 | 22 | #include "config.h" | |
| 23 | 23 | ||
| 24 | 24 | #include <errno.h> | |
| 25 | + | #include <stdio.h> | |
| 25 | 26 | #include <stdlib.h> | |
| 26 | 27 | #include <string.h> | |
| 27 | − | #include <sys/types.h> | |
| 28 | 28 | #include <sys/stat.h> | |
| 29 | 29 | #include <unistd.h> | |
| 30 | 30 | #include <utime.h> | |
| @@ -21,8 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | #include <assert.h> | |
| 23 | 23 | #include <stdlib.h> | |
| 24 | + | #include <stdarg.h> | |
| 25 | + | #include <stdio.h> | |
| 24 | 26 | #include <string.h> | |
| 25 | − | #include <sys/types.h> | |
| 26 | 27 | #include <sys/stat.h> | |
| 27 | 28 | #include <unistd.h> | |
| 28 | 29 | #include <errno.h> | |