From f674dde3ff42b0babeac0e3990ef8b7ab5996096 Mon Sep 17 00:00:00 2001 From: firewave Date: Wed, 14 Feb 2024 06:08:25 +0100 Subject: [PATCH] cleaned up includes based on include-what-you-use --- gui/checkthread.h | 2 ++ gui/mainwindow.cpp | 1 + gui/mainwindow.h | 3 ++- gui/projectfiledialog.cpp | 1 + gui/resultstree.cpp | 3 +++ gui/xmlreportv2.cpp | 3 +++ lib/checkbufferoverrun.cpp | 1 + lib/checkunusedfunctions.cpp | 4 ---- lib/errorlogger.cpp | 1 + lib/settings.cpp | 3 ++- lib/settings.h | 3 +++ test/testerrorlogger.cpp | 1 + test/testimportproject.cpp | 1 + test/testpath.cpp | 2 ++ test/testpathmatch.cpp | 1 + test/testprocessexecutor.cpp | 1 - test/testsettings.cpp | 3 +++ test/testsingleexecutor.cpp | 1 - test/testsuppressions.cpp | 1 - test/testsymboldatabase.cpp | 3 --- test/testunusedvar.cpp | 1 + test/testvarid.cpp | 1 + 22 files changed, 29 insertions(+), 12 deletions(-) diff --git a/gui/checkthread.h b/gui/checkthread.h index f12089d330de..6cbdf8a6d17e 100644 --- a/gui/checkthread.h +++ b/gui/checkthread.h @@ -24,6 +24,8 @@ #include "suppressions.h" #include +#include +#include #include #include diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index fe66a842cb62..7a35b60b1499 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -39,6 +39,7 @@ #include "report.h" #include "resultsview.h" #include "scratchpad.h" +#include "settings.h" #include "showtypes.h" #include "statsdialog.h" #include "settingsdialog.h" diff --git a/gui/mainwindow.h b/gui/mainwindow.h index b0f059218cfb..5214b690ddca 100644 --- a/gui/mainwindow.h +++ b/gui/mainwindow.h @@ -20,12 +20,12 @@ #define MAINWINDOW_H #include "library.h" -#include "settings.h" #include "platforms.h" #include #include #include +#include #include #include @@ -43,6 +43,7 @@ class ImportProject; class QCloseEvent; class QNetworkAccessManager; class QNetworkReply; +class Settings; namespace Ui { class MainWindow; } diff --git a/gui/projectfiledialog.cpp b/gui/projectfiledialog.cpp index 6ffc4722bf13..0e736f98beca 100644 --- a/gui/projectfiledialog.cpp +++ b/gui/projectfiledialog.cpp @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 155a5645999c..53dc83a75d43 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -23,6 +23,7 @@ #include "common.h" #include "config.h" #include "erroritem.h" +#include "errorlogger.h" #include "errortypes.h" #include "path.h" #include "projectfile.h" @@ -32,6 +33,8 @@ #include "threadhandler.h" #include "xmlreportv2.h" +#include + #include #include #include diff --git a/gui/xmlreportv2.cpp b/gui/xmlreportv2.cpp index 3bb5190e1837..583e865d678c 100644 --- a/gui/xmlreportv2.cpp +++ b/gui/xmlreportv2.cpp @@ -21,8 +21,11 @@ #include "cppcheck.h" #include "erroritem.h" #include "report.h" +#include "settings.h" #include "xmlreport.h" +#include + #include #include #include diff --git a/lib/checkbufferoverrun.cpp b/lib/checkbufferoverrun.cpp index 0dbb06562ffc..2e6111b8d01b 100644 --- a/lib/checkbufferoverrun.cpp +++ b/lib/checkbufferoverrun.cpp @@ -40,6 +40,7 @@ #include #include // std::accumulate #include +#include #include "xml.h" diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index 33f3812c9b35..3c6921e0f999 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -43,10 +43,6 @@ #include "xml.h" -namespace CTU { - class FileInfo; -} - //--------------------------------------------------------------------------- // Register this check class diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index 7da864f41c51..194917c3b8f3 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -21,6 +21,7 @@ #include "color.h" #include "cppcheck.h" #include "path.h" +#include "settings.h" #include "suppressions.h" #include "token.h" #include "tokenlist.h" diff --git a/lib/settings.cpp b/lib/settings.cpp index 0488785edf33..8ceb13b4965b 100644 --- a/lib/settings.cpp +++ b/lib/settings.cpp @@ -21,8 +21,9 @@ #include "summaries.h" #include "vfvalue.h" +#include #include -#include +#include // IWYU pragma: keep #include "json.h" diff --git a/lib/settings.h b/lib/settings.h index e1a53110943d..c0480e83db2e 100644 --- a/lib/settings.h +++ b/lib/settings.h @@ -33,12 +33,15 @@ #include #include #include +#include #include +#include #include #include #include #include #include +#include enum class SHOWTIME_MODES; namespace ValueFlow { diff --git a/test/testerrorlogger.cpp b/test/testerrorlogger.cpp index d02bfa5acdce..8b714a2ae802 100644 --- a/test/testerrorlogger.cpp +++ b/test/testerrorlogger.cpp @@ -24,6 +24,7 @@ #include #include +#include #include "xml.h" diff --git a/test/testimportproject.cpp b/test/testimportproject.cpp index 049e399a561b..d8d65af4f10e 100644 --- a/test/testimportproject.cpp +++ b/test/testimportproject.cpp @@ -26,6 +26,7 @@ #include #include // IWYU pragma: keep #include +#include #include class TestImporter : public ImportProject { diff --git a/test/testpath.cpp b/test/testpath.cpp index 61b49ef5f502..7e563ee57dfa 100644 --- a/test/testpath.cpp +++ b/test/testpath.cpp @@ -19,7 +19,9 @@ #include "path.h" #include "fixture.h" #include "helpers.h" +#include "standards.h" +#include #include #include diff --git a/test/testpathmatch.cpp b/test/testpathmatch.cpp index 4aa580b478e1..615cb2b1246a 100644 --- a/test/testpathmatch.cpp +++ b/test/testpathmatch.cpp @@ -20,6 +20,7 @@ #include "fixture.h" #include +#include #include diff --git a/test/testprocessexecutor.cpp b/test/testprocessexecutor.cpp index 6b54db417249..f3618ca11ebc 100644 --- a/test/testprocessexecutor.cpp +++ b/test/testprocessexecutor.cpp @@ -25,7 +25,6 @@ #include "helpers.h" #include "timer.h" -#include #include #include #include diff --git a/test/testsettings.cpp b/test/testsettings.cpp index 2e7ff77fdc55..f8dcd349d87c 100644 --- a/test/testsettings.cpp +++ b/test/testsettings.cpp @@ -21,6 +21,9 @@ #include "settings.h" #include "fixture.h" #include "helpers.h" +#include "suppressions.h" + + class TestSettings : public TestFixture { public: diff --git a/test/testsingleexecutor.cpp b/test/testsingleexecutor.cpp index de9d1572ccb5..b9bbd8ddfd08 100644 --- a/test/testsingleexecutor.cpp +++ b/test/testsingleexecutor.cpp @@ -26,7 +26,6 @@ #include "singleexecutor.h" #include "timer.h" -#include #include #include #include diff --git a/test/testsuppressions.cpp b/test/testsuppressions.cpp index 8e1fb86c0968..19e7d6f46dfb 100644 --- a/test/testsuppressions.cpp +++ b/test/testsuppressions.cpp @@ -30,7 +30,6 @@ #include "threadexecutor.h" #include "singleexecutor.h" -#include #include #include #include diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 1c42d76fdf97..9c75348565e9 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -19,7 +19,6 @@ #include "errortypes.h" #include "fixture.h" #include "helpers.h" -#include "library.h" #include "platform.h" #include "settings.h" #include "sourcelocation.h" @@ -34,12 +33,10 @@ #include #include #include -#include #include #include #include #include -#include #include class TestSymbolDatabase; diff --git a/test/testunusedvar.cpp b/test/testunusedvar.cpp index 5bd59e6f5dc9..9f81ec5cf56f 100644 --- a/test/testunusedvar.cpp +++ b/test/testunusedvar.cpp @@ -22,6 +22,7 @@ #include "preprocessor.h" #include "settings.h" #include "fixture.h" +#include "standards.h" #include "tokenize.h" #include diff --git a/test/testvarid.cpp b/test/testvarid.cpp index 98780b066539..4a6b613d987d 100644 --- a/test/testvarid.cpp +++ b/test/testvarid.cpp @@ -27,6 +27,7 @@ #include // IWYU pragma: keep #include +#include class TestVarID : public TestFixture { public: