summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorKatja Marttila <katja.marttila@qt.io>2018-11-01 10:38:13 +0200
committerKatja Marttila <katja.marttila@qt.io>2019-01-09 05:41:16 +0000
commit9dacee18f9b7211699164bc70dd17f9934a15f50 (patch)
treed16ee18d0f54a9c28f07aeebab77bb8b9168da55 /tools
parent818c8ab9836c3e949e891e2266807dbd59c31906 (diff)
Replace 0 with nullptr
Prevents a lot of warnings seen in QtCreator Change-Id: I63bf95aca68a04fc9fd0eecbe29c63e9b9c47efd Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/binarycreator/binarycreator.cpp2
-rw-r--r--tools/binarycreator/rcc/rcc.cpp12
-rw-r--r--tools/devtool/binarydump.cpp2
-rw-r--r--tools/repocompare/repositorymanager.cpp6
4 files changed, 11 insertions, 11 deletions
diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp
index 3ce7db3f2..5de4ff745 100644
--- a/tools/binarycreator/binarycreator.cpp
+++ b/tools/binarycreator/binarycreator.cpp
@@ -546,7 +546,7 @@ QT_END_NAMESPACE
static int runRcc(const QStringList &args)
{
const int argc = args.count();
- QVector<char*> argv(argc, 0);
+ QVector<char*> argv(argc, nullptr);
for (int i = 0; i < argc; ++i)
argv[i] = qstrdup(qPrintable(args[i]));
diff --git a/tools/binarycreator/rcc/rcc.cpp b/tools/binarycreator/rcc/rcc.cpp
index 2361e43e0..10b7cbc4f 100644
--- a/tools/binarycreator/rcc/rcc.cpp
+++ b/tools/binarycreator/rcc/rcc.cpp
@@ -126,7 +126,7 @@ RCCFileInfo::RCCFileInfo(const QString &name, const QFileInfo &fileInfo,
m_language = language;
m_country = country;
m_flags = flags;
- m_parent = 0;
+ m_parent = nullptr;
m_nameOffset = 0;
m_dataOffset = 0;
m_childOffset = 0;
@@ -325,7 +325,7 @@ RCCResourceLibrary::Strings::Strings() :
}
RCCResourceLibrary::RCCResourceLibrary()
- : m_root(0),
+ : m_root(nullptr),
m_format(C_Code),
m_verbose(false),
m_compressLevel(CONSTANT_COMPRESSLEVEL_DEFAULT),
@@ -334,7 +334,7 @@ RCCResourceLibrary::RCCResourceLibrary()
m_namesOffset(0),
m_dataOffset(0),
m_useNameSpace(CONSTANT_USENAMESPACE),
- m_errorDevice(0)
+ m_errorDevice(nullptr)
{
m_out.reserve(30 * 1000 * 1000);
}
@@ -550,7 +550,7 @@ bool RCCResourceLibrary::interpretResourceFile(QIODevice *inputDevice,
return false;
}
- if (m_root == 0) {
+ if (m_root == nullptr) {
const QString msg = QString::fromUtf8("RCC: Warning: No resources in '%1'.\n").arg(fname);
m_errorDevice->write(msg.toUtf8());
if (!ignoreErrors && m_format == Binary) {
@@ -606,9 +606,9 @@ void RCCResourceLibrary::reset()
{
if (m_root) {
delete m_root;
- m_root = 0;
+ m_root = nullptr;
}
- m_errorDevice = 0;
+ m_errorDevice = nullptr;
m_failedResources.clear();
}
diff --git a/tools/devtool/binarydump.cpp b/tools/devtool/binarydump.cpp
index ad5093837..bd8e9053c 100644
--- a/tools/devtool/binarydump.cpp
+++ b/tools/devtool/binarydump.cpp
@@ -54,7 +54,7 @@ int BinaryDump::dump(const QInstaller::ResourceCollectionManager &manager, const
}
}
- QInstaller::CopyDirectoryOperation copyMetadata(0);
+ QInstaller::CopyDirectoryOperation copyMetadata(nullptr);
copyMetadata.setArguments(QStringList() << QLatin1String(":/")
<< (targetDir.path() + QLatin1Char('/'))); // Add "/" at the end to make operation work.
if (!copyMetadata.performOperation()) {
diff --git a/tools/repocompare/repositorymanager.cpp b/tools/repocompare/repositorymanager.cpp
index 7d24b9620..3fb863eaf 100644
--- a/tools/repocompare/repositorymanager.cpp
+++ b/tools/repocompare/repositorymanager.cpp
@@ -71,7 +71,7 @@ void RepositoryManager::setProductionRepository(const QString &repo)
{
QUrl url(repo);
if (!url.isValid()) {
- QMessageBox::critical(0, QLatin1String("Error"), QLatin1String("Specified URL is not valid"));
+ QMessageBox::critical(nullptr, QLatin1String("Error"), QLatin1String("Specified URL is not valid"));
return;
}
@@ -83,7 +83,7 @@ void RepositoryManager::setUpdateRepository(const QString &repo)
{
QUrl url(repo);
if (!url.isValid()) {
- QMessageBox::critical(0, QLatin1String("Error"), QLatin1String("Specified URL is not valid"));
+ QMessageBox::critical(nullptr, QLatin1String("Error"), QLatin1String("Specified URL is not valid"));
return;
}
@@ -181,7 +181,7 @@ void RepositoryManager::writeUpdateFile(const QString &fileName)
{
QFile file(fileName);
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
- QMessageBox::critical(0, QLatin1String("Error"),
+ QMessageBox::critical(nullptr, QLatin1String("Error"),
QString::fromLatin1("Cannot open file \"%1\" for writing: %2").arg(
QDir::toNativeSeparators(fileName), file.errorString()));
return;