summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-19 12:05:06 +0200
committercgzones <cgzones@googlemail.com>2020-10-20 21:44:25 +0200
commit8a08a3209c093f9b1137ec5879d3804026b0df6e (patch)
tree88b8ceda524a300c9df221ac58f18427b9f98ef7
parent803234a58d12b23cbc700a14b50e57764718f5a5 (diff)
IWYU update
- Add Settings forward declaration in Process.h - Add assert.h include in XUitls.c - Add conditional stdbool.h include in Object.h - Drop unneeded stddef.h include in Richstring.c - Drop unneeded unistd.h include in Process.h - Drop unneeded string.h include in linux/Platform.c - Use String_eq to avoid string.h include in Action.c - Improve script to run custom iwyu version
-rw-r--r--Action.c4
-rw-r--r--Object.h4
-rw-r--r--Process.h3
-rw-r--r--RichString.c1
-rw-r--r--XUtils.c1
-rwxr-xr-xiwyu/run_iwyu.sh6
-rw-r--r--linux/Platform.c1
7 files changed, 13 insertions, 7 deletions
diff --git a/Action.c b/Action.c
index 7443c842..3f5737fc 100644
--- a/Action.c
+++ b/Action.c
@@ -511,10 +511,10 @@ static Htop_Reaction actionHelp(State* st) {
mvaddstr(line + item, 9, helpLeft[item].info);
attrset(CRT_colors[HELP_BOLD]);
mvaddstr(line + item, 0, helpLeft[item].key);
- if (0 == strcmp(helpLeft[item].key, " H: ")) {
+ if (String_eq(helpLeft[item].key, " H: ")) {
attrset(CRT_colors[PROCESS_THREAD]);
mvaddstr(line + item, 32, "threads");
- } else if (0 == strcmp(helpLeft[item].key, " K: ")) {
+ } else if (String_eq(helpLeft[item].key, " K: ")) {
attrset(CRT_colors[PROCESS_THREAD]);
mvaddstr(line + item, 26, "threads");
}
diff --git a/Object.h b/Object.h
index 2d3fd3c4..caa3e919 100644
--- a/Object.h
+++ b/Object.h
@@ -11,6 +11,10 @@ in the source distribution for its full text.
#include "RichString.h"
#include "XUtils.h" // IWYU pragma: keep
+#ifndef NDEBUG
+#include <stdbool.h>
+#endif
+
struct Object_;
typedef struct Object_ Object;
diff --git a/Process.h b/Process.h
index db85f147..a13ca86c 100644
--- a/Process.h
+++ b/Process.h
@@ -9,7 +9,6 @@ in the source distribution for its full text.
*/
#include <stdbool.h>
-#include <unistd.h>
#include <sys/types.h>
#include "Object.h"
@@ -55,6 +54,8 @@ typedef struct ProcessPidColumn_ {
const char* label;
} ProcessPidColumn;
+struct Settings_;
+
typedef struct Process_ {
Object super;
diff --git a/RichString.c b/RichString.c
index 60fe8d07..90cc428c 100644
--- a/RichString.c
+++ b/RichString.c
@@ -7,7 +7,6 @@ in the source distribution for its full text.
#include "RichString.h"
-#include <stddef.h>
#include <stdlib.h>
#include <string.h>
diff --git a/XUtils.c b/XUtils.c
index a444a7f8..811fa50f 100644
--- a/XUtils.c
+++ b/XUtils.c
@@ -9,6 +9,7 @@ in the source distribution for its full text.
#include "XUtils.h"
+#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
diff --git a/iwyu/run_iwyu.sh b/iwyu/run_iwyu.sh
index 83d2c484..37843dcf 100755
--- a/iwyu/run_iwyu.sh
+++ b/iwyu/run_iwyu.sh
@@ -6,7 +6,9 @@ SOURCEDIR="$SCRIPTDIR/.."
PKG_NL3=$(pkg-config --cflags libnl-3.0)
-cd "$SOURCEDIR"
+IWYU=${IWYU:-iwyu}
+
+cd "$SOURCEDIR" || exit
make clean
-make -k CC="iwyu" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3"
+make --keep-going --silent CC="$IWYU" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3"
diff --git a/linux/Platform.c b/linux/Platform.c
index afa2b7fd..95e0000d 100644
--- a/linux/Platform.c
+++ b/linux/Platform.c
@@ -13,7 +13,6 @@ in the source distribution for its full text.
#include <ctype.h>
#include <math.h>
#include <stdio.h>
-#include <string.h>
#include "BatteryMeter.h"
#include "ClockMeter.h"

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