Skip to content

Commit

Permalink
cleaned up includes based on include-what-you-use (#6627)
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave authored Jul 21, 2024
1 parent 0552b41 commit d03d820
Show file tree
Hide file tree
Showing 49 changed files with 42 additions and 26 deletions.
1 change: 0 additions & 1 deletion cli/executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <mutex>
#include <string>
#include <unordered_set>
#include <utility>

class Settings;
class ErrorLogger;
Expand Down
1 change: 1 addition & 0 deletions cli/processexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <cassert>
#include <cerrno>
#include <csignal>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>
Expand Down
3 changes: 0 additions & 3 deletions cli/singleexecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@

#include "executor.h"

#include <cstddef>
#include <list>
#include <string>
#include <utility>

class ErrorLogger;
class Settings;
Expand Down
2 changes: 1 addition & 1 deletion cli/threadexecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "timer.h"

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <future>
#include <iostream>
Expand Down
2 changes: 0 additions & 2 deletions gui/checkthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,11 @@
#include "utils.h"

#include <algorithm>
#include <cstddef>
#include <fstream>
#include <iterator>
#include <list>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include <QByteArray>
Expand Down
2 changes: 0 additions & 2 deletions gui/codeeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

#include <QChar>
#include <QColor>
#include <QCryptographicHash>
#include <QFont>
#include <QFontMetrics>
#include <QKeySequence>
Expand All @@ -31,7 +30,6 @@
#include <QPainter>
#include <QPaintEvent>
#include <QRect>
#include <QRectF>
#include <QRegularExpressionMatchIterator>
#include <QShortcut>
#include <QTextBlock>
Expand Down
1 change: 0 additions & 1 deletion gui/codeeditorstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "codeeditorstyle.h"

#include <QSettings>
#include <QStringList>
#include <QVariant>

CodeEditorStyle::CodeEditorStyle(
Expand Down
2 changes: 2 additions & 0 deletions gui/codeeditstylecontrols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#include <QColorDialog>
#include <QDialog>
#include <QObject>
#include <QString>
#include <QVariant>

class QWidget;
Expand Down
1 change: 1 addition & 0 deletions gui/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <QDir>
#include <QFileInfo>
#include <QList>
#include <QMap>
#include <QSettings>
#include <QStringList>
#include <QVariant>
Expand Down
1 change: 0 additions & 1 deletion gui/cppchecklibrarydata.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <QList>
#include <QMap>
#include <QPair>
#include <QSet>
#include <QString>
#include <QStringList>

Expand Down
1 change: 0 additions & 1 deletion gui/helpdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <QDialog>
#include <QObject>
#include <QString>
#include <QTextBrowser>
#include <QVariant>

Expand Down
1 change: 1 addition & 0 deletions gui/libraryeditargdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QComboBox>
#include <QLineEdit>
#include <QSpinBox>
#include <QString>
#include <QStringList>

class QWidget;
Expand Down
1 change: 0 additions & 1 deletion gui/libraryeditargdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <QDialog>
#include <QList>
#include <QObject>
#include <QString>

class QWidget;
namespace Ui {
Expand Down
2 changes: 2 additions & 0 deletions gui/newsuppressiondialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@

#include "ui_newsuppressiondialog.h"

#include <cstdint>
#include <string>

#include <QComboBox>
#include <QLineEdit>
#include <QString>
#include <QStringList>

class QWidget;
Expand Down
1 change: 0 additions & 1 deletion gui/newsuppressiondialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include <QDialog>
#include <QObject>
#include <QString>

class QWidget;
namespace Ui {
Expand Down
1 change: 1 addition & 0 deletions gui/projectfiledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include <QListWidget>
#include <QListWidgetItem>
#include <QMap>
#include <QObject>
#include <QPushButton>
#include <QRadioButton>
#include <QRegularExpression>
Expand Down
2 changes: 2 additions & 0 deletions gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "xmlreportv2.h"

#include <utility>
#include <vector>

#include <QAction>
#include <QApplication>
Expand All @@ -53,6 +54,7 @@
#include <QMenu>
#include <QMessageBox>
#include <QModelIndex>
#include <QObject>
#include <QProcess>
#include <QSet>
#include <QSettings>
Expand Down
2 changes: 1 addition & 1 deletion gui/resultsview.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#ifndef RESULTSVIEW_H
#define RESULTSVIEW_H

#include "common.h"
#include "report.h"
#include "showtypes.h"

Expand All @@ -38,6 +37,7 @@ class QPrinter;
class QSettings;
class CheckStatistics;
class QPoint;
enum class ReportType : std::uint8_t;
namespace Ui {
class ResultsView;
}
Expand Down
1 change: 0 additions & 1 deletion gui/scratchpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <QDialog>
#include <QObject>
#include <QString>

class MainWindow;
namespace Ui {
Expand Down
1 change: 1 addition & 0 deletions lib/checkcondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "checkother.h" // comparisonNonZeroExpressionLessThanZero and testIfNonZeroExpressionIsPositive

#include <algorithm>
#include <cstdint>
#include <limits>
#include <list>
#include <set>
Expand Down
1 change: 0 additions & 1 deletion lib/checkleakautovar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <algorithm>
#include <array>
#include <cstddef>
#include <iostream>
#include <list>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions lib/checkleakautovar.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <map>
#include <set>
#include <string>
#include <utility>

class ErrorLogger;
class Settings;
Expand Down
1 change: 1 addition & 0 deletions lib/checkother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include <algorithm> // find_if()
#include <cctype>
#include <cstdint>
#include <list>
#include <map>
#include <set>
Expand Down
1 change: 1 addition & 0 deletions lib/checkunusedvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "valueflow.h"

#include <algorithm>
#include <cstdint>
#include <list>
#include <set>
#include <utility>
Expand Down
1 change: 0 additions & 1 deletion lib/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "color.h"

#include <cstddef>
#include <cstdlib>
#include <sstream>
#include <iostream>
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 <set>
#include <string>
#include <unordered_set>
#include <utility>
#include <vector>

class TokenList;
Expand Down
1 change: 1 addition & 0 deletions lib/forwardanalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdint>
#include <functional>
#include <list>
#include <string>
Expand Down
2 changes: 1 addition & 1 deletion lib/fwdanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "vfvalue.h"

#include <list>
#include <map>
#include <string>
#include <utility>

static bool isUnchanged(const Token *startToken, const Token *endToken, const std::set<nonneg int> &exprVarIds, bool local)
{
Expand Down
1 change: 1 addition & 0 deletions lib/preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>

#include <simplecpp.h>
Expand Down
1 change: 1 addition & 0 deletions lib/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <tuple>
#include <vector>
#include <unordered_set>
#include <utility>

enum class SHOWTIME_MODES : std::uint8_t;
namespace ValueFlow {
Expand Down
2 changes: 2 additions & 0 deletions lib/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "utils.h"
#include "vfvalue.h"

#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstddef>
Expand All @@ -37,6 +38,7 @@
#include <ostream>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions lib/tokenlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "token.h"

#include <cctype>
#include <cstdint>
#include <exception>
#include <functional>
#include <utility>
Expand Down
1 change: 1 addition & 0 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
#include <array>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <functional>
Expand Down
2 changes: 2 additions & 0 deletions lib/vf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "symboldatabase.h"
#include "vfvalue.h"

#include <cstddef>
#include <list>
#include <string>

class Token;
Expand Down
2 changes: 1 addition & 1 deletion lib/vf_enumvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include "symboldatabase.h"
#include "token.h"
#include "valueflow.h"
#include "vfvalue.h"

#include <list>
#include <memory>
#include <vector>

namespace ValueFlow
Expand Down
1 change: 0 additions & 1 deletion lib/vf_settokenvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <cstddef>
#include <functional>
#include <list>
#include <memory>
#include <string>
#include <unordered_map>
#include <unordered_set>
Expand Down
1 change: 1 addition & 0 deletions test/fixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "cppcheck.h"
#include "errortypes.h"
#include "helpers.h"
#include "library.h"
#include "options.h"
#include "redirect.h"

Expand Down
1 change: 0 additions & 1 deletion test/fixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "color.h"
#include "config.h"
#include "errorlogger.h"
#include "library.h"
#include "platform.h"
#include "settings.h"
#include "standards.h"
Expand Down
4 changes: 4 additions & 0 deletions test/helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#define helpersH

#include "config.h"
#include "library.h"
#include "preprocessor.h"
#include "settings.h"
#include "standards.h"
Expand All @@ -40,6 +41,9 @@ class ErrorLogger;
namespace simplecpp {
struct DUI;
}
namespace tinyxml2 {
class XMLDocument;
}

// TODO: make Tokenizer private
class SimpleTokenizer : public Tokenizer {
Expand Down
2 changes: 2 additions & 0 deletions test/testassert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "helpers.h"
#include "settings.h"

#include <cstddef>

class TestAssert : public TestFixture {
public:
TestAssert() : TestFixture("TestAssert") {}
Expand Down
1 change: 1 addition & 0 deletions test/testastutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "token.h"
#include "tokenlist.h"

#include <cstdint>
#include <cstring>

class TestAstUtils : public TestFixture {
Expand Down
Loading

0 comments on commit d03d820

Please sign in to comment.