diff options
40 files changed, 199 insertions, 207 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 13d707a881..72daa97fe4 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -829,7 +829,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"), &frameworkdirs = project->values("QMAKE_FRAMEWORKPATH"); - static const char * const libs[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + static const char * const libs[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; libs[i]; i++) { tmp = project->values(libs[i]); for(int x = 0; x < tmp.count();) { @@ -1422,7 +1422,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) testHost.append("Contents/MacOS/"); testHost.append(targetName); - static const char * const configs[] = { "Debug", "Release", 0 }; + static const char * const configs[] = { "Debug", "Release", nullptr }; for (int i = 0; configs[i]; i++) { QString testBundleBuildConfig = keyFor(pbx_dir + "QMAKE_PBX_TEST_BUNDLE_BUILDCONFIG_" + configs[i]); t << "\t\t" << testBundleBuildConfig << " = {\n" diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h index f92436c215..f15c814cb4 100644 --- a/qmake/generators/mac/pbuilder_pbx.h +++ b/qmake/generators/mac/pbuilder_pbx.h @@ -40,7 +40,7 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator int pbuilderVersion() const; bool writeSubDirs(QTextStream &); bool writeMakeParts(QTextStream &); - bool writeMakefile(QTextStream &); + bool writeMakefile(QTextStream &) override; QString pbxbuild(); QHash<QString, QString> keys; @@ -64,11 +64,11 @@ public: ProjectBuilderMakefileGenerator(); ~ProjectBuilderMakefileGenerator(); - virtual bool supportsMetaBuild() { return false; } - virtual bool openOutput(QFile &, const QString &) const; + bool supportsMetaBuild() override { return false; } + bool openOutput(QFile &, const QString &) const override; protected: - bool doPrecompiledHeaders() const { return false; } - virtual bool doDepends() const { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); } + bool doPrecompiledHeaders() const override { return false; } + bool doDepends() const override { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); } }; inline ProjectBuilderMakefileGenerator::~ProjectBuilderMakefileGenerator() diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index fd8c0a965c..cae179cc93 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -96,7 +96,7 @@ bool MakefileGenerator::mkdir(const QString &in_path) const // ** base makefile generator MakefileGenerator::MakefileGenerator() : - no_io(false), project(0) + no_io(false), project(nullptr) { } @@ -164,7 +164,7 @@ MakefileGenerator::initOutPaths() v["PRECOMPILED_DIR"] = v["OBJECTS_DIR"]; static const char * const dirs[] = { "OBJECTS_DIR", "DESTDIR", "SUBLIBS_DIR", "DLLDESTDIR", - "PRECOMPILED_DIR", 0 }; + "PRECOMPILED_DIR", nullptr }; for (int x = 0; dirs[x]; x++) { const ProKey dkey(dirs[x]); if (v[dkey].isEmpty()) @@ -424,7 +424,7 @@ MakefileGenerator::init() } incs.append(project->specDir()); - const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", 0 }; + const char * const cacheKeys[] = { "_QMAKE_STASH_", "_QMAKE_SUPER_CACHE_", nullptr }; for (int i = 0; cacheKeys[i]; ++i) { if (v[cacheKeys[i]].isEmpty()) continue; @@ -614,7 +614,7 @@ MakefileGenerator::init() //build up a list of compilers QVector<Compiler> compilers; { - const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", 0 }; + const char *builtins[] = { "OBJECTS", "SOURCES", "PRECOMPILED_HEADER", nullptr }; for(x = 0; builtins[x]; ++x) { Compiler compiler; compiler.variable_in = builtins[x]; @@ -829,7 +829,7 @@ MakefileGenerator::init() } //fix up the target deps - static const char * const fixpaths[] = { "PRE_TARGETDEPS", "POST_TARGETDEPS", 0 }; + static const char * const fixpaths[] = { "PRE_TARGETDEPS", "POST_TARGETDEPS", nullptr }; for (int path = 0; fixpaths[path]; path++) { ProStringList &l = v[fixpaths[path]]; for (ProStringList::Iterator val_it = l.begin(); val_it != l.end(); ++val_it) { @@ -2790,7 +2790,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) QFileInfo MakefileGenerator::fileInfo(QString file) const { - static QHash<FileInfoCacheKey, QFileInfo> *cache = 0; + static QHash<FileInfoCacheKey, QFileInfo> *cache = nullptr; static QFileInfo noInfo = QFileInfo(); if(!cache) { cache = new QHash<FileInfoCacheKey, QFileInfo>; diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index 6b9bd43cae..b5c150e1cb 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -124,9 +124,9 @@ protected: { return replaceExtraCompilerVariables(val, QStringList(in), QStringList(out), forShell); } //interface to the source file info - QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool); - QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &); - QFileInfo findFileInfo(const QMakeLocalFileName &); + QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool) override; + QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &) override; + QFileInfo findFileInfo(const QMakeLocalFileName &) override; QMakeProject *project; //escape @@ -172,7 +172,7 @@ protected: { int ret; canExecute(cmdline, &ret); return ret; } bool canExecute(const QStringList &cmdline, int *argv0) const; inline bool canExecute(const QString &cmdline) const - { return canExecute(cmdline.split(' '), 0); } + { return canExecute(cmdline.split(' '), nullptr); } bool mkdir(const QString &dir) const; QString mkdir_p_asstring(const QString &dir, bool escape=true) const; @@ -253,7 +253,7 @@ protected: public: MakefileGenerator(); - virtual ~MakefileGenerator(); + ~MakefileGenerator(); QMakeProject *projectFile() const; void setProjectFile(QMakeProject *p); diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp index ffccdefbe1..decc1d980c 100644 --- a/qmake/generators/makefiledeps.cpp +++ b/qmake/generators/makefiledeps.cpp @@ -81,7 +81,7 @@ const QString struct SourceDependChildren; struct SourceFile { - SourceFile() : deps(0), type(QMakeSourceFileInfo::TYPE_UNKNOWN), + SourceFile() : deps(nullptr), type(QMakeSourceFileInfo::TYPE_UNKNOWN), mocable(0), traversed(0), exists(1), moc_checked(0), dep_checked(0), included_count(0) { } ~SourceFile(); @@ -95,8 +95,8 @@ struct SourceFile { struct SourceDependChildren { SourceFile **children; int num_nodes, used_nodes; - SourceDependChildren() : children(0), num_nodes(0), used_nodes(0) { } - ~SourceDependChildren() { if(children) free(children); children = 0; } + SourceDependChildren() : children(nullptr), num_nodes(0), used_nodes(0) { } + ~SourceDependChildren() { if (children) free(children); children = nullptr; } void addChild(SourceFile *s) { if(num_nodes <= used_nodes) { num_nodes += 200; @@ -115,10 +115,10 @@ public: SourceFile *lookupFile(const char *); inline SourceFile *lookupFile(const QString &f) { return lookupFile(f.toLatin1().constData()); } inline SourceFile *lookupFile(const QMakeLocalFileName &f) { return lookupFile(f.local().toLatin1().constData()); } - void addFile(SourceFile *, const char *k=0, bool own=true); + void addFile(SourceFile *, const char *k = nullptr, bool own = true); struct SourceFileNode { - SourceFileNode() : key(0), next(0), file(0), own_file(1) { } + SourceFileNode() : key(nullptr), next(nullptr), file(nullptr), own_file(1) { } ~SourceFileNode() { delete [] key; if(own_file) @@ -135,7 +135,7 @@ SourceFiles::SourceFiles() { nodes = (SourceFileNode**)malloc(sizeof(SourceFileNode*)*(num_nodes=3037)); for(int n = 0; n < num_nodes; n++) - nodes[n] = 0; + nodes[n] = nullptr; } SourceFiles::~SourceFiles() @@ -170,7 +170,7 @@ SourceFile *SourceFiles::lookupFile(const char *file) if(!strcmp(p->key, file)) return p->file; } - return 0; + return nullptr; } void SourceFiles::addFile(SourceFile *p, const char *k, bool own_file) @@ -259,11 +259,11 @@ QMakeSourceFileInfo::QMakeSourceFileInfo(const QString &cf) dep_mode = Recursive; //quick project lookups - includes = files = 0; + includes = files = nullptr; files_changed = false; //buffer - spare_buffer = 0; + spare_buffer = nullptr; spare_buffer_size = 0; //cache @@ -281,7 +281,7 @@ QMakeSourceFileInfo::~QMakeSourceFileInfo() //buffer if(spare_buffer) { free(spare_buffer); - spare_buffer = 0; + spare_buffer = nullptr; spare_buffer_size = 0; } @@ -538,7 +538,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) const QMakeLocalFileName sourceFile = fixPathForFile(file->file, true); struct stat fst; - char *buffer = 0; + char *buffer = nullptr; int buffer_len = 0; { int fd; @@ -588,7 +588,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) } for (; x < buffer_len; ++x) { bool try_local = true; - char *inc = 0; + char *inc = nullptr; if(file->type == QMakeSourceFileInfo::TYPE_UI) { // skip whitespaces while (x < buffer_len && (buffer[x] == ' ' || buffer[x] == '\t')) @@ -802,7 +802,7 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file) if (cpp_state == WantName) buffer[clean] = '\0'; else // i.e. malformed - inc = 0; + inc = nullptr; cpp_state = InCode; // hereafter break; @@ -915,7 +915,7 @@ bool QMakeSourceFileInfo::findMocs(SourceFile *file) file->moc_checked = true; int buffer_len = 0; - char *buffer = 0; + char *buffer = nullptr; { struct stat fst; int fd; diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index 874b4286bc..8ebd0c61ce 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -62,11 +62,11 @@ private: public: BuildsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : MetaMakefileGenerator(p, n, op), init_flag(false) { } - virtual ~BuildsMetaMakefileGenerator() { clearBuilds(); } + ~BuildsMetaMakefileGenerator() { clearBuilds(); } - virtual bool init(); - virtual int type() const { return BUILDSMETATYPE; } - virtual bool write(); + bool init() override; + int type() const override { return BUILDSMETATYPE; } + bool write() override; }; void @@ -138,7 +138,7 @@ BuildsMetaMakefileGenerator::init() bool BuildsMetaMakefileGenerator::write() { - Build *glue = 0; + Build *glue = nullptr; if(!makefiles.isEmpty() && !makefiles.first()->build.isNull()) { glue = new Build; glue->name = name; @@ -228,7 +228,7 @@ MakefileGenerator if (build_proj->read(project->projectFile())) return createMakefileGenerator(build_proj); } - return 0; + return nullptr; } class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator @@ -236,7 +236,7 @@ class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator protected: bool init_flag; struct Subdir { - Subdir() : makefile(0), indent(0) { } + Subdir() : makefile(nullptr), indent(0) { } ~Subdir() { delete makefile; } QString input_dir; QString output_dir, output_file; @@ -248,11 +248,11 @@ protected: public: SubdirsMetaMakefileGenerator(QMakeProject *p, const QString &n, bool op) : MetaMakefileGenerator(p, n, op), init_flag(false) { } - virtual ~SubdirsMetaMakefileGenerator(); + ~SubdirsMetaMakefileGenerator(); - virtual bool init(); - virtual int type() const { return SUBDIRSMETATYPE; } - virtual bool write(); + bool init() override; + int type() const override { return SUBDIRSMETATYPE; } + bool write() override; }; bool @@ -336,7 +336,7 @@ SubdirsMetaMakefileGenerator::init() hasError |= !sub->makefile->write(); delete sub; qmakeClearCaches(); - sub = 0; + sub = nullptr; Option::output.setFileName(output_name); } Option::output_dir = old_output_dir; @@ -412,7 +412,7 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO) { Option::postProcessProject(proj); - MakefileGenerator *mkfile = NULL; + MakefileGenerator *mkfile = nullptr; if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) { mkfile = new ProjectGenerator; mkfile->setProjectFile(proj); @@ -459,7 +459,7 @@ MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &na { Option::postProcessProject(proj); - MetaMakefileGenerator *ret = 0; + MetaMakefileGenerator *ret = nullptr; if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) { if (proj->first("TEMPLATE").endsWith("subdirs")) diff --git a/qmake/generators/metamakefile.h b/qmake/generators/metamakefile.h index 706bca3363..9337130143 100644 --- a/qmake/generators/metamakefile.h +++ b/qmake/generators/metamakefile.h @@ -49,7 +49,7 @@ public: virtual ~MetaMakefileGenerator(); - static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true, bool *success = 0); + static MetaMakefileGenerator *createMetaGenerator(QMakeProject *proj, const QString &name, bool op=true, bool *success = nullptr); static MakefileGenerator *createMakefileGenerator(QMakeProject *proj, bool noIO = false); inline QMakeProject *projectFile() const { return project; } diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index 27b7e9dfdc..f45a90b851 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -229,7 +229,7 @@ ProjectGenerator::init() ProStringList &h = v["HEADERS"]; bool no_qt_files = true; - static const char *srcs[] = { "SOURCES", "YACCSOURCES", "LEXSOURCES", "FORMS", 0 }; + static const char *srcs[] = { "SOURCES", "YACCSOURCES", "LEXSOURCES", "FORMS", nullptr }; for (int i = 0; srcs[i]; i++) { const ProStringList &l = v[srcs[i]]; QMakeSourceFileInfo::SourceFileType type = QMakeSourceFileInfo::TYPE_C; diff --git a/qmake/generators/projectgenerator.h b/qmake/generators/projectgenerator.h index 89c66f1ec8..cbc9f371ab 100644 --- a/qmake/generators/projectgenerator.h +++ b/qmake/generators/projectgenerator.h @@ -40,16 +40,16 @@ class ProjectGenerator : public MakefileGenerator QString getWritableVar(const char *, bool fixPath=true); QString fixPathToQmake(const QString &file); protected: - virtual void init(); - virtual bool writeMakefile(QTextStream &); + void init() override; + bool writeMakefile(QTextStream &) override; - virtual QString escapeFilePath(const QString &path) const { Q_ASSERT(false); return QString(); } + QString escapeFilePath(const QString &path) const override { Q_ASSERT(false); return QString(); } public: ProjectGenerator(); ~ProjectGenerator(); - virtual bool supportsMetaBuild() { return false; } - virtual bool openOutput(QFile &, const QString &) const; + bool supportsMetaBuild() override { return false; } + bool openOutput(QFile &, const QString &) const override; }; inline ProjectGenerator::~ProjectGenerator() diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 52d34ef513..4fe1a54501 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -420,7 +420,7 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.append(QMakeLocalFileName(dlib.toQString())); frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); - static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { ProStringList &l = project->values(lflags[i]); for (ProStringList::Iterator it = l.begin(); it != l.end(); ) { diff --git a/qmake/generators/unix/unixmake.h b/qmake/generators/unix/unixmake.h index da5cdb320c..c5e42aa1ae 100644 --- a/qmake/generators/unix/unixmake.h +++ b/qmake/generators/unix/unixmake.h @@ -38,7 +38,7 @@ class UnixMakefileGenerator : public MakefileGenerator bool include_deps; QString libtoolFileName(bool fixify=true); void writeLibtoolFile(); // for libtool - void writePrlFile(QTextStream &); + void writePrlFile(QTextStream &) override; public: UnixMakefileGenerator(); @@ -46,23 +46,23 @@ public: protected: virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); } - virtual bool doDepends() const { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); } + bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); } #ifdef Q_OS_WIN // MinGW x-compiling for QNX - virtual QString installRoot() const; + QString installRoot() const override; #endif - virtual QString defaultInstall(const QString &); - virtual ProString fixLibFlag(const ProString &lib); + QString defaultInstall(const QString &) override; + ProString fixLibFlag(const ProString &lib) override; - virtual bool findLibraries(bool linkPrl, bool mergeLflags); - virtual QString escapeFilePath(const QString &path) const; + bool findLibraries(bool linkPrl, bool mergeLflags) override; + QString escapeFilePath(const QString &path) const override; ProString escapeFilePath(const ProString &path) const { return MakefileGenerator::escapeFilePath(path); } - virtual QStringList &findDependencies(const QString &); - virtual void init(); + QStringList &findDependencies(const QString &) override; + void init() override; - virtual void writeDefaultVariables(QTextStream &t); - virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags); + void writeDefaultVariables(QTextStream &t) override; + void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override; void writeMakeParts(QTextStream &); - bool writeMakefile(QTextStream &); + bool writeMakefile(QTextStream &) override; private: void init2(); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index bda44eaa67..2ed1866584 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -346,7 +346,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) t << mkdir_p_asstring("$(@D)", false) << "\n\t" << "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n"; - static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 }; + static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", nullptr }; for (int x = 0; src[x]; x++) { const ProStringList &l = project->values(src[x]); for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it) { diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h index 934d28456d..5da5b24088 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -40,27 +40,27 @@ public: ~MingwMakefileGenerator(); protected: using MakefileGenerator::escapeDependencyPath; - virtual QString escapeDependencyPath(const QString &path) const; - virtual ProString fixLibFlag(const ProString &lib); - virtual bool processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff); - virtual QString getManifestFileForRcFile() const; - bool writeMakefile(QTextStream &); - void init(); - virtual QString installRoot() const; + QString escapeDependencyPath(const QString &path) const override; + ProString fixLibFlag(const ProString &lib) override; + bool processPrlFileBase(QString &origFile, const QStringRef &origName, + const QStringRef &fixedBase, int slashOff) override; + QString getManifestFileForRcFile() const override; + bool writeMakefile(QTextStream &) override; + void init() override; + QString installRoot() const override; private: void writeMingwParts(QTextStream &); - void writeIncPart(QTextStream &t); - void writeLibsPart(QTextStream &t); - void writeObjectsPart(QTextStream &t); - void writeBuildRulesPart(QTextStream &t); - void writeRcFilePart(QTextStream &t); + void writeIncPart(QTextStream &t) override; + void writeLibsPart(QTextStream &t) override; + void writeObjectsPart(QTextStream &t) override; + void writeBuildRulesPart(QTextStream &t) override; + void writeRcFilePart(QTextStream &t) override; - QStringList &findDependencies(const QString &file); + QStringList &findDependencies(const QString &file) override; QString preCompHeaderOut; - virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg); + LibFlagType parseLibFlag(const ProString &flag, ProString *arg) override; QString objectsLinkLine; }; diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp index 9f82ce4f8e..59e6127e46 100644 --- a/qmake/generators/win32/msbuild_objectmodel.cpp +++ b/qmake/generators/win32/msbuild_objectmodel.cpp @@ -1201,7 +1201,7 @@ static inline QString toString(midlCharOption option) static inline QString toString(midlErrorCheckOption option) { switch (option) { - case midlAlignNotSet: + case midlEnableCustom: break; case midlDisableAll: return "None"; diff --git a/qmake/generators/win32/msbuild_objectmodel.h b/qmake/generators/win32/msbuild_objectmodel.h index 2e77537916..ce5711f2da 100644 --- a/qmake/generators/win32/msbuild_objectmodel.h +++ b/qmake/generators/win32/msbuild_objectmodel.h @@ -72,7 +72,7 @@ public: return Uindex; } - void addElement(const QString &filepath, const VCFilterFile &allInfo){ + void addElement(const QString &filepath, const VCFilterFile &allInfo) override { QString newNodeName(filepath); int index = pathIndex(filepath); @@ -89,7 +89,7 @@ public: n->addElement(filepath.mid(index+1), allInfo); } - void removeElements() { + void removeElements() override { ChildrenMap::ConstIterator it = children.constBegin(); ChildrenMap::ConstIterator end = children.constEnd(); for( ; it != end; it++) { @@ -100,8 +100,8 @@ public: } void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &tool, - const QString &filter); - bool hasElements() { + const QString &filter) override; + bool hasElements() override { return children.size() != 0; } }; @@ -124,7 +124,7 @@ public: return Uindex; } - void addElement(const QString &filepath, const VCFilterFile &allInfo){ + void addElement(const QString &filepath, const VCFilterFile &allInfo) override { QString newKey(filepath); int index = pathIndex(filepath); @@ -136,13 +136,13 @@ public: children.insert(newKey + "\0" + allInfo.file, allInfo); } - void removeElements() { + void removeElements() override { children.clear(); } void generateXML(XmlOutput &xml, XmlOutput &xmlFilter, const QString &tagName, VCProject &proj, - const QString &filter); - bool hasElements() { + const QString &filter) override; + bool hasElements() override { return children.size() != 0; } }; @@ -150,20 +150,20 @@ public: class VCXProjectWriter : public VCProjectWriter { public: - void write(XmlOutput &, VCProjectSingleConfig &); - void write(XmlOutput &, VCProject &); - - void write(XmlOutput &, const VCCLCompilerTool &); - void write(XmlOutput &, const VCLinkerTool &); - void write(XmlOutput &, const VCMIDLTool &); - void write(XmlOutput &, const VCCustomBuildTool &); - void write(XmlOutput &, const VCLibrarianTool &); - void write(XmlOutput &, const VCResourceCompilerTool &); - void write(XmlOutput &, const VCEventTool &); - void write(XmlOutput &, const VCDeploymentTool &); - void write(XmlOutput &, const VCWinDeployQtTool &); - void write(XmlOutput &, const VCConfiguration &); - void write(XmlOutput &, VCFilter &); + void write(XmlOutput &, VCProjectSingleConfig &) override; + void write(XmlOutput &, VCProject &) override; + + void write(XmlOutput &, const VCCLCompilerTool &) override; + void write(XmlOutput &, const VCLinkerTool &) override; + void write(XmlOutput &, const VCMIDLTool &) override; + void write(XmlOutput &, const VCCustomBuildTool &) override; + void write(XmlOutput &, const VCLibrarianTool &) override; + void write(XmlOutput &, const VCResourceCompilerTool &) override; + void write(XmlOutput &, const VCEventTool &) override; + void write(XmlOutput &, const VCDeploymentTool &) override; + void write(XmlOutput &, const VCWinDeployQtTool &) override; + void write(XmlOutput &, const VCConfiguration &) override; + void write(XmlOutput &, VCFilter &) override; private: struct OutputFilterData diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index a1e3c08a7e..fa7ee1b98a 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -499,7 +499,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) QSet<QString> source_directories; if (useInferenceRules) { source_directories.insert("."); - static const char * const directories[] = { "UI_SOURCES_DIR", "UI_DIR", 0 }; + static const char * const directories[] = { "UI_SOURCES_DIR", "UI_DIR", nullptr }; for (int y = 0; directories[y]; y++) { QString dirTemp = project->first(directories[y]).toQString(); if (dirTemp.endsWith("\\")) @@ -507,7 +507,7 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) if(!dirTemp.isEmpty()) source_directories.insert(dirTemp); } - static const char * const srcs[] = { "SOURCES", "GENERATED_SOURCES", 0 }; + static const char * const srcs[] = { "SOURCES", "GENERATED_SOURCES", nullptr }; for (int x = 0; srcs[x]; x++) { const ProStringList &l = project->values(srcs[x]); for (ProStringList::ConstIterator sit = l.begin(); sit != l.end(); ++sit) { diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h index 67b609d0a6..67a56c7813 100644 --- a/qmake/generators/win32/msvc_nmake.h +++ b/qmake/generators/win32/msvc_nmake.h @@ -36,21 +36,21 @@ QT_BEGIN_NAMESPACE class NmakeMakefileGenerator : public Win32MakefileGenerator { void writeNmakeParts(QTextStream &); - bool writeMakefile(QTextStream &); - void writeImplicitRulesPart(QTextStream &t); - void writeBuildRulesPart(QTextStream &t); + bool writeMakefile(QTextStream &) override; + void writeImplicitRulesPart(QTextStream &t) override; + void writeBuildRulesPart(QTextStream &t) override; void writeLinkCommand(QTextStream &t, const QString &extraFlags = QString(), const QString &extraInlineFileContent = QString()); void writeResponseFileFiles(QTextStream &t, const ProStringList &files); int msvcVersion() const; - void init(); + void init() override; static QStringList sourceFilesForImplicitRulesFilter(); protected: - virtual void writeSubMakeCall(QTextStream &t, const QString &callPrefix, - const QString &makeArguments); - virtual QString defaultInstall(const QString &t); - virtual QStringList &findDependencies(const QString &file); - QString var(const ProKey &value) const; + void writeSubMakeCall(QTextStream &t, const QString &callPrefix, + const QString &makeArguments) override; + QString defaultInstall(const QString &t) override; + QStringList &findDependencies(const QString &file) override; + QString var(const ProKey &value) const override; QString precompH, precompObj, precompPch; QString precompObjC, precompPchC; bool usePCH, usePCHC; diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index 300792c5af..0406da584b 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -2185,7 +2185,7 @@ VCConfiguration::VCConfiguration() // VCFilter --------------------------------------------------------- VCFilter::VCFilter() : ParseFiles(unset), - Config(0) + Config(nullptr) { useCustomBuildTool = false; useCompilerTool = false; diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h index 10d44970ff..9d1a170489 100644 --- a/qmake/generators/win32/msvc_objectmodel.h +++ b/qmake/generators/win32/msvc_objectmodel.h @@ -484,7 +484,7 @@ public: // Functions VCCLCompilerTool(); - bool parseOption(const char* option); + bool parseOption(const char* option) override; // Variables QStringList AdditionalIncludeDirectories; @@ -581,7 +581,7 @@ public: // Functions VCLinkerTool(); - bool parseOption(const char* option); + bool parseOption(const char* option) override; // Variables QStringList AdditionalDependencies; @@ -676,7 +676,7 @@ class VCManifestTool : public VCToolBase public: VCManifestTool(); - bool parseOption(const char* option); + bool parseOption(const char* option) override; triState EmbedManifest; }; @@ -687,7 +687,7 @@ public: // Functions VCMIDLTool(); - bool parseOption(const char* option); + bool parseOption(const char* option) override; // Variables QStringList AdditionalIncludeDirectories; @@ -741,7 +741,7 @@ public: // Functions VCLibrarianTool(); - bool parseOption(const char*){ return false; } + bool parseOption(const char*) override { return false; } // Variables QStringList AdditionalDependencies; @@ -762,7 +762,7 @@ public: // Functions VCCustomBuildTool(); - bool parseOption(const char*){ return false; } + bool parseOption(const char*) override { return false; } // Variables QStringList AdditionalDependencies; @@ -781,7 +781,7 @@ public: // Functions VCResourceCompilerTool(); - bool parseOption(const char*){ return false; } + bool parseOption(const char*) override { return false; } // Variables QStringList AdditionalIncludeDirectories; @@ -815,7 +815,7 @@ protected: // Functions VCEventTool(const QString &eventName); - bool parseOption(const char*){ return false; } + bool parseOption(const char*) override { return false; } public: // Variables @@ -851,7 +851,7 @@ public: VCWinDeployQtTool() {} protected: - bool parseOption(const char *) { return false; } + bool parseOption(const char *) override { return false; } public: // Variables @@ -1037,7 +1037,7 @@ public: return Uindex; } - void addElement(const QString &filepath, const VCFilterFile &allInfo){ + void addElement(const QString &filepath, const VCFilterFile &allInfo) override { QString newNodeName(filepath); int index = pathIndex(filepath); @@ -1054,7 +1054,7 @@ public: n->addElement(filepath.mid(index+1), allInfo); } - void removeElements() { + void removeElements() override { ChildrenMap::ConstIterator it = children.constBegin(); ChildrenMap::ConstIterator end = children.constEnd(); for( ; it != end; it++) { @@ -1064,8 +1064,8 @@ public: children.clear(); } - void generateXML(XmlOutput &xml, const QString &tagName, VCProject &tool, const QString &filter); - bool hasElements() { + void generateXML(XmlOutput &xml, const QString &tagName, VCProject &tool, const QString &filter) override; + bool hasElements() override { return children.size() != 0; } }; @@ -1088,7 +1088,7 @@ public: return Uindex; } - void addElement(const QString &filepath, const VCFilterFile &allInfo){ + void addElement(const QString &filepath, const VCFilterFile &allInfo) override { QString newKey(filepath); int index = pathIndex(filepath); @@ -1100,12 +1100,12 @@ public: children.insert(newKey + "\0" + allInfo.file, allInfo); } - void removeElements() { + void removeElements() override { children.clear(); } - void generateXML(XmlOutput &xml, const QString &tagName, VCProject &proj, const QString &filter); - bool hasElements() { + void generateXML(XmlOutput &xml, const QString &tagName, VCProject &proj, const QString &filter) override; + bool hasElements() override { return children.size() != 0; } }; diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index b812e3a326..b453873344 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -112,7 +112,7 @@ VcprojGenerator::VcprojGenerator() : Win32MakefileGenerator(), is64Bit(false), customBuildToolFilterFileSuffix(QStringLiteral(".cbt")), - projectWriter(0) + projectWriter(nullptr) { } @@ -1100,7 +1100,7 @@ void VcprojGenerator::initLinkerTool() if (!project->values("DEF_FILE").isEmpty()) conf.linker.ModuleDefinitionFile = project->first("DEF_FILE").toQString(); - static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { const auto libs = fixLibFlags(lflags[i]); for (const ProString &lib : libs) { diff --git a/qmake/generators/win32/msvc_vcproj.h b/qmake/generators/win32/msvc_vcproj.h index 4882296b46..6af5ec7007 100644 --- a/qmake/generators/win32/msvc_vcproj.h +++ b/qmake/generators/win32/msvc_vcproj.h @@ -47,10 +47,10 @@ class VcprojGenerator : public Win32MakefileGenerator bool is64Bit; bool writeVcprojParts(QTextStream &); - bool writeMakefile(QTextStream &); - bool writeProjectMakefile(); + bool writeMakefile(QTextStream &) override; + bool writeProjectMakefile() override; - void init(); + void init() override; public: VcprojGenerator(); @@ -70,14 +70,14 @@ public: protected: virtual VCProjectWriter *createProjectWriter(); - virtual bool doDepends() const { return false; } //never necesary + bool doDepends() const override { return false; } // Never necessary using Win32MakefileGenerator::replaceExtraCompilerVariables; - virtual QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor); - virtual bool supportsMetaBuild() { return true; } - virtual bool supportsMergedBuilds() { return true; } - virtual bool mergeBuildProject(MakefileGenerator *other); + QString replaceExtraCompilerVariables(const QString &, const QStringList &, const QStringList &, ReplaceFor) override; + bool supportsMetaBuild() override { return true; } + bool supportsMergedBuilds() override { return true; } + bool mergeBuildProject(MakefileGenerator *other) override; - virtual bool openOutput(QFile &file, const QString &build) const; + bool openOutput(QFile &file, const QString &build) const override; virtual void initProject(); void initConfiguration(); diff --git a/qmake/generators/win32/msvc_vcxproj.h b/qmake/generators/win32/msvc_vcxproj.h index 8f68348693..7e02b6c32f 100644 --- a/qmake/generators/win32/msvc_vcxproj.h +++ b/qmake/generators/win32/msvc_vcxproj.h @@ -39,7 +39,7 @@ public: VcxprojGenerator(); protected: - virtual VCProjectWriter *createProjectWriter(); + VCProjectWriter *createProjectWriter() override; }; QT_END_NAMESPACE diff --git a/qmake/generators/win32/registry.cpp b/qmake/generators/win32/registry.cpp index 7320cb0551..3391ab9512 100644 --- a/qmake/generators/win32/registry.cpp +++ b/qmake/generators/win32/registry.cpp @@ -77,7 +77,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned l QString rSubkeyName = keyName(rSubkey); QString rSubkeyPath = keyPath(rSubkey); - HKEY handle = 0; + HKEY handle = nullptr; LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ | options, &handle); @@ -87,7 +87,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned l // get the size and type of the value DWORD dataType; DWORD dataSize; - res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize); + res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, &dataType, nullptr, &dataSize); if (res != ERROR_SUCCESS) { RegCloseKey(handle); return QString(); @@ -95,7 +95,7 @@ QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned l // get the value QByteArray data(dataSize, 0); - res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0, + res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, nullptr, reinterpret_cast<unsigned char*>(data.data()), &dataSize); if (res != ERROR_SUCCESS) { RegCloseKey(handle); diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 318ce50661..3c730299be 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -84,7 +84,7 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) if (impexts.isEmpty()) impexts = project->values("QMAKE_EXTENSION_STATICLIB"); QList<QMakeLocalFileName> dirs; - static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", 0 }; + static const char * const lflags[] = { "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { ProStringList &l = project->values(lflags[i]); for (ProStringList::Iterator it = l.begin(); it != l.end();) { @@ -439,7 +439,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) { t << "clean: compiler_clean " << depVar("CLEAN_DEPS"); { - const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", 0 }; + const char *clean_targets[] = { "OBJECTS", "QMAKE_CLEAN", "CLEAN_FILES", nullptr }; for(int i = 0; clean_targets[i]; ++i) { const ProStringList &list = project->values(clean_targets[i]); const QString del_statement("-$(DEL_FILE)"); @@ -468,7 +468,7 @@ void Win32MakefileGenerator::writeCleanParts(QTextStream &t) t << "distclean: clean " << depVar("DISTCLEAN_DEPS"); { - const char *clean_targets[] = { "QMAKE_DISTCLEAN", 0 }; + const char *clean_targets[] = { "QMAKE_DISTCLEAN", nullptr }; for(int i = 0; clean_targets[i]; ++i) { const ProStringList &list = project->values(clean_targets[i]); const QString del_statement("-$(DEL_FILE)"); diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index a2a0c9a63c..4416951a09 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -39,7 +39,7 @@ public: Win32MakefileGenerator(); ~Win32MakefileGenerator(); protected: - virtual QString defaultInstall(const QString &); + QString defaultInstall(const QString &) override; virtual void writeCleanParts(QTextStream &t); virtual void writeStandardParts(QTextStream &t); virtual void writeIncPart(QTextStream &t); @@ -48,18 +48,18 @@ protected: virtual void writeImplicitRulesPart(QTextStream &t); virtual void writeBuildRulesPart(QTextStream &); using MakefileGenerator::escapeFilePath; - virtual QString escapeFilePath(const QString &path) const; + QString escapeFilePath(const QString &path) const override; using MakefileGenerator::escapeDependencyPath; - virtual QString escapeDependencyPath(const QString &path) const; + QString escapeDependencyPath(const QString &path) const override; virtual void writeRcFilePart(QTextStream &t); - virtual bool findLibraries(bool linkPrl, bool mergeLflags); + bool findLibraries(bool linkPrl, bool mergeLflags) override; - virtual LibFlagType parseLibFlag(const ProString &flag, ProString *arg); - virtual ProString fixLibFlag(const ProString &lib); - virtual bool processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff); + LibFlagType parseLibFlag(const ProString &flag, ProString *arg) override; + ProString fixLibFlag(const ProString &lib) override; + bool processPrlFileBase(QString &origFile, const QStringRef &origName, + const QStringRef &fixedBase, int slashOff) override; void processVars(); void fixTargetExt(); diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index fd84dff59d..2b2c6d0078 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -200,7 +200,7 @@ QString IoUtils::shellQuoteWin(const QString &arg) # if defined(Q_OS_WIN) static QString windowsErrorCode() { - wchar_t *string = 0; + wchar_t *string = nullptr; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), @@ -244,7 +244,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF return false; } FILETIME ft; - GetFileTime(rHand, 0, 0, &ft); + GetFileTime(rHand, NULL, NULL, &ft); CloseHandle(rHand); HANDLE wHand = CreateFile((wchar_t*)targetFileName.utf16(), GENERIC_WRITE, FILE_SHARE_READ, @@ -253,7 +253,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF *errorString = fL1S("Cannot open %1: %2").arg(targetFileName, windowsErrorCode()); return false; } - SetFileTime(wHand, 0, 0, &ft); + SetFileTime(wHand, NULL, NULL, &ft); CloseHandle(wHand); # endif return true; diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h index fcb6869780..2b09fc2074 100644 --- a/qmake/library/proitems.h +++ b/qmake/library/proitems.h @@ -78,12 +78,12 @@ public: int sourceFile() const { return m_file; } ProString &prepend(const ProString &other); - ProString &append(const ProString &other, bool *pending = 0); + ProString &append(const ProString &other, bool *pending = nullptr); ProString &append(const QString &other) { return append(ProString(other)); } ProString &append(const QLatin1String other); ProString &append(const char *other) { return append(QLatin1String(other)); } ProString &append(QChar other); - ProString &append(const ProStringList &other, bool *pending = 0, bool skipEmpty1st = false); + ProString &append(const ProStringList &other, bool *pending = nullptr, bool skipEmpty1st = false); ProString &operator+=(const ProString &other) { return append(other); } ProString &operator+=(const QString &other) { return append(other); } ProString &operator+=(const QLatin1String other) { return append(other); } @@ -133,9 +133,9 @@ public: bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; } bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; } bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; } - int toLongLong(bool *ok = 0, int base = 10) const { return toQStringRef().toLongLong(ok, base); } - int toInt(bool *ok = 0, int base = 10) const { return toQStringRef().toInt(ok, base); } - short toShort(bool *ok = 0, int base = 10) const { return toQStringRef().toShort(ok, base); } + int toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringRef().toLongLong(ok, base); } + int toInt(bool *ok = nullptr, int base = 10) const { return toQStringRef().toInt(ok, base); } + short toShort(bool *ok = nullptr, int base = 10) const { return toQStringRef().toShort(ok, base); } uint hash() const { return m_hash; } static uint hash(const QChar *p, int n); @@ -261,7 +261,7 @@ class ProStringRwUser : public ProStringRoUser { public: ProStringRwUser(QString &rs) - : ProStringRoUser(rs), m_ps(0) {} + : ProStringRoUser(rs), m_ps(nullptr) {} ProStringRwUser(const ProString &ps, QString &rs) : ProStringRoUser(ps, rs), m_ps(&ps) {} QString &set(const ProString &ps) { m_ps = &ps; return ProStringRoUser::set(ps); } diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index fda1e1c593..f81bec158b 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1680,7 +1680,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional( #endif case T_INCLUDE: { QString parseInto; - LoadFlags flags = 0; + LoadFlags flags; if (m_cumulative) flags = LoadSilent; if (args.count() >= 2) { diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index ea2233f201..432339d48e 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -118,7 +118,7 @@ bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two) } QMakeBaseEnv::QMakeBaseEnv() - : evaluator(0) + : evaluator(nullptr) { #ifdef PROEVALUATOR_THREAD_SAFE inProgress = false; @@ -215,7 +215,7 @@ QMakeEvaluator::QMakeEvaluator(QMakeGlobals *option, QMakeParser *parser, QMakeV initStatics(); // Configuration, more or less - m_caller = 0; + m_caller = nullptr; #ifdef PROEVALUATOR_CUMULATIVE m_cumulative = false; #endif @@ -941,7 +941,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable( if (varName == statics.strTEMPLATE) setTemplate(); else if (varName == statics.strQMAKE_PLATFORM) - m_featureRoots = 0; + m_featureRoots = nullptr; else if (varName == statics.strQMAKE_DIR_SEP) m_dirSep = first(varName); else if (varName == statics.strQMAKESPEC) { @@ -950,7 +950,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProVariable( if (IoUtils::isAbsolutePath(spec)) { m_qmakespec = spec; m_qmakespecName = IoUtils::fileName(m_qmakespec).toString(); - m_featureRoots = 0; + m_featureRoots = nullptr; } } } @@ -1594,7 +1594,7 @@ ProFile *QMakeEvaluator::currentProFile() const { if (m_profileStack.count() > 0) return m_profileStack.top(); - return 0; + return nullptr; } int QMakeEvaluator::currentFileId() const @@ -1874,7 +1874,7 @@ ProValueMap *QMakeEvaluator::findValues(const ProKey &variableName, ProValueMap: if (first && isFunctParam(variableName)) break; } - return 0; + return nullptr; } ProStringList &QMakeEvaluator::valuesRef(const ProKey &variableName) diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h index b87aaa0eec..f617681cbb 100644 --- a/qmake/library/qmakeevaluator.h +++ b/qmake/library/qmakeevaluator.h @@ -282,9 +282,9 @@ public: #endif struct Location { - Location() : pro(0), line(0) {} + Location() : pro(nullptr), line(0) {} Location(ProFile *_pro, ushort _line) : pro(_pro), line(_line) {} - void clear() { pro = 0; line = 0; } + void clear() { pro = nullptr; line = 0; } ProFile *pro; ushort line; }; diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp index 37608c7a15..131ec6db6a 100644 --- a/qmake/library/qmakeparser.cpp +++ b/qmake/library/qmakeparser.cpp @@ -215,7 +215,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags) pro->itemsRef()->squeeze(); pro->ref(); } else { - pro = 0; + pro = nullptr; } ent->pro = pro; #ifdef PROPARSER_THREAD_SAFE @@ -234,7 +234,7 @@ ProFile *QMakeParser::parsedProFile(const QString &fileName, ParseFlags flags) if (readFile(id, flags, &contents)) pro = parsedProBlock(QStringRef(&contents), id, fileName, 1, FullGrammar); else - pro = 0; + pro = nullptr; } return pro; } @@ -437,7 +437,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar if (context == CtxPureValue) { end = inend; - cptr = 0; + cptr = nullptr; lineCont = false; indent = 0; // just gcc being stupid goto nextChr; @@ -449,7 +449,7 @@ void QMakeParser::read(ProFile *pro, const QStringRef &in, int line, SubGrammar // First, skip leading whitespace for (indent = 0; ; ++cur, ++indent) { if (cur == inend) { - cur = 0; + cur = nullptr; goto flushLine; } c = *cur; @@ -1112,7 +1112,7 @@ void QMakeParser::finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int arg if (uc == ptr) { // for(literal) (only "ever" would be legal if qmake was sane) putTok(tokPtr, TokForLoop); - putHashStr(tokPtr, (ushort *)0, (uint)0); + putHashStr(tokPtr, nullptr, (uint)0); putBlockLen(tokPtr, 1 + 3 + nlen + 1); putTok(tokPtr, TokHashLiteral); putHashStr(tokPtr, uce + 2, nlen); @@ -1135,7 +1135,7 @@ void QMakeParser::finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int arg } else if (argc == 1) { // for(non-literal) (this wouldn't be here if qmake was sane) putTok(tokPtr, TokForLoop); - putHashStr(tokPtr, (ushort *)0, (uint)0); + putHashStr(tokPtr, nullptr, (uint)0); uc = uce; goto doFor; } diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h index 3ae30dcf74..e9529f8bf6 100644 --- a/qmake/library/qmakeparser.h +++ b/qmake/library/qmakeparser.h @@ -110,7 +110,7 @@ private: }; struct BlockScope { - BlockScope() : start(0), braceLevel(0), special(false), inBranch(false), nest(NestNone) {} + BlockScope() : start(nullptr), braceLevel(0), special(false), inBranch(false), nest(NestNone) {} BlockScope(const BlockScope &other) { *this = other; } ushort *start; // Where this block started; store length here int braceLevel; // Nesting of braces in scope diff --git a/qmake/main.cpp b/qmake/main.cpp index 316e4b494f..a4ef79227b 100644 --- a/qmake/main.cpp +++ b/qmake/main.cpp @@ -546,7 +546,7 @@ int runQMake(int argc, char **argv) exit_val = 5; } delete mkfile; - mkfile = NULL; + mkfile = nullptr; } qmakeClearCaches(); return exit_val; diff --git a/qmake/option.cpp b/qmake/option.cpp index baad644280..dcebeadcb8 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -507,7 +507,7 @@ QString Option::fixString(QString string, uchar flags) { //const QString orig_string = string; - static QHash<FixStringCacheKey, QString> *cache = 0; + static QHash<FixStringCacheKey, QString> *cache = nullptr; if(!cache) { cache = new QHash<FixStringCacheKey, QString>; qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FixStringCacheKey, QString> >, (void**)&cache); @@ -635,7 +635,7 @@ public: QMakeCacheClearItem(qmakeCacheClearFunc f, void **d) : func(f), data(d) { } ~QMakeCacheClearItem() { (*func)(*data); - *data = 0; + *data = nullptr; } }; static QList<QMakeCacheClearItem*> cache_items; diff --git a/qmake/option.h b/qmake/option.h index eaa3706b24..25b2d64aaa 100644 --- a/qmake/option.h +++ b/qmake/option.h @@ -60,12 +60,12 @@ class QMakeProject; class EvalHandler : public QMakeHandler { public: - void message(int type, const QString &msg, const QString &fileName, int lineNo); + void message(int type, const QString &msg, const QString &fileName, int lineNo) override; - void fileMessage(int type, const QString &msg); + void fileMessage(int type, const QString &msg) override; - void aboutToEval(ProFile *, ProFile *, EvalFileType); - void doneWithEval(ProFile *); + void aboutToEval(ProFile *, ProFile *, EvalFileType) override; + void doneWithEval(ProFile *) override; }; struct Option @@ -108,7 +108,7 @@ struct Option }; //both of these must be called.. - static int init(int argc=0, char **argv=0); //parse cmdline + static int init(int argc = 0, char **argv = nullptr); //parse cmdline static void prepareProject(const QString &pfile); static bool postProcessProject(QMakeProject *); diff --git a/qmake/property.cpp b/qmake/property.cpp index 9a8db8904d..c0a3ec0dab 100644 --- a/qmake/property.cpp +++ b/qmake/property.cpp @@ -68,7 +68,7 @@ static const struct { { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true, true }, }; -QMakeProperty::QMakeProperty() : settings(0) +QMakeProperty::QMakeProperty() : settings(nullptr) { reload(); } @@ -99,7 +99,7 @@ void QMakeProperty::reload() QMakeProperty::~QMakeProperty() { delete settings; - settings = 0; + settings = nullptr; } void QMakeProperty::initSettings() diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp index f1735a80e7..6a27aad9e5 100644 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp @@ -535,7 +535,7 @@ static QVector<QTimeZonePrivate::Data> calculatePosixTransitions(const QByteArra // See the section about TZ at http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html QList<QByteArray> parts = posixRule.split(','); - PosixZone stdZone, dstZone; + PosixZone stdZone, dstZone = PosixZone::invalid(); { const QByteArray &zoneinfo = parts.at(0); const char *begin = zoneinfo.constBegin(); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 45788fec15..528927b0fb 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1382,16 +1382,6 @@ QPoint QWindowsWindow::mapFromGlobal(const QPoint &pos) const return m_data.hwnd ? QWindowsGeometryHint::mapFromGlobal(m_data.hwnd, pos) : pos; } -static inline HWND transientParentHwnd(HWND hwnd) -{ - if (GetAncestor(hwnd, GA_PARENT) == GetDesktopWindow()) { - const HWND rootOwnerHwnd = GetAncestor(hwnd, GA_ROOTOWNER); - if (rootOwnerHwnd != hwnd) // May return itself for toplevels. - return rootOwnerHwnd; - } - return 0; -} - // Update the transient parent for a toplevel window. The concept does not // really exist on Windows, the relationship is set by passing a parent along with !WS_CHILD // to window creation or by setting the parent using GWL_HWNDPARENT (as opposed to @@ -1406,7 +1396,7 @@ void QWindowsWindow::updateTransientParent() const if (window()->type() == Qt::Popup) return; // QTBUG-34503, // a popup stays on top, no parent, see also WindowCreationData::fromWindow(). // Update transient parent. - const HWND oldTransientParent = transientParentHwnd(m_data.hwnd); + const HWND oldTransientParent = GetWindow(m_data.hwnd, GW_OWNER); HWND newTransientParent = 0; if (const QWindow *tp = window()->transientParent()) if (const QWindowsWindow *tw = QWindowsWindow::windowsWindowOf(tp)) diff --git a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST index 2a31afd735..4c999ff88f 100644 --- a/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST +++ b/tests/auto/corelib/animation/qsequentialanimationgroup/BLACKLIST @@ -3,5 +3,6 @@ windows [finishWithUncontrolledAnimation] windows osx-10.12 +osx-10.13 [groupWithZeroDurationAnimations] osx diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index a9fbf02923..0f207b421e 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -2,6 +2,7 @@ [normalGeometry] ubuntu-16.04 [saveRestoreGeometry] +xcb b2qt [restoreVersion1Geometry] osx |