Skip to content

Commit

Permalink
cleaned up includes based on include-what-you-use (danmar#5532)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored Oct 9, 2023
1 parent f7268e7 commit 06b5ef1
Show file tree
Hide file tree
Showing 62 changed files with 81 additions and 124 deletions.
30 changes: 15 additions & 15 deletions Makefile

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion cli/cmdlineparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "cppcheckexecutor.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "filelister.h"
#include "importproject.h"
#include "path.h"
#include "platform.h"
Expand Down
6 changes: 3 additions & 3 deletions cli/cppcheckexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

#include "cppcheckexecutor.h"

#include "addoninfo.h"
#include "analyzerinfo.h"
#include "checkers.h"
#include "checkersreport.h"
#include "cmdlinelogger.h"
#include "cmdlineparser.h"
#include "color.h"
#include "config.h"
Expand Down Expand Up @@ -48,12 +49,11 @@
#include <cassert>
#include <cstdio>
#include <cstdlib> // EXIT_SUCCESS and EXIT_FAILURE
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <memory>
#include <sstream> // IWYU pragma: keep
#include <unordered_set>
#include <utility>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion cli/filelister.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "filelister.h"

#include "config.h"
#include "path.h"
#include "pathmatch.h"
#include "utils.h"
Expand Down
2 changes: 0 additions & 2 deletions cli/processexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include "config.h"
#include "cppcheck.h"
#include "cppcheckexecutor.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "importproject.h"
Expand All @@ -37,7 +36,6 @@
#include <csignal>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <sstream> // IWYU pragma: keep
Expand Down
2 changes: 0 additions & 2 deletions cli/threadexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

#include "config.h"
#include "cppcheck.h"
#include "cppcheckexecutor.h"
#include "errorlogger.h"
#include "importproject.h"
#include "settings.h"
Expand All @@ -29,7 +28,6 @@
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <functional>
#include <future>
#include <iostream>
#include <list>
Expand Down
2 changes: 1 addition & 1 deletion gui/checkstatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

#include <QMap>
#include <QObject>
#include <QSet>
#include <QString>
#include <QStringList>

#include <set>
#include <string>
#include <utility>

/// @addtogroup GUI
/// @{
Expand Down
1 change: 0 additions & 1 deletion gui/checkthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

#include <algorithm>
#include <cstddef>
#include <functional>
#include <iterator>
#include <list>
#include <map>
Expand Down
1 change: 1 addition & 0 deletions gui/compliancereportdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include <QFileInfo>
#include <QIODevice>
#include <QLineEdit>
#include <QList>
#include <QMessageBox>
#include <QProcess>
#include <QRegularExpression>
Expand Down
3 changes: 2 additions & 1 deletion gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "mainwindow.h"

#include "addoninfo.h"
#include "applicationlist.h"
#include "aboutdialog.h"
#include "analyzerinfo.h"
Expand Down Expand Up @@ -48,12 +49,12 @@
#include "ui_mainwindow.h"

#include <algorithm>
#include <functional>
#include <iterator>
#include <list>
#include <set>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

#include <QApplication>
Expand Down
1 change: 0 additions & 1 deletion gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include <QMenu>
#include <QMessageBox>
#include <QModelIndex>
#include <QModelIndexList>
#include <QProcess>
#include <QSet>
#include <QSettings>
Expand Down
7 changes: 7 additions & 0 deletions gui/resultsview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@
#include "common.h"
#include "csvreport.h"
#include "erroritem.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "path.h"
#include "printablereport.h"
#include "resultstree.h"
#include "settings.h"
#include "txtreport.h"
#include "xmlreport.h"
#include "xmlreportv2.h"

#include "ui_resultsview.h"

#include <set>
#include <string>

#include <QAbstractItemModel>
#include <QApplication>
#include <QByteArray>
Expand All @@ -45,6 +51,7 @@
#include <QFile>
#include <QFileInfo>
#include <QIODevice>
#include <QLabel>
#include <QList>
#include <QListWidget>
#include <QListWidgetItem>
Expand Down
2 changes: 2 additions & 0 deletions gui/statsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
#include <QDate>
#include <QFileDialog>
#include <QFileInfo>
#include <QFont>
#include <QLabel>
#include <QLineEdit>
#include <QMimeData>
#include <QPageSize>
#include <QPlainTextEdit>
#include <QPrinter>
#include <QPushButton>
#include <QStringList>
Expand Down
5 changes: 1 addition & 4 deletions gui/test/projectfile/testprojectfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@

#include "testprojectfile.h"

#include "addoninfo.h"
#include "importproject.h"
#include "library.h"
#include "platform.h"
#include "projectfile.h"
#include "settings.h"

#include <set>
#include <string>
#include <utility>
#include <vector>

#include <QList>
#include <QStringList>
Expand Down
2 changes: 1 addition & 1 deletion lib/addoninfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "utils.h"

#include <fstream>
#include <sstream>
#include <string>
#include <vector>

#include "json.h"

Expand Down
1 change: 1 addition & 0 deletions lib/astutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "config.h"
#include "errortypes.h"
#include "library.h"
#include "mathlib.h"
#include "smallvector.h"
#include "symboldatabase.h"
#include "token.h"
Expand Down
1 change: 0 additions & 1 deletion lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "symboldatabase.h"
#include "errorlogger.h"
#include "errortypes.h"
#include "mathlib.h"
#include "token.h"
#include "tokenize.h"
#include "tokenlist.h"
Expand Down
8 changes: 8 additions & 0 deletions lib/checkersreport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@
*/

#include "checkersreport.h"

#include "checkers.h"
#include "errortypes.h"
#include "settings.h"

#include <map>
#include <sstream>
#include <unordered_set>
#include <utility>
#include <vector>

static bool isCppcheckPremium(const Settings& settings) {
return (settings.cppcheckCfgProductName.compare(0, 16, "Cppcheck Premium") == 0);
Expand Down
5 changes: 4 additions & 1 deletion lib/checkersreport.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@

#pragma once

#include "settings.h"
#include "config.h"

#include <set>
#include <string>

class Settings;

class CPPCHECKLIB CheckersReport {
public:
CheckersReport(const Settings& settings, const std::set<std::string>& activeCheckers);
Expand Down
2 changes: 2 additions & 0 deletions lib/checkmemoryleak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "astutils.h"
#include "errorlogger.h"
#include "library.h"
#include "mathlib.h"
#include "platform.h"
#include "settings.h"
#include "symboldatabase.h"
#include "token.h"
Expand Down
4 changes: 4 additions & 0 deletions lib/checktype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
#include "tokenize.h"
#include "valueflow.h"

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <iterator>
#include <list>
#include <sstream>
#include <utility>
#include <vector>

//---------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions lib/checkvaarg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "tokenize.h"

#include <cstddef>
#include <iterator>
#include <list>
#include <vector>

//---------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions lib/cppcheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@
#include "ctu.h"
#include "errortypes.h"
#include "library.h"
#include "mathlib.h"
#include "path.h"
#include "platform.h"
#include "preprocessor.h" // Preprocessor
#include "preprocessor.h"
#include "standards.h"
#include "suppressions.h"
#include "timer.h"
#include "token.h"
#include "tokenize.h" // Tokenizer
#include "tokenize.h"
#include "tokenlist.h"
#include "utils.h"
#include "valueflow.h"
#include "version.h"

#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdint>
#include <cstring>
Expand Down
1 change: 1 addition & 0 deletions lib/cppcheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include <vector>

class Tokenizer;
enum class SHOWTIME_MODES;

/// @addtogroup Core
/// @{
Expand Down
2 changes: 1 addition & 1 deletion lib/errorlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

#include "color.h"
#include "cppcheck.h"
#include "mathlib.h"
#include "path.h"
#include "suppressions.h"
#include "token.h"
#include "tokenlist.h"
#include "utils.h"
Expand Down
2 changes: 0 additions & 2 deletions lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

#include <tinyxml2.h>

#include <simplecpp.h>

#include "json.h"

void ImportProject::ignorePaths(const std::vector<std::string> &ipaths)
Expand Down
1 change: 1 addition & 0 deletions lib/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <algorithm>
#include <cctype>
#include <climits>
#include <cstddef>
#include <cstring>
#include <list>
#include <memory>
Expand Down
1 change: 0 additions & 1 deletion lib/library.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "errortypes.h"
#include "standards.h"

#include <cstddef>
#include <map>
#include <memory>
#include <set>
Expand Down
1 change: 0 additions & 1 deletion lib/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <sys/stat.h>
#include <utility>

Expand Down
1 change: 0 additions & 1 deletion lib/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "settings.h"
#include "path.h"
#include "summaries.h"
#include "timer.h"
#include "vfvalue.h"

#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion lib/suppressions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "suppressions.h"

#include "errorlogger.h"
#include "mathlib.h"
#include "errortypes.h"
#include "path.h"
#include "utils.h"
#include "token.h"
Expand Down
1 change: 0 additions & 1 deletion lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "errortypes.h"
#include "keywords.h"
#include "library.h"
#include "mathlib.h"
#include "path.h"
#include "platform.h"
#include "settings.h"
Expand Down
1 change: 1 addition & 0 deletions test/fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "options.h"
#include "redirect.h"

#include <algorithm>
#include <cstdio>
#include <cctype>
#include <exception>
Expand Down
Loading

0 comments on commit 06b5ef1

Please sign in to comment.