From b3cf54e3f94bfa7c6e519b12123e71fa1902719c Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Wed, 24 May 2023 09:39:04 +0200 Subject: [PATCH 1/3] Always mark config.h with IWYU pragma: keep --- CRT.h | 2 +- ProvideCurses.h | 2 +- RichString.h | 2 +- generic/fdstat_sysctl.c | 4 ++-- linux/LibSensors.c | 2 +- linux/LinuxMachine.h | 2 +- linux/LinuxProcessList.h | 2 +- linux/Platform.c | 2 +- linux/Platform.h | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CRT.h b/CRT.h index f5fd94527..5361457ce 100644 --- a/CRT.h +++ b/CRT.h @@ -7,7 +7,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 diff --git a/ProvideCurses.h b/ProvideCurses.h index 06602ff06..26e2d3ae7 100644 --- a/ProvideCurses.h +++ b/ProvideCurses.h @@ -8,7 +8,7 @@ in the source distribution for its full text. */ -#include "config.h" +#include "config.h" // IWYU pragma: keep // IWYU pragma: begin_exports diff --git a/RichString.h b/RichString.h index cbcbe48b7..3284a75e9 100644 --- a/RichString.h +++ b/RichString.h @@ -7,7 +7,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 "ProvideCurses.h" diff --git a/generic/fdstat_sysctl.c b/generic/fdstat_sysctl.c index 49e8e362a..226797c7a 100644 --- a/generic/fdstat_sysctl.c +++ b/generic/fdstat_sysctl.c @@ -5,6 +5,8 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ +#include "config.h" // IWYU pragma: keep + #include "generic/fdstat_sysctl.h" #include @@ -14,8 +16,6 @@ in the source distribution for its full text. #include // Shitty FreeBSD upstream headers #include -#include "config.h" - static void Generic_getFileDescriptors_sysctl_internal( const char* sysctlname_maxfiles, diff --git a/linux/LibSensors.c b/linux/LibSensors.c index ff084b648..6b980fb19 100644 --- a/linux/LibSensors.c +++ b/linux/LibSensors.c @@ -1,6 +1,6 @@ #include "linux/LibSensors.h" -#include "config.h" +#include "config.h" // IWYU pragma: keep #ifdef HAVE_SENSORS_SENSORS_H diff --git a/linux/LinuxMachine.h b/linux/LinuxMachine.h index 7dba905fd..30817747c 100644 --- a/linux/LinuxMachine.h +++ b/linux/LinuxMachine.h @@ -7,7 +7,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 #include diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h index 824de482e..d026e00ec 100644 --- a/linux/LinuxProcessList.h +++ b/linux/LinuxProcessList.h @@ -7,7 +7,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 #include diff --git a/linux/Platform.c b/linux/Platform.c index 693044af1..955f080be 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -6,7 +6,7 @@ in the source distribution for its full text. */ #include "ZramMeter.h" -#include "config.h" +#include "config.h" // IWYU pragma: keep #include "linux/Platform.h" diff --git a/linux/Platform.h b/linux/Platform.h index 1621d5628..4a69907e5 100644 --- a/linux/Platform.h +++ b/linux/Platform.h @@ -7,7 +7,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 #include From 32f8d4c4073099bdc16f48108cb4ae85de1870b6 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Wed, 24 May 2023 10:08:28 +0200 Subject: [PATCH 2/3] Make header sort order consistent again --- SignalsPanel.h | 4 ++-- generic/gettime.c | 1 + generic/hostname.c | 1 + generic/uname.c | 1 + linux/LibSensors.c | 4 ++-- linux/LinuxProcess.h | 2 +- linux/Platform.c | 3 +-- linux/Platform.h | 1 + pcp/PCPDynamicMeter.c | 1 + pcp/PCPMachine.c | 2 +- pcp/PCPProcessList.c | 2 +- solaris/Platform.h | 2 +- solaris/SolarisMachine.h | 4 ++-- 13 files changed, 16 insertions(+), 12 deletions(-) diff --git a/SignalsPanel.h b/SignalsPanel.h index 529043a19..d86766220 100644 --- a/SignalsPanel.h +++ b/SignalsPanel.h @@ -9,12 +9,12 @@ in the source distribution for its full text. #include "config.h" // IWYU pragma: keep +#include "Panel.h" + #ifndef HTOP_SOLARIS #include #endif -#include "Panel.h" - typedef struct SignalItem_ { const char* name; diff --git a/generic/gettime.c b/generic/gettime.c index b7c4885eb..209f52329 100644 --- a/generic/gettime.c +++ b/generic/gettime.c @@ -4,6 +4,7 @@ htop - generic/gettime.c Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ + #include "config.h" // IWYU pragma: keep #include "generic/gettime.h" diff --git a/generic/hostname.c b/generic/hostname.c index 69a414687..e3275828c 100644 --- a/generic/hostname.c +++ b/generic/hostname.c @@ -4,6 +4,7 @@ htop - generic/hostname.c Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ + #include "config.h" // IWYU pragma: keep #include "generic/hostname.h" diff --git a/generic/uname.c b/generic/uname.c index 2a734dc1d..b5bb5834a 100644 --- a/generic/uname.c +++ b/generic/uname.c @@ -4,6 +4,7 @@ htop - generic/uname.c Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ + #include "config.h" // IWYU pragma: keep #include "generic/uname.h" diff --git a/linux/LibSensors.c b/linux/LibSensors.c index 6b980fb19..f52bd2189 100644 --- a/linux/LibSensors.c +++ b/linux/LibSensors.c @@ -1,7 +1,7 @@ -#include "linux/LibSensors.h" - #include "config.h" // IWYU pragma: keep +#include "linux/LibSensors.h" + #ifdef HAVE_SENSORS_SENSORS_H #include diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h index 6c309893c..4b0eab8b4 100644 --- a/linux/LinuxProcess.h +++ b/linux/LinuxProcess.h @@ -13,10 +13,10 @@ in the source distribution for its full text. #include #include -#include "linux/IOPriority.h" #include "Machine.h" #include "Object.h" #include "Process.h" +#include "linux/IOPriority.h" #define PROCESS_FLAG_LINUX_IOPRIO 0x00000100 diff --git a/linux/Platform.c b/linux/Platform.c index 955f080be..422b243de 100644 --- a/linux/Platform.c +++ b/linux/Platform.c @@ -5,7 +5,6 @@ Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ -#include "ZramMeter.h" #include "config.h" // IWYU pragma: keep #include "linux/Platform.h" @@ -47,7 +46,6 @@ in the source distribution for its full text. #include "Panel.h" #include "PressureStallMeter.h" #include "ProvideCurses.h" -#include "linux/SELinuxMeter.h" #include "Settings.h" #include "SwapMeter.h" #include "SysArchMeter.h" @@ -58,6 +56,7 @@ in the source distribution for its full text. #include "linux/IOPriorityPanel.h" #include "linux/LinuxMachine.h" #include "linux/LinuxProcess.h" +#include "linux/SELinuxMeter.h" #include "linux/SystemdMeter.h" #include "linux/ZramMeter.h" #include "linux/ZramStats.h" diff --git a/linux/Platform.h b/linux/Platform.h index 4a69907e5..4c775735a 100644 --- a/linux/Platform.h +++ b/linux/Platform.h @@ -32,6 +32,7 @@ in the source distribution for its full text. #include "generic/hostname.h" #include "generic/uname.h" + /* GNU/Hurd does not have PATH_MAX in limits.h */ #ifndef PATH_MAX #define PATH_MAX 4096 diff --git a/pcp/PCPDynamicMeter.c b/pcp/PCPDynamicMeter.c index e89998813..419581835 100644 --- a/pcp/PCPDynamicMeter.c +++ b/pcp/PCPDynamicMeter.c @@ -5,6 +5,7 @@ htop - PCPDynamicMeter.c Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. */ + #include "config.h" // IWYU pragma: keep #include "pcp/PCPDynamicMeter.h" diff --git a/pcp/PCPMachine.c b/pcp/PCPMachine.c index 59e056247..516de7b8c 100644 --- a/pcp/PCPMachine.c +++ b/pcp/PCPMachine.c @@ -18,8 +18,8 @@ in the source distribution for its full text. #include #include -#include "Macros.h" #include "Machine.h" +#include "Macros.h" #include "Object.h" #include "Platform.h" #include "Settings.h" diff --git a/pcp/PCPProcessList.c b/pcp/PCPProcessList.c index c18d74be9..d902696aa 100644 --- a/pcp/PCPProcessList.c +++ b/pcp/PCPProcessList.c @@ -18,8 +18,8 @@ in the source distribution for its full text. #include #include -#include "Macros.h" #include "Machine.h" +#include "Macros.h" #include "Object.h" #include "Platform.h" #include "Process.h" diff --git a/solaris/Platform.h b/solaris/Platform.h index 3dc6e3b59..8bb6f05e1 100644 --- a/solaris/Platform.h +++ b/solaris/Platform.h @@ -30,12 +30,12 @@ in the source distribution for its full text. #include "Action.h" #include "BatteryMeter.h" +#include "CommandLine.h" #include "DiskIOMeter.h" #include "Hashtable.h" #include "NetworkIOMeter.h" #include "ProcessLocksScreen.h" #include "SignalsPanel.h" -#include "CommandLine.h" #include "generic/gettime.h" #include "generic/hostname.h" #include "generic/uname.h" diff --git a/solaris/SolarisMachine.h b/solaris/SolarisMachine.h index da091c6e9..3f0050f56 100644 --- a/solaris/SolarisMachine.h +++ b/solaris/SolarisMachine.h @@ -14,11 +14,11 @@ in the source distribution for its full text. #include #include #include -#include #include +#include #include #include -#include +#include #include "Hashtable.h" #include "UsersTable.h" From 8e4ce18ba8d1fd11c17631eff785340219136091 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Wed, 24 May 2023 11:14:25 +0200 Subject: [PATCH 3/3] Add missing copyright/file headers --- CommandScreen.c | 8 ++++++++ CommandScreen.h | 7 +++++++ DynamicColumn.h | 8 ++++++++ DynamicMeter.h | 7 +++++++ EnvScreen.c | 9 +++++++++ EnvScreen.h | 8 ++++++++ InfoScreen.c | 8 ++++++++ InfoScreen.h | 7 +++++++ Macros.h | 6 ++++++ NetworkIOMeter.c | 7 +++++++ NetworkIOMeter.h | 6 ++++++ ProvideCurses.h | 2 +- ProvideTerm.h | 2 +- linux/LibSensors.c | 7 +++++++ linux/LibSensors.h | 6 ++++++ linux/ZramMeter.c | 8 ++++++++ linux/ZramMeter.h | 7 +++++++ 17 files changed, 111 insertions(+), 2 deletions(-) diff --git a/CommandScreen.c b/CommandScreen.c index 6a87d1375..7e286e4dc 100644 --- a/CommandScreen.c +++ b/CommandScreen.c @@ -1,3 +1,11 @@ +/* +htop - CommandScreen.c +(C) 2017,2020 ryenus +(C) 2020,2021 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + #include "config.h" // IWYU pragma: keep #include "CommandScreen.h" diff --git a/CommandScreen.h b/CommandScreen.h index e56982b2e..2eef5e554 100644 --- a/CommandScreen.h +++ b/CommandScreen.h @@ -1,5 +1,12 @@ #ifndef HEADER_CommandScreen #define HEADER_CommandScreen +/* +htop - CommandScreen.h +(C) 2017,2020 ryenus +(C) 2020,2021 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include "InfoScreen.h" #include "Object.h" diff --git a/DynamicColumn.h b/DynamicColumn.h index 4760e6ea5..00f10cf64 100644 --- a/DynamicColumn.h +++ b/DynamicColumn.h @@ -1,5 +1,13 @@ #ifndef HEADER_DynamicColumn #define HEADER_DynamicColumn +/* +htop - DynamicColumn.h +(C) 2021 Sohaib Mohammed +(C) 2021 htop dev team +(C) 2021 Red Hat, Inc. All Rights Reserved. +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include diff --git a/DynamicMeter.h b/DynamicMeter.h index 3ef0176a9..2bc3cba15 100644 --- a/DynamicMeter.h +++ b/DynamicMeter.h @@ -1,5 +1,12 @@ #ifndef HEADER_DynamicMeter #define HEADER_DynamicMeter +/* +htop - DynamicMeter.h +(C) 2021 htop dev team +(C) 2021 Red Hat, Inc. All Rights Reserved. +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include diff --git a/EnvScreen.c b/EnvScreen.c index 0fcee83a2..7b2d2bafa 100644 --- a/EnvScreen.c +++ b/EnvScreen.c @@ -1,3 +1,12 @@ +/* +htop - EnvScreen.c +(C) 2015,2016 Michael Klein +(C) 2016,2017 Hisham H. Muhammad +(C) 2020,2021 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + #include "config.h" // IWYU pragma: keep #include "EnvScreen.h" diff --git a/EnvScreen.h b/EnvScreen.h index 4d44c81c5..118c271c0 100644 --- a/EnvScreen.h +++ b/EnvScreen.h @@ -1,5 +1,13 @@ #ifndef HEADER_EnvScreen #define HEADER_EnvScreen +/* +htop - EnvScreen.h +(C) 2015,2016 Michael Klein +(C) 2016,2017 Hisham H. Muhammad +(C) 2020,2021 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include "InfoScreen.h" #include "Object.h" diff --git a/InfoScreen.c b/InfoScreen.c index 105d9c34d..e9f06f27d 100644 --- a/InfoScreen.c +++ b/InfoScreen.c @@ -1,3 +1,11 @@ +/* +htop - InfoScreen.c +(C) 2016 Hisham H. Muhammad +(C) 2020,2022 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + #include "config.h" // IWYU pragma: keep #include "InfoScreen.h" diff --git a/InfoScreen.h b/InfoScreen.h index d7497bed2..469c27079 100644 --- a/InfoScreen.h +++ b/InfoScreen.h @@ -1,5 +1,12 @@ #ifndef HEADER_InfoScreen #define HEADER_InfoScreen +/* +htop - InfoScreen.h +(C) 2016 Hisham H. Muhammad +(C) 2020,2022 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include diff --git a/Macros.h b/Macros.h index 0f95347b7..540724b64 100644 --- a/Macros.h +++ b/Macros.h @@ -1,5 +1,11 @@ #ifndef HEADER_Macros #define HEADER_Macros +/* +htop - Macros.h +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include // IWYU pragma: keep diff --git a/NetworkIOMeter.c b/NetworkIOMeter.c index 5945bae79..1faf1789e 100644 --- a/NetworkIOMeter.c +++ b/NetworkIOMeter.c @@ -1,3 +1,10 @@ +/* +htop - NetworkIOMeter.c +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + #include "NetworkIOMeter.h" #include diff --git a/NetworkIOMeter.h b/NetworkIOMeter.h index 18c23ce29..d112a7451 100644 --- a/NetworkIOMeter.h +++ b/NetworkIOMeter.h @@ -1,5 +1,11 @@ #ifndef HEADER_NetworkIOMeter #define HEADER_NetworkIOMeter +/* +htop - NetworkIOMeter.h +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include "Meter.h" diff --git a/ProvideCurses.h b/ProvideCurses.h index 26e2d3ae7..7ae99e620 100644 --- a/ProvideCurses.h +++ b/ProvideCurses.h @@ -1,7 +1,7 @@ #ifndef HEADER_ProvideCurses #define HEADER_ProvideCurses /* -htop - RichString.h +htop - ProvideCurses.h (C) 2004,2011 Hisham H. Muhammad Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. diff --git a/ProvideTerm.h b/ProvideTerm.h index 0e07b1c49..a8910f1af 100644 --- a/ProvideTerm.h +++ b/ProvideTerm.h @@ -1,7 +1,7 @@ #ifndef HEADER_ProvideTerm #define HEADER_ProvideTerm /* -htop - Filename.h +htop - ProvideTerm.h (C) 2023 htop dev team Released under the GNU GPLv2+, see the COPYING file in the source distribution for its full text. diff --git a/linux/LibSensors.c b/linux/LibSensors.c index f52bd2189..f6df4f445 100644 --- a/linux/LibSensors.c +++ b/linux/LibSensors.c @@ -1,3 +1,10 @@ +/* +htop - linux/LibSensors.c +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + #include "config.h" // IWYU pragma: keep #include "linux/LibSensors.h" diff --git a/linux/LibSensors.h b/linux/LibSensors.h index 2b9801bcd..6f0544897 100644 --- a/linux/LibSensors.h +++ b/linux/LibSensors.h @@ -1,5 +1,11 @@ #ifndef HEADER_LibSensors #define HEADER_LibSensors +/* +htop - linux/LibSensors.h +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include "linux/LinuxMachine.h" diff --git a/linux/ZramMeter.c b/linux/ZramMeter.c index 6e80eb1a7..6d4c7717c 100644 --- a/linux/ZramMeter.c +++ b/linux/ZramMeter.c @@ -1,3 +1,11 @@ +/* +htop - linux/ZramMeter.c +(C) 2020 Murloc Knight +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ + #include "linux/ZramMeter.h" #include diff --git a/linux/ZramMeter.h b/linux/ZramMeter.h index db27d0b35..14a52155a 100644 --- a/linux/ZramMeter.h +++ b/linux/ZramMeter.h @@ -1,5 +1,12 @@ #ifndef HEADER_ZramMeter #define HEADER_ZramMeter +/* +htop - linux/ZramMeter.h +(C) 2020 Murloc Knight +(C) 2020-2023 htop dev team +Released under the GNU GPLv2+, see the COPYING file +in the source distribution for its full text. +*/ #include "Meter.h"