summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Shienkov <denis.shienkov@gmail.com>2017-11-18 19:07:25 +0300
committerJake Petroules <jake.petroules@qt.io>2017-11-20 21:03:07 +0000
commit7494bf59c28570dcc6ed6019f979e5625956c8af (patch)
tree3fb1e7fab1d064ebda1e78ffb21b06bd83e5107f
parent95c1e81382246f5235322eeb6876f77f65b22c19 (diff)
downloadqbs-7494bf59c28570dcc6ed6019f979e5625956c8af.tar.gz
Use nullptr to initialize the pointers
Change-Id: I59d743f585410cb5c00d36a7b6f9a3e9d696d19e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/app/config-ui/mainwindow.h2
-rw-r--r--src/app/qbs/application.cpp2
-rw-r--r--src/app/qbs/commandlinefrontend.cpp2
-rw-r--r--src/app/qbs/commandlinefrontend.h2
-rw-r--r--src/app/qbs/parser/commandlineparser.cpp6
-rw-r--r--src/lib/corelib/api/changeset.cpp12
-rw-r--r--src/lib/corelib/api/internaljobs.cpp8
-rw-r--r--src/lib/corelib/api/internaljobs.h10
-rw-r--r--src/lib/corelib/api/projectfileupdater.cpp4
-rw-r--r--src/lib/corelib/api/qmljsrewriter.cpp32
-rw-r--r--src/lib/corelib/buildgraph/abstractcommandexecutor.cpp6
-rw-r--r--src/lib/corelib/buildgraph/abstractcommandexecutor.h2
-rw-r--r--src/lib/corelib/buildgraph/buildgraph.cpp2
-rw-r--r--src/lib/corelib/buildgraph/cycledetector.cpp2
-rw-r--r--src/lib/corelib/buildgraph/depscanner.cpp4
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp4
-rw-r--r--src/lib/corelib/buildgraph/executor.h2
-rw-r--r--src/lib/corelib/buildgraph/executorjob.cpp4
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp6
-rw-r--r--src/lib/corelib/buildgraph/jscommandexecutor.cpp2
-rw-r--r--src/lib/corelib/buildgraph/jscommandexecutor.h2
-rw-r--r--src/lib/corelib/buildgraph/nodeset.cpp2
-rw-r--r--src/lib/corelib/buildgraph/processcommandexecutor.h2
-rw-r--r--src/lib/corelib/buildgraph/qtmocscanner.cpp6
-rw-r--r--src/lib/corelib/buildgraph/rulesapplicator.cpp4
-rw-r--r--src/lib/corelib/buildgraph/rulesevaluationcontext.cpp2
-rw-r--r--src/lib/corelib/jsextensions/domxml.cpp2
-rw-r--r--src/lib/corelib/jsextensions/moduleproperties.cpp2
-rw-r--r--src/lib/corelib/jsextensions/process.cpp4
-rw-r--r--src/lib/corelib/jsextensions/textfile.cpp6
-rw-r--r--src/lib/corelib/language/evaluatorscriptclass.cpp4
-rwxr-xr-xsrc/lib/corelib/language/evaluatorscriptclass.h2
-rw-r--r--src/lib/corelib/language/filecontext.cpp2
-rw-r--r--src/lib/corelib/language/item.cpp12
-rw-r--r--src/lib/corelib/language/item.h2
-rw-r--r--src/lib/corelib/language/itemreadervisitorstate.cpp2
-rw-r--r--src/lib/corelib/language/language.cpp4
-rw-r--r--src/lib/corelib/language/loader.cpp2
-rw-r--r--src/lib/corelib/language/moduleloader.cpp14
-rw-r--r--src/lib/corelib/language/moduleloader.h4
-rw-r--r--src/lib/corelib/language/modulemerger.cpp2
-rw-r--r--src/lib/corelib/language/projectresolver.cpp6
-rw-r--r--src/lib/corelib/language/scriptengine.h2
-rw-r--r--src/lib/corelib/language/value.cpp2
-rw-r--r--src/lib/corelib/parser/qmlerror.cpp10
-rw-r--r--src/lib/corelib/parser/qmljsast.cpp8
-rw-r--r--src/lib/corelib/parser/qmljsast_p.h50
-rw-r--r--src/lib/corelib/parser/qmljsengine_p.cpp2
-rw-r--r--src/lib/corelib/parser/qmljslexer.cpp12
-rw-r--r--src/lib/corelib/parser/qmljsmemorypool_p.h10
-rw-r--r--src/lib/corelib/parser/qmljsparser.cpp52
-rw-r--r--src/lib/corelib/parser/qmljsparser_p.h6
-rw-r--r--src/lib/corelib/tools/id.cpp2
-rw-r--r--src/lib/corelib/tools/persistence.cpp2
-rw-r--r--src/lib/corelib/tools/persistence.h4
-rw-r--r--src/lib/corelib/tools/profiling.cpp4
-rw-r--r--src/lib/corelib/tools/qbsprocess.h2
-rw-r--r--src/lib/corelib/tools/scannerpluginmanager.cpp2
-rw-r--r--src/lib/corelib/tools/settingsmodel.cpp6
-rw-r--r--src/lib/corelib/tools/settingsmodel.h2
-rw-r--r--src/lib/corelib/tools/vsenvironmentdetector.cpp2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h4
-rw-r--r--src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h4
-rw-r--r--src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuilditem.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h4
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuildproject.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuildproperty.h4
-rw-r--r--src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuildfiltersproject.cpp2
-rw-r--r--src/plugins/generator/visualstudio/msbuildfiltersproject.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuildqbsgenerateproject.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp2
-rw-r--r--src/plugins/generator/visualstudio/msbuildqbsproductproject.h2
-rw-r--r--src/plugins/generator/visualstudio/msbuildtargetproject.h2
-rw-r--r--src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h2
-rw-r--r--src/plugins/generator/visualstudio/solution/visualstudiosolution.h2
-rw-r--r--src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h2
-rw-r--r--src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h2
-rw-r--r--src/plugins/scanner/cpp/Token.cpp4
-rw-r--r--src/plugins/scanner/cpp/cppscanner.cpp16
-rw-r--r--src/plugins/scanner/qt/qtscanner.cpp24
-rw-r--r--src/shared/json/json.cpp36
-rw-r--r--tests/auto/api/testdata/generated-files-list/mainwindow.h2
-rw-r--r--tests/auto/api/testdata/lots-of-dots/object.narf.h2
-rw-r--r--tests/auto/api/testdata/moc-hpp-included/object.h2
-rw-r--r--tests/auto/api/testdata/moc-hpp-included/object2.h2
-rw-r--r--tests/auto/api/testdata/moc-hpp/object.h2
-rw-r--r--tests/auto/api/tst_api.cpp8
-rw-r--r--tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.h2
-rw-r--r--tests/auto/blackbox/testdata-qt/trackAddMocInclude/after/main.cpp2
-rw-r--r--tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/main.cpp2
-rw-r--r--tests/fuzzy-test/fuzzytester.cpp2
101 files changed, 274 insertions, 274 deletions
diff --git a/src/app/config-ui/mainwindow.h b/src/app/config-ui/mainwindow.h
index 73a01bc6a..908e447ea 100644
--- a/src/app/config-ui/mainwindow.h
+++ b/src/app/config-ui/mainwindow.h
@@ -53,7 +53,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- explicit MainWindow(const QString &settingsDir, QWidget *parent = 0);
+ explicit MainWindow(const QString &settingsDir, QWidget *parent = nullptr);
~MainWindow();
bool eventFilter(QObject *watched, QEvent *event);
diff --git a/src/app/qbs/application.cpp b/src/app/qbs/application.cpp
index 33fab4390..e22a0e9cc 100644
--- a/src/app/qbs/application.cpp
+++ b/src/app/qbs/application.cpp
@@ -45,7 +45,7 @@
namespace qbs {
Application::Application(int &argc, char **argv)
- : QCoreApplication(argc, argv), m_clFrontend(0), m_canceled(false)
+ : QCoreApplication(argc, argv), m_clFrontend(nullptr), m_canceled(false)
{
setApplicationName(QLatin1String("qbs"));
setOrganizationName(QLatin1String("QtProject"));
diff --git a/src/app/qbs/commandlinefrontend.cpp b/src/app/qbs/commandlinefrontend.cpp
index d5a8bbd55..8ed409c87 100644
--- a/src/app/qbs/commandlinefrontend.cpp
+++ b/src/app/qbs/commandlinefrontend.cpp
@@ -68,7 +68,7 @@ CommandLineFrontend::CommandLineFrontend(const CommandLineParser &parser, Settin
: QObject(parent)
, m_parser(parser)
, m_settings(settings)
- , m_observer(0)
+ , m_observer(nullptr)
, m_cancelStatus(CancelStatusNone)
, m_cancelTimer(new QTimer(this))
{
diff --git a/src/app/qbs/commandlinefrontend.h b/src/app/qbs/commandlinefrontend.h
index 9fc1f2c5b..8860324a6 100644
--- a/src/app/qbs/commandlinefrontend.h
+++ b/src/app/qbs/commandlinefrontend.h
@@ -66,7 +66,7 @@ class CommandLineFrontend : public QObject
Q_OBJECT
public:
explicit CommandLineFrontend(const CommandLineParser &parser, Settings *settings,
- QObject *parent = 0);
+ QObject *parent = nullptr);
~CommandLineFrontend();
void cancel();
diff --git a/src/app/qbs/parser/commandlineparser.cpp b/src/app/qbs/parser/commandlineparser.cpp
index 2df1d8cce..4569bc277 100644
--- a/src/app/qbs/parser/commandlineparser.cpp
+++ b/src/app/qbs/parser/commandlineparser.cpp
@@ -110,7 +110,7 @@ public:
bool logTime;
};
-CommandLineParser::CommandLineParser() : d(0)
+CommandLineParser::CommandLineParser() : d(nullptr)
{
}
@@ -312,7 +312,7 @@ bool CommandLineParser::parseCommandLine(const QStringList &args)
CommandLineParser::CommandLineParserPrivate::CommandLineParserPrivate()
- : command(0), commandPool(optionPool), showProgress(false), logTime(false)
+ : command(nullptr), commandPool(optionPool), showProgress(false), logTime(false)
{
}
@@ -357,7 +357,7 @@ Command *CommandLineParser::CommandLineParserPrivate::commandFromString(const QS
if (command->representation() == commandString)
return command;
}
- return 0;
+ return nullptr;
}
QList<Command *> CommandLineParser::CommandLineParserPrivate::allCommands() const
diff --git a/src/lib/corelib/api/changeset.cpp b/src/lib/corelib/api/changeset.cpp
index f5d60df80..699270b39 100644
--- a/src/lib/corelib/api/changeset.cpp
+++ b/src/lib/corelib/api/changeset.cpp
@@ -44,12 +44,12 @@
namespace QbsQmlJS {
ChangeSet::ChangeSet()
- : m_string(0), m_cursor(0), m_error(false)
+ : m_string(nullptr), m_cursor(nullptr), m_error(false)
{
}
ChangeSet::ChangeSet(const QList<EditOp> &operations)
- : m_string(0), m_cursor(0), m_operationList(operations), m_error(false)
+ : m_string(nullptr), m_cursor(nullptr), m_operationList(operations), m_error(false)
{
}
@@ -130,8 +130,8 @@ QList<ChangeSet::EditOp> ChangeSet::operationList() const
void ChangeSet::clear()
{
- m_string = 0;
- m_cursor = 0;
+ m_string = nullptr;
+ m_cursor = nullptr;
m_operationList.clear();
m_error = false;
}
@@ -345,14 +345,14 @@ void ChangeSet::apply(QString *s)
{
m_string = s;
apply_helper();
- m_string = 0;
+ m_string = nullptr;
}
void ChangeSet::apply(QTextCursor *textCursor)
{
m_cursor = textCursor;
apply_helper();
- m_cursor = 0;
+ m_cursor = nullptr;
}
QString ChangeSet::textAt(int pos, int length)
diff --git a/src/lib/corelib/api/internaljobs.cpp b/src/lib/corelib/api/internaljobs.cpp
index 61acab258..2a2731331 100644
--- a/src/lib/corelib/api/internaljobs.cpp
+++ b/src/lib/corelib/api/internaljobs.cpp
@@ -70,7 +70,7 @@ namespace Internal {
class JobObserver : public ProgressObserver
{
public:
- JobObserver(InternalJob *job) : m_canceled(false), m_job(job), m_timedLogger(0) { }
+ JobObserver(InternalJob *job) : m_canceled(false), m_job(job), m_timedLogger(nullptr) { }
~JobObserver() { delete m_timedLogger; }
void cancel()
@@ -103,7 +103,7 @@ private:
m_value = value;
if (value == m_maximum) {
delete m_timedLogger;
- m_timedLogger = 0;
+ m_timedLogger = nullptr;
}
emit m_job->taskProgress(value, m_job);
}
@@ -266,7 +266,7 @@ void InternalSetupProjectJob::start()
}
execute();
if (m_existingProject)
- m_existingProject->bgLocker = 0;
+ m_existingProject->bgLocker = nullptr;
m_newProject->bgLocker = bgLocker;
deleteLocker = false;
} catch (const ErrorInfo &error) {
@@ -362,7 +362,7 @@ void BuildGraphTouchingJob::storeBuildGraph()
}
InternalBuildJob::InternalBuildJob(const Logger &logger, QObject *parent)
- : BuildGraphTouchingJob(logger, parent), m_executor(0)
+ : BuildGraphTouchingJob(logger, parent), m_executor(nullptr)
{
}
diff --git a/src/lib/corelib/api/internaljobs.h b/src/lib/corelib/api/internaljobs.h
index f0260cc98..4ed6bf1f4 100644
--- a/src/lib/corelib/api/internaljobs.h
+++ b/src/lib/corelib/api/internaljobs.h
@@ -80,7 +80,7 @@ public:
void shareObserverWith(InternalJob *otherJob);
protected:
- explicit InternalJob(const Logger &logger, QObject *parent = 0);
+ explicit InternalJob(const Logger &logger, QObject *parent = nullptr);
JobObserver *observer() const { return m_observer; }
void setTimed(bool timed) { m_timed = timed; }
@@ -105,7 +105,7 @@ class InternalJobThreadWrapper : public InternalJob
{
Q_OBJECT
public:
- InternalJobThreadWrapper(InternalJob *synchronousJob, QObject *parent = 0);
+ InternalJobThreadWrapper(InternalJob *synchronousJob, QObject *parent = nullptr);
~InternalJobThreadWrapper();
void start() override;
@@ -159,7 +159,7 @@ signals:
void reportProcessResult(const qbs::ProcessResult &result);
protected:
- BuildGraphTouchingJob(const Logger &logger, QObject *parent = 0);
+ BuildGraphTouchingJob(const Logger &logger, QObject *parent = nullptr);
~BuildGraphTouchingJob();
void setup(const TopLevelProjectPtr &project, const QList<ResolvedProductPtr> &products,
@@ -177,7 +177,7 @@ class InternalBuildJob : public BuildGraphTouchingJob
{
Q_OBJECT
public:
- InternalBuildJob(const Logger &logger, QObject *parent = 0);
+ InternalBuildJob(const Logger &logger, QObject *parent = nullptr);
void build(const TopLevelProjectPtr &project, const QList<ResolvedProductPtr> &products,
const BuildOptions &buildOptions);
@@ -194,7 +194,7 @@ class InternalCleanJob : public BuildGraphTouchingJob
{
Q_OBJECT
public:
- InternalCleanJob(const Logger &logger, QObject *parent = 0);
+ InternalCleanJob(const Logger &logger, QObject *parent = nullptr);
void init(const TopLevelProjectPtr &project, const QList<ResolvedProductPtr> &products,
const CleanOptions &options);
diff --git a/src/lib/corelib/api/projectfileupdater.cpp b/src/lib/corelib/api/projectfileupdater.cpp
index 37dfb7688..648235731 100644
--- a/src/lib/corelib/api/projectfileupdater.cpp
+++ b/src/lib/corelib/api/projectfileupdater.cpp
@@ -65,7 +65,7 @@ namespace Internal {
class ItemFinder : public Visitor
{
public:
- ItemFinder(const CodeLocation &cl) : m_cl(cl), m_item(0) { }
+ ItemFinder(const CodeLocation &cl) : m_cl(cl), m_item(nullptr) { }
UiObjectDefinition *item() const { return m_item; }
@@ -87,7 +87,7 @@ class FilesBindingFinder : public Visitor
{
public:
FilesBindingFinder(const UiObjectDefinition *startItem)
- : m_startItem(startItem), m_binding(0)
+ : m_startItem(startItem), m_binding(nullptr)
{
}
diff --git a/src/lib/corelib/api/qmljsrewriter.cpp b/src/lib/corelib/api/qmljsrewriter.cpp
index 8d8d071a9..ebcc00b07 100644
--- a/src/lib/corelib/api/qmljsrewriter.cpp
+++ b/src/lib/corelib/api/qmljsrewriter.cpp
@@ -93,7 +93,7 @@ Rewriter::Range Rewriter::addBinding(AST::UiObjectInitializer *ast,
SourceLocation endOfPreviousMember;
SourceLocation startOfNextMember;
- if (insertAfter == 0 || insertAfter->member == 0) {
+ if (insertAfter == nullptr || insertAfter->member == nullptr) {
// insert as first member
endOfPreviousMember = ast->lbraceToken;
@@ -114,7 +114,7 @@ Rewriter::Range Rewriter::addBinding(AST::UiObjectInitializer *ast,
bool needsTrailingSemicolon = false;
if (isOneLiner) {
- if (insertAfter == 0) { // we're inserting after an lbrace
+ if (insertAfter == nullptr) { // we're inserting after an lbrace
if (ast->members) { // we're inserting before a member (and not the rbrace)
needsTrailingSemicolon = bindingType == ScriptBinding;
}
@@ -168,8 +168,8 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
{
const int objectDefinitionInsertionPoint = propertyOrder.indexOf(QString());
- UiObjectMemberList *lastObjectDef = 0;
- UiObjectMemberList *lastNonObjectDef = 0;
+ UiObjectMemberList *lastObjectDef = nullptr;
+ UiObjectMemberList *lastNonObjectDef = nullptr;
for (UiObjectMemberList *iter = members; iter; iter = iter->next) {
UiObjectMember *member = iter->member;
@@ -201,8 +201,8 @@ UiArrayMemberList *Rewriter::searchMemberToInsertAfter(UiArrayMemberList *member
{
const int objectDefinitionInsertionPoint = propertyOrder.indexOf(QString());
- UiArrayMemberList *lastObjectDef = 0;
- UiArrayMemberList *lastNonObjectDef = 0;
+ UiArrayMemberList *lastObjectDef = nullptr;
+ UiArrayMemberList *lastNonObjectDef = nullptr;
for (UiArrayMemberList *iter = members; iter; iter = iter->next) {
UiObjectMember *member = iter->member;
@@ -234,7 +234,7 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
const QStringList &propertyOrder)
{
if (!members)
- return 0; // empty members
+ return nullptr; // empty members
QHash<QString, UiObjectMemberList *> orderedMembers;
@@ -266,7 +266,7 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
return candidate;
}
- return 0;
+ return nullptr;
}
void Rewriter::changeBinding(UiObjectInitializer *ast,
@@ -382,7 +382,7 @@ void Rewriter::insertIntoArray(UiArrayBinding *ast, const QString &newValue)
if (!ast)
return;
- UiObjectMember *lastMember = 0;
+ UiObjectMember *lastMember = nullptr;
for (UiArrayMemberList *iter = ast->members; iter; iter = iter->next) {
lastMember = iter->member;
}
@@ -426,7 +426,7 @@ void Rewriter::removeGroupedProperty(UiObjectDefinition *ast,
const QString propName = propertyName.mid(dotIdx + 1);
- UiObjectMember *wanted = 0;
+ UiObjectMember *wanted = nullptr;
unsigned memberCount = 0;
for (UiObjectMemberList *it = ast->initializer->members; it; it = it->next) {
++memberCount;
@@ -545,8 +545,8 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
{
const int objectDefinitionInsertionPoint = propertyOrder.indexOf(QString::null);
- UiObjectMemberList *lastObjectDef = 0;
- UiObjectMemberList *lastNonObjectDef = 0;
+ UiObjectMemberList *lastObjectDef = nullptr;
+ UiObjectMemberList *lastNonObjectDef = nullptr;
for (UiObjectMemberList *iter = members; iter; iter = iter->next) {
UiObjectMember *member = iter->member;
@@ -576,7 +576,7 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *members, const QString &propertyName, const QStringList &propertyOrder)
{
if (!members)
- return 0; // empty members
+ return nullptr; // empty members
QHash<QString, UiObjectMemberList *> orderedMembers;
@@ -608,7 +608,7 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
return candidate;
}
- return 0;
+ return nullptr;
}
#endif
@@ -616,7 +616,7 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
void Rewriter::appendToArrayBinding(UiArrayBinding *arrayBinding,
const QString &content)
{
- UiObjectMember *lastMember = 0;
+ UiObjectMember *lastMember = nullptr;
for (UiArrayMemberList *iter = arrayBinding->members; iter; iter = iter->next)
if (iter->member)
lastMember = iter->member;
@@ -697,7 +697,7 @@ void Rewriter::extendToLeadingOrTrailingComma(UiArrayBinding *parentArray,
int &start,
int &end) const
{
- UiArrayMemberList *currentMember = 0;
+ UiArrayMemberList *currentMember = nullptr;
for (UiArrayMemberList *it = parentArray->members; it; it = it->next) {
if (it->member == member) {
currentMember = it;
diff --git a/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp b/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
index 1ed5f21f3..94597e6d3 100644
--- a/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
+++ b/src/lib/corelib/buildgraph/abstractcommandexecutor.cpp
@@ -50,9 +50,9 @@ namespace Internal {
AbstractCommandExecutor::AbstractCommandExecutor(const Logger &logger, QObject *parent)
: QObject(parent)
, m_echoMode(defaultCommandEchoMode())
- , m_command(0)
- , m_transformer(0)
- , m_mainThreadScriptEngine(0)
+ , m_command(nullptr)
+ , m_transformer(nullptr)
+ , m_mainThreadScriptEngine(nullptr)
, m_dryRun(false)
, m_logger(logger)
{
diff --git a/src/lib/corelib/buildgraph/abstractcommandexecutor.h b/src/lib/corelib/buildgraph/abstractcommandexecutor.h
index 7ff769396..505fd8da0 100644
--- a/src/lib/corelib/buildgraph/abstractcommandexecutor.h
+++ b/src/lib/corelib/buildgraph/abstractcommandexecutor.h
@@ -58,7 +58,7 @@ class AbstractCommandExecutor : public QObject
{
Q_OBJECT
public:
- explicit AbstractCommandExecutor(const Internal::Logger &logger, QObject *parent = 0);
+ explicit AbstractCommandExecutor(const Internal::Logger &logger, QObject *parent = nullptr);
void setMainThreadScriptEngine(ScriptEngine *engine) { m_mainThreadScriptEngine = engine; }
void setDryRunEnabled(bool enabled) { m_dryRun = enabled; }
diff --git a/src/lib/corelib/buildgraph/buildgraph.cpp b/src/lib/corelib/buildgraph/buildgraph.cpp
index 7a87303b1..0baacc27d 100644
--- a/src/lib/corelib/buildgraph/buildgraph.cpp
+++ b/src/lib/corelib/buildgraph/buildgraph.cpp
@@ -490,7 +490,7 @@ Artifact *lookupArtifact(const ResolvedProductConstPtr &product,
: artifact->product == product))
return artifact;
}
- return 0;
+ return nullptr;
}
Artifact *lookupArtifact(const ResolvedProductConstPtr &product, const QString &dirPath,
diff --git a/src/lib/corelib/buildgraph/cycledetector.cpp b/src/lib/corelib/buildgraph/cycledetector.cpp
index 13d1d85b9..95afba87d 100644
--- a/src/lib/corelib/buildgraph/cycledetector.cpp
+++ b/src/lib/corelib/buildgraph/cycledetector.cpp
@@ -52,7 +52,7 @@ namespace qbs {
namespace Internal {
CycleDetector::CycleDetector(const Logger &logger)
- : m_parent(0), m_logger(logger)
+ : m_parent(nullptr), m_logger(logger)
{
}
diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp
index 274a848d9..e0fae57c9 100644
--- a/src/lib/corelib/buildgraph/depscanner.cpp
+++ b/src/lib/corelib/buildgraph/depscanner.cpp
@@ -112,7 +112,7 @@ QStringList PluginDependencyScanner::collectDependencies(FileResourceBase *file,
int flags = 0;
int length = 0;
const char *szOutFilePath = m_plugin->next(scannerHandle, &length, &flags);
- if (szOutFilePath == 0)
+ if (szOutFilePath == nullptr)
break;
QString outFilePath = QString::fromLocal8Bit(szOutFilePath, length);
if (outFilePath.isEmpty())
@@ -157,7 +157,7 @@ UserDependencyScanner::UserDependencyScanner(const ResolvedScannerConstPtr &scan
: m_scanner(scanner),
m_engine(engine),
m_observer(m_engine, UnobserveMode::Enabled),
- m_product(0)
+ m_product(nullptr)
{
m_global = m_engine->newObject();
m_global.setPrototype(m_engine->globalObject());
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index b7a069096..6d5cc9f90 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -84,9 +84,9 @@ bool Executor::ComparePriority::operator() (const BuildGraphNode *x, const Build
Executor::Executor(const Logger &logger, QObject *parent)
: QObject(parent)
- , m_productInstaller(0)
+ , m_productInstaller(nullptr)
, m_logger(logger)
- , m_progressObserver(0)
+ , m_progressObserver(nullptr)
, m_state(ExecutorIdle)
, m_cancelationTimer(new QTimer(this))
{
diff --git a/src/lib/corelib/buildgraph/executor.h b/src/lib/corelib/buildgraph/executor.h
index 849920aee..cdc7e2f1a 100644
--- a/src/lib/corelib/buildgraph/executor.h
+++ b/src/lib/corelib/buildgraph/executor.h
@@ -74,7 +74,7 @@ class Executor : public QObject, private BuildGraphVisitor
public:
void build();
- Executor(const Logger &logger, QObject *parent = 0);
+ Executor(const Logger &logger, QObject *parent = nullptr);
~Executor();
void setProject(const TopLevelProjectPtr &project);
diff --git a/src/lib/corelib/buildgraph/executorjob.cpp b/src/lib/corelib/buildgraph/executorjob.cpp
index 8fb767d38..0b67f2eee 100644
--- a/src/lib/corelib/buildgraph/executorjob.cpp
+++ b/src/lib/corelib/buildgraph/executorjob.cpp
@@ -166,8 +166,8 @@ void ExecutorJob::setFinished()
void ExecutorJob::reset()
{
- m_transformer = 0;
- m_currentCommandExecutor = 0;
+ m_transformer = nullptr;
+ m_currentCommandExecutor = nullptr;
m_currentCommandIdx = -1;
m_error.clear();
}
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index 78808b531..31e54486e 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -74,9 +74,9 @@ static void resolveDepencency(const RawScannedDependency &dependency,
absDirPath = QDir::cleanPath(absDirPath);
ResolvedProject *project = product->project.get();
- FileDependency *fileDependencyArtifact = 0;
- Artifact *dependencyInProduct = 0;
- Artifact *dependencyInOtherProduct = 0;
+ FileDependency *fileDependencyArtifact = nullptr;
+ Artifact *dependencyInProduct = nullptr;
+ Artifact *dependencyInOtherProduct = nullptr;
for (FileResourceBase *lookupResult : project->topLevelProject()
->buildData->lookupFiles(absDirPath, dependency.fileName())) {
if ((fileDependencyArtifact = dynamic_cast<FileDependency *>(lookupResult)))
diff --git a/src/lib/corelib/buildgraph/jscommandexecutor.cpp b/src/lib/corelib/buildgraph/jscommandexecutor.cpp
index be71cb6b5..974aa676d 100644
--- a/src/lib/corelib/buildgraph/jscommandexecutor.cpp
+++ b/src/lib/corelib/buildgraph/jscommandexecutor.cpp
@@ -73,7 +73,7 @@ class JsCommandExecutorThreadObject : public QObject
public:
JsCommandExecutorThreadObject(const Logger &logger)
: m_logger(logger)
- , m_scriptEngine(0)
+ , m_scriptEngine(nullptr)
{
}
diff --git a/src/lib/corelib/buildgraph/jscommandexecutor.h b/src/lib/corelib/buildgraph/jscommandexecutor.h
index 929c81fff..f70d54711 100644
--- a/src/lib/corelib/buildgraph/jscommandexecutor.h
+++ b/src/lib/corelib/buildgraph/jscommandexecutor.h
@@ -55,7 +55,7 @@ class JsCommandExecutor : public AbstractCommandExecutor
{
Q_OBJECT
public:
- explicit JsCommandExecutor(const Logger &logger, QObject *parent = 0);
+ explicit JsCommandExecutor(const Logger &logger, QObject *parent = nullptr);
~JsCommandExecutor();
signals:
diff --git a/src/lib/corelib/buildgraph/nodeset.cpp b/src/lib/corelib/buildgraph/nodeset.cpp
index d8b662e48..b9ef222eb 100644
--- a/src/lib/corelib/buildgraph/nodeset.cpp
+++ b/src/lib/corelib/buildgraph/nodeset.cpp
@@ -50,7 +50,7 @@ namespace Internal {
BuildGraphNode *loadBuildGraphNode(PersistentPool &pool)
{
const auto t = pool.load<quint8>();
- BuildGraphNode *node = 0;
+ BuildGraphNode *node = nullptr;
switch (static_cast<BuildGraphNode::Type>(t)) {
case BuildGraphNode::ArtifactNodeType:
node = pool.load<Artifact *>();
diff --git a/src/lib/corelib/buildgraph/processcommandexecutor.h b/src/lib/corelib/buildgraph/processcommandexecutor.h
index b96f6a0f1..877c0bffb 100644
--- a/src/lib/corelib/buildgraph/processcommandexecutor.h
+++ b/src/lib/corelib/buildgraph/processcommandexecutor.h
@@ -56,7 +56,7 @@ class ProcessCommandExecutor : public AbstractCommandExecutor
{
Q_OBJECT
public:
- explicit ProcessCommandExecutor(const Internal::Logger &logger, QObject *parent = 0);
+ explicit ProcessCommandExecutor(const Internal::Logger &logger, QObject *parent = nullptr);
void setProcessEnvironment(const QProcessEnvironment &processEnvironment) {
m_buildEnvironment = processEnvironment;
diff --git a/src/lib/corelib/buildgraph/qtmocscanner.cpp b/src/lib/corelib/buildgraph/qtmocscanner.cpp
index df2bfab00..a5f607d8a 100644
--- a/src/lib/corelib/buildgraph/qtmocscanner.cpp
+++ b/src/lib/corelib/buildgraph/qtmocscanner.cpp
@@ -98,8 +98,8 @@ QtMocScanner::QtMocScanner(const ResolvedProductPtr &product, QScriptValue targe
: m_tags(*commonFileTags())
, m_product(product)
, m_targetScriptValue(targetScriptValue)
- , m_cppScanner(0)
- , m_hppScanner(0)
+ , m_cppScanner(nullptr)
+ , m_hppScanner(nullptr)
{
ScriptEngine *engine = static_cast<ScriptEngine *>(targetScriptValue.engine());
QScriptValue scannerObj = engine->newObject();
@@ -151,7 +151,7 @@ static RawScanResult runScanner(ScannerPlugin *scanner, const Artifact *artifact
forever {
int flags = 0;
const char *szOutFilePath = scanner->next(opaq, &length, &flags);
- if (szOutFilePath == 0)
+ if (szOutFilePath == nullptr)
break;
QString includedFilePath = QString::fromLocal8Bit(szOutFilePath, length);
if (includedFilePath.isEmpty())
diff --git a/src/lib/corelib/buildgraph/rulesapplicator.cpp b/src/lib/corelib/buildgraph/rulesapplicator.cpp
index 674a5a2bb..3430b5204 100644
--- a/src/lib/corelib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/corelib/buildgraph/rulesapplicator.cpp
@@ -73,7 +73,7 @@ namespace Internal {
RulesApplicator::RulesApplicator(const ResolvedProductPtr &product, const Logger &logger)
: m_product(product)
- , m_mocScanner(0)
+ , m_mocScanner(nullptr)
, m_logger(logger)
{
}
@@ -121,7 +121,7 @@ void RulesApplicator::handleRemovedRuleOutputs(const ArtifactSet &inputArtifacts
const ArtifactSet &outputArtifactsToRemove, const Logger &logger)
{
ArtifactSet artifactsToRemove;
- const TopLevelProject *project = 0;
+ const TopLevelProject *project = nullptr;
for (Artifact * const removedArtifact : outputArtifactsToRemove) {
qCDebug(lcBuildGraph) << "dynamic rule removed output artifact"
<< removedArtifact->toString();
diff --git a/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp b/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp
index cd4df4d01..0b6774adb 100644
--- a/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp
+++ b/src/lib/corelib/buildgraph/rulesevaluationcontext.cpp
@@ -56,7 +56,7 @@ namespace Internal {
RulesEvaluationContext::RulesEvaluationContext(const Logger &logger)
: m_logger(logger),
m_engine(new ScriptEngine(m_logger, EvalContext::RuleExecution)),
- m_observer(0),
+ m_observer(nullptr),
m_initScopeCalls(0)
{
m_prepareScriptScope = m_engine->newObject();
diff --git a/src/lib/corelib/jsextensions/domxml.cpp b/src/lib/corelib/jsextensions/domxml.cpp
index 6b2cf6bed..b47ac5b05 100644
--- a/src/lib/corelib/jsextensions/domxml.cpp
+++ b/src/lib/corelib/jsextensions/domxml.cpp
@@ -143,7 +143,7 @@ QBS_JSEXTENSION_REGISTER(Xml, &initializeJsExtensionXml)
QScriptValue XmlDomDocument::ctor(QScriptContext *context, QScriptEngine *engine)
{
- XmlDomDocument *xml = 0;
+ XmlDomDocument *xml = nullptr;
switch (context->argumentCount()) {
case 0:
xml = new XmlDomDocument(context);
diff --git a/src/lib/corelib/jsextensions/moduleproperties.cpp b/src/lib/corelib/jsextensions/moduleproperties.cpp
index 47b226e50..b544699fe 100644
--- a/src/lib/corelib/jsextensions/moduleproperties.cpp
+++ b/src/lib/corelib/jsextensions/moduleproperties.cpp
@@ -229,7 +229,7 @@ QScriptValue ModuleProperties::moduleProperty(QScriptContext *context, QScriptEn
const void *ptr = reinterpret_cast<const void *>(qscriptvalue_cast<quintptr>(ptrScriptValue));
PropertyMapConstPtr properties;
- const Artifact *artifact = 0;
+ const Artifact *artifact = nullptr;
if (typeScriptValue.toString() == productType()) {
properties = static_cast<const ResolvedProduct *>(ptr)->moduleProperties;
} else if (typeScriptValue.toString() == artifactType()) {
diff --git a/src/lib/corelib/jsextensions/process.cpp b/src/lib/corelib/jsextensions/process.cpp
index fed7e57e7..b38c10aad 100644
--- a/src/lib/corelib/jsextensions/process.cpp
+++ b/src/lib/corelib/jsextensions/process.cpp
@@ -244,9 +244,9 @@ void Process::close()
return;
Q_ASSERT(thisObject().engine() == engine());
delete m_textStream;
- m_textStream = 0;
+ m_textStream = nullptr;
delete m_qProcess;
- m_qProcess = 0;
+ m_qProcess = nullptr;
}
bool Process::waitForFinished(int msecs)
diff --git a/src/lib/corelib/jsextensions/textfile.cpp b/src/lib/corelib/jsextensions/textfile.cpp
index bfa2b12d2..57c928d86 100644
--- a/src/lib/corelib/jsextensions/textfile.cpp
+++ b/src/lib/corelib/jsextensions/textfile.cpp
@@ -166,7 +166,7 @@ TextFile::TextFile(QScriptContext *context, const QString &filePath, OpenMode mo
context->throwError(Tr::tr("Unable to open file '%1': %2")
.arg(filePath, m_file->errorString()));
delete m_file;
- m_file = 0;
+ m_file = nullptr;
}
}
@@ -175,10 +175,10 @@ void TextFile::close()
if (checkForClosed())
return;
delete m_stream;
- m_stream = 0;
+ m_stream = nullptr;
m_file->close();
delete m_file;
- m_file = 0;
+ m_file = nullptr;
}
QString TextFile::filePath()
diff --git a/src/lib/corelib/language/evaluatorscriptclass.cpp b/src/lib/corelib/language/evaluatorscriptclass.cpp
index f416be1b1..533025ff6 100644
--- a/src/lib/corelib/language/evaluatorscriptclass.cpp
+++ b/src/lib/corelib/language/evaluatorscriptclass.cpp
@@ -586,8 +586,8 @@ QScriptValue EvaluatorScriptClass::property(const QScriptValue &object, const QS
const EvaluationData *data = m_queryResult.data;
const Item * const itemOfProperty = m_queryResult.itemOfProperty;
m_queryResult.foundInParent = false;
- m_queryResult.data = 0;
- m_queryResult.itemOfProperty = 0;
+ m_queryResult.data = nullptr;
+ m_queryResult.itemOfProperty = nullptr;
QBS_ASSERT(data, return QScriptValue());
const QueryPropertyType qpt = static_cast<QueryPropertyType>(id);
diff --git a/src/lib/corelib/language/evaluatorscriptclass.h b/src/lib/corelib/language/evaluatorscriptclass.h
index 6968e9d98..ba39e23c9 100755
--- a/src/lib/corelib/language/evaluatorscriptclass.h
+++ b/src/lib/corelib/language/evaluatorscriptclass.h
@@ -89,7 +89,7 @@ private:
struct QueryResult
{
QueryResult()
- : data(0), itemOfProperty(0)
+ : data(nullptr), itemOfProperty(nullptr)
{}
bool isNull() const
diff --git a/src/lib/corelib/language/filecontext.cpp b/src/lib/corelib/language/filecontext.cpp
index 27107ff49..6daf8c871 100644
--- a/src/lib/corelib/language/filecontext.cpp
+++ b/src/lib/corelib/language/filecontext.cpp
@@ -45,7 +45,7 @@ namespace qbs {
namespace Internal {
FileContext::FileContext()
- : m_idScope(0)
+ : m_idScope(nullptr)
{
}
diff --git a/src/lib/corelib/language/item.cpp b/src/lib/corelib/language/item.cpp
index 4bdee83ea..646d90ff7 100644
--- a/src/lib/corelib/language/item.cpp
+++ b/src/lib/corelib/language/item.cpp
@@ -59,11 +59,11 @@ namespace Internal {
Item::Item(ItemPool *pool, ItemType type)
: m_pool(pool)
- , m_observer(0)
- , m_prototype(0)
- , m_scope(0)
- , m_outerItem(0)
- , m_parent(0)
+ , m_observer(nullptr)
+ , m_prototype(nullptr)
+ , m_scope(nullptr)
+ , m_outerItem(nullptr)
+ , m_parent(nullptr)
, m_type(type)
{
}
@@ -338,7 +338,7 @@ void Item::removeProperty(const QString &name)
Item *Item::child(ItemType type, bool checkForMultiple) const
{
- Item *child = 0;
+ Item *child = nullptr;
for (Item * const currentChild : children()) {
if (currentChild->type() == type) {
if (!checkForMultiple)
diff --git a/src/lib/corelib/language/item.h b/src/lib/corelib/language/item.h
index 62f4adde3..6dfc138aa 100644
--- a/src/lib/corelib/language/item.h
+++ b/src/lib/corelib/language/item.h
@@ -72,7 +72,7 @@ public:
struct Module
{
Module()
- : item(0), isProduct(false), required(true)
+ : item(nullptr), isProduct(false), required(true)
{}
QualifiedId name;
diff --git a/src/lib/corelib/language/itemreadervisitorstate.cpp b/src/lib/corelib/language/itemreadervisitorstate.cpp
index b1261f0ca..a48f081ff 100644
--- a/src/lib/corelib/language/itemreadervisitorstate.cpp
+++ b/src/lib/corelib/language/itemreadervisitorstate.cpp
@@ -62,7 +62,7 @@ class ASTCacheValueData : public QSharedData
Q_DISABLE_COPY(ASTCacheValueData)
public:
ASTCacheValueData()
- : ast(0)
+ : ast(nullptr)
, processing(false)
{
}
diff --git a/src/lib/corelib/language/language.cpp b/src/lib/corelib/language/language.cpp
index 22a678399..5f6a5ff58 100644
--- a/src/lib/corelib/language/language.cpp
+++ b/src/lib/corelib/language/language.cpp
@@ -773,7 +773,7 @@ QString ResolvedProduct::cachedExecutablePath(const QString &origFilePath) const
}
-ResolvedProject::ResolvedProject() : enabled(true), m_topLevelProject(0)
+ResolvedProject::ResolvedProject() : enabled(true), m_topLevelProject(nullptr)
{
}
@@ -849,7 +849,7 @@ void ResolvedProject::store(PersistentPool &pool) const
TopLevelProject::TopLevelProject()
- : bgLocker(0), locked(false), lastResolveTime(FileTime::oldestTime())
+ : bgLocker(nullptr), locked(false), lastResolveTime(FileTime::oldestTime())
{
}
diff --git a/src/lib/corelib/language/loader.cpp b/src/lib/corelib/language/loader.cpp
index 997124465..685865371 100644
--- a/src/lib/corelib/language/loader.cpp
+++ b/src/lib/corelib/language/loader.cpp
@@ -62,7 +62,7 @@ namespace Internal {
Loader::Loader(ScriptEngine *engine, const Logger &logger)
: m_logger(logger)
- , m_progressObserver(0)
+ , m_progressObserver(nullptr)
, m_engine(engine)
{
m_logger.storeWarnings();
diff --git a/src/lib/corelib/language/moduleloader.cpp b/src/lib/corelib/language/moduleloader.cpp
index 40e41e47e..138a07f53 100644
--- a/src/lib/corelib/language/moduleloader.cpp
+++ b/src/lib/corelib/language/moduleloader.cpp
@@ -239,9 +239,9 @@ private:
};
ModuleLoader::ModuleLoader(Evaluator *evaluator, Logger &logger)
- : m_pool(0)
+ : m_pool(nullptr)
, m_logger(logger)
- , m_progressObserver(0)
+ , m_progressObserver(nullptr)
, m_reader(new ItemReader(logger))
, m_evaluator(evaluator)
{
@@ -375,7 +375,7 @@ public:
PropertyDeclarationCheck(const Set<Item *> &disabledItems,
const SetupProjectParameters &params, Logger &logger)
: m_disabledItems(disabledItems)
- , m_parentItem(0)
+ , m_parentItem(nullptr)
, m_params(params)
, m_logger(logger)
{
@@ -2455,7 +2455,7 @@ Item *ModuleLoader::loadModule(ProductContext *productContext, Item *exportingPr
}
delayedPropertyChanger.applyNow();
if (!modulePrototype)
- return 0;
+ return nullptr;
instantiateModule(productContext, exportingProductItem, item, moduleInstance, modulePrototype,
moduleName, pmi);
@@ -2552,7 +2552,7 @@ Item *ModuleLoader::searchAndLoadModuleFile(ProductContext *productContext,
throw ErrorInfo(Tr::tr("Module %1 could not be loaded.").arg(fullName),
dependsItemLocation);
- return 0;
+ return nullptr;
}
// returns QVariant::Invalid for types that do not need conversion
@@ -2630,7 +2630,7 @@ Item *ModuleLoader::loadModuleFile(ProductContext *productContext, const QString
<< "Alleged module " << fullModuleName << " has type '"
<< module->typeName() << "', so it's not a module after all.";
*triedToLoad = false;
- return 0;
+ return nullptr;
}
// Set the name before evaluating any properties. EvaluatorScriptClass reads the module name.
@@ -2670,7 +2670,7 @@ Item *ModuleLoader::loadModuleFile(ProductContext *productContext, const QString
if (!enabled) {
qCDebug(lcModuleLoader) << "condition of module" << fullModuleName << "is false";
m_modulePrototypeItemCache.insert(cacheKey, ItemCacheValue(module, false));
- return 0;
+ return nullptr;
}
if (isBaseModule)
diff --git a/src/lib/corelib/language/moduleloader.h b/src/lib/corelib/language/moduleloader.h
index cc3b02973..a46f80873 100644
--- a/src/lib/corelib/language/moduleloader.h
+++ b/src/lib/corelib/language/moduleloader.h
@@ -77,7 +77,7 @@ using ModulePropertiesPerGroup = std::unordered_map<const Item *, QualifiedIdSet
struct ModuleLoaderResult
{
ModuleLoaderResult()
- : itemPool(new ItemPool), root(0)
+ : itemPool(new ItemPool), root(nullptr)
{}
struct ProductInfo
@@ -145,7 +145,7 @@ private:
{
public:
ContextBase()
- : item(0), scope(0)
+ : item(nullptr), scope(nullptr)
{}
Item *item;
diff --git a/src/lib/corelib/language/modulemerger.cpp b/src/lib/corelib/language/modulemerger.cpp
index 607d0627b..c0b574407 100644
--- a/src/lib/corelib/language/modulemerger.cpp
+++ b/src/lib/corelib/language/modulemerger.cpp
@@ -145,7 +145,7 @@ void ModuleMerger::start()
Item::PropertyMap ModuleMerger::dfs(const Item::Module &m, Item::PropertyMap props)
{
- Item *moduleInstance = 0;
+ Item *moduleInstance = nullptr;
size_t numberOfOutprops = m.item->modules().size();
for (const Item::Module &dep : m.item->modules()) {
if (dep.name == m_mergedModule.name) {
diff --git a/src/lib/corelib/language/projectresolver.cpp b/src/lib/corelib/language/projectresolver.cpp
index 879f42a11..ee95cacf1 100644
--- a/src/lib/corelib/language/projectresolver.cpp
+++ b/src/lib/corelib/language/projectresolver.cpp
@@ -110,7 +110,7 @@ ProjectResolver::ProjectResolver(Evaluator *evaluator, const ModuleLoaderResult
: m_evaluator(evaluator)
, m_logger(logger)
, m_engine(m_evaluator->engine())
- , m_progressObserver(0)
+ , m_progressObserver(nullptr)
, m_setupParams(setupParameters)
, m_loadResult(loadResult)
{
@@ -151,8 +151,8 @@ TopLevelProjectPtr ProjectResolver::resolve()
m_setupParams.logElapsedTime());
qCDebug(lcProjectResolver) << "resolving" << m_loadResult.root->file()->filePath();
- m_productContext = 0;
- m_moduleContext = 0;
+ m_productContext = nullptr;
+ m_moduleContext = nullptr;
m_elapsedTimeModPropEval = m_elapsedTimeAllPropEval = m_elapsedTimeGroups = 0;
TopLevelProjectPtr tlp;
try {
diff --git a/src/lib/corelib/language/scriptengine.h b/src/lib/corelib/language/scriptengine.h
index 68455c44e..05f4f519f 100644
--- a/src/lib/corelib/language/scriptengine.h
+++ b/src/lib/corelib/language/scriptengine.h
@@ -97,7 +97,7 @@ class QBS_AUTOTEST_EXPORT ScriptEngine : public QScriptEngine
{
Q_OBJECT
public:
- ScriptEngine(Logger &logger, EvalContext evalContext, QObject *parent = 0);
+ ScriptEngine(Logger &logger, EvalContext evalContext, QObject *parent = nullptr);
~ScriptEngine();
Logger &logger() const { return m_logger; }
diff --git a/src/lib/corelib/language/value.cpp b/src/lib/corelib/language/value.cpp
index 8c3dea32c..69f7836d2 100644
--- a/src/lib/corelib/language/value.cpp
+++ b/src/lib/corelib/language/value.cpp
@@ -49,7 +49,7 @@ namespace qbs {
namespace Internal {
Value::Value(Type t, bool createdByPropertiesBlock)
- : m_type(t), m_definingItem(0), m_createdByPropertiesBlock(createdByPropertiesBlock)
+ : m_type(t), m_definingItem(nullptr), m_createdByPropertiesBlock(createdByPropertiesBlock)
{
}
diff --git a/src/lib/corelib/parser/qmlerror.cpp b/src/lib/corelib/parser/qmlerror.cpp
index 6556ba8a5..c6fd2e27c 100644
--- a/src/lib/corelib/parser/qmlerror.cpp
+++ b/src/lib/corelib/parser/qmlerror.cpp
@@ -94,7 +94,7 @@ QmlErrorPrivate::QmlErrorPrivate()
Creates an empty error object.
*/
QmlError::QmlError()
-: d(0)
+: d(nullptr)
{
}
@@ -102,7 +102,7 @@ QmlError::QmlError()
Creates a copy of \a other.
*/
QmlError::QmlError(const QmlError &other)
-: d(0)
+: d(nullptr)
{
*this = other;
}
@@ -114,7 +114,7 @@ QmlError &QmlError::operator=(const QmlError &other)
{
if (!other.d) {
delete d;
- d = 0;
+ d = nullptr;
} else {
if (!d) d = new QmlErrorPrivate;
d->url = other.d->url;
@@ -130,7 +130,7 @@ QmlError &QmlError::operator=(const QmlError &other)
*/
QmlError::~QmlError()
{
- delete d; d = 0;
+ delete d; d = nullptr;
}
/*!
@@ -138,7 +138,7 @@ QmlError::~QmlError()
*/
bool QmlError::isValid() const
{
- return d != 0;
+ return d != nullptr;
}
/*!
diff --git a/src/lib/corelib/parser/qmljsast.cpp b/src/lib/corelib/parser/qmljsast.cpp
index 1d0d87b2e..8c87f80b2 100644
--- a/src/lib/corelib/parser/qmljsast.cpp
+++ b/src/lib/corelib/parser/qmljsast.cpp
@@ -60,22 +60,22 @@ void Node::accept(Node *node, Visitor *visitor)
ExpressionNode *Node::expressionCast()
{
- return 0;
+ return nullptr;
}
BinaryExpression *Node::binaryExpressionCast()
{
- return 0;
+ return nullptr;
}
Statement *Node::statementCast()
{
- return 0;
+ return nullptr;
}
UiObjectMember *Node::uiObjectMemberCast()
{
- return 0;
+ return nullptr;
}
ExpressionNode *ExpressionNode::expressionCast()
diff --git a/src/lib/corelib/parser/qmljsast_p.h b/src/lib/corelib/parser/qmljsast_p.h
index 072c77521..d7b627a4b 100644
--- a/src/lib/corelib/parser/qmljsast_p.h
+++ b/src/lib/corelib/parser/qmljsast_p.h
@@ -110,10 +110,10 @@ namespace AST {
template <typename _T1, typename _T2>
_T1 cast(_T2 *ast)
{
- if (ast && ast->kind == static_cast<_T1>(0)->K)
+ if (ast && ast->kind == static_cast<_T1>(nullptr)->K)
return static_cast<_T1>(ast);
- return 0;
+ return nullptr;
}
class QML_PARSER_EXPORT Node: public Managed
@@ -448,11 +448,11 @@ public:
QMLJS_DECLARE_AST_NODE(ArrayLiteral)
ArrayLiteral(Elision *e):
- elements (0), elision (e)
+ elements (nullptr), elision (e)
{ kind = K; }
ArrayLiteral(ElementList *elts):
- elements (elts), elision (0)
+ elements (elts), elision (nullptr)
{ kind = K; }
ArrayLiteral(ElementList *elts, Elision *e):
@@ -481,7 +481,7 @@ public:
QMLJS_DECLARE_AST_NODE(ObjectLiteral)
ObjectLiteral():
- properties (0) { kind = K; }
+ properties (nullptr) { kind = K; }
ObjectLiteral(PropertyNameAndValueList *plist):
properties (plist) { kind = K; }
@@ -526,7 +526,7 @@ public:
inline Elision *finish ()
{
Elision *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -555,7 +555,7 @@ public:
inline ElementList *finish ()
{
ElementList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -631,7 +631,7 @@ public:
inline PropertyNameAndValueList *finish ()
{
PropertyNameAndValueList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -835,7 +835,7 @@ public:
inline ArgumentList *finish ()
{
ArgumentList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -1199,7 +1199,7 @@ public:
inline StatementList *finish ()
{
StatementList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -1287,10 +1287,10 @@ public:
inline VariableDeclarationList *finish (bool readOnly)
{
VariableDeclarationList *front = next;
- next = 0;
+ next = nullptr;
if (readOnly) {
VariableDeclarationList *vdl;
- for (vdl = front; vdl != 0; vdl = vdl->next)
+ for (vdl = front; vdl != nullptr; vdl = vdl->next)
vdl->declaration->readOnly = true;
}
return front;
@@ -1735,7 +1735,7 @@ public:
inline CaseClauses *finish ()
{
CaseClauses *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -1871,11 +1871,11 @@ public:
{ kind = K; }
TryStatement(Statement *stmt, Finally *f):
- statement (stmt), catchExpression (0), finallyExpression (f)
+ statement (stmt), catchExpression (nullptr), finallyExpression (f)
{ kind = K; }
TryStatement(Statement *stmt, Catch *c):
- statement (stmt), catchExpression (c), finallyExpression (0)
+ statement (stmt), catchExpression (c), finallyExpression (nullptr)
{ kind = K; }
virtual void accept0(Visitor *visitor);
@@ -1969,7 +1969,7 @@ public:
inline FormalParameterList *finish ()
{
FormalParameterList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -2017,7 +2017,7 @@ public:
inline SourceElements *finish ()
{
SourceElements *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -2151,7 +2151,7 @@ public:
UiQualifiedId *finish()
{
UiQualifiedId *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2175,7 +2175,7 @@ public:
QMLJS_DECLARE_AST_NODE(UiImport)
UiImport(const QStringRef &fileName)
- : fileName(fileName), importUri(0)
+ : fileName(fileName), importUri(nullptr)
{ kind = K; }
UiImport(UiQualifiedId *uri)
@@ -2223,7 +2223,7 @@ public:
UiImportList *finish()
{
UiImportList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2277,7 +2277,7 @@ public:
UiObjectMemberList *finish()
{
UiObjectMemberList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2348,7 +2348,7 @@ public:
UiArrayMemberList *finish()
{
UiArrayMemberList *head = next;
- next = 0;
+ next = nullptr;
return head;
}
@@ -2409,7 +2409,7 @@ public:
inline UiParameterList *finish ()
{
UiParameterList *front = next;
- next = 0;
+ next = nullptr;
return front;
}
@@ -2429,13 +2429,13 @@ public:
UiPublicMember(const QStringRef &memberType,
const QStringRef &name)
- : type(Property), memberType(memberType), name(name), statement(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ : type(Property), memberType(memberType), name(name), statement(nullptr), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr)
{ kind = K; }
UiPublicMember(const QStringRef &memberType,
const QStringRef &name,
Statement *statement)
- : type(Property), memberType(memberType), name(name), statement(statement), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
+ : type(Property), memberType(memberType), name(name), statement(statement), binding(nullptr), isDefaultMember(false), isReadonlyMember(false), parameters(nullptr)
{ kind = K; }
virtual void accept0(Visitor *visitor);
diff --git a/src/lib/corelib/parser/qmljsengine_p.cpp b/src/lib/corelib/parser/qmljsengine_p.cpp
index 8a7b9dbc8..211743190 100644
--- a/src/lib/corelib/parser/qmljsengine_p.cpp
+++ b/src/lib/corelib/parser/qmljsengine_p.cpp
@@ -118,7 +118,7 @@ double integerFromString(const QString &str, int radix)
Engine::Engine()
- : _lexer(0), _directives(0)
+ : _lexer(nullptr), _directives(nullptr)
{ }
Engine::~Engine()
diff --git a/src/lib/corelib/parser/qmljslexer.cpp b/src/lib/corelib/parser/qmljslexer.cpp
index 43c52a474..2c96aa8cf 100644
--- a/src/lib/corelib/parser/qmljslexer.cpp
+++ b/src/lib/corelib/parser/qmljslexer.cpp
@@ -84,10 +84,10 @@ static QChar convertUnicode(QChar c1, QChar c2, QChar c3, QChar c4)
Lexer::Lexer(Engine *engine)
: _engine(engine)
- , _codePtr(0)
- , _lastLinePtr(0)
- , _tokenLinePtr(0)
- , _tokenStartPtr(0)
+ , _codePtr(nullptr)
+ , _lastLinePtr(nullptr)
+ , _tokenLinePtr(nullptr)
+ , _tokenStartPtr(nullptr)
, _char(QLatin1Char('\n'))
, _errorCode(NoError)
, _currentLineNumber(0)
@@ -455,7 +455,7 @@ again:
chars.append('\0');
const char *begin = chars.constData();
- const char *end = 0;
+ const char *end = nullptr;
bool ok = false;
_tokenValue = qstrtod(begin, &end, &ok);
@@ -845,7 +845,7 @@ int Lexer::scanNumber(QChar ch)
chars.append('\0');
const char *begin = chars.constData();
- const char *end = 0;
+ const char *end = nullptr;
bool ok = false;
_tokenValue = qstrtod(begin, &end, &ok);
diff --git a/src/lib/corelib/parser/qmljsmemorypool_p.h b/src/lib/corelib/parser/qmljsmemorypool_p.h
index fa16ac409..897348712 100644
--- a/src/lib/corelib/parser/qmljsmemorypool_p.h
+++ b/src/lib/corelib/parser/qmljsmemorypool_p.h
@@ -68,11 +68,11 @@ class QML_PARSER_EXPORT MemoryPool : public QSharedData
public:
MemoryPool()
- : _blocks(0),
+ : _blocks(nullptr),
_allocatedBlocks(0),
_blockCount(-1),
- _ptr(0),
- _end(0)
+ _ptr(nullptr),
+ _end(nullptr)
{ }
~MemoryPool()
@@ -101,7 +101,7 @@ public:
void reset()
{
_blockCount = -1;
- _ptr = _end = 0;
+ _ptr = _end = nullptr;
}
private:
@@ -118,7 +118,7 @@ private:
_blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
- _blocks[index] = 0;
+ _blocks[index] = nullptr;
}
char *&block = _blocks[_blockCount];
diff --git a/src/lib/corelib/parser/qmljsparser.cpp b/src/lib/corelib/parser/qmljsparser.cpp
index 963631b7d..10be751a8 100644
--- a/src/lib/corelib/parser/qmljsparser.cpp
+++ b/src/lib/corelib/parser/qmljsparser.cpp
@@ -77,13 +77,13 @@ Parser::Parser(Engine *engine):
pool(engine->pool()),
tos(0),
stack_size(0),
- sym_stack(0),
- state_stack(0),
- location_stack(0),
- string_stack(0),
- program(0),
- first_token(0),
- last_token(0)
+ sym_stack(nullptr),
+ state_stack(nullptr),
+ location_stack(nullptr),
+ string_stack(nullptr),
+ program(nullptr),
+ first_token(nullptr),
+ last_token(nullptr)
{
}
@@ -132,7 +132,7 @@ AST::UiQualifiedId *Parser::reparseAsQualifiedId(AST::ExpressionNode *expr)
return currentId->finish();
}
- return 0;
+ return nullptr;
}
bool Parser::parse(int startToken)
@@ -160,7 +160,7 @@ bool Parser::parse(int startToken)
}
tos = -1;
- program = 0;
+ program = nullptr;
do {
if (++tos == stack_size)
@@ -275,7 +275,7 @@ case 19: {
} break;
case 20: {
- AST::UiImport *node = 0;
+ AST::UiImport *node = nullptr;
if (AST::StringLiteral *importIdLiteral = AST::cast<AST::StringLiteral *>(sym(2).Expression)) {
node = new (pool) AST::UiImport(importIdLiteral->value);
@@ -298,7 +298,7 @@ case 20: {
} break;
case 21: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 22: {
@@ -379,7 +379,7 @@ case 41:
} break;
case 45: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 46: {
@@ -497,7 +497,7 @@ case 62: {
AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(6));
propertyName->identifierToken = loc(6);
- propertyName->next = 0;
+ propertyName->next = nullptr;
AST::UiArrayBinding *binding = new (pool) AST::UiArrayBinding(
propertyName, sym(9).UiArrayMemberList->finish());
@@ -519,7 +519,7 @@ case 63: {
AST::UiQualifiedId *propertyName = new (pool) AST::UiQualifiedId(stringRef(3));
propertyName->identifierToken = loc(3);
- propertyName->next = 0;
+ propertyName->next = nullptr;
AST::UiObjectBinding *binding = new (pool) AST::UiObjectBinding(
propertyName, sym(5).UiQualifiedId, sym(6).UiObjectInitializer);
@@ -652,7 +652,7 @@ case 85: {
} break;
case 86: {
- AST::ObjectLiteral *node = 0;
+ AST::ObjectLiteral *node = nullptr;
if (sym(2).Node)
node = new (pool) AST::ObjectLiteral(
sym(2).PropertyNameAndValueList->finish ());
@@ -689,7 +689,7 @@ case 89: {
if (AST::UiQualifiedId *qualifiedId = reparseAsQualifiedId(sym(1).Expression)) {
sym(1).UiQualifiedId = qualifiedId;
} else {
- sym(1).UiQualifiedId = 0;
+ sym(1).UiQualifiedId = nullptr;
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, loc(1),
QLatin1String("Expected a qualified name id")));
@@ -834,7 +834,7 @@ case 147: {
} break;
case 148: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 149: {
@@ -1261,7 +1261,7 @@ case 242: {
} break;
case 243: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 246: {
@@ -1271,7 +1271,7 @@ case 246: {
} break;
case 247: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 264: {
@@ -1290,7 +1290,7 @@ case 266: {
} break;
case 267: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 268: {
@@ -1350,7 +1350,7 @@ case 279: {
} break;
case 280: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 282: {
@@ -1359,7 +1359,7 @@ case 282: {
} break;
case 283: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 285: {
@@ -1530,7 +1530,7 @@ case 312: {
} break;
case 313: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 314: {
@@ -1649,7 +1649,7 @@ case 332: {
} break;
case 333: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 334: {
@@ -1657,7 +1657,7 @@ case 334: {
} break;
case 335: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
case 337: {
@@ -1689,7 +1689,7 @@ case 344: {
} break;
case 346: {
- sym(1).Node = 0;
+ sym(1).Node = nullptr;
} break;
} // switch
diff --git a/src/lib/corelib/parser/qmljsparser_p.h b/src/lib/corelib/parser/qmljsparser_p.h
index fde61ea11..05e22074b 100644
--- a/src/lib/corelib/parser/qmljsparser_p.h
+++ b/src/lib/corelib/parser/qmljsparser_p.h
@@ -134,7 +134,7 @@ public:
AST::Statement *statement() const
{
if (! program)
- return 0;
+ return nullptr;
return program->statementCast();
}
@@ -142,7 +142,7 @@ public:
AST::ExpressionNode *expression() const
{
if (! program)
- return 0;
+ return nullptr;
return program->expressionCast();
}
@@ -150,7 +150,7 @@ public:
AST::UiObjectMember *uiObjectMember() const
{
if (! program)
- return 0;
+ return nullptr;
return program->uiObjectMemberCast();
}
diff --git a/src/lib/corelib/tools/id.cpp b/src/lib/corelib/tools/id.cpp
index e2e0cf5f5..66c5f85d7 100644
--- a/src/lib/corelib/tools/id.cpp
+++ b/src/lib/corelib/tools/id.cpp
@@ -69,7 +69,7 @@ class StringHolder
{
public:
StringHolder()
- : n(0), str(0)
+ : n(0), str(nullptr)
{}
StringHolder(const char *s, int length)
diff --git a/src/lib/corelib/tools/persistence.cpp b/src/lib/corelib/tools/persistence.cpp
index dd1265f92..2dc7ab30a 100644
--- a/src/lib/corelib/tools/persistence.cpp
+++ b/src/lib/corelib/tools/persistence.cpp
@@ -142,7 +142,7 @@ void PersistentPool::finalizeWriteStream()
void PersistentPool::closeStream()
{
delete m_stream.device();
- m_stream.setDevice(0);
+ m_stream.setDevice(nullptr);
}
void PersistentPool::storePersistentObject(const PersistentObject *object)
diff --git a/src/lib/corelib/tools/persistence.h b/src/lib/corelib/tools/persistence.h
index 847ded5cb..cbabd828f 100644
--- a/src/lib/corelib/tools/persistence.h
+++ b/src/lib/corelib/tools/persistence.h
@@ -136,7 +136,7 @@ template <typename T> inline T *PersistentPool::idLoad()
m_stream >> id;
if (id < 0)
- return 0;
+ return nullptr;
if (id < static_cast<PersistentObjectId>(m_loadedRaw.size())) {
PersistentObject *obj = m_loadedRaw.at(id);
@@ -146,7 +146,7 @@ template <typename T> inline T *PersistentPool::idLoad()
auto i = m_loadedRaw.size();
m_loadedRaw.resize(id + 1);
for (; i < m_loadedRaw.size(); ++i)
- m_loadedRaw[i] = 0;
+ m_loadedRaw[i] = nullptr;
T * const t = new T;
PersistentObject * const po = t;
diff --git a/src/lib/corelib/tools/profiling.cpp b/src/lib/corelib/tools/profiling.cpp
index 18ce2322d..2f92658d7 100644
--- a/src/lib/corelib/tools/profiling.cpp
+++ b/src/lib/corelib/tools/profiling.cpp
@@ -57,7 +57,7 @@ public:
TimedActivityLogger::TimedActivityLogger(const Logger &logger, const QString &activity,
bool enabled)
- : d(0)
+ : d(nullptr)
{
if (!enabled)
return;
@@ -76,7 +76,7 @@ void TimedActivityLogger::finishActivity()
d->logger.qbsLog(LoggerInfo, true)
<< Tr::tr("Activity '%2' took %3.").arg(d->activity, timeString);
delete d;
- d = 0;
+ d = nullptr;
}
TimedActivityLogger::~TimedActivityLogger()
diff --git a/src/lib/corelib/tools/qbsprocess.h b/src/lib/corelib/tools/qbsprocess.h
index 9d2343010..07f344e8a 100644
--- a/src/lib/corelib/tools/qbsprocess.h
+++ b/src/lib/corelib/tools/qbsprocess.h
@@ -54,7 +54,7 @@ class QbsProcess : public QObject
{
Q_OBJECT
public:
- explicit QbsProcess(QObject *parent = 0);
+ explicit QbsProcess(QObject *parent = nullptr);
QProcess::ProcessState state() const { return m_state; }
void setProcessEnvironment(const QProcessEnvironment &env) { m_environment = env; }
diff --git a/src/lib/corelib/tools/scannerpluginmanager.cpp b/src/lib/corelib/tools/scannerpluginmanager.cpp
index eaa70ec36..55fed81c0 100644
--- a/src/lib/corelib/tools/scannerpluginmanager.cpp
+++ b/src/lib/corelib/tools/scannerpluginmanager.cpp
@@ -61,7 +61,7 @@ QList<ScannerPlugin *> ScannerPluginManager::scannersForFileTag(const FileTag &f
void ScannerPluginManager::registerPlugins(ScannerPlugin **plugins)
{
- for (int i = 0; plugins[i] != 0; ++i) {
+ for (int i = 0; plugins[i] != nullptr; ++i) {
const FileTags &fileTags = FileTags::fromStringList(
QString::fromLatin1(plugins[i]->fileTags).split(QLatin1Char(',')));
for (const FileTag &tag : fileTags)
diff --git a/src/lib/corelib/tools/settingsmodel.cpp b/src/lib/corelib/tools/settingsmodel.cpp
index 4562de906..b175211a1 100644
--- a/src/lib/corelib/tools/settingsmodel.cpp
+++ b/src/lib/corelib/tools/settingsmodel.cpp
@@ -60,7 +60,7 @@ namespace Internal {
struct Node
{
- Node() : parent(0), isFromSettings(true) {}
+ Node() : parent(nullptr), isFromSettings(true) {}
~Node() { qDeleteAll(children); }
QString uniqueChildName() const;
@@ -279,7 +279,7 @@ bool SettingsModel::setData(const QModelIndex &index, const QVariant &value, int
if (!node)
return false;
const QString valueString = value.toString();
- QString *toChange = 0;
+ QString *toChange = nullptr;
if (index.column() == keyColumn() && !valueString.isEmpty()
&& !node->parent->hasDirectChildWithName(valueString)
&& !(node->parent->parent == &d->rootNode
@@ -358,7 +358,7 @@ void SettingsModel::SettingsModelPrivate::addNodeFromSettings(Node *parentNode,
void SettingsModel::SettingsModelPrivate::addNode(qbs::Internal::Node *parentNode,
const QString &currentNamePart, const QStringList &restOfName, const QVariant &value)
{
- Node *currentNode = 0;
+ Node *currentNode = nullptr;
for (Node * const n : qAsConst(parentNode->children)) {
if (n->name == currentNamePart) {
currentNode = n;
diff --git a/src/lib/corelib/tools/settingsmodel.h b/src/lib/corelib/tools/settingsmodel.h
index 8628bf77d..94f163438 100644
--- a/src/lib/corelib/tools/settingsmodel.h
+++ b/src/lib/corelib/tools/settingsmodel.h
@@ -51,7 +51,7 @@ class QBS_EXPORT SettingsModel : public QAbstractItemModel
{
Q_OBJECT
public:
- SettingsModel(const QString &settingsDir, QObject *parent = 0);
+ SettingsModel(const QString &settingsDir, QObject *parent = nullptr);
~SettingsModel();
int keyColumn() const { return 0; }
diff --git a/src/lib/corelib/tools/vsenvironmentdetector.cpp b/src/lib/corelib/tools/vsenvironmentdetector.cpp
index 16cdc3110..fd5feecc9 100644
--- a/src/lib/corelib/tools/vsenvironmentdetector.cpp
+++ b/src/lib/corelib/tools/vsenvironmentdetector.cpp
@@ -233,7 +233,7 @@ void VsEnvironmentDetector::writeBatchFile(QIODevice *device, const QString &vcv
void VsEnvironmentDetector::parseBatOutput(const QByteArray &output, std::vector<MSVC *> msvcs)
{
QString arch;
- QProcessEnvironment *targetEnv = 0;
+ QProcessEnvironment *targetEnv = nullptr;
for (QByteArray line : output.split('\n')) {
line = line.trimmed();
if (line.isEmpty())
diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h b/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h
index b57011e13..848c855ef 100644
--- a/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h
+++ b/src/plugins/generator/visualstudio/msbuild/imsbuildgroup.h
@@ -44,7 +44,7 @@ class IMSBuildGroup : public QObject
{
Q_OBJECT
public:
- explicit IMSBuildGroup(MSBuildProject *parent = 0);
+ explicit IMSBuildGroup(MSBuildProject *parent = nullptr);
virtual ~IMSBuildGroup();
QString condition() const;
@@ -58,7 +58,7 @@ class IMSBuildItemGroup : public IMSBuildGroup
{
Q_OBJECT
public:
- explicit IMSBuildItemGroup(MSBuildProject *parent = 0);
+ explicit IMSBuildItemGroup(MSBuildProject *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h b/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h
index a6032c729..2e9405dfa 100644
--- a/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h
+++ b/src/plugins/generator/visualstudio/msbuild/imsbuildproperty.h
@@ -44,7 +44,7 @@ class IMSBuildProperty : public QObject
{
Q_OBJECT
protected:
- explicit IMSBuildProperty(QObject *parent = 0);
+ explicit IMSBuildProperty(QObject *parent = nullptr);
public:
virtual ~IMSBuildProperty();
diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h
index 745c3ed7f..8c326a036 100644
--- a/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h
+++ b/src/plugins/generator/visualstudio/msbuild/items/msbuildclcompile.h
@@ -40,7 +40,7 @@ class MSBuildClCompile : public MSBuildFileItem
Q_OBJECT
Q_DISABLE_COPY(MSBuildClCompile)
public:
- explicit MSBuildClCompile(IMSBuildItemGroup *parent = 0);
+ explicit MSBuildClCompile(IMSBuildItemGroup *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h
index cfe31022f..77d8e0ff2 100644
--- a/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h
+++ b/src/plugins/generator/visualstudio/msbuild/items/msbuildclinclude.h
@@ -40,7 +40,7 @@ class MSBuildClInclude : public MSBuildFileItem
Q_OBJECT
Q_DISABLE_COPY(MSBuildClInclude)
public:
- explicit MSBuildClInclude(IMSBuildItemGroup *parent = 0);
+ explicit MSBuildClInclude(IMSBuildItemGroup *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h
index 820fc7f42..df1fc8201 100644
--- a/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h
+++ b/src/plugins/generator/visualstudio/msbuild/items/msbuildfileitem.h
@@ -49,7 +49,7 @@ public:
void setFilterName(const QString &filterName);
protected:
- explicit MSBuildFileItem(const QString &name, IMSBuildItemGroup *parent = 0);
+ explicit MSBuildFileItem(const QString &name, IMSBuildItemGroup *parent = nullptr);
private:
std::unique_ptr<MSBuildFileItemPrivate> d;
diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h
index a47b1a85c..59be8d5fe 100644
--- a/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h
+++ b/src/plugins/generator/visualstudio/msbuild/items/msbuildfilter.h
@@ -42,9 +42,9 @@ class MSBuildFilter : public MSBuildItem
{
Q_OBJECT
public:
- explicit MSBuildFilter(IMSBuildItemGroup *parent = 0);
+ explicit MSBuildFilter(IMSBuildItemGroup *parent = nullptr);
MSBuildFilter(const QString &name, const QList<QString> &extensions,
- IMSBuildItemGroup *parent = 0);
+ IMSBuildItemGroup *parent = nullptr);
~MSBuildFilter();
QUuid identifier() const;
diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h
index caf125440..3d7a3ab44 100644
--- a/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h
+++ b/src/plugins/generator/visualstudio/msbuild/items/msbuildlink.h
@@ -41,7 +41,7 @@ class MSBuildLink : public MSBuildItem
{
Q_OBJECT
public:
- explicit MSBuildLink(IMSBuildItemGroup *parent = 0);
+ explicit MSBuildLink(IMSBuildItemGroup *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h b/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h
index 98dac7a76..3779da04f 100644
--- a/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h
+++ b/src/plugins/generator/visualstudio/msbuild/items/msbuildnone.h
@@ -40,7 +40,7 @@ class MSBuildNone : public MSBuildFileItem
Q_OBJECT
Q_DISABLE_COPY(MSBuildNone)
public:
- explicit MSBuildNone(IMSBuildItemGroup *parent = 0);
+ explicit MSBuildNone(IMSBuildItemGroup *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h b/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h
index ec306886a..829f5dd08 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuildimportgroup.h
@@ -49,7 +49,7 @@ class MSBuildImportGroup : public IMSBuildGroup, public IMSBuildNode
Q_OBJECT
Q_DISABLE_COPY(MSBuildImportGroup)
public:
- explicit MSBuildImportGroup(MSBuildProject *parent = 0);
+ explicit MSBuildImportGroup(MSBuildProject *parent = nullptr);
virtual ~MSBuildImportGroup();
QString label() const;
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditem.h b/src/plugins/generator/visualstudio/msbuild/msbuilditem.h
index ee4b53888..48c07f9e7 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuilditem.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuilditem.h
@@ -52,7 +52,7 @@ class MSBuildItem : public QObject, public IMSBuildNode
{
Q_OBJECT
public:
- explicit MSBuildItem(const QString &name, IMSBuildItemGroup *parent = 0);
+ explicit MSBuildItem(const QString &name, IMSBuildItemGroup *parent = nullptr);
virtual ~MSBuildItem();
QString name() const;
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h b/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h
index a96f0fff8..4fb95c4c6 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuilditemdefinitiongroup.h
@@ -48,7 +48,7 @@ class MSBuildItemDefinitionGroup : public IMSBuildItemGroup, public IMSBuildNode
{
Q_OBJECT
public:
- explicit MSBuildItemDefinitionGroup(MSBuildProject *parent = 0);
+ explicit MSBuildItemDefinitionGroup(MSBuildProject *parent = nullptr);
~MSBuildItemDefinitionGroup();
void accept(IMSBuildNodeVisitor *visitor) const;
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h b/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h
index 74ce4168c..a77e55e57 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuilditemgroup.h
@@ -51,7 +51,7 @@ class MSBuildItemGroup : public IMSBuildItemGroup, public IMSBuildNode
Q_OBJECT
Q_DISABLE_COPY(MSBuildItemGroup)
public:
- explicit MSBuildItemGroup(MSBuildProject *parent = 0);
+ explicit MSBuildItemGroup(MSBuildProject *parent = nullptr);
~MSBuildItemGroup();
QString label() const;
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h b/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h
index 7a42f1736..f1768b286 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuilditemmetadata.h
@@ -48,9 +48,9 @@ class MSBuildItemMetadata : public IMSBuildProperty, public IMSBuildNode
Q_OBJECT
Q_DISABLE_COPY(MSBuildItemMetadata)
public:
- explicit MSBuildItemMetadata(MSBuildItem *parent = 0);
+ explicit MSBuildItemMetadata(MSBuildItem *parent = nullptr);
MSBuildItemMetadata(const QString &name, const QVariant &value = QVariant(),
- MSBuildItem *parent = 0);
+ MSBuildItem *parent = nullptr);
void accept(IMSBuildNodeVisitor *visitor) const;
};
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildproject.h b/src/plugins/generator/visualstudio/msbuild/msbuildproject.h
index 00e28bcf8..820c0ecbd 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuildproject.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuildproject.h
@@ -50,7 +50,7 @@ class MSBuildProject : public QObject, public IMSBuildNode
Q_OBJECT
Q_DISABLE_COPY(MSBuildProject)
public:
- explicit MSBuildProject(QObject *parent = 0);
+ explicit MSBuildProject(QObject *parent = nullptr);
~MSBuildProject();
QString defaultTargets() const;
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h b/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h
index 310fcc044..f1382406c 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuildproperty.h
@@ -47,9 +47,9 @@ class MSBuildProperty : public IMSBuildProperty, public IMSBuildNode
{
Q_OBJECT
public:
- explicit MSBuildProperty(MSBuildPropertyGroup *parent = 0);
+ explicit MSBuildProperty(MSBuildPropertyGroup *parent = nullptr);
MSBuildProperty(const QString &name, const QVariant &value = QVariant(),
- MSBuildPropertyGroup *parent = 0);
+ MSBuildPropertyGroup *parent = nullptr);
void accept(IMSBuildNodeVisitor *visitor) const;
};
diff --git a/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h b/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h
index 6617a4a59..c3289457c 100644
--- a/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h
+++ b/src/plugins/generator/visualstudio/msbuild/msbuildpropertygroup.h
@@ -49,7 +49,7 @@ class MSBuildPropertyGroup : public IMSBuildGroup, public IMSBuildNode
Q_OBJECT
Q_DISABLE_COPY(MSBuildPropertyGroup)
public:
- explicit MSBuildPropertyGroup(MSBuildProject *parent = 0);
+ explicit MSBuildPropertyGroup(MSBuildProject *parent = nullptr);
~MSBuildPropertyGroup();
QString label() const;
diff --git a/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp b/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp
index 45a09236a..0897c929e 100644
--- a/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp
+++ b/src/plugins/generator/visualstudio/msbuildfiltersproject.cpp
@@ -73,7 +73,7 @@ static QStringList headerFileExtensions()
<< QStringLiteral("h++");
}
-static std::vector<MSBuildFilter *> defaultItemGroupFilters(IMSBuildItemGroup *parent = 0)
+static std::vector<MSBuildFilter *> defaultItemGroupFilters(IMSBuildItemGroup *parent = nullptr)
{
const auto sourceFilter = new MSBuildFilter(QStringLiteral("Source Files"), sourceFileExtensions(), parent);
const auto headerFilter = new MSBuildFilter(QStringLiteral("Header Files"), headerFileExtensions(), parent);
diff --git a/src/plugins/generator/visualstudio/msbuildfiltersproject.h b/src/plugins/generator/visualstudio/msbuildfiltersproject.h
index 521a6e610..5d67bfaa8 100644
--- a/src/plugins/generator/visualstudio/msbuildfiltersproject.h
+++ b/src/plugins/generator/visualstudio/msbuildfiltersproject.h
@@ -46,7 +46,7 @@ class MSBuildFiltersProject : public MSBuildProject
Q_DISABLE_COPY(MSBuildFiltersProject)
public:
explicit MSBuildFiltersProject(const GeneratableProductData &product,
- QObject *parent = 0);
+ QObject *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuildqbsgenerateproject.h b/src/plugins/generator/visualstudio/msbuildqbsgenerateproject.h
index 433bd31a1..8c5ef80c4 100644
--- a/src/plugins/generator/visualstudio/msbuildqbsgenerateproject.h
+++ b/src/plugins/generator/visualstudio/msbuildqbsgenerateproject.h
@@ -45,7 +45,7 @@ class MSBuildQbsGenerateProject : public MSBuildTargetProject
public:
MSBuildQbsGenerateProject(const GeneratableProject &project,
const Internal::VisualStudioVersionInfo &versionInfo,
- VisualStudioGenerator *parent = 0);
+ VisualStudioGenerator *parent = nullptr);
};
} // namespace qbs
diff --git a/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp b/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp
index fc9187ae2..91dc77d77 100644
--- a/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp
+++ b/src/plugins/generator/visualstudio/msbuildqbsproductproject.cpp
@@ -337,7 +337,7 @@ void MSBuildQbsProductProject::addItemDefGroup(const Project &project,
}
static MSBuildFileItem *fileItemForFileTags(const QList<QString> &fileTags,
- IMSBuildItemGroup *parent = 0)
+ IMSBuildItemGroup *parent = nullptr)
{
const auto fileTagsSet = Internal::Set<QString>::fromList(fileTags);
if (fileTagsSet.intersects(
diff --git a/src/plugins/generator/visualstudio/msbuildqbsproductproject.h b/src/plugins/generator/visualstudio/msbuildqbsproductproject.h
index 7fb9e2a39..4d386508f 100644
--- a/src/plugins/generator/visualstudio/msbuildqbsproductproject.h
+++ b/src/plugins/generator/visualstudio/msbuildqbsproductproject.h
@@ -53,7 +53,7 @@ public:
MSBuildQbsProductProject(const GeneratableProject &project,
const GeneratableProductData &product,
const Internal::VisualStudioVersionInfo &versionInfo,
- VisualStudioGenerator *parent = 0);
+ VisualStudioGenerator *parent = nullptr);
private:
typedef QHash<QString, Internal::Set<Project>> ProjectConfigurations;
diff --git a/src/plugins/generator/visualstudio/msbuildtargetproject.h b/src/plugins/generator/visualstudio/msbuildtargetproject.h
index bf7e9f65f..647f0dc91 100644
--- a/src/plugins/generator/visualstudio/msbuildtargetproject.h
+++ b/src/plugins/generator/visualstudio/msbuildtargetproject.h
@@ -50,7 +50,7 @@ class MSBuildTargetProject : public MSBuildProject
protected:
MSBuildTargetProject(const GeneratableProject &project,
const Internal::VisualStudioVersionInfo &versionInfo,
- VisualStudioGenerator *parent = 0);
+ VisualStudioGenerator *parent = nullptr);
public:
~MSBuildTargetProject();
diff --git a/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h b/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h
index fecb3f244..b53f39ee1 100644
--- a/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h
+++ b/src/plugins/generator/visualstudio/solution/ivisualstudiosolutionproject.h
@@ -45,7 +45,7 @@ class IVisualStudioSolutionProject : public QObject
{
Q_OBJECT
protected:
- explicit IVisualStudioSolutionProject(QObject *parent = 0);
+ explicit IVisualStudioSolutionProject(QObject *parent = nullptr);
public:
virtual ~IVisualStudioSolutionProject();
diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolution.h b/src/plugins/generator/visualstudio/solution/visualstudiosolution.h
index 072bdd8f1..67fcbbe01 100644
--- a/src/plugins/generator/visualstudio/solution/visualstudiosolution.h
+++ b/src/plugins/generator/visualstudio/solution/visualstudiosolution.h
@@ -54,7 +54,7 @@ class VisualStudioSolution : public QObject
Q_DISABLE_COPY(VisualStudioSolution)
public:
explicit VisualStudioSolution(const Internal::VisualStudioVersionInfo &versionInfo,
- QObject *parent = 0);
+ QObject *parent = nullptr);
~VisualStudioSolution();
Internal::VisualStudioVersionInfo versionInfo() const;
diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h b/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h
index 7d2677e97..22848b8fb 100644
--- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h
+++ b/src/plugins/generator/visualstudio/solution/visualstudiosolutionfileproject.h
@@ -44,7 +44,7 @@ class VisualStudioSolutionFileProject : public IVisualStudioSolutionProject
{
Q_OBJECT
public:
- explicit VisualStudioSolutionFileProject(const QString &filePath, QObject *parent = 0);
+ explicit VisualStudioSolutionFileProject(const QString &filePath, QObject *parent = nullptr);
~VisualStudioSolutionFileProject();
QString name() const override;
diff --git a/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h b/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h
index 6bcaa517e..3cc8a8702 100644
--- a/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h
+++ b/src/plugins/generator/visualstudio/solution/visualstudiosolutionglobalsection.h
@@ -44,7 +44,7 @@ class VisualStudioSolutionGlobalSection : public QObject
Q_OBJECT
Q_DISABLE_COPY(VisualStudioSolutionGlobalSection)
public:
- explicit VisualStudioSolutionGlobalSection(const QString &name, QObject *parent = 0);
+ explicit VisualStudioSolutionGlobalSection(const QString &name, QObject *parent = nullptr);
~VisualStudioSolutionGlobalSection();
QString name() const;
diff --git a/src/plugins/scanner/cpp/Token.cpp b/src/plugins/scanner/cpp/Token.cpp
index ee125652c..f8b017fdb 100644
--- a/src/plugins/scanner/cpp/Token.cpp
+++ b/src/plugins/scanner/cpp/Token.cpp
@@ -114,7 +114,7 @@ static const char *token_names[] = {
};
Token::Token() :
- flags(0), offset(0), ptr(0)
+ flags(0), offset(0), ptr(nullptr)
{
}
@@ -126,7 +126,7 @@ void Token::reset()
{
flags = 0;
offset = 0;
- ptr = 0;
+ ptr = nullptr;
}
const char *Token::name(int kind)
diff --git a/src/plugins/scanner/cpp/cppscanner.cpp b/src/plugins/scanner/cpp/cppscanner.cpp
index 9e7b3c690..84bda61b6 100644
--- a/src/plugins/scanner/cpp/cppscanner.cpp
+++ b/src/plugins/scanner/cpp/cppscanner.cpp
@@ -83,7 +83,7 @@ struct Opaq
fd(0),
mapl(0),
#endif
- fileContent(0),
+ fileContent(nullptr),
fileType(FT_UNKNOWN),
hasQObjectMacro(false),
hasPluginMetaDataMacro(false),
@@ -223,29 +223,29 @@ static void *openScanner(const unsigned short *filePath, const char *fileTags, i
opaque->fd = open(qPrintable(filePathS), O_RDONLY);
if (opaque->fd == -1) {
opaque->fd = 0;
- return 0;
+ return nullptr;
}
struct stat s;
int r = fstat(opaque->fd, &s);
if (r != 0)
- return 0;
+ return nullptr;
mapl = s.st_size;
opaque->mapl = mapl;
void *vmap = mmap(0, s.st_size, PROT_READ, MAP_PRIVATE, opaque->fd, 0);
if (vmap == MAP_FAILED)
- return 0;
+ return nullptr;
#else
opaque->file.setFileName(opaque->fileName);
if (!opaque->file.open(QFile::ReadOnly))
- return 0;
+ return nullptr;
uchar *vmap = opaque->file.map(0, opaque->file.size());
mapl = opaque->file.size();
#endif
if (!vmap)
- return 0;
+ return nullptr;
opaque->fileContent = reinterpret_cast<char *>(vmap);
CPlusPlus::Lexer lex(opaque->fileContent, opaque->fileContent + mapl);
@@ -271,7 +271,7 @@ static const char *next(void *opaq, int *size, int *flags)
}
*size = 0;
*flags = 0;
- return 0;
+ return nullptr;
}
static const char **additionalFileTags(void *opaq, int *size)
@@ -295,7 +295,7 @@ static const char **additionalFileTags(void *opaq, int *size)
}
}
*size = 0;
- return 0;
+ return nullptr;
}
ScannerPlugin includeScanner =
diff --git a/src/plugins/scanner/qt/qtscanner.cpp b/src/plugins/scanner/qt/qtscanner.cpp
index 04de23fe6..10947e61c 100644
--- a/src/plugins/scanner/qt/qtscanner.cpp
+++ b/src/plugins/scanner/qt/qtscanner.cpp
@@ -81,10 +81,10 @@ struct OpaqQrc
#ifdef Q_OS_UNIX
: fd (0),
#else
- : file(0),
+ : file(nullptr),
#endif
- map(0),
- xml(0)
+ map(nullptr),
+ xml(nullptr)
{}
~OpaqQrc()
@@ -112,26 +112,26 @@ static void *openScannerQrc(const unsigned short *filePath, const char *fileTags
opaque->fd = open(qPrintable(filePathS), O_RDONLY);
if (opaque->fd == -1) {
opaque->fd = 0;
- return 0;
+ return nullptr;
}
struct stat s;
int r = fstat(opaque->fd, &s);
if (r != 0)
- return 0;
+ return nullptr;
opaque->mapl = s.st_size;
void *map = mmap(0, s.st_size, PROT_READ, MAP_PRIVATE, opaque->fd, 0);
- if (map == 0)
- return 0;
+ if (map == nullptr)
+ return nullptr;
#else
opaque->file = new QFile(QString::fromUtf16(filePath));
if (!opaque->file->open(QFile::ReadOnly))
- return 0;
+ return nullptr;
uchar *map = opaque->file->map(0, opaque->file->size());
if (!map)
- return 0;
+ return nullptr;
#endif
opaque->map = reinterpret_cast<char *>(map);
@@ -161,18 +161,18 @@ static const char *nextQrc(void *opaq, int *size, int *flags)
}
break;
case QXmlStreamReader::EndDocument:
- return 0;
+ return nullptr;
default:
break;
}
}
- return 0;
+ return nullptr;
}
static const char **additionalFileTagsQrc(void *, int *size)
{
*size = 0;
- return 0;
+ return nullptr;
}
ScannerPlugin qrcScanner =
diff --git a/src/shared/json/json.cpp b/src/shared/json/json.cpp
index fbf467924..c84eb560c 100644
--- a/src/shared/json/json.cpp
+++ b/src/shared/json/json.cpp
@@ -500,7 +500,7 @@ public:
{
}
Data(int reserved, JsonValue::Type valueType)
- : rawData(0), compactionCounter(0), ownsData(true)
+ : rawData(nullptr), compactionCounter(0), ownsData(true)
{
// assert(valueType == JsonValue::Array || valueType == JsonValue::Object);
@@ -686,7 +686,7 @@ using namespace Internal;
The default is to create a Null value.
*/
JsonValue::JsonValue(Type type)
- : ui(0), d(0), t(type)
+ : ui(0), d(nullptr), t(type)
{
}
@@ -694,7 +694,7 @@ JsonValue::JsonValue(Type type)
\internal
*/
JsonValue::JsonValue(Internal::Data *data, Internal::Base *base, const Internal::Value &v)
- : d(0), t((Type)(uint32_t)v.type)
+ : d(nullptr), t((Type)(uint32_t)v.type)
{
switch (t) {
case Undefined:
@@ -727,7 +727,7 @@ JsonValue::JsonValue(Internal::Data *data, Internal::Base *base, const Internal:
Creates a value of type Bool, with value \a b.
*/
JsonValue::JsonValue(bool b)
- : d(0), t(Bool)
+ : d(nullptr), t(Bool)
{
this->b = b;
}
@@ -736,7 +736,7 @@ JsonValue::JsonValue(bool b)
Creates a value of type Double, with value \a n.
*/
JsonValue::JsonValue(double n)
- : d(0), t(Double)
+ : d(nullptr), t(Double)
{
this->dbl = n;
}
@@ -746,7 +746,7 @@ JsonValue::JsonValue(double n)
Creates a value of type Double, with value \a n.
*/
JsonValue::JsonValue(int n)
- : d(0), t(Double)
+ : d(nullptr), t(Double)
{
this->dbl = n;
}
@@ -758,7 +758,7 @@ JsonValue::JsonValue(int n)
If you pass in values outside this range expect a loss of precision to occur.
*/
JsonValue::JsonValue(int64_t n)
- : d(0), t(Double)
+ : d(nullptr), t(Double)
{
this->dbl = double(n);
}
@@ -767,7 +767,7 @@ JsonValue::JsonValue(int64_t n)
Creates a value of type String, with value \a s.
*/
JsonValue::JsonValue(const std::string &s)
- : d(0), t(String)
+ : d(nullptr), t(String)
{
stringData = new Internal::SharedString;
stringData->s = s;
@@ -775,7 +775,7 @@ JsonValue::JsonValue(const std::string &s)
}
JsonValue::JsonValue(const char *s)
- : d(0), t(String)
+ : d(nullptr), t(String)
{
stringData = new Internal::SharedString;
stringData->s = s;
@@ -1244,12 +1244,12 @@ JsonValue JsonValueRef::toValue() const
Creates an empty array.
*/
JsonArray::JsonArray()
- : d(0), a(0)
+ : d(nullptr), a(nullptr)
{
}
JsonArray::JsonArray(std::initializer_list<JsonValue> args)
- : d(0), a(0)
+ : d(nullptr), a(nullptr)
{
for (auto i = args.begin(); i != args.end(); ++i)
append(*i);
@@ -2277,12 +2277,12 @@ void JsonArray::compact()
\sa isEmpty()
*/
JsonObject::JsonObject()
- : d(0), o(0)
+ : d(nullptr), o(nullptr)
{
}
JsonObject::JsonObject(std::initializer_list<std::pair<std::string, JsonValue> > args)
- : d(0), o(0)
+ : d(nullptr), o(nullptr)
{
for (auto i = args.begin(); i != args.end(); ++i)
insert(i->first, i->second);
@@ -3242,7 +3242,7 @@ void JsonObject::setValueAt(int i, const JsonValue &val)
* Constructs an empty and invalid document.
*/
JsonDocument::JsonDocument()
- : d(0)
+ : d(nullptr)
{
}
@@ -3250,7 +3250,7 @@ JsonDocument::JsonDocument()
* Creates a JsonDocument from \a object.
*/
JsonDocument::JsonDocument(const JsonObject &object)
- : d(0)
+ : d(nullptr)
{
setObject(object);
}
@@ -3259,7 +3259,7 @@ JsonDocument::JsonDocument(const JsonObject &object)
* Constructs a JsonDocument from \a array.
*/
JsonDocument::JsonDocument(const JsonArray &array)
- : d(0)
+ : d(nullptr)
{
setArray(array);
}
@@ -3369,7 +3369,7 @@ const char *JsonDocument::rawData(int *size) const
{
if (!d) {
*size = 0;
- return 0;
+ return nullptr;
}
*size = d->alloc;
return d->rawData;
@@ -3905,7 +3905,7 @@ void arrayToJson(const Array *a, std::string &json, int indent, bool compact)
using namespace Internal;
Parser::Parser(const char *json, int length)
- : head(json), json(json), data(0), dataLength(0), current(0), nestingLevel(0), lastError(JsonParseError::NoError)
+ : head(json), json(json), data(nullptr), dataLength(0), current(0), nestingLevel(0), lastError(JsonParseError::NoError)
{
end = json + length;
}
diff --git a/tests/auto/api/testdata/generated-files-list/mainwindow.h b/tests/auto/api/testdata/generated-files-list/mainwindow.h
index 5460460eb..76f9c80ce 100644
--- a/tests/auto/api/testdata/generated-files-list/mainwindow.h
+++ b/tests/auto/api/testdata/generated-files-list/mainwindow.h
@@ -40,7 +40,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
- explicit MainWindow(QWidget *parent = 0);
+ explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
diff --git a/tests/auto/api/testdata/lots-of-dots/object.narf.h b/tests/auto/api/testdata/lots-of-dots/object.narf.h
index 2fdebcd39..76147bf4d 100644
--- a/tests/auto/api/testdata/lots-of-dots/object.narf.h
+++ b/tests/auto/api/testdata/lots-of-dots/object.narf.h
@@ -34,7 +34,7 @@ class ObjectNarf : public QObject
{
Q_OBJECT
public:
- ObjectNarf(QObject *parent = 0);
+ ObjectNarf(QObject *parent = nullptr);
};
#endif
diff --git a/tests/auto/api/testdata/moc-hpp-included/object.h b/tests/auto/api/testdata/moc-hpp-included/object.h
index 95292c113..3a0a5581d 100644
--- a/tests/auto/api/testdata/moc-hpp-included/object.h
+++ b/tests/auto/api/testdata/moc-hpp-included/object.h
@@ -34,7 +34,7 @@ class Object : public QObject
{
Q_OBJECT
public:
- Object(QObject *parent = 0);
+ Object(QObject *parent = nullptr);
};
#endif
diff --git a/tests/auto/api/testdata/moc-hpp-included/object2.h b/tests/auto/api/testdata/moc-hpp-included/object2.h
index e0fca9663..b73f4b0d8 100644
--- a/tests/auto/api/testdata/moc-hpp-included/object2.h
+++ b/tests/auto/api/testdata/moc-hpp-included/object2.h
@@ -34,7 +34,7 @@ class Object2 : public QObject
{
Q_OBJECT
public:
- Object2(QObject *parent = 0);
+ Object2(QObject *parent = nullptr);
};
#endif
diff --git a/tests/auto/api/testdata/moc-hpp/object.h b/tests/auto/api/testdata/moc-hpp/object.h
index 95292c113..3a0a5581d 100644
--- a/tests/auto/api/testdata/moc-hpp/object.h
+++ b/tests/auto/api/testdata/moc-hpp/object.h
@@ -34,7 +34,7 @@ class Object : public QObject
{
Q_OBJECT
public:
- Object(QObject *parent = 0);
+ Object(QObject *parent = nullptr);
};
#endif
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index cc2e11096..72bc11114 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -221,7 +221,7 @@ void TestApi::addedFilePersistent()
0));
waitForFinished(setupJob.get());
QVERIFY2(!setupJob->error().hasError(), qPrintable(setupJob->error().toString()));
- setupJob.reset(0);
+ setupJob.reset(nullptr);
// Remove the file again. qbs must unschedule the rule application again.
// Consequently, the linking step must fail as in the initial run.
@@ -241,7 +241,7 @@ void TestApi::addedFilePersistent()
setupJob.reset(qbs::Project().setupProject(params, m_logSink, 0));
waitForFinished(setupJob.get());
QVERIFY2(!setupJob->error().hasError(), qPrintable(setupJob->error().toString()));
- setupJob.reset(0);
+ setupJob.reset(nullptr);
// qbs must remember that a file was scheduled for rule application. The build must then
// succeed, as now all necessary symbols are linked in.
@@ -892,8 +892,8 @@ void TestApi::changeContent()
VERIFY_NO_ERROR(errorInfo);
project = qbs::Project();
- job.reset(0);
- buildJob.reset(0);
+ job.reset(nullptr);
+ buildJob.reset(nullptr);
removeBuildDir(setupParams);
// Add a file to the top level of a product that does not have a "files" binding yet.
setupParams.setProjectFilePath(QDir::cleanPath(m_workingDataDir +
diff --git a/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.h b/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.h
index 3a63c6a06..b64928353 100644
--- a/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.h
+++ b/tests/auto/blackbox/testdata-qt/dbus-interfaces/controller.h
@@ -37,7 +37,7 @@ class Controller : public QWidget
Q_OBJECT
public:
- Controller(QWidget *parent = 0);
+ Controller(QWidget *parent = nullptr);
protected:
void timerEvent(QTimerEvent *event);
diff --git a/tests/auto/blackbox/testdata-qt/trackAddMocInclude/after/main.cpp b/tests/auto/blackbox/testdata-qt/trackAddMocInclude/after/main.cpp
index 566024acd..3bb9efa5a 100644
--- a/tests/auto/blackbox/testdata-qt/trackAddMocInclude/after/main.cpp
+++ b/tests/auto/blackbox/testdata-qt/trackAddMocInclude/after/main.cpp
@@ -32,7 +32,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0)
+ MyObject(QObject *parent = nullptr)
: QObject(parent)
{
}
diff --git a/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/main.cpp b/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/main.cpp
index 2a44ceec4..14a23f67b 100644
--- a/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/main.cpp
+++ b/tests/auto/blackbox/testdata-qt/trackAddMocInclude/before/main.cpp
@@ -32,7 +32,7 @@ class MyObject : public QObject
{
Q_OBJECT
public:
- MyObject(QObject *parent = 0)
+ MyObject(QObject *parent = nullptr)
: QObject(parent)
{
}
diff --git a/tests/fuzzy-test/fuzzytester.cpp b/tests/fuzzy-test/fuzzytester.cpp
index 2265592f2..d01c3c3f2 100644
--- a/tests/fuzzy-test/fuzzytester.cpp
+++ b/tests/fuzzy-test/fuzzytester.cpp
@@ -70,7 +70,7 @@ void FuzzyTester::runTest(const QString &profile, const QString &startCommit,
// Shuffle the initial sequence. Otherwise all invocations of the tool with the same start
// commit would try the same sequence of commits.
- std::srand(std::time(0));
+ std::srand(std::time(nullptr));
std::random_shuffle(allCommits.begin(), allCommits.end());
quint64 run = 0;