CppTools: Consistently use nullptr

Fixed by clang-tidy modernize-use-nullptr.

Change-Id: I951627ba3543faa357f67ee76527518290efe3f1
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Tobias Hunger
2018-05-07 17:36:22 +02:00
parent fb71cac07b
commit b554c761fb
12 changed files with 15 additions and 15 deletions

View File

@@ -37,7 +37,7 @@ class CPPTOOLS_EXPORT AbstractEditorSupport : public QObject
{
Q_OBJECT
public:
explicit AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent = 0);
explicit AbstractEditorSupport(CppModelManager *modelmanager, QObject *parent = nullptr);
~AbstractEditorSupport() override;
/// \returns the contents, encoded as UTF-8

View File

@@ -57,7 +57,7 @@ public:
explicit ClangDiagnosticConfigsWidget(
const ClangDiagnosticConfigsModel &diagnosticConfigsModel = ClangDiagnosticConfigsModel(),
const Core::Id &configToSelect = Core::Id(),
QWidget *parent = 0);
QWidget *parent = nullptr);
~ClangDiagnosticConfigsWidget() override;
Core::Id currentConfigId() const;

View File

@@ -118,7 +118,7 @@ protected:
bool maybeFunction(const CPlusPlus::Name *name) const;
void checkNamespace(CPlusPlus::NameAST *name);
void checkName(CPlusPlus::NameAST *ast, CPlusPlus::Scope *scope = 0);
void checkName(CPlusPlus::NameAST *ast, CPlusPlus::Scope *scope = nullptr);
CPlusPlus::ClassOrNamespace *checkNestedName(CPlusPlus::QualifiedNameAST *ast);
void addUse(const Result &use);

View File

@@ -217,7 +217,7 @@ private:
QStringRef currentTokenText() const;
int tokenizeBlock(const QTextBlock &block, bool *endedJoined = 0);
int tokenizeBlock(const QTextBlock &block, bool *endedJoined = nullptr);
void turnInto(int newState);

View File

@@ -37,7 +37,7 @@ class CPPTOOLS_EXPORT CppCodeStylePreferences : public TextEditor::ICodeStylePre
Q_OBJECT
public:
explicit CppCodeStylePreferences(
QObject *parent = 0);
QObject *parent = nullptr);
QVariant value() const override;
void setValue(const QVariant &) override;

View File

@@ -48,7 +48,7 @@ class CPPTOOLS_EXPORT CppCompletionAssistProvider : public TextEditor::Completio
Q_OBJECT
public:
CppCompletionAssistProvider(QObject *parent = 0);
CppCompletionAssistProvider(QObject *parent = nullptr);
int activationCharSequenceLength() const override;
bool isActivationCharSequence(const QString &sequence) const override;
bool isContinuationChar(const QChar &c) const override;

View File

@@ -67,7 +67,7 @@ public:
public:
SymbolSearcher(QObject *parent = 0);
SymbolSearcher(QObject *parent = nullptr);
~SymbolSearcher() override = 0;
virtual void runSearch(QFutureInterface<Core::SearchResultItem> &future) = 0;
};

View File

@@ -42,7 +42,7 @@ public:
ASTNodePositions(CPlusPlus::AST *_ast) : ast(_ast) {}
operator bool() const { return ast; }
CPlusPlus::AST *ast = 0;
CPlusPlus::AST *ast = nullptr;
unsigned firstTokenIndex = 0;
unsigned lastTokenIndex = 0;
unsigned secondToLastTokenIndex = 0;
@@ -54,7 +54,7 @@ class CPPTOOLS_EXPORT CppSelectionChanger : public QObject
{
Q_OBJECT
public:
explicit CppSelectionChanger(QObject *parent = 0);
explicit CppSelectionChanger(QObject *parent = nullptr);
enum Direction {
ExpandSelection,

View File

@@ -68,7 +68,7 @@ const CPlusPlus::Macro CPPTOOLS_EXPORT *findCanonicalMacro(const QTextCursor &cu
enum class CacheUsage { ReadWrite, ReadOnly };
QString CPPTOOLS_EXPORT correspondingHeaderOrSource(const QString &fileName, bool *wasHeader = 0,
QString CPPTOOLS_EXPORT correspondingHeaderOrSource(const QString &fileName, bool *wasHeader = nullptr,
CacheUsage cacheUsage = CacheUsage::ReadWrite);
void CPPTOOLS_EXPORT switchHeaderSource();

View File

@@ -46,11 +46,11 @@ class CPPTOOLS_EXPORT FunctionUtils
public:
static bool isVirtualFunction(const CPlusPlus::Function *function,
const CPlusPlus::LookupContext &context,
const CPlusPlus::Function **firstVirtual = 0);
const CPlusPlus::Function **firstVirtual = nullptr);
static bool isPureVirtualFunction(const CPlusPlus::Function *function,
const CPlusPlus::LookupContext &context,
const CPlusPlus::Function **firstVirtual = 0);
const CPlusPlus::Function **firstVirtual = nullptr);
static QList<CPlusPlus::Function *> overrides(CPlusPlus::Function *function,
CPlusPlus::Class *functionsClass,

View File

@@ -90,8 +90,8 @@ public:
/// Returns the line (1-based) at which the include directive should be inserted.
/// On error, -1 is returned.
int operator()(const QString &newIncludeFileName, unsigned *newLinesToPrepend = 0,
unsigned *newLinesToAppend = 0);
int operator()(const QString &newIncludeFileName, unsigned *newLinesToPrepend = nullptr,
unsigned *newLinesToAppend = nullptr);
private:
int findInsertLineForVeryFirstInclude(unsigned *newLinesToPrepend, unsigned *newLinesToAppend);

View File

@@ -55,7 +55,7 @@ class CPPTOOLS_EXPORT ModelManagerTestHelper: public QObject
public:
typedef ProjectExplorer::Project Project;
explicit ModelManagerTestHelper(QObject *parent = 0,
explicit ModelManagerTestHelper(QObject *parent = nullptr,
bool testOnlyForCleanedProjects = true);
~ModelManagerTestHelper() override;