summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Goettsche <cgzones@googlemail.com>2020-11-18 15:12:18 +0100
committerBenBE <BenBE@geshi.org>2020-11-19 23:51:50 +0100
commitf5c3349bdb9cae2eec5adb9892445d3a1b482ec4 (patch)
tree72d2d82c7e2fac5f95205d344a837fa15022e516
parent7cf527759481a760b0f08da16add3a5120048572 (diff)
IWYU update (FreeBSD)
-rw-r--r--Action.c7
-rw-r--r--Affinity.c2
-rw-r--r--Affinity.h13
-rw-r--r--CPUMeter.c2
-rw-r--r--freebsd/FreeBSDProcess.c13
-rw-r--r--freebsd/FreeBSDProcess.h1
-rw-r--r--freebsd/FreeBSDProcessList.c18
-rw-r--r--freebsd/FreeBSDProcessList.h8
-rw-r--r--freebsd/Platform.c9
-rw-r--r--freebsd/Platform.h3
-rw-r--r--iwyu/htop.imp8
-rwxr-xr-xiwyu/run_iwyu.sh2
-rw-r--r--zfs/ZfsArcStats.c16
-rw-r--r--zfs/openzfs_sysctl.c13
14 files changed, 63 insertions, 52 deletions
diff --git a/Action.c b/Action.c
index edaebc66..ef7caaf4 100644
--- a/Action.c
+++ b/Action.c
@@ -13,8 +13,6 @@ in the source distribution for its full text.
#include <stdbool.h>
#include <stdlib.h>
-#include "Affinity.h"
-#include "AffinityPanel.h"
#include "CategoriesPanel.h"
#include "CommandScreen.h"
#include "CRT.h"
@@ -36,6 +34,11 @@ in the source distribution for its full text.
#include "Vector.h"
#include "XUtils.h"
+#if (defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY))
+#include "Affinity.h"
+#include "AffinityPanel.h"
+#endif
+
Object* Action_pickFromVector(State* st, Panel* list, int x, bool followProcess) {
Panel* panel = st->panel;
diff --git a/Affinity.c b/Affinity.c
index 6fb5846c..c157885b 100644
--- a/Affinity.c
+++ b/Affinity.c
@@ -6,7 +6,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
-#include "config.h"
+#include "config.h" // IWYU pragma: keep
#include "Affinity.h"
diff --git a/Affinity.h b/Affinity.h
index 0797b366..97c8e466 100644
--- a/Affinity.h
+++ b/Affinity.h
@@ -8,18 +8,23 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
-#include "config.h"
+#include "config.h" // IWYU pragma: keep
+#include "ProcessList.h"
+
+#if defined(HAVE_LIBHWLOC) || defined(HAVE_LINUX_AFFINITY)
#include <stdbool.h>
#include "Object.h"
#include "Process.h"
-#include "ProcessList.h"
+#endif
+
#if defined(HAVE_LIBHWLOC) && defined(HAVE_LINUX_AFFINITY)
-#error hwlock and linux affinity are mutual exclusive.
+#error hwloc and linux affinity are mutual exclusive.
#endif
+
typedef struct Affinity_ {
ProcessList* pl;
int size;
@@ -39,6 +44,6 @@ Affinity* Affinity_get(Process* proc, ProcessList* pl);
bool Affinity_set(Process* proc, Arg arg);
-#endif
+#endif /* HAVE_LIBHWLOC || HAVE_LINUX_AFFINITY */
#endif
diff --git a/CPUMeter.c b/CPUMeter.c
index cb5a5e74..61b33cb6 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -5,7 +5,7 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
-#include "config.h"
+#include "config.h" // IWYU pragma: keep
#include "CPUMeter.h"
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
index 57e64118..c4568677 100644
--- a/freebsd/FreeBSDProcess.c
+++ b/freebsd/FreeBSDProcess.c
@@ -5,16 +5,15 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
-#include "Process.h"
-#include "ProcessList.h"
#include "FreeBSDProcess.h"
-#include "Platform.h"
-#include "CRT.h"
#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/syscall.h>
+
+#include "CRT.h"
+#include "Macros.h"
+#include "Process.h"
+#include "RichString.h"
+#include "XUtils.h"
const char* const nodevStr = "nodev";
diff --git a/freebsd/FreeBSDProcess.h b/freebsd/FreeBSDProcess.h
index d2fee956..89119764 100644
--- a/freebsd/FreeBSDProcess.h
+++ b/freebsd/FreeBSDProcess.h
@@ -11,7 +11,6 @@ in the source distribution for its full text.
#include "Object.h"
#include "Process.h"
-#include "RichString.h"
#include "Settings.h"
diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c
index 7ce787f8..7dd432f5 100644
--- a/freebsd/FreeBSDProcessList.c
+++ b/freebsd/FreeBSDProcessList.c
@@ -10,23 +10,31 @@ in the source distribution for its full text.
#include <assert.h>
#include <dirent.h>
#include <err.h>
-#include <fcntl.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <unistd.h>
+#include <sys/_iovec.h>
+#include <sys/dirent.h>
+#include <sys/errno.h>
+#include <sys/param.h> // needs to be included before <sys/jail.h> for MAXPATHLEN
+#include <sys/jail.h>
+#include <sys/priority.h>
+#include <sys/proc.h>
+#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
+#include <sys/time.h>
#include <sys/types.h>
#include <sys/user.h>
-#include "Compat.h"
#include "CRT.h"
+#include "Compat.h"
#include "FreeBSDProcess.h"
#include "Macros.h"
+#include "Object.h"
+#include "Process.h"
#include "ProcessList.h"
+#include "Settings.h"
#include "XUtils.h"
#include "zfs/ZfsArcStats.h"
#include "zfs/openzfs_sysctl.h"
diff --git a/freebsd/FreeBSDProcessList.h b/freebsd/FreeBSDProcessList.h
index cbe4742c..f18275df 100644
--- a/freebsd/FreeBSDProcessList.h
+++ b/freebsd/FreeBSDProcessList.h
@@ -8,14 +8,10 @@ in the source distribution for its full text.
*/
#include <kvm.h>
-#include <sys/param.h> // needs to be included before <sys/jail.h> for MAXPATHLEN
-#include <sys/jail.h>
-#include <sys/resource.h>
-#include <sys/uio.h>
+#include <stdbool.h>
+#include <sys/types.h>
-#include "FreeBSDProcess.h"
#include "Hashtable.h"
-#include "Process.h"
#include "ProcessList.h"
#include "UsersTable.h"
#include "zfs/ZfsArcStats.h"
diff --git a/freebsd/Platform.c b/freebsd/Platform.c
index 8efa4e68..f73b48bd 100644
--- a/freebsd/Platform.c
+++ b/freebsd/Platform.c
@@ -9,10 +9,16 @@ in the source distribution for its full text.
#include <devstat.h>
#include <math.h>
+#include <stdint.h>
+#include <stdlib.h>
#include <time.h>
#include <net/if.h>
#include <net/if_mib.h>
+#include <sys/_types.h>
+#include <sys/devicestat.h>
+#include <sys/param.h>
#include <sys/resource.h>
+#include <sys/socket.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
@@ -31,9 +37,12 @@ in the source distribution for its full text.
#include "MemoryMeter.h"
#include "Meter.h"
#include "NetworkIOMeter.h"
+#include "ProcessList.h"
+#include "Settings.h"
#include "SwapMeter.h"
#include "TasksMeter.h"
#include "UptimeMeter.h"
+#include "XUtils.h"
#include "zfs/ZfsArcMeter.h"
#include "zfs/ZfsCompressedArcMeter.h"
diff --git a/freebsd/Platform.h b/freebsd/Platform.h
index 5e3b29fb..b3cb6717 100644
--- a/freebsd/Platform.h
+++ b/freebsd/Platform.h
@@ -13,9 +13,12 @@ in the source distribution for its full text.
#include "Action.h"
#include "BatteryMeter.h"
#include "DiskIOMeter.h"
+#include "Meter.h"
+#include "Process.h"
#include "ProcessLocksScreen.h"
#include "SignalsPanel.h"
+
extern ProcessFieldData Process_fields[];
extern ProcessField Platform_defaultFields[];
diff --git a/iwyu/htop.imp b/iwyu/htop.imp
index c95bfaff..7fe432c4 100644
--- a/iwyu/htop.imp
+++ b/iwyu/htop.imp
@@ -7,4 +7,12 @@
{ include: ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
{ include: ["<bits/getopt_core.h>", "private", "<unistd.h>", "public"] },
+
+ { include: ["<sys/signal.h>", "private", "<signal.h>", "public"] },
+
+ { include: ["<sys/_stdarg.h>", "private", "<stdarg.h>", "public"] },
+
+ { include: ["<sys/limits.h>", "private", "<limits.h>", "public"] },
+
+ { include: ["<x86/_inttypes.h>", "private", "<inttypes.h>", "public"] },
]
diff --git a/iwyu/run_iwyu.sh b/iwyu/run_iwyu.sh
index 37843dcf..6139ebec 100755
--- a/iwyu/run_iwyu.sh
+++ b/iwyu/run_iwyu.sh
@@ -11,4 +11,4 @@ IWYU=${IWYU:-iwyu}
cd "$SOURCEDIR" || exit
make clean
-make --keep-going --silent CC="$IWYU" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3"
+make -k -s CC="$IWYU" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3"
diff --git a/zfs/ZfsArcStats.c b/zfs/ZfsArcStats.c
index ae565633..bead8461 100644
--- a/zfs/ZfsArcStats.c
+++ b/zfs/ZfsArcStats.c
@@ -5,22 +5,6 @@ Released under the GNU GPLv2, see the COPYING file
in the source distribution for its full text.
*/
-/*{
-typedef struct ZfsArcStats_ {
- int enabled;
- int isCompressed;
- unsigned long long int max;
- unsigned long long int size;
- unsigned long long int MFU;
- unsigned long long int MRU;
- unsigned long long int anon;
- unsigned long long int header;
- unsigned long long int other;
- unsigned long long int compressed;
- unsigned long long int uncompressed;
-} ZfsArcStats;
-}*/
-
#include "Macros.h"
static int make_iso_compilers_happy ATTR_UNUSED;
diff --git a/zfs/openzfs_sysctl.c b/zfs/openzfs_sysctl.c
index 59d7469f..fd00d61b 100644
--- a/zfs/openzfs_sysctl.c
+++ b/zfs/openzfs_sysctl.c
@@ -6,12 +6,13 @@ in the source distribution for its full text.
*/
#include "zfs/openzfs_sysctl.h"
-#include "zfs/ZfsArcStats.h"
-#include <unistd.h>
#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/sysctl.h>
+#include <sys/types.h> // IWYU pragma: keep
+#include <sys/sysctl.h> // needs <sys/types.h> for u_int with gcc
+
+#include "zfs/ZfsArcStats.h"
+
static int MIB_kstat_zfs_misc_arcstats_size[5];
static int MIB_kstat_zfs_misc_arcstats_c_max[5];
@@ -23,10 +24,6 @@ static int MIB_kstat_zfs_misc_arcstats_other_size[5];
static int MIB_kstat_zfs_misc_arcstats_compressed_size[5];
static int MIB_kstat_zfs_misc_arcstats_uncompressed_size[5];
-/*{
-#include "zfs/ZfsArcStats.h"
-}*/
-
void openzfs_sysctl_init(ZfsArcStats* stats) {
size_t len;
unsigned long long int arcSize;

© 2014-2024 Faster IT GmbH | imprint | privacy policy