diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-09-19 13:55:23 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2020-10-18 20:09:05 +0200 |
commit | 0f5262917fab34b44b43f63946fdf6bb0621875a (patch) | |
tree | 07e449767f00310ef038d786688f891600a01b4d /linux | |
parent | 29346d05616ce69e5988b3f1257c340f91299602 (diff) |
Make all required includes explicit
Information as seen by IWYU 0.12 + clang 9 on Linux
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Battery.c | 10 | ||||
-rw-r--r-- | linux/Battery.h | 1 | ||||
-rw-r--r-- | linux/IOPriorityPanel.c | 6 | ||||
-rw-r--r-- | linux/IOPriorityPanel.h | 1 | ||||
-rw-r--r-- | linux/LinuxProcess.c | 18 | ||||
-rw-r--r-- | linux/LinuxProcess.h | 13 | ||||
-rw-r--r-- | linux/LinuxProcessList.c | 56 | ||||
-rw-r--r-- | linux/LinuxProcessList.h | 7 | ||||
-rw-r--r-- | linux/Platform.c | 51 | ||||
-rw-r--r-- | linux/Platform.h | 8 | ||||
-rw-r--r-- | linux/PressureStallMeter.c | 4 | ||||
-rw-r--r-- | linux/SELinuxMeter.c | 12 |
12 files changed, 120 insertions, 67 deletions
diff --git a/linux/Battery.c b/linux/Battery.c index faf4064c..f3e2ff24 100644 --- a/linux/Battery.c +++ b/linux/Battery.c @@ -13,13 +13,17 @@ Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat #include <dirent.h> #include <errno.h> -#include <unistd.h> +#include <fcntl.h> +#include <math.h> +#include <stdbool.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <fcntl.h> #include <time.h> -#include <math.h> +#include <unistd.h> +#include "BatteryMeter.h" +#include "Macros.h" #include "XUtils.h" diff --git a/linux/Battery.h b/linux/Battery.h index 496ce1a6..18b0dab6 100644 --- a/linux/Battery.h +++ b/linux/Battery.h @@ -11,6 +11,7 @@ Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat #include "BatteryMeter.h" + void Battery_getData(double* level, ACPresence* isOnAC); #endif diff --git a/linux/IOPriorityPanel.c b/linux/IOPriorityPanel.c index cc1b3916..50f57c10 100644 --- a/linux/IOPriorityPanel.c +++ b/linux/IOPriorityPanel.c @@ -7,6 +7,12 @@ in the source distribution for its full text. #include "IOPriorityPanel.h" +#include <stdbool.h> +#include <stddef.h> + +#include "FunctionBar.h" +#include "ListItem.h" +#include "Object.h" #include "XUtils.h" diff --git a/linux/IOPriorityPanel.h b/linux/IOPriorityPanel.h index d7358226..2ac4b316 100644 --- a/linux/IOPriorityPanel.h +++ b/linux/IOPriorityPanel.h @@ -9,7 +9,6 @@ in the source distribution for its full text. #include "Panel.h" #include "IOPriority.h" -#include "ListItem.h" Panel* IOPriorityPanel_new(IOPriority currPrio); diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 75900b5a..6d1e3ca6 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -6,19 +6,19 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ -#include "Process.h" -#include "ProcessList.h" #include "LinuxProcess.h" -#include "CRT.h" -#include "Platform.h" -#include "XUtils.h" +#include <math.h> +#include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <string.h> -#include <sys/syscall.h> -#include <time.h> -#include <math.h> +#include <syscall.h> +#include <unistd.h> + +#include "CRT.h" +#include "Process.h" +#include "ProvideCurses.h" +#include "XUtils.h" /* semi-global */ diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index ac80317d..8e7c36dc 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -8,6 +8,17 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include "config.h" + +#include <stdbool.h> +#include <sys/types.h> + +#include "IOPriority.h" +#include "Object.h" +#include "Process.h" +#include "RichString.h" +#include "Settings.h" + #define PROCESS_FLAG_LINUX_IOPRIO 0x0100 #define PROCESS_FLAG_LINUX_OPENVZ 0x0200 #define PROCESS_FLAG_LINUX_VSERVER 0x0400 @@ -87,8 +98,6 @@ typedef enum LinuxProcessFields { LAST_PROCESSFIELD = 124, } LinuxProcessField; -#include "IOPriority.h" - typedef struct LinuxProcess_ { Process super; bool isKernelThread; diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index bbb064d1..1ed13826 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -5,44 +5,52 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "LinuxProcessList.h" -#include "LinuxProcess.h" -#include "CRT.h" -#include "XUtils.h" -#include <errno.h> -#include <sys/time.h> -#include <sys/utsname.h> -#include <sys/stat.h> -#include <unistd.h> +#include <assert.h> #include <dirent.h> -#include <stdlib.h> -#include <stdio.h> -#include <signal.h> -#include <stdbool.h> -#include <stdarg.h> +#include <errno.h> +#include <fcntl.h> #include <math.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> #include <string.h> -#include <time.h> -#include <assert.h> +#include <strings.h> +#include <unistd.h> +#include <sys/stat.h> +#include <sys/time.h> #include <sys/types.h> -#include <fcntl.h> -#ifdef MAJOR_IN_MKDEV -#include <sys/mkdev.h> -#elif defined(MAJOR_IN_SYSMACROS) -#include <sys/sysmacros.h> -#endif #ifdef HAVE_DELAYACCT +#include <linux/netlink.h> +#include <linux/taskstats.h> #include <netlink/attr.h> +#include <netlink/handlers.h> +#include <netlink/msg.h> #include <netlink/netlink.h> +#include <netlink/socket.h> #include <netlink/genl/genl.h> #include <netlink/genl/ctrl.h> -#include <netlink/socket.h> -#include <netlink/msg.h> -#include <linux/taskstats.h> #endif +#include "CRT.h" +#include "LinuxProcess.h" +#include "Macros.h" +#include "Object.h" +#include "Process.h" +#include "Settings.h" +#include "XUtils.h" + +#ifdef MAJOR_IN_MKDEV +#include <sys/mkdev.h> +#elif defined(MAJOR_IN_SYSMACROS) +#include <sys/sysmacros.h> +#endif + + static ssize_t xread(int fd, void *buf, size_t count) { // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested. size_t alreadyRead = 0; diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h index 913f3cb4..57bc9dc0 100644 --- a/linux/LinuxProcessList.h +++ b/linux/LinuxProcessList.h @@ -7,7 +7,14 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include "config.h" + +#include <stdbool.h> +#include <sys/types.h> + +#include "Hashtable.h" #include "ProcessList.h" +#include "UsersTable.h" #include "zfs/ZfsArcStats.h" typedef struct CPUData_ { diff --git a/linux/Platform.c b/linux/Platform.c index feb6b6cf..1bb476ab 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -5,39 +5,48 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include "config.h" + #include "Platform.h" + +#include <assert.h> +#include <ctype.h> +#include <math.h> +#include <stdio.h> +#include <string.h> + +#include "BatteryMeter.h" +#include "ClockMeter.h" +#include "CPUMeter.h" +#include "DateMeter.h" +#include "DateTimeMeter.h" +#include "DiskIOMeter.h" +#include "HostnameMeter.h" #include "IOPriority.h" #include "IOPriorityPanel.h" #include "LinuxProcess.h" #include "LinuxProcessList.h" -#include "Battery.h" - +#include "LoadAverageMeter.h" +#include "Macros.h" +#include "MainPanel.h" #include "Meter.h" -#include "CPUMeter.h" -#include "DiskIOMeter.h" #include "MemoryMeter.h" +#include "NetworkIOMeter.h" +#include "Object.h" +#include "Panel.h" +#include "PressureStallMeter.h" +#include "ProcessList.h" +#include "ProvideCurses.h" +#include "SELinuxMeter.h" +#include "Settings.h" #include "SwapMeter.h" #include "TasksMeter.h" -#include "LoadAverageMeter.h" #include "UptimeMeter.h" -#include "PressureStallMeter.h" -#include "ClockMeter.h" -#include "DateMeter.h" -#include "DateTimeMeter.h" -#include "HostnameMeter.h" -#include "NetworkIOMeter.h" -#include "zfs/ZfsArcMeter.h" -#include "zfs/ZfsCompressedArcMeter.h" -#include "LinuxProcess.h" -#include "SELinuxMeter.h" #include "XUtils.h" -#include <math.h> -#include <assert.h> -#include <limits.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> +#include "zfs/ZfsArcMeter.h" +#include "zfs/ZfsArcStats.h" +#include "zfs/ZfsCompressedArcMeter.h" ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, (int)M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 }; diff --git a/linux/Platform.h b/linux/Platform.h index 007cd32b..3d4cabac 100644 --- a/linux/Platform.h +++ b/linux/Platform.h @@ -7,10 +7,12 @@ Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ +#include <stdbool.h> +#include <sys/types.h> + #include "Action.h" -#include "MainPanel.h" -#include "BatteryMeter.h" -#include "LinuxProcess.h" +#include "Meter.h" +#include "Process.h" #include "SignalsPanel.h" extern ProcessField Platform_defaultFields[]; diff --git a/linux/PressureStallMeter.c b/linux/PressureStallMeter.c index 4733415f..9ac0ced2 100644 --- a/linux/PressureStallMeter.c +++ b/linux/PressureStallMeter.c @@ -8,10 +8,14 @@ in the source distribution for its full text. #include "PressureStallMeter.h" +#include <stdbool.h> #include <string.h> #include "CRT.h" +#include "Meter.h" +#include "Object.h" #include "Platform.h" +#include "RichString.h" #include "XUtils.h" diff --git a/linux/SELinuxMeter.c b/linux/SELinuxMeter.c index 8562215b..275eefef 100644 --- a/linux/SELinuxMeter.c +++ b/linux/SELinuxMeter.c @@ -10,12 +10,16 @@ in the source distribution for its full text. #include "CRT.h" #include <fcntl.h> +#include <stdbool.h> +#include <stdio.h> +#include <unistd.h> #include <linux/magic.h> -#include <sys/stat.h> +#include <sys/statfs.h> #include <sys/statvfs.h> -#include <sys/types.h> -#include <sys/vfs.h> -#include <unistd.h> + +#include "Macros.h" +#include "Object.h" +#include "XUtils.h" static const int SELinuxMeter_attributes[] = { |