nsxivb162aee
sort and group includes
* includes are sorted alphabetically * their grouping and layout is the following: - nsxiv.h will be the first include - followed by any internal headers (e.g "commands.h" "config.h") - followed by system headers (<stdlib.h> etc) - followed by third party headers (X.h libwebp etc) * also add `llvm-include-order` check to clang-tidy so that it can catch unsorted includes during CI.
+24 −20
8 files changed
- M .woodpecker/clang-tidy-checks +1 −0
- M autoreload.c +1 −1
- M commands.c +4 −4
- M main.c +10 −9
- M nsxiv.h +2 −1
- M options.c +1 −1
- M util.c +2 −2
- M window.c +3 −2
| @@ -1,6 +1,7 @@ | |||
| 1 | 1 | # checks | |
| 2 | 2 | clang-analyzer-*,clang-diagnostic-*,bugprone-*,performance-*,modernize-* | |
| 3 | 3 | misc-*,readability-*,android-cloexec-*,cert-* | |
| 4 | + | llvm-include-order | |
| 4 | 5 | ||
| 5 | 6 | # silence | |
| 6 | 7 | -misc-unused-parameters | |
| @@ -23,8 +23,8 @@ | |||
| 23 | 23 | #include <errno.h> | |
| 24 | 24 | #include <stdlib.h> | |
| 25 | 25 | #include <string.h> | |
| 26 | − | #include <unistd.h> | |
| 27 | 26 | #include <sys/inotify.h> | |
| 27 | + | #include <unistd.h> | |
| 28 | 28 | ||
| 29 | 29 | static union { | |
| 30 | 30 | char d[4096]; /* aligned buffer */ | |
| @@ -19,13 +19,13 @@ | |||
| 19 | 19 | ||
| 20 | 20 | #include "nsxiv.h" | |
| 21 | 21 | ||
| 22 | − | #include <stdlib.h> | |
| 22 | + | #include "commands.h" | |
| 23 | + | ||
| 23 | 24 | #include <stdio.h> | |
| 25 | + | #include <stdlib.h> | |
| 24 | 26 | #include <string.h> | |
| 25 | − | #include <unistd.h> | |
| 26 | 27 | #include <sys/wait.h> | |
| 27 | − | ||
| 28 | − | #include "commands.h" | |
| 28 | + | #include <unistd.h> | |
| 29 | 29 | ||
| 30 | 30 | extern img_t img; | |
| 31 | 31 | extern tns_t tns; | |
| @@ -22,22 +22,23 @@ | |||
| 22 | 22 | #include "commands.h" | |
| 23 | 23 | #include "config.h" | |
| 24 | 24 | ||
| 25 | − | #include <stdlib.h> | |
| 26 | − | #include <stdarg.h> | |
| 27 | − | #include <stdio.h> | |
| 28 | − | #include <string.h> | |
| 29 | − | #include <fcntl.h> | |
| 30 | − | #include <unistd.h> | |
| 31 | 25 | #include <errno.h> | |
| 26 | + | #include <fcntl.h> | |
| 32 | 27 | #include <locale.h> | |
| 33 | − | #include <signal.h> | |
| 34 | 28 | #include <poll.h> | |
| 29 | + | #include <signal.h> | |
| 30 | + | #include <stdarg.h> | |
| 31 | + | #include <stdio.h> | |
| 32 | + | #include <stdlib.h> | |
| 33 | + | #include <string.h> | |
| 35 | 34 | #include <sys/stat.h> | |
| 35 | + | #include <sys/time.h> | |
| 36 | 36 | #include <sys/wait.h> | |
| 37 | 37 | #include <time.h> | |
| 38 | − | #include <sys/time.h> | |
| 39 | − | #include <X11/keysym.h> | |
| 38 | + | #include <unistd.h> | |
| 39 | + | ||
| 40 | 40 | #include <X11/XF86keysym.h> | |
| 41 | + | #include <X11/keysym.h> | |
| 41 | 42 | ||
| 42 | 43 | #define MODMASK(mask) ((mask) & USED_MODMASK) | |
| 43 | 44 | #define BAR_SEP " " | |
| @@ -20,8 +20,9 @@ | |||
| 20 | 20 | #ifndef NSXIV_H | |
| 21 | 21 | #define NSXIV_H | |
| 22 | 22 | ||
| 23 | − | #include <stddef.h> | |
| 24 | 23 | #include <stdbool.h> | |
| 24 | + | #include <stddef.h> | |
| 25 | + | ||
| 25 | 26 | #include <Imlib2.h> | |
| 26 | 27 | #include <X11/Xlib.h> | |
| 27 | 28 | ||
| @@ -20,8 +20,8 @@ | |||
| 20 | 20 | #include "nsxiv.h" | |
| 21 | 21 | #include "version.h" | |
| 22 | 22 | ||
| 23 | − | #include <stdlib.h> | |
| 24 | 23 | #include <stdio.h> | |
| 24 | + | #include <stdlib.h> | |
| 25 | 25 | #include <string.h> | |
| 26 | 26 | #include <unistd.h> | |
| 27 | 27 | ||
| @@ -20,13 +20,13 @@ | |||
| 20 | 20 | #include "nsxiv.h" | |
| 21 | 21 | ||
| 22 | 22 | #include <assert.h> | |
| 23 | − | #include <stdlib.h> | |
| 23 | + | #include <errno.h> | |
| 24 | 24 | #include <stdarg.h> | |
| 25 | 25 | #include <stdio.h> | |
| 26 | + | #include <stdlib.h> | |
| 26 | 27 | #include <string.h> | |
| 27 | 28 | #include <sys/stat.h> | |
| 28 | 29 | #include <unistd.h> | |
| 29 | − | #include <errno.h> | |
| 30 | 30 | ||
| 31 | 31 | const char *progname; | |
| 32 | 32 | ||
| @@ -22,13 +22,14 @@ | |||
| 22 | 22 | #include "config.h" | |
| 23 | 23 | #include "icon/data.h" | |
| 24 | 24 | ||
| 25 | + | #include <locale.h> | |
| 25 | 26 | #include <stdlib.h> | |
| 26 | 27 | #include <string.h> | |
| 27 | − | #include <locale.h> | |
| 28 | 28 | #include <unistd.h> | |
| 29 | − | #include <X11/cursorfont.h> | |
| 29 | + | ||
| 30 | 30 | #include <X11/Xatom.h> | |
| 31 | 31 | #include <X11/Xresource.h> | |
| 32 | + | #include <X11/cursorfont.h> | |
| 32 | 33 | ||
| 33 | 34 | #if HAVE_LIBFONTS | |
| 34 | 35 | #include "utf8.h" | |