aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@qt.io>2018-08-02 19:09:31 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-08-20 14:00:16 +0000
commitdd61fdb5017dcd9521ec389b0b40dad9a93bfd21 (patch)
tree489ad170aa60cb2089f7a7d6a2abca6c667c70aa /src/lib/corelib
parent36c67caee1a65b601446ac9c67d5a3dae03ee1f3 (diff)
corelib: Apply modernize-use-nullptr
Use nullptr instead of 0. Change-Id: Id5b7933844730e244a2dcf3fcebf24f9f048047f Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/lib/corelib')
-rw-r--r--src/lib/corelib/api/internaljobs.cpp2
-rw-r--r--src/lib/corelib/api/project.cpp12
-rw-r--r--src/lib/corelib/api/project.h21
-rw-r--r--src/lib/corelib/api/qmljsrewriter.cpp2
-rw-r--r--src/lib/corelib/buildgraph/artifactcleaner.h2
-rw-r--r--src/lib/corelib/buildgraph/executor.cpp2
-rw-r--r--src/lib/corelib/buildgraph/inputartifactscanner.cpp2
-rw-r--r--src/lib/corelib/buildgraph/processcommandexecutor.cpp2
-rw-r--r--src/lib/corelib/buildgraph/projectbuilddata.h4
-rw-r--r--src/lib/corelib/language/evaluator.h11
-rw-r--r--src/lib/corelib/language/moduleloader.h2
-rw-r--r--src/lib/corelib/language/projectresolver.h4
-rw-r--r--src/lib/corelib/language/scriptengine.cpp2
-rw-r--r--src/lib/corelib/tools/persistence.cpp2
-rw-r--r--src/lib/corelib/tools/profile.h4
-rw-r--r--src/lib/corelib/tools/setupprojectparameters.h4
16 files changed, 41 insertions, 37 deletions
diff --git a/src/lib/corelib/api/internaljobs.cpp b/src/lib/corelib/api/internaljobs.cpp
index 5122db8ee..703e0ad62 100644
--- a/src/lib/corelib/api/internaljobs.cpp
+++ b/src/lib/corelib/api/internaljobs.cpp
@@ -246,7 +246,7 @@ TopLevelProjectPtr InternalSetupProjectJob::project() const
void InternalSetupProjectJob::start()
{
- BuildGraphLocker *bgLocker = m_existingProject ? m_existingProject->bgLocker : 0;
+ BuildGraphLocker *bgLocker = m_existingProject ? m_existingProject->bgLocker : nullptr;
bool deleteLocker = false;
try {
const ErrorInfo err = m_parameters.expandBuildConfiguration();
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index 5bbfb31c7..d1cb351be 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -1031,7 +1031,7 @@ RunEnvironment Project::getRunEnvironment(const ProductData &product,
BuildJob *Project::buildAllProducts(const BuildOptions &options, ProductSelection productSelection,
QObject *jobOwner) const
{
- QBS_ASSERT(isValid(), return 0);
+ QBS_ASSERT(isValid(), return nullptr);
const bool includingNonDefault = productSelection == ProductSelectionWithNonDefault;
return d->buildProducts(d->allEnabledInternalProducts(includingNonDefault), options,
!includingNonDefault, jobOwner);
@@ -1046,7 +1046,7 @@ BuildJob *Project::buildAllProducts(const BuildOptions &options, ProductSelectio
BuildJob *Project::buildSomeProducts(const QList<ProductData> &products,
const BuildOptions &options, QObject *jobOwner) const
{
- QBS_ASSERT(isValid(), return 0);
+ QBS_ASSERT(isValid(), return nullptr);
return d->buildProducts(d->internalProducts(products), options, true, jobOwner);
}
@@ -1067,7 +1067,7 @@ BuildJob *Project::buildOneProduct(const ProductData &product, const BuildOption
*/
CleanJob *Project::cleanAllProducts(const CleanOptions &options, QObject *jobOwner) const
{
- QBS_ASSERT(isValid(), return 0);
+ QBS_ASSERT(isValid(), return nullptr);
return d->cleanProducts(d->allEnabledInternalProducts(true), options, jobOwner);
}
@@ -1078,7 +1078,7 @@ CleanJob *Project::cleanAllProducts(const CleanOptions &options, QObject *jobOwn
CleanJob *Project::cleanSomeProducts(const QList<ProductData> &products,
const CleanOptions &options, QObject *jobOwner) const
{
- QBS_ASSERT(isValid(), return 0);
+ QBS_ASSERT(isValid(), return nullptr);
return d->cleanProducts(d->internalProducts(products), options, jobOwner);
}
@@ -1101,7 +1101,7 @@ CleanJob *Project::cleanOneProduct(const ProductData &product, const CleanOption
InstallJob *Project::installAllProducts(const InstallOptions &options,
ProductSelection productSelection, QObject *jobOwner) const
{
- QBS_ASSERT(isValid(), return 0);
+ QBS_ASSERT(isValid(), return nullptr);
const bool includingNonDefault = productSelection == ProductSelectionWithNonDefault;
return d->installProducts(d->allEnabledInternalProducts(includingNonDefault), options,
!includingNonDefault, jobOwner);
@@ -1114,7 +1114,7 @@ InstallJob *Project::installAllProducts(const InstallOptions &options,
InstallJob *Project::installSomeProducts(const QList<ProductData> &products,
const InstallOptions &options, QObject *jobOwner) const
{
- QBS_ASSERT(isValid(), return 0);
+ QBS_ASSERT(isValid(), return nullptr);
return d->installProducts(d->internalProducts(products), options, true, jobOwner);
}
diff --git a/src/lib/corelib/api/project.h b/src/lib/corelib/api/project.h
index b43eecfc7..05f08deee 100644
--- a/src/lib/corelib/api/project.h
+++ b/src/lib/corelib/api/project.h
@@ -104,25 +104,26 @@ public:
enum ProductSelection { ProductSelectionDefaultOnly, ProductSelectionWithNonDefault };
BuildJob *buildAllProducts(const BuildOptions &options,
ProductSelection productSelection = ProductSelectionDefaultOnly,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
BuildJob *buildSomeProducts(const QList<ProductData> &products, const BuildOptions &options,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
BuildJob *buildOneProduct(const ProductData &product, const BuildOptions &options,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
- CleanJob *cleanAllProducts(const CleanOptions &options, QObject *jobOwner = 0) const;
+ CleanJob *cleanAllProducts(const CleanOptions &options, QObject *jobOwner = nullptr) const;
CleanJob *cleanSomeProducts(const QList<ProductData> &products, const CleanOptions &options,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
CleanJob *cleanOneProduct(const ProductData &product, const CleanOptions &options,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
InstallJob *installAllProducts(const InstallOptions &options,
ProductSelection productSelection = ProductSelectionDefaultOnly,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
InstallJob *installSomeProducts(const QList<ProductData> &products,
- const InstallOptions &options, QObject *jobOwner = 0) const;
+ const InstallOptions &options,
+ QObject *jobOwner = nullptr) const;
InstallJob *installOneProduct(const ProductData &product, const InstallOptions &options,
- QObject *jobOwner = 0) const;
+ QObject *jobOwner = nullptr) const;
void updateTimestamps(const QList<ProductData> &products);
@@ -136,7 +137,7 @@ public:
std::set<QString> buildSystemFiles() const;
RuleCommandList ruleCommands(const ProductData &product, const QString &inputFilePath,
- const QString &outputFileTag, ErrorInfo *error = 0) const;
+ const QString &outputFileTag, ErrorInfo *error = nullptr) const;
ProjectTransformerData transformerData(ErrorInfo *error = nullptr) const;
ErrorInfo dumpNodesTree(QIODevice &outDevice, const QList<ProductData> &products);
diff --git a/src/lib/corelib/api/qmljsrewriter.cpp b/src/lib/corelib/api/qmljsrewriter.cpp
index 29fcbafa5..60c384004 100644
--- a/src/lib/corelib/api/qmljsrewriter.cpp
+++ b/src/lib/corelib/api/qmljsrewriter.cpp
@@ -262,7 +262,7 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
for (; idx > 0; --idx) {
const QString prop = propertyOrder.at(idx - 1);
UiObjectMemberList *candidate = orderedMembers.value(prop, 0);
- if (candidate != 0)
+ if (candidate != nullptr)
return candidate;
}
diff --git a/src/lib/corelib/buildgraph/artifactcleaner.h b/src/lib/corelib/buildgraph/artifactcleaner.h
index 34be4e0f4..4d8c86ea8 100644
--- a/src/lib/corelib/buildgraph/artifactcleaner.h
+++ b/src/lib/corelib/buildgraph/artifactcleaner.h
@@ -59,7 +59,7 @@ public:
private:
void removeEmptyDirectories(const QString &rootDir, const CleanOptions &options,
- bool *isEmpty = 0);
+ bool *isEmpty = nullptr);
Logger m_logger;
bool m_hasError;
diff --git a/src/lib/corelib/buildgraph/executor.cpp b/src/lib/corelib/buildgraph/executor.cpp
index ce20391cd..9a97b054e 100644
--- a/src/lib/corelib/buildgraph/executor.cpp
+++ b/src/lib/corelib/buildgraph/executor.cpp
@@ -772,7 +772,7 @@ void Executor::addExecutorJobs()
}
}
-void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = 0)
+void Executor::rescueOldBuildData(Artifact *artifact, bool *childrenAdded = nullptr)
{
if (childrenAdded)
*childrenAdded = false;
diff --git a/src/lib/corelib/buildgraph/inputartifactscanner.cpp b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
index 7255a36ba..051560aba 100644
--- a/src/lib/corelib/buildgraph/inputartifactscanner.cpp
+++ b/src/lib/corelib/buildgraph/inputartifactscanner.cpp
@@ -170,7 +170,7 @@ void InputArtifactScanner::scanForFileDependencies(Artifact *inputArtifact)
for (DependencyScanner * const scanner : scanners) {
scanForScannerFileDependencies(scanner, inputArtifact, fileToBeScanned,
- scanner->recursive() ? &filesToScan : 0, cacheItem[scanner->key()]);
+ scanner->recursive() ? &filesToScan : nullptr, cacheItem[scanner->key()]);
}
}
}
diff --git a/src/lib/corelib/buildgraph/processcommandexecutor.cpp b/src/lib/corelib/buildgraph/processcommandexecutor.cpp
index cee45bcd0..0818e1200 100644
--- a/src/lib/corelib/buildgraph/processcommandexecutor.cpp
+++ b/src/lib/corelib/buildgraph/processcommandexecutor.cpp
@@ -197,7 +197,7 @@ void ProcessCommandExecutor::doStart()
void ProcessCommandExecutor::cancel()
{
// We don't want this command to be reported as failing, since we explicitly terminated it.
- disconnect(this, &ProcessCommandExecutor::reportProcessResult, 0, 0);
+ disconnect(this, &ProcessCommandExecutor::reportProcessResult, nullptr, nullptr);
m_process.cancel();
}
diff --git a/src/lib/corelib/buildgraph/projectbuilddata.h b/src/lib/corelib/buildgraph/projectbuilddata.h
index e63922bae..0df303c0b 100644
--- a/src/lib/corelib/buildgraph/projectbuilddata.h
+++ b/src/lib/corelib/buildgraph/projectbuilddata.h
@@ -62,7 +62,7 @@ class ScriptEngine;
class QBS_AUTOTEST_EXPORT ProjectBuildData
{
public:
- ProjectBuildData(const ProjectBuildData *other = 0);
+ ProjectBuildData(const ProjectBuildData *other = nullptr);
~ProjectBuildData();
static QString deriveBuildGraphFilePath(const QString &buildDir, const QString &projectId);
@@ -75,7 +75,7 @@ public:
QList<FileResourceBase *> lookupFiles(const Artifact *artifact) const;
void insertFileDependency(FileDependency *dependency);
void removeArtifactAndExclusiveDependents(Artifact *artifact, const Logger &logger,
- bool removeFromProduct = true, ArtifactSet *removedArtifacts = 0);
+ bool removeFromProduct = true, ArtifactSet *removedArtifacts = nullptr);
void removeArtifact(Artifact *artifact, const Logger &logger, bool removeFromDisk = true,
bool removeFromProduct = true);
diff --git a/src/lib/corelib/language/evaluator.h b/src/lib/corelib/language/evaluator.h
index 50923afa1..d8931a37e 100644
--- a/src/lib/corelib/language/evaluator.h
+++ b/src/lib/corelib/language/evaluator.h
@@ -69,14 +69,15 @@ public:
ScriptEngine *engine() const { return m_scriptEngine; }
QScriptValue property(const Item *item, const QString &name);
- QScriptValue value(const Item *item, const QString &name, bool *propertySet = 0);
+ QScriptValue value(const Item *item, const QString &name, bool *propertySet = nullptr);
bool boolValue(const Item *item, const QString &name, bool *propertyWasSet = nullptr);
int intValue(const Item *item, const QString &name, int defaultValue = 0,
- bool *propertyWasSet = 0);
- FileTags fileTagsValue(const Item *item, const QString &name, bool *propertySet = 0);
+ bool *propertyWasSet = nullptr);
+ FileTags fileTagsValue(const Item *item, const QString &name, bool *propertySet = nullptr);
QString stringValue(const Item *item, const QString &name,
- const QString &defaultValue = QString(), bool *propertyWasSet = 0);
- QStringList stringListValue(const Item *item, const QString &name, bool *propertyWasSet = 0);
+ const QString &defaultValue = QString(), bool *propertyWasSet = nullptr);
+ QStringList stringListValue(const Item *item, const QString &name,
+ bool *propertyWasSet = nullptr);
void convertToPropertyType(const PropertyDeclaration& decl, const CodeLocation &loc,
QScriptValue &v);
diff --git a/src/lib/corelib/language/moduleloader.h b/src/lib/corelib/language/moduleloader.h
index 7be9a0fcc..7b9e0bede 100644
--- a/src/lib/corelib/language/moduleloader.h
+++ b/src/lib/corelib/language/moduleloader.h
@@ -324,7 +324,7 @@ private:
void resolveProbe(ProductContext *productContext, Item *parent, Item *probe);
void checkCancelation() const;
bool checkItemCondition(Item *item, Item *itemToDisable = nullptr);
- QStringList readExtraSearchPaths(Item *item, bool *wasSet = 0);
+ QStringList readExtraSearchPaths(Item *item, bool *wasSet = nullptr);
void copyProperties(const Item *sourceProject, Item *targetProject);
Item *wrapInProjectIfNecessary(Item *item);
static QString findExistingModulePath(const QString &searchPath,
diff --git a/src/lib/corelib/language/projectresolver.h b/src/lib/corelib/language/projectresolver.h
index 63a083fef..b176893ef 100644
--- a/src/lib/corelib/language/projectresolver.h
+++ b/src/lib/corelib/language/projectresolver.h
@@ -89,8 +89,8 @@ private:
class ProductContextSwitcher;
void checkCancelation() const;
- QString verbatimValue(const ValueConstPtr &value, bool *propertyWasSet = 0) const;
- QString verbatimValue(Item *item, const QString &name, bool *propertyWasSet = 0) const;
+ QString verbatimValue(const ValueConstPtr &value, bool *propertyWasSet = nullptr) const;
+ QString verbatimValue(Item *item, const QString &name, bool *propertyWasSet = nullptr) const;
ScriptFunctionPtr scriptFunctionValue(Item *item, const QString &name) const;
ResolvedFileContextPtr resolvedFileContext(const FileContextConstPtr &ctx) const;
void ignoreItem(Item *item, ProjectContext *projectContext);
diff --git a/src/lib/corelib/language/scriptengine.cpp b/src/lib/corelib/language/scriptengine.cpp
index a1661faf4..fb4706b3b 100644
--- a/src/lib/corelib/language/scriptengine.cpp
+++ b/src/lib/corelib/language/scriptengine.cpp
@@ -768,7 +768,7 @@ void ScriptEngine::extendJavaScriptBuiltins()
}
void ScriptEngine::installFunction(const QString &name, int length, QScriptValue *functionValue,
- FunctionSignature f, QScriptValue *targetObject = 0)
+ FunctionSignature f, QScriptValue *targetObject = nullptr)
{
if (!functionValue->isValid())
*functionValue = newFunction(f, length);
diff --git a/src/lib/corelib/tools/persistence.cpp b/src/lib/corelib/tools/persistence.cpp
index 216dfad24..759ae4d7f 100644
--- a/src/lib/corelib/tools/persistence.cpp
+++ b/src/lib/corelib/tools/persistence.cpp
@@ -81,7 +81,7 @@ void PersistentPool::load(const QString &filePath)
QByteArray magic;
m_stream >> magic;
if (magic != QBS_PERSISTENCE_MAGIC) {
- m_stream.setDevice(0);
+ m_stream.setDevice(nullptr);
throw ErrorInfo(Tr::tr("Cannot use stored build graph at '%1': Incompatible file format. "
"Expected magic token '%2', got '%3'.")
.arg(filePath, QString::fromLatin1(QBS_PERSISTENCE_MAGIC),
diff --git a/src/lib/corelib/tools/profile.h b/src/lib/corelib/tools/profile.h
index a4c6a91f1..2ccc99def 100644
--- a/src/lib/corelib/tools/profile.h
+++ b/src/lib/corelib/tools/profile.h
@@ -59,7 +59,7 @@ public:
bool exists() const;
QVariant value(const QString &key, const QVariant &defaultValue = QVariant(),
- ErrorInfo *error = 0) const;
+ ErrorInfo *error = nullptr) const;
void setValue(const QString &key, const QVariant &value);
void remove(const QString &key);
@@ -72,7 +72,7 @@ public:
void removeProfile();
enum KeySelection { KeySelectionRecursive, KeySelectionNonRecursive };
- QStringList allKeys(KeySelection selection, ErrorInfo *error = 0) const;
+ QStringList allKeys(KeySelection selection, ErrorInfo *error = nullptr) const;
static QString cleanName(const QString &name);
diff --git a/src/lib/corelib/tools/setupprojectparameters.h b/src/lib/corelib/tools/setupprojectparameters.h
index fd73d0748..fe7e3d487 100644
--- a/src/lib/corelib/tools/setupprojectparameters.h
+++ b/src/lib/corelib/tools/setupprojectparameters.h
@@ -97,7 +97,9 @@ public:
void setOverriddenValues(const QVariantMap &values);
QVariantMap overriddenValuesTree() const;
- static QVariantMap expandedBuildConfiguration(const Profile &profile, const QString &configurationName, ErrorInfo *errorInfo = 0);
+ static QVariantMap expandedBuildConfiguration(const Profile &profile,
+ const QString &configurationName,
+ ErrorInfo *errorInfo = nullptr);
ErrorInfo expandBuildConfiguration();
QVariantMap buildConfiguration() const;
QVariantMap buildConfigurationTree() const;