diff options
author | Paul Wicking <paul.wicking@qt.io> | 2019-01-31 16:43:15 +0100 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2019-02-08 21:48:17 +0000 |
commit | 4d2903ce81b5e1cdfb18b108838f44bc8e8603de (patch) | |
tree | d1fd1177b9fa3b99c6807038d9a76c346765d33f | |
parent | 439d9682de6052492431324e8c207e3cc3c02957 (diff) | |
download | qttools-4d2903ce81b5e1cdfb18b108838f44bc8e8603de.tar.gz |
QDoc: Code cleanup, use nullptr for nullptr constants
Replace 0 as nullptr constant with nullptr.
Remove reduntant semi-colons after member function definitions.
Adjust whitespace on lines otherwise touched.
Change-Id: I6af218ca8377611040360e0a3da392e7cffd29e9
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r-- | src/qdoc/atom.h | 10 | ||||
-rw-r--r-- | src/qdoc/codeparser.h | 2 | ||||
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 18 | ||||
-rw-r--r-- | src/qdoc/cppcodeparser.h | 2 | ||||
-rw-r--r-- | src/qdoc/doc.h | 4 | ||||
-rw-r--r-- | src/qdoc/generator.cpp | 28 | ||||
-rw-r--r-- | src/qdoc/generator.h | 4 | ||||
-rw-r--r-- | src/qdoc/helpprojectwriter.cpp | 12 | ||||
-rw-r--r-- | src/qdoc/htmlgenerator.cpp | 8 | ||||
-rw-r--r-- | src/qdoc/htmlgenerator.h | 14 | ||||
-rw-r--r-- | src/qdoc/location.cpp | 20 | ||||
-rw-r--r-- | src/qdoc/node.cpp | 34 | ||||
-rw-r--r-- | src/qdoc/node.h | 32 | ||||
-rw-r--r-- | src/qdoc/qdocdatabase.cpp | 316 | ||||
-rw-r--r-- | src/qdoc/qdocdatabase.h | 26 | ||||
-rw-r--r-- | src/qdoc/qdocindexfiles.cpp | 16 | ||||
-rw-r--r-- | src/qdoc/qdoctagfiles.cpp | 6 | ||||
-rw-r--r-- | src/qdoc/qmlcodemarker.cpp | 4 | ||||
-rw-r--r-- | src/qdoc/qmlcodeparser.cpp | 6 | ||||
-rw-r--r-- | src/qdoc/qmlvisitor.cpp | 10 | ||||
-rw-r--r-- | src/qdoc/sections.cpp | 28 | ||||
-rw-r--r-- | src/qdoc/sections.h | 4 | ||||
-rw-r--r-- | src/qdoc/text.cpp | 68 | ||||
-rw-r--r-- | src/qdoc/text.h | 6 | ||||
-rw-r--r-- | src/qdoc/tokenizer.cpp | 26 | ||||
-rw-r--r-- | src/qdoc/tree.cpp | 34 | ||||
-rw-r--r-- | src/qdoc/tree.h | 6 | ||||
-rw-r--r-- | src/qdoc/webxmlgenerator.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/yyindent.cpp | 20 |
29 files changed, 383 insertions, 383 deletions
diff --git a/src/qdoc/atom.h b/src/qdoc/atom.h index 88a2b86c4..b72264d18 100644 --- a/src/qdoc/atom.h +++ b/src/qdoc/atom.h @@ -134,19 +134,19 @@ public: friend class LinkAtom; Atom(const QString& string) - : next_(0), type_(Link) + : next_(nullptr), type_(Link) { strs << string; } Atom(AtomType type, const QString& string = "") - : next_(0), type_(type) + : next_(nullptr), type_(type) { strs << string; } Atom(AtomType type, const QString& p1, const QString& p2) - : next_(0), type_(type) + : next_(nullptr), type_(type) { strs << p1; if (!p2.isEmpty()) @@ -192,7 +192,7 @@ public: virtual bool isLinkAtom() const { return false; } virtual Node::Genus genus() { return Node::DontCare; } virtual bool specifiesDomain() { return false; } - virtual Tree* domain() { return 0; } + virtual Tree* domain() { return nullptr; } virtual Node::NodeType goal() { return Node::NoType; } virtual const QString& error() { return noError_; } virtual void resolveSquareBracketParams() { } @@ -214,7 +214,7 @@ class LinkAtom : public Atom bool isLinkAtom() const override { return true; } Node::Genus genus() override { resolveSquareBracketParams(); return genus_; } - bool specifiesDomain() override { resolveSquareBracketParams(); return (domain_ != 0); } + bool specifiesDomain() override { resolveSquareBracketParams(); return (domain_ != nullptr); } Tree* domain() override { resolveSquareBracketParams(); return domain_; } Node::NodeType goal() override { resolveSquareBracketParams(); return goal_; } const QString& error() override { return error_; } diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h index dd0191e86..bde7bda9e 100644 --- a/src/qdoc/codeparser.h +++ b/src/qdoc/codeparser.h @@ -55,7 +55,7 @@ public: virtual void parseHeaderFile(const Location& location, const QString& filePath); virtual void parseSourceFile(const Location& location, const QString& filePath) = 0; virtual void precompileHeaders() { } - virtual Node *parseFnArg(const Location &, const QString &) { return 0; } + virtual Node *parseFnArg(const Location &, const QString &) { return nullptr; } bool isParsingH() const; bool isParsingCpp() const; diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 4f5eb9bdc..91e3b78d8 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -229,16 +229,16 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, QStringList words = arg.first.split(QLatin1Char(' ')); QStringList path; int idx = 0; - Node *node = 0; + Node *node = nullptr; if (type == Node::Variable && words.size() > 1) idx = words.size() - 1; path = words[idx].split("::"); node = qdb_->findNodeInOpenNamespace(path, nodeTypeTestFuncMap_[command]); - if (node == 0) + if (node == nullptr) node = qdb_->findNodeByNameAndType(path, nodeTypeTestFuncMap_[command]); - if (node == 0) { + if (node == nullptr) { if (isWorthWarningAbout(doc)) { doc.location().warning(tr("Cannot find '%1' specified with '\\%2' in any header file") .arg(arg.first).arg(command)); @@ -362,7 +362,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, (command == COMMAND_JSATTACHEDMETHOD)) { Q_UNREACHABLE(); } - return 0; + return nullptr; } /*! @@ -464,9 +464,9 @@ void CppCodeParser::processQmlProperties(const Doc& doc, QString module; QString qmlTypeName; QString property; - QmlPropertyNode* qpn = 0; - QmlTypeNode* qmlType = 0; - QmlPropertyGroupNode* qpgn = 0; + QmlPropertyNode* qpn = nullptr; + QmlTypeNode* qmlType = nullptr; + QmlPropertyGroupNode* qpgn = nullptr; Topic qmlPropertyGroupTopic; const TopicList& topics = doc.topicsUsed(); @@ -530,7 +530,7 @@ void CppCodeParser::processQmlProperties(const Doc& doc, if (!aggregate) aggregate = qdb_->findQmlBasicType(module, qmlTypeName); if (aggregate) { - if (aggregate->hasQmlProperty(property, attached) != 0) { + if (aggregate->hasQmlProperty(property, attached) != nullptr) { QString msg = tr("QML property documented multiple times: '%1'").arg(arg); doc.startLocation().warning(msg); } @@ -846,7 +846,7 @@ FunctionNode *CppCodeParser::parseMacroArg(const Location &location, const QStri if (leftParenSplit.isEmpty()) return nullptr; QString macroName; - FunctionNode* oldMacroNode = 0; + FunctionNode* oldMacroNode = nullptr; QStringList blankSplit = leftParenSplit[0].split(' '); if (blankSplit.size() > 0) { macroName = blankSplit.last(); diff --git a/src/qdoc/cppcodeparser.h b/src/qdoc/cppcodeparser.h index 12bed3ada..491ffb4cd 100644 --- a/src/qdoc/cppcodeparser.h +++ b/src/qdoc/cppcodeparser.h @@ -46,7 +46,7 @@ class CppCodeParser : public CodeParser Node::NodeType type; // The node type: Function, etc. bool isAttached; // If true, the method is attached. bool isMacro; // If true, we are parsing a macro signature. - ExtraFuncData() : root(0), type(Node::Function), isAttached(false), isMacro(false) { } + ExtraFuncData() : root(nullptr), type(Node::Function), isAttached(false), isMacro(false) { } ExtraFuncData(Aggregate* r, Node::NodeType t, bool a) : root(r), type(t), isAttached(a), isMacro(false) { } }; diff --git a/src/qdoc/doc.h b/src/qdoc/doc.h index d9873c4bb..0c63cde7f 100644 --- a/src/qdoc/doc.h +++ b/src/qdoc/doc.h @@ -78,7 +78,7 @@ public: void setNavtitle(const QString& t) { navtitle_ = t; } void setHref(const QString& t) { href_ = t; } virtual bool isMapRef() const = 0; - virtual const DitaRefList* subrefs() const { return 0; } + virtual const DitaRefList* subrefs() const { return nullptr; } virtual void appendSubref(DitaRef* ) { } private: @@ -125,7 +125,7 @@ public: Section4 = 4 }; - Doc() : priv(0) {} + Doc() : priv(nullptr) {} Doc(const Location& start_loc, const Location& end_loc, const QString& source, diff --git a/src/qdoc/generator.cpp b/src/qdoc/generator.cpp index 34194b7d7..fdbbd284d 100644 --- a/src/qdoc/generator.cpp +++ b/src/qdoc/generator.cpp @@ -72,7 +72,7 @@ Generator::QDocPass Generator::qdocPass_ = Generator::Neither; bool Generator::qdocSingleExec_ = false; bool Generator::qdocWriteQaPages_ = false; bool Generator::useOutputSubdirs_ = true; -QmlTypeNode* Generator::qmlTypeContext_ = 0; +QmlTypeNode* Generator::qmlTypeContext_ = nullptr; static QRegExp tag("</?@[^>]*>"); static QLatin1String amp("&"); @@ -136,7 +136,7 @@ void Generator::appendFullName(Text& text, const Node *relative, const Node *actualNode) { - if (actualNode == 0) + if (actualNode == nullptr) actualNode = apparentNode; text << Atom(Atom::LinkNode, CodeMarker::stringForNode(actualNode)) << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) @@ -149,7 +149,7 @@ void Generator::appendFullName(Text& text, const QString& fullName, const Node *actualNode) { - if (actualNode == 0) + if (actualNode == nullptr) actualNode = apparentNode; text << Atom(Atom::LinkNode, CodeMarker::stringForNode(actualNode)) << Atom(Atom::FormattingLeft, ATOM_FORMATTING_LINK) @@ -597,7 +597,7 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) else if (fileBase(node).isEmpty()) return QString(); - Node *parentNode = 0; + Node *parentNode = nullptr; if ((parentNode = node->parent())) { if (parentNode->isQmlPropertyGroup() || parentNode->isJsPropertyGroup()) { @@ -739,7 +739,7 @@ const Atom *Generator::generateAtomList(const Atom *atom, generate && rightFormat, numAtoms); if (!atom) - return 0; + return nullptr; if (atom->type() == Atom::FormatElse) { ++numAtoms; @@ -749,7 +749,7 @@ const Atom *Generator::generateAtomList(const Atom *atom, generate && !rightFormat, numAtoms); if (!atom) - return 0; + return nullptr; } if (atom->type() == Atom::FormatEndif) { @@ -780,7 +780,7 @@ const Atom *Generator::generateAtomList(const Atom *atom, atom = atom->next(); } } - return 0; + return nullptr; } /*! @@ -1090,7 +1090,7 @@ void Generator::generateDocumentation(Node* node) */ CodeMarker *marker = CodeMarker::markerForFileName(node->location().filePath()); - if (node->parent() != 0) { + if (node->parent() != nullptr) { if (node->isCollectionNode()) { /* A collection node collects: groups, C++ modules, @@ -1223,7 +1223,7 @@ bool Generator::generateQmlText(const Text& text, const Atom* atom = text.firstAtom(); bool result = false; - if (atom != 0) { + if (atom != nullptr) { initializeTextOutput(); while (atom) { if (atom->type() != Atom::QmlText) @@ -1378,7 +1378,7 @@ bool Generator::generateText(const Text& text, CodeMarker *marker) { bool result = false; - if (text.firstAtom() != 0) { + if (text.firstAtom() != nullptr) { int numAtoms = 0; initializeTextOutput(); generateAtomList(text.firstAtom(), @@ -1626,7 +1626,7 @@ Generator *Generator::generatorForFormat(const QString& format) return *g; ++g; } - return 0; + return nullptr; } /*! @@ -1897,7 +1897,7 @@ void Generator::initializeGenerator(const Config& config) bool Generator::matchAhead(const Atom *atom, Atom::AtomType expectedAtomType) { - return atom->next() != 0 && atom->next()->type() == expectedAtomType; + return atom->next() != nullptr && atom->next()->type() == expectedAtomType; } /*! @@ -2062,7 +2062,7 @@ int Generator::skipAtoms(const Atom *atom, Atom::AtomType type) const { int skipAhead = 0; atom = atom->next(); - while (atom != 0 && atom->type() != type) { + while (atom != nullptr && atom->type() != type) { skipAhead++; atom = atom->next(); } @@ -2090,7 +2090,7 @@ void Generator::supplementAlsoList(const Node *node, QList<Text> &alsoList) const FunctionNode *fn = static_cast<const FunctionNode *>(node); if (fn->overloadNumber() == 0) { QString alternateName; - const FunctionNode *alternateFunc = 0; + const FunctionNode *alternateFunc = nullptr; if (fn->name().startsWith("set") && fn->name().size() >= 4) { alternateName = fn->name()[3].toLower(); diff --git a/src/qdoc/generator.h b/src/qdoc/generator.h index dd1747e4e..5b4870f4d 100644 --- a/src/qdoc/generator.h +++ b/src/qdoc/generator.h @@ -178,7 +178,7 @@ protected: int* pos, int n, QStringRef* contents, - QStringRef* par1 = 0, + QStringRef* par1 = nullptr, bool debug = false); void setImageFileExtensions(const QStringList& extensions); void unknownAtom(const Atom *atom); @@ -197,7 +197,7 @@ protected: void appendFullName(Text& text, const Node *apparentNode, const Node *relative, - const Node *actualNode = 0); + const Node *actualNode = nullptr); void appendFullName(Text& text, const Node *apparentNode, const QString& fullName, diff --git a/src/qdoc/helpprojectwriter.cpp b/src/qdoc/helpprojectwriter.cpp index f125a4a54..aea4981fc 100644 --- a/src/qdoc/helpprojectwriter.cpp +++ b/src/qdoc/helpprojectwriter.cpp @@ -713,7 +713,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) writer.writeStartElement("toc"); writer.writeStartElement("section"); const Node* node = qdb_->findPageNodeByTitle(project.indexTitle); - if (node == 0) + if (node == nullptr) node = qdb_->findNodeByNameAndType(QStringList("index.html"), &Node::isPageNode); QString indexPath; if (node) @@ -730,7 +730,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (subproject.type == QLatin1String("manual")) { - const Node *indexPage = qdb_->findNodeForTarget(subproject.indexTitle, 0); + const Node *indexPage = qdb_->findNodeForTarget(subproject.indexTitle, nullptr); if (indexPage) { Text indexBody = indexPage->doc().body(); const Atom *atom = indexBody.firstAtom(); @@ -757,7 +757,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (sectionStack.top() > 0) writer.writeEndElement(); // section - const Node *page = qdb_->findNodeForTarget(atom->string(), 0); + const Node *page = qdb_->findNodeForTarget(atom->string(), nullptr); writer.writeStartElement("section"); QString indexPath = gen_->fullDocumentLocation(page, false); writer.writeAttribute("ref", indexPath); @@ -786,7 +786,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) } else { writer.writeStartElement("section"); - QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, 0), + QString indexPath = gen_->fullDocumentLocation(qdb_->findNodeForTarget(subproject.indexTitle, nullptr), false); writer.writeAttribute("ref", indexPath); writer.writeAttribute("title", subproject.title); @@ -806,7 +806,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) if (!nextTitle.isEmpty() && node->links().value(Node::ContentsLink).first.isEmpty()) { - const Node *nextPage = qdb_->findNodeForTarget(nextTitle, 0); + const Node *nextPage = qdb_->findNodeForTarget(nextTitle, nullptr); // Write the contents node. writeNode(project, writer, node); @@ -817,7 +817,7 @@ void HelpProjectWriter::generateProject(HelpProject &project) nextTitle = nextPage->links().value(Node::NextLink).first; if (nextTitle.isEmpty() || visited.contains(nextTitle)) break; - nextPage = qdb_->findNodeForTarget(nextTitle, 0); + nextPage = qdb_->findNodeForTarget(nextTitle, nullptr); visited.insert(nextTitle); } break; diff --git a/src/qdoc/htmlgenerator.cpp b/src/qdoc/htmlgenerator.cpp index 04e3bb0e7..8fcb8817f 100644 --- a/src/qdoc/htmlgenerator.cpp +++ b/src/qdoc/htmlgenerator.cpp @@ -1376,8 +1376,8 @@ void HtmlGenerator::generateCppReferencePage(Aggregate *aggregate, CodeMarker *m QString rawTitle; QString fullTitle; NamespaceNode* ns = nullptr; - SectionVector *summarySections = 0; - SectionVector *detailsSections = 0; + SectionVector *summarySections = nullptr; + SectionVector *detailsSections = nullptr; Sections sections(aggregate); QString word = aggregate->typeWord(true); @@ -1598,8 +1598,8 @@ void HtmlGenerator::generateProxyPage(Aggregate *aggregate, CodeMarker *marker) QString rawTitle; QString fullTitle; Text subtitleText; - SectionVector *summarySections = 0; - SectionVector *detailsSections = 0; + SectionVector *summarySections = nullptr; + SectionVector *detailsSections = nullptr; Sections sections(aggregate); rawTitle = aggregate->plainName(); diff --git a/src/qdoc/htmlgenerator.h b/src/qdoc/htmlgenerator.h index b83e21aa2..3dba71a56 100644 --- a/src/qdoc/htmlgenerator.h +++ b/src/qdoc/htmlgenerator.h @@ -113,24 +113,24 @@ private: const QString &buildversion, bool tableItems = false); void generateHeader(const QString& title, - const Node *node = 0, - CodeMarker *marker = 0); + const Node *node = nullptr, + CodeMarker *marker = nullptr); void generateTitle(const QString& title, const Text &subTitle, SubTitleSize subTitleSize, const Node *relative, CodeMarker *marker); - void generateFooter(const Node *node = 0); + void generateFooter(const Node *node = nullptr); void generateRequisites(Aggregate *inner, CodeMarker *marker); void generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker); void generateBrief(const Node *node, CodeMarker *marker, - const Node *relative = 0, bool addLink=true); + const Node *relative = nullptr, bool addLink=true); void generateTableOfContents(const Node *node, CodeMarker *marker, - QVector<Section>* sections = 0); + QVector<Section>* sections = nullptr); void generateSidebar(); QString generateAllMembersFile(const Section §ion, CodeMarker *marker); QString generateAllQmlMembersFile(const Sections §ions, CodeMarker* marker); @@ -173,14 +173,14 @@ private: CodeMarker *marker, Section::Style style, bool alignNames = false, - const QString* prefix = 0); + const QString* prefix = nullptr); void generateSectionInheritedList(const Section& section, const Node *relative); QString highlightedCode(const QString& markedCode, const Node* relative, bool alignNames = false, Node::Genus genus = Node::DontCare); - void generateFullName(const Node *apparentNode, const Node *relative, const Node *actualNode = 0); + void generateFullName(const Node *apparentNode, const Node *relative, const Node *actualNode = nullptr); void generateDetailedMember(const Node *node, const PageNode *relative, CodeMarker *marker); void generateLink(const Atom *atom, CodeMarker *marker); diff --git a/src/qdoc/location.cpp b/src/qdoc/location.cpp index 68e2a262a..18e9a1283 100644 --- a/src/qdoc/location.cpp +++ b/src/qdoc/location.cpp @@ -47,7 +47,7 @@ int Location::warningCount = 0; int Location::warningLimit = -1; QString Location::programName; QString Location::project; -QRegExp *Location::spuriousRegExp = 0; +QRegExp *Location::spuriousRegExp = nullptr; bool Location::logProgress_ = false; /*! @@ -65,7 +65,7 @@ bool Location::logProgress_ = false; Constructs an empty location. */ Location::Location() - : stk(0), stkTop(&stkBottom), stkDepth(0), etcetera(false) + : stk(nullptr), stkTop(&stkBottom), stkDepth(0), etcetera(false) { // nothing. } @@ -75,7 +75,7 @@ Location::Location() position stack. */ Location::Location(const QString& fileName) - : stk(0), stkTop(&stkBottom), stkDepth(0), etcetera(false) + : stk(nullptr), stkTop(&stkBottom), stkDepth(0), etcetera(false) { push(fileName); } @@ -85,7 +85,7 @@ Location::Location(const QString& fileName) this Location using the assignment operator. */ Location::Location(const Location& other) - : stk(0), stkTop(&stkBottom), stkDepth(0), etcetera(false) + : stk(nullptr), stkTop(&stkBottom), stkDepth(0), etcetera(false) { *this = other; } @@ -99,8 +99,8 @@ Location& Location::operator=(const Location& other) QStack<StackEntry> *oldStk = stk; stkBottom = other.stkBottom; - if (other.stk == 0) { - stk = 0; + if (other.stk == nullptr) { + stk = nullptr; stkTop = &stkBottom; } else { @@ -158,7 +158,7 @@ void Location::advance(QChar ch) void Location::push(const QString& filePath) { if (stkDepth++ >= 1) { - if (stk == 0) + if (stk == nullptr) stk = new QStack<StackEntry>; stk->push(StackEntry()); stkTop = &stk->top(); @@ -184,7 +184,7 @@ void Location::pop() stk->pop(); if (stk->isEmpty()) { delete stk; - stk = 0; + stk = nullptr; stkTop = &stkBottom; } else { @@ -354,7 +354,7 @@ void Location::initialize(const Config& config) void Location::terminate() { delete spuriousRegExp; - spuriousRegExp = 0; + spuriousRegExp = nullptr; } /*! @@ -410,7 +410,7 @@ void Location::emitMessage(MessageType type, const QString& details) const { if (type == Warning && - spuriousRegExp != 0 && + spuriousRegExp != nullptr && spuriousRegExp->exactMatch(message)) return; diff --git a/src/qdoc/node.cpp b/src/qdoc/node.cpp index 992d683f4..db9106d6e 100644 --- a/src/qdoc/node.cpp +++ b/src/qdoc/node.cpp @@ -322,7 +322,7 @@ Node::Node(NodeType type, Aggregate *parent, const QString& name) indexNodeFlag_(false), relatedNonmember_(false), parent_(parent), - sharedCommentNode_(0), + sharedCommentNode_(nullptr), name_(name) { if (parent_) @@ -789,7 +789,7 @@ QmlTypeNode* Node::qmlTypeNode() if (n && (n->isQmlType() || n->isJsType())) return static_cast<QmlTypeNode*>(n); } - return 0; + return nullptr; } /*! @@ -804,7 +804,7 @@ ClassNode* Node::declarativeCppNode() QmlTypeNode* qcn = qmlTypeNode(); if (qcn) return qcn->classNode(); - return 0; + return nullptr; } /*! @@ -960,7 +960,7 @@ Aggregate::~Aggregate() for (int i = 0; i < children_.size(); ++i) { if ((children_[i] != nullptr) && (children_[i]->parent() == this)) delete children_[i]; - children_[i] = 0; + children_[i] = nullptr; } children_.clear(); } @@ -1255,7 +1255,7 @@ const EnumNode *Aggregate::findEnumNodeForValue(const QString &enumValue) const if (en->hasItem(enumValue)) return en; } - return 0; + return nullptr; } /*! @@ -1534,7 +1534,7 @@ QmlPropertyNode* Aggregate::hasQmlProperty(const QString& n) const return t; } } - return 0; + return nullptr; } /*! @@ -1560,7 +1560,7 @@ QmlPropertyNode* Aggregate::hasQmlProperty(const QString& n, bool attached) cons return t; } } - return 0; + return nullptr; } /*! @@ -1812,7 +1812,7 @@ PropertyNode* ClassNode::findPropertyNode(const QString& name) if (n) return static_cast<PropertyNode*>(n); - PropertyNode* pn = 0; + PropertyNode* pn = nullptr; const QList<RelatedClass> &bases = baseClasses(); if (!bases.isEmpty()) { @@ -1848,7 +1848,7 @@ PropertyNode* ClassNode::findPropertyNode(const QString& name) */ QmlTypeNode* ClassNode::findQmlBaseNode() { - QmlTypeNode* result = 0; + QmlTypeNode* result = nullptr; const QList<RelatedClass>& bases = baseClasses(); if (!bases.isEmpty()) { @@ -1862,7 +1862,7 @@ QmlTypeNode* ClassNode::findQmlBaseNode() ClassNode* cn = bases[i].node_; if (cn) { result = cn->findQmlBaseNode(); - if (result != 0) { + if (result != nullptr) { return result; } } @@ -1900,7 +1900,7 @@ FunctionNode* ClassNode::findOverriddenFunction(const FunctionNode* fn) } ++bc; } - return 0; + return nullptr; } /*! @@ -2663,7 +2663,7 @@ PropertyNode::PropertyNode(Aggregate *parent, const QString& name) const_(false), final_(false), revision_(-1), - overrides_(0) + overrides_(nullptr) { // nothing } @@ -2733,9 +2733,9 @@ QmlTypeNode::QmlTypeNode(Aggregate *parent, const QString& name, NodeType type) abstract_(false), cnodeRequired_(false), wrapper_(false), - cnode_(0), - logicalModule_(0), - qmlBaseNode_(0) + cnode_(nullptr), + logicalModule_(nullptr), + qmlBaseNode_(nullptr) { int i = 0; if (name.startsWith("QML:")) { @@ -2836,7 +2836,7 @@ QString QmlTypeNode::logicalModuleIdentifier() const bool QmlTypeNode::inherits(Aggregate* type) { QmlTypeNode* qtn = qmlBaseNode(); - while (qtn != 0) { + while (qtn != nullptr) { if (qtn == type) return true; qtn = qtn->qmlBaseNode(); @@ -3024,7 +3024,7 @@ PropertyNode* QmlPropertyNode::findCorrespondingCppProperty() } } } - return 0; + return nullptr; } /*! diff --git a/src/qdoc/node.h b/src/qdoc/node.h index 155ece365..20b375b69 100644 --- a/src/qdoc/node.h +++ b/src/qdoc/node.h @@ -232,9 +232,9 @@ public: virtual bool isWrapper() const; QString plainName() const; - QString plainFullName(const Node* relative = 0) const; + QString plainFullName(const Node* relative = nullptr) const; QString plainSignature() const; - QString fullName(const Node* relative=0) const; + QString fullName(const Node* relative = nullptr) const; virtual QString signature(bool , bool ) const { return plainName(); } const QString& fileNameBase() const { return fileNameBase_; } @@ -292,7 +292,7 @@ public: virtual QString nameForLists() const { return name_; } virtual QString outputFileName() const { return QString(); } virtual QString obsoleteLink() const { return QString(); } - virtual void setObsoleteLink(const QString& ) { }; + virtual void setObsoleteLink(const QString& ) { } virtual void setQtVariable(const QString& ) { } virtual QString qtVariable() const { return QString(); } virtual bool hasTag(const QString& ) const { return false; } @@ -317,7 +317,7 @@ public: QString nodeSubtypeString() const; virtual void addPageKeywords(const QString& ) { } - bool isSharingComment() const { return (sharedCommentNode_ != 0); } + bool isSharingComment() const { return (sharedCommentNode_ != nullptr); } bool hasSharedDoc() const; void setSharedCommentNode(SharedCommentNode* t); @@ -330,11 +330,11 @@ public: virtual QString logicalModuleIdentifier() const { return QString(); } virtual void setLogicalModuleInfo(const QString& ) { } virtual void setLogicalModuleInfo(const QStringList& ) { } - virtual CollectionNode* logicalModule() const { return 0; } + virtual CollectionNode* logicalModule() const { return nullptr; } virtual void setQmlModule(CollectionNode* ) { } - virtual ClassNode* classNode() { return 0; } + virtual ClassNode* classNode() { return nullptr; } virtual void setClassNode(ClassNode* ) { } - virtual const Node* applyModuleName(const Node* ) const { return 0; } + virtual const Node* applyModuleName(const Node* ) const { return nullptr; } virtual QString idNumber() { return "0"; } QmlTypeNode* qmlTypeNode(); ClassNode* declarativeCppNode(); @@ -474,7 +474,7 @@ public: QStringList primaryKeys(); QmlPropertyNode* hasQmlProperty(const QString& ) const; QmlPropertyNode* hasQmlProperty(const QString&, bool attached) const; - virtual QmlTypeNode* qmlBaseNode() const { return 0; } + virtual QmlTypeNode* qmlBaseNode() const { return nullptr; } void addChildByTitle(Node* child, const QString& title); void printChildren(const QString& title); void addChild(Node* child); @@ -532,7 +532,7 @@ class NamespaceNode : public Aggregate { public: NamespaceNode(Aggregate* parent, const QString& name) : Aggregate(Namespace, parent, name), - seen_(false), documented_(false), tree_(0), docNode_(0) { } + seen_(false), documented_(false), tree_(nullptr), docNode_(nullptr) { } virtual ~NamespaceNode(); Tree* tree() const override { return (parent() ? parent()->tree() : tree_); } @@ -572,7 +572,7 @@ struct RelatedClass : access_(access), node_(node) { } // constructor for unresolved base class RelatedClass(Node::Access access, const QStringList& path, const QString& signature) - : access_(access), node_(0), path_(path), signature_(signature) { } + : access_(access), node_(nullptr), path_(path), signature_(signature) { } QString accessString() const; bool isPrivate() const { return (access_ == Node::Private); } @@ -585,7 +585,7 @@ struct RelatedClass struct UsingClause { UsingClause() { } - UsingClause(const QString& signature) : node_(0), signature_(signature) { } + UsingClause(const QString& signature) : node_(nullptr), signature_(signature) { } const QString& signature() const { return signature_; } const Node* node() { return node_; } void setNode(const Node* n) { node_ = n; } @@ -598,7 +598,7 @@ class ClassNode : public Aggregate { public: ClassNode(NodeType type, Aggregate* parent, const QString& name) : Aggregate(type, parent, name), - abstract_(false), wrapper_(false), qmlelement(0) { } + abstract_(false), wrapper_(false), qmlelement(nullptr) { } virtual ~ClassNode() { } bool isFirstClassAggregate() const override { return true; } bool isClassNode() const override { return true; } @@ -733,7 +733,7 @@ public: void setImportList(const ImportList& il) { importList_ = il; } const QString& qmlBaseName() const { return qmlBaseName_; } void setQmlBaseName(const QString& name) { qmlBaseName_ = name; } - bool qmlBaseNodeNotSet() const { return (qmlBaseNode_ == 0); } + bool qmlBaseNodeNotSet() const { return (qmlBaseNode_ == nullptr); } QmlTypeNode* qmlBaseNode() const override { return qmlBaseNode_; } void setQmlBaseNode(QmlTypeNode* b) { qmlBaseNode_ = b; } void requireCppClass() { cnodeRequired_ = true; } @@ -866,7 +866,7 @@ private: class EnumNode : public Node { public: - EnumNode(Aggregate *parent, const QString& name) : Node(Enum, parent, name), flagsType_(0) { } + EnumNode(Aggregate *parent, const QString& name) : Node(Enum, parent, name), flagsType_(nullptr) { } virtual ~EnumNode() { } void addItem(const EnumItem& item); @@ -889,7 +889,7 @@ class TypedefNode : public Node { public: TypedefNode(Aggregate *parent, const QString& name) : Node(Typedef, parent, name), - associatedEnum_(0) { } + associatedEnum_(nullptr) { } virtual ~TypedefNode() { } bool hasAssociatedEnum() const { return associatedEnum_ != nullptr; } @@ -991,7 +991,7 @@ public: void setVirtual() { virtualness_ = NormalVirtual; } void setConst(bool b) { const_ = b; } void setStatic(bool b) { static_ = b; } - void setReimpFlag() { reimpFlag_ = true; }; + void setReimpFlag() { reimpFlag_ = true; } void setOverridesThis(const QString &path) { overridesThis_ = path; } const QString& returnType() const { return returnType_; } diff --git a/src/qdoc/qdocdatabase.cpp b/src/qdoc/qdocdatabase.cpp index 1d08f8d45..ab1d44f46 100644 --- a/src/qdoc/qdocdatabase.cpp +++ b/src/qdoc/qdocdatabase.cpp @@ -92,7 +92,7 @@ QDocForest::~QDocForest() searchOrder_.clear(); indexSearchOrder_.clear(); moduleNames_.clear(); - primaryTree_ = 0; + primaryTree_ = nullptr; } /*! @@ -103,7 +103,7 @@ QDocForest::~QDocForest() NamespaceNode* QDocForest::firstRoot() { currentIndex_ = 0; - return (!searchOrder().isEmpty() ? searchOrder()[0]->root() : 0); + return (!searchOrder().isEmpty() ? searchOrder()[0]->root() : nullptr); } /*! @@ -114,7 +114,7 @@ NamespaceNode* QDocForest::firstRoot() NamespaceNode* QDocForest::nextRoot() { ++currentIndex_; - return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_]->root() : 0); + return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_]->root() : nullptr); } /*! @@ -125,7 +125,7 @@ NamespaceNode* QDocForest::nextRoot() Tree* QDocForest::firstTree() { currentIndex_ = 0; - return (!searchOrder().isEmpty() ? searchOrder()[0] : 0); + return (!searchOrder().isEmpty() ? searchOrder()[0] : nullptr); } /*! @@ -136,7 +136,7 @@ Tree* QDocForest::firstTree() Tree* QDocForest::nextTree() { ++currentIndex_; - return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_] : 0); + return (currentIndex_ < searchOrder().size() ? searchOrder()[currentIndex_] : nullptr); } /*! @@ -425,7 +425,7 @@ const FunctionNode *QDocForest::findFunctionNode(const QStringList &path, other useful data structures. */ -QDocDatabase* QDocDatabase::qdocDB_ = NULL; +QDocDatabase* QDocDatabase::qdocDB_ = nullptr; NodeMap QDocDatabase::typeNodeMap_; NodeMultiMap QDocDatabase::obsoleteClasses_; NodeMultiMap QDocDatabase::classesWithObsoleteMembers_; @@ -491,7 +491,7 @@ void QDocDatabase::destroyQdocDB() { if (qdocDB_) { delete qdocDB_; - qdocDB_ = 0; + qdocDB_ = nullptr; } } @@ -514,139 +514,139 @@ void QDocDatabase::destroyQdocDB() void QDocDatabase::initializeDB() { Node::initialize(); - typeNodeMap_.insert( "accepted", 0); - typeNodeMap_.insert( "actionPerformed", 0); - typeNodeMap_.insert( "activated", 0); - typeNodeMap_.insert( "alias", 0); - typeNodeMap_.insert( "anchors", 0); - typeNodeMap_.insert( "any", 0); - typeNodeMap_.insert( "array", 0); - typeNodeMap_.insert( "autoSearch", 0); - typeNodeMap_.insert( "axis", 0); - typeNodeMap_.insert( "backClicked", 0); - typeNodeMap_.insert( "boomTime", 0); - typeNodeMap_.insert( "border", 0); - typeNodeMap_.insert( "buttonClicked", 0); - typeNodeMap_.insert( "callback", 0); - typeNodeMap_.insert( "char", 0); - typeNodeMap_.insert( "clicked", 0); - typeNodeMap_.insert( "close", 0); - typeNodeMap_.insert( "closed", 0); - typeNodeMap_.insert( "cond", 0); - typeNodeMap_.insert( "data", 0); - typeNodeMap_.insert( "dataReady", 0); - typeNodeMap_.insert( "dateString", 0); - typeNodeMap_.insert( "dateTimeString", 0); - typeNodeMap_.insert( "datetime", 0); - typeNodeMap_.insert( "day", 0); - typeNodeMap_.insert( "deactivated", 0); - typeNodeMap_.insert( "drag", 0); - typeNodeMap_.insert( "easing", 0); - typeNodeMap_.insert( "error", 0); - typeNodeMap_.insert( "exposure", 0); - typeNodeMap_.insert( "fatalError", 0); - typeNodeMap_.insert( "fileSelected", 0); - typeNodeMap_.insert( "flags", 0); - typeNodeMap_.insert( "float", 0); - typeNodeMap_.insert( "focus", 0); - typeNodeMap_.insert( "focusZone", 0); - typeNodeMap_.insert( "format", 0); - typeNodeMap_.insert( "framePainted", 0); - typeNodeMap_.insert( "from", 0); - typeNodeMap_.insert( "frontClicked", 0); - typeNodeMap_.insert( "function", 0); - typeNodeMap_.insert( "hasOpened", 0); - typeNodeMap_.insert( "hovered", 0); - typeNodeMap_.insert( "hoveredTitle", 0); - typeNodeMap_.insert( "hoveredUrl", 0); - typeNodeMap_.insert( "imageCapture", 0); - typeNodeMap_.insert( "imageProcessing", 0); - typeNodeMap_.insert( "index", 0); - typeNodeMap_.insert( "initialized", 0); - typeNodeMap_.insert( "isLoaded", 0); - typeNodeMap_.insert( "item", 0); - typeNodeMap_.insert( "jsdict", 0); - typeNodeMap_.insert( "jsobject", 0); - typeNodeMap_.insert( "key", 0); - typeNodeMap_.insert( "keysequence", 0); - typeNodeMap_.insert( "listViewClicked", 0); - typeNodeMap_.insert( "loadRequest", 0); - typeNodeMap_.insert( "locale", 0); - typeNodeMap_.insert( "location", 0); - typeNodeMap_.insert( "long", 0); - typeNodeMap_.insert( "message", 0); - typeNodeMap_.insert( "messageReceived", 0); - typeNodeMap_.insert( "mode", 0); - typeNodeMap_.insert( "month", 0); - typeNodeMap_.insert( "name", 0); - typeNodeMap_.insert( "number", 0); - typeNodeMap_.insert( "object", 0); - typeNodeMap_.insert( "offset", 0); - typeNodeMap_.insert( "ok", 0); - typeNodeMap_.insert( "openCamera", 0); - typeNodeMap_.insert( "openImage", 0); - typeNodeMap_.insert( "openVideo", 0); - typeNodeMap_.insert( "padding", 0); - typeNodeMap_.insert( "parent", 0); - typeNodeMap_.insert( "path", 0); - typeNodeMap_.insert( "photoModeSelected", 0); - typeNodeMap_.insert( "position", 0); - typeNodeMap_.insert( "precision", 0); - typeNodeMap_.insert( "presetClicked", 0); - typeNodeMap_.insert( "preview", 0); - typeNodeMap_.insert( "previewSelected", 0); - typeNodeMap_.insert( "progress", 0); - typeNodeMap_.insert( "puzzleLost", 0); - typeNodeMap_.insert( "qmlSignal", 0); - typeNodeMap_.insert( "rectangle", 0); - typeNodeMap_.insert( "request", 0); - typeNodeMap_.insert( "requestId", 0); - typeNodeMap_.insert( "section", 0); - typeNodeMap_.insert( "selected", 0); - typeNodeMap_.insert( "send", 0); - typeNodeMap_.insert( "settingsClicked", 0); - typeNodeMap_.insert( "shoe", 0); - typeNodeMap_.insert( "short", 0); - typeNodeMap_.insert( "signed", 0); - typeNodeMap_.insert( "sizeChanged", 0); - typeNodeMap_.insert( "size_t", 0); - typeNodeMap_.insert( "sockaddr", 0); - typeNodeMap_.insert( "someOtherSignal", 0); - typeNodeMap_.insert( "sourceSize", 0); - typeNodeMap_.insert( "startButtonClicked", 0); - typeNodeMap_.insert( "state", 0); - typeNodeMap_.insert( "std::initializer_list", 0); - typeNodeMap_.insert( "std::list", 0); - typeNodeMap_.insert( "std::map", 0); - typeNodeMap_.insert( "std::pair", 0); - typeNodeMap_.insert( "std::string", 0); - typeNodeMap_.insert( "std::vector", 0); - typeNodeMap_.insert( "stringlist", 0); - typeNodeMap_.insert( "swapPlayers", 0); - typeNodeMap_.insert( "symbol", 0); - typeNodeMap_.insert( "t", 0); - typeNodeMap_.insert( "T", 0); - typeNodeMap_.insert( "tagChanged", 0); - typeNodeMap_.insert( "timeString", 0); - typeNodeMap_.insert( "timeout", 0); - typeNodeMap_.insert( "to", 0); - typeNodeMap_.insert( "toggled", 0); - typeNodeMap_.insert( "type", 0); - typeNodeMap_.insert( "unsigned", 0); - typeNodeMap_.insert( "urllist", 0); - typeNodeMap_.insert( "va_list", 0); - typeNodeMap_.insert( "value", 0); - typeNodeMap_.insert( "valueEmitted", 0); - typeNodeMap_.insert( "videoFramePainted", 0); - typeNodeMap_.insert( "videoModeSelected", 0); - typeNodeMap_.insert( "videoRecorder", 0); - typeNodeMap_.insert( "void", 0); - typeNodeMap_.insert( "volatile", 0); - typeNodeMap_.insert( "wchar_t", 0); - typeNodeMap_.insert( "x", 0); - typeNodeMap_.insert( "y", 0); - typeNodeMap_.insert( "zoom", 0); - typeNodeMap_.insert( "zoomTo", 0); + typeNodeMap_.insert( "accepted", nullptr); + typeNodeMap_.insert( "actionPerformed", nullptr); + typeNodeMap_.insert( "activated", nullptr); + typeNodeMap_.insert( "alias", nullptr); + typeNodeMap_.insert( "anchors", nullptr); + typeNodeMap_.insert( "any", nullptr); + typeNodeMap_.insert( "array", nullptr); + typeNodeMap_.insert( "autoSearch", nullptr); + typeNodeMap_.insert( "axis", nullptr); + typeNodeMap_.insert( "backClicked", nullptr); + typeNodeMap_.insert( "boomTime", nullptr); + typeNodeMap_.insert( "border", nullptr); + typeNodeMap_.insert( "buttonClicked", nullptr); + typeNodeMap_.insert( "callback", nullptr); + typeNodeMap_.insert( "char", nullptr); + typeNodeMap_.insert( "clicked", nullptr); + typeNodeMap_.insert( "close", nullptr); + typeNodeMap_.insert( "closed", nullptr); + typeNodeMap_.insert( "cond", nullptr); + typeNodeMap_.insert( "data", nullptr); + typeNodeMap_.insert( "dataReady", nullptr); + typeNodeMap_.insert( "dateString", nullptr); + typeNodeMap_.insert( "dateTimeString", nullptr); + typeNodeMap_.insert( "datetime", nullptr); + typeNodeMap_.insert( "day", nullptr); + typeNodeMap_.insert( "deactivated", nullptr); + typeNodeMap_.insert( "drag", nullptr); + typeNodeMap_.insert( "easing", nullptr); + typeNodeMap_.insert( "error", nullptr); + typeNodeMap_.insert( "exposure", nullptr); + typeNodeMap_.insert( "fatalError", nullptr); + typeNodeMap_.insert( "fileSelected", nullptr); + typeNodeMap_.insert( "flags", nullptr); + typeNodeMap_.insert( "float", nullptr); + typeNodeMap_.insert( "focus", nullptr); + typeNodeMap_.insert( "focusZone", nullptr); + typeNodeMap_.insert( "format", nullptr); + typeNodeMap_.insert( "framePainted", nullptr); + typeNodeMap_.insert( "from", nullptr); + typeNodeMap_.insert( "frontClicked", nullptr); + typeNodeMap_.insert( "function", nullptr); + typeNodeMap_.insert( "hasOpened", nullptr); + typeNodeMap_.insert( "hovered", nullptr); + typeNodeMap_.insert( "hoveredTitle", nullptr); + typeNodeMap_.insert( "hoveredUrl", nullptr); + typeNodeMap_.insert( "imageCapture", nullptr); + typeNodeMap_.insert( "imageProcessing", nullptr); + typeNodeMap_.insert( "index", nullptr); + typeNodeMap_.insert( "initialized", nullptr); + typeNodeMap_.insert( "isLoaded", nullptr); + typeNodeMap_.insert( "item", nullptr); + typeNodeMap_.insert( "jsdict", nullptr); + typeNodeMap_.insert( "jsobject", nullptr); + typeNodeMap_.insert( "key", nullptr); + typeNodeMap_.insert( "keysequence", nullptr); + typeNodeMap_.insert( "listViewClicked", nullptr); + typeNodeMap_.insert( "loadRequest", nullptr); + typeNodeMap_.insert( "locale", nullptr); + typeNodeMap_.insert( "location", nullptr); + typeNodeMap_.insert( "long", nullptr); + typeNodeMap_.insert( "message", nullptr); + typeNodeMap_.insert( "messageReceived", nullptr); + typeNodeMap_.insert( "mode", nullptr); + typeNodeMap_.insert( "month", nullptr); + typeNodeMap_.insert( "name", nullptr); + typeNodeMap_.insert( "number", nullptr); + typeNodeMap_.insert( "object", nullptr); + typeNodeMap_.insert( "offset", nullptr); + typeNodeMap_.insert( "ok", nullptr); + typeNodeMap_.insert( "openCamera", nullptr); + typeNodeMap_.insert( "openImage", nullptr); + typeNodeMap_.insert( "openVideo", nullptr); + typeNodeMap_.insert( "padding", nullptr); + typeNodeMap_.insert( "parent", nullptr); + typeNodeMap_.insert( "path", nullptr); + typeNodeMap_.insert( "photoModeSelected", nullptr); + typeNodeMap_.insert( "position", nullptr); + typeNodeMap_.insert( "precision", nullptr); + typeNodeMap_.insert( "presetClicked", nullptr); + typeNodeMap_.insert( "preview", nullptr); + typeNodeMap_.insert( "previewSelected", nullptr); + typeNodeMap_.insert( "progress", nullptr); + typeNodeMap_.insert( "puzzleLost", nullptr); + typeNodeMap_.insert( "qmlSignal", nullptr); + typeNodeMap_.insert( "rectangle", nullptr); + typeNodeMap_.insert( "request", nullptr); + typeNodeMap_.insert( "requestId", nullptr); + typeNodeMap_.insert( "section", nullptr); + typeNodeMap_.insert( "selected", nullptr); + typeNodeMap_.insert( "send", nullptr); + typeNodeMap_.insert( "settingsClicked", nullptr); + typeNodeMap_.insert( "shoe", nullptr); + typeNodeMap_.insert( "short", nullptr); + typeNodeMap_.insert( "signed", nullptr); + typeNodeMap_.insert( "sizeChanged", nullptr); + typeNodeMap_.insert( "size_t", nullptr); + typeNodeMap_.insert( "sockaddr", nullptr); + typeNodeMap_.insert( "someOtherSignal", nullptr); + typeNodeMap_.insert( "sourceSize", nullptr); + typeNodeMap_.insert( "startButtonClicked", nullptr); + typeNodeMap_.insert( "state", nullptr); + typeNodeMap_.insert( "std::initializer_list", nullptr); + typeNodeMap_.insert( "std::list", nullptr); + typeNodeMap_.insert( "std::map", nullptr); + typeNodeMap_.insert( "std::pair", nullptr); + typeNodeMap_.insert( "std::string", nullptr); + typeNodeMap_.insert( "std::vector", nullptr); + typeNodeMap_.insert( "stringlist", nullptr); + typeNodeMap_.insert( "swapPlayers", nullptr); + typeNodeMap_.insert( "symbol", nullptr); + typeNodeMap_.insert( "t", nullptr); + typeNodeMap_.insert( "T", nullptr); + typeNodeMap_.insert( "tagChanged", nullptr); + typeNodeMap_.insert( "timeString", nullptr); + typeNodeMap_.insert( "timeout", nullptr); + typeNodeMap_.insert( "to", nullptr); + typeNodeMap_.insert( "toggled", nullptr); + typeNodeMap_.insert( "type", nullptr); + typeNodeMap_.insert( "unsigned", nullptr); + typeNodeMap_.insert( "urllist", nullptr); + typeNodeMap_.insert( "va_list", nullptr); + typeNodeMap_.insert( "value", nullptr); + typeNodeMap_.insert( "valueEmitted", nullptr); + typeNodeMap_.insert( "videoFramePainted", nullptr); + typeNodeMap_.insert( "videoModeSelected", nullptr); + typeNodeMap_.insert( "videoRecorder", nullptr); + typeNodeMap_.insert( "void", nullptr); + typeNodeMap_.insert( "volatile", nullptr); + typeNodeMap_.insert( "wchar_t", nullptr); + typeNodeMap_.insert( "x", nullptr); + typeNodeMap_.insert( "y", nullptr); + typeNodeMap_.insert( "zoom", nullptr); + typeNodeMap_.insert( "zoomTo", nullptr); } /*! \fn NamespaceNode* QDocDatabase::primaryTreeRoot() @@ -778,7 +778,7 @@ QmlTypeNode* QDocDatabase::findQmlType(const QString& name) QmlTypeNode* qcn = forest_.lookupQmlType(name); if (qcn) return qcn; - return 0; + return nullptr; } /*! @@ -802,7 +802,7 @@ QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name) Node* n = forest_.findNodeByNameAndType(path, &Node::isQmlType); if (n && (n->isQmlType() || n->isJsType())) return static_cast<QmlTypeNode*>(n); - return 0; + return nullptr; } /*! @@ -826,7 +826,7 @@ Aggregate* QDocDatabase::findQmlBasicType(const QString& qmid, const QString& na Node* n = forest_.findNodeByNameAndType(path, &Node::isQmlBasicType); if (n && n->isQmlBasicType()) return static_cast<Aggregate*>(n); - return 0; + return nullptr; } /*! @@ -852,7 +852,7 @@ QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& n return qcn; } } - return 0; + return nullptr; } /*! @@ -1175,8 +1175,8 @@ void QDocDatabase::resolveNamespaces() } QList<QString> keys = namespaceMultimap.uniqueKeys(); foreach (const QString &s, keys) { - NamespaceNode* ns = 0; - NamespaceNode* somewhere = 0; + NamespaceNode* ns = nullptr; + NamespaceNode* somewhere = nullptr; NodeList namespaces = namespaceMultimap.values(s); int count = namespaceMultimap.remove(s); if (count > 0) { @@ -1186,7 +1186,7 @@ void QDocDatabase::resolveNamespaces() break; else if (ns->wasDocumented()) somewhere = ns; - ns = 0; + ns = nullptr; } if (ns) { foreach (Node *n, namespaces) { @@ -1198,7 +1198,7 @@ void QDocDatabase::resolveNamespaces() } } - } else if (somewhere == 0) { + } else if (somewhere == nullptr) { foreach (Node *n, namespaces) { NamespaceNode* NS = static_cast<NamespaceNode*>(n); NS->reportDocumentedChildrenInUndocumentedNamespace(); @@ -1234,7 +1234,7 @@ void QDocDatabase::resolveNamespaces() } } } - if (ns == 0) + if (ns == nullptr) ns = static_cast<NamespaceNode*>(namespaces.at(0)); namespaceIndex_.insert(ns->name(), ns); } @@ -1333,7 +1333,7 @@ const Node* QDocDatabase::findTypeNode(const QString& type, const Node* relative */ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* relative) { - const Node* node = 0; + const Node* node = nullptr; if (target.isEmpty()) node = relative; else if (target.endsWith(".html")) @@ -1345,7 +1345,7 @@ const Node* QDocDatabase::findNodeForTarget(const QString& target, const Node* r const Node* n = t->findNode(path, relative, flags, Node::DontCare); if (n) return n; - relative = 0; + relative = nullptr; } node = findPageNodeByTitle(target); } @@ -1405,8 +1405,8 @@ void QDocDatabase::generateIndex(const QString &fileName, const QString &url, co Node* QDocDatabase::findNodeInOpenNamespace(QStringList& path, bool (Node::*isMatch) () const) { if (path.isEmpty()) - return 0; - Node* n = 0; + return nullptr; + Node* n = nullptr; if (!openNamespaces_.isEmpty()) { foreach (const QString& t, openNamespaces_) { QStringList p; @@ -1450,7 +1450,7 @@ void QDocDatabase::mergeCollections(Node::NodeType type, CNMap& cnm, const Node* QStringList keys = cnmm.uniqueKeys(); foreach (const QString &key, keys) { QList<CollectionNode*> values = cnmm.values(key); - CollectionNode* n = 0; + CollectionNode* n = nullptr; foreach (CollectionNode* v, values) { if (v && v->wasSeen() && (v != relative)) { n = v; @@ -1518,13 +1518,13 @@ void QDocDatabase::mergeCollections(CollectionNode* c) */ const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, QString& ref) { - const Node* node = 0; + const Node* node = nullptr; Atom* atom = const_cast<Atom*>(a); QStringList targetPath = atom->string().split(QLatin1Char('#')); QString first = targetPath.first().trimmed(); - Tree* domain = 0; + Tree* domain = nullptr; Node::Genus genus = Node::DontCare; // Reserved for future use //Node::NodeType goal = Node::NoType; @@ -1563,7 +1563,7 @@ const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, Q if (!targetPath.isEmpty()) target = targetPath.takeFirst(); if (relative && relative->tree()->physicalModuleName() != domain->physicalModuleName()) - relative = 0; + relative = nullptr; return domain->findNodeForTarget(nodePath, target, relative, flags, genus, ref); } } @@ -1583,7 +1583,7 @@ const Node* QDocDatabase::findNodeForAtom(const Atom* a, const Node* relative, Q if (!targetPath.isEmpty()) { ref = node->root()->tree()->getRef(targetPath.first(), node); if (ref.isEmpty()) - node = 0; + node = nullptr; } } return node; diff --git a/src/qdoc/qdocdatabase.h b/src/qdoc/qdocdatabase.h index 2b4d43ac0..e8d5153fe 100644 --- a/src/qdoc/qdocdatabase.h +++ b/src/qdoc/qdocdatabase.h @@ -56,7 +56,7 @@ class QDocForest private: friend class QDocDatabase; QDocForest(QDocDatabase* qdb) - : qdb_(qdb), primaryTree_(0), currentIndex_(0) { } + : qdb_(qdb), primaryTree_(nullptr), currentIndex_(0) { } ~QDocForest(); NamespaceNode* firstRoot(); @@ -68,7 +68,7 @@ class QDocForest QStringList keys() { return forest_.keys(); } - NamespaceNode* primaryTreeRoot() { return (primaryTree_ ? primaryTree_->root() : 0); } + NamespaceNode* primaryTreeRoot() { return (primaryTree_ ? primaryTree_->root() : nullptr); } bool isEmpty() { return searchOrder().isEmpty(); } bool done() { return (currentIndex_ >= searchOrder().size()); } const QVector<Tree*>& searchOrder(); @@ -90,9 +90,9 @@ class QDocForest const Node* n = t->findNode(path, relative, findFlags, genus); if (n) return n; - relative = 0; + relative = nullptr; } - return 0; + return nullptr; } Node* findNodeByNameAndType(const QStringList& path, bool (Node::*isMatch) () const) { @@ -101,7 +101,7 @@ class QDocForest if (n) return n; } - return 0; + return nullptr; } ClassNode* findClassNode(const QStringList& path) { @@ -110,7 +110,7 @@ class QDocForest if (n) return n; } - return 0; + return nullptr; } Node* findNodeForInclude(const QStringList& path) { @@ -119,7 +119,7 @@ class QDocForest if (n) return n; } - return 0; + return nullptr; } const FunctionNode *findFunctionNode(const QStringList &path, @@ -140,9 +140,9 @@ class QDocForest const Node* n = t->findNode(path, relative, flags, genus); if (n) return n; - relative = 0; + relative = nullptr; } - return 0; + return nullptr; } const PageNode* findPageNodeByTitle(const QString& title) @@ -152,7 +152,7 @@ class QDocForest if (n) return n; } - return 0; + return nullptr; } const CollectionNode* getCollectionNode(const QString& name, Node::NodeType type) @@ -162,7 +162,7 @@ class QDocForest if (cn) return cn; } - return 0; + return nullptr; } QmlTypeNode* lookupQmlType(const QString& name) @@ -172,7 +172,7 @@ class QDocForest if (qcn) return qcn; } - return 0; + return nullptr; } Aggregate* lookupQmlBasicType(const QString& name) @@ -182,7 +182,7 @@ class QDocForest if (a) return a; } - return 0; + return nullptr; } void clearSearchOrder() { searchOrder_.clear(); } void clearLinkCounts() diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index 47e89d651..83057e620 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -50,7 +50,7 @@ enum QDocAttr { QDocAttrExternalPage }; -static Node* root_ = 0; +static Node* root_ = nullptr; /*! \class QDocIndexFiles @@ -58,13 +58,13 @@ static Node* root_ = 0; This class handles qdoc index files. */ -QDocIndexFiles* QDocIndexFiles::qdocIndexFiles_ = NULL; +QDocIndexFiles* QDocIndexFiles::qdocIndexFiles_ = nullptr; /*! Constructs the singleton QDocIndexFiles. */ QDocIndexFiles::QDocIndexFiles() - : gen_( 0 ) + : gen_(nullptr) { qdb_ = QDocDatabase::qdocDB(); } @@ -74,8 +74,8 @@ QDocIndexFiles::QDocIndexFiles() */ QDocIndexFiles::~QDocIndexFiles() { - qdb_ = 0; - gen_ = 0; + qdb_ = nullptr; + gen_ = nullptr; } /*! @@ -96,7 +96,7 @@ void QDocIndexFiles::destroyQDocIndexFiles() { if (qdocIndexFiles_) { delete qdocIndexFiles_; - qdocIndexFiles_ = 0; + qdocIndexFiles_ = nullptr; } } @@ -183,7 +183,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader, QString href = attributes.value(QLatin1String("href")).toString(); Node* node; Location location; - Aggregate* parent = 0; + Aggregate* parent = nullptr; bool hasReadChildren = false; @@ -421,7 +421,7 @@ void QDocIndexFiles::readIndexSection(QXmlStreamReader& reader, goto done; } } - PageNode* pn = 0; + PageNode* pn = nullptr; if (subtype == QDocAttrExample) pn = new ExampleNode(parent, name); else if (subtype == QDocAttrExternalPage) diff --git a/src/qdoc/qdoctagfiles.cpp b/src/qdoc/qdoctagfiles.cpp index 136ca87d7..2c934193b 100644 --- a/src/qdoc/qdoctagfiles.cpp +++ b/src/qdoc/qdoctagfiles.cpp @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE This class handles the generation of the qdoc tag file. */ -QDocTagFiles* QDocTagFiles::qdocTagFiles_ = NULL; +QDocTagFiles* QDocTagFiles::qdocTagFiles_ = nullptr; /*! Constructs the singleton. \a qdb is the pointer to the @@ -64,7 +64,7 @@ QDocTagFiles::QDocTagFiles() */ QDocTagFiles::~QDocTagFiles() { - qdb_ = 0; + qdb_ = nullptr; } /*! @@ -85,7 +85,7 @@ void QDocTagFiles::destroyQDocTagFiles() { if (qdocTagFiles_) { delete qdocTagFiles_; - qdocTagFiles_ = 0; + qdocTagFiles_ = nullptr; } } diff --git a/src/qdoc/qmlcodemarker.cpp b/src/qdoc/qmlcodemarker.cpp index 9687c33b3..22c8c3edd 100644 --- a/src/qdoc/qmlcodemarker.cpp +++ b/src/qdoc/qmlcodemarker.cpp @@ -151,7 +151,7 @@ QString QmlCodeMarker::markedUpIncludes(const QStringList& includes) ++inc; } Location location; - return addMarkUp(code, 0, location); + return addMarkUp(code, nullptr, location); } QString QmlCodeMarker::functionBeginRegExp(const QString& funcName) @@ -228,7 +228,7 @@ QList<QQmlJS::AST::SourceLocation> QmlCodeMarker::extractPragmas(QString &script const QString library(QLatin1String("library")); QList<QQmlJS::AST::SourceLocation> removed; - QQmlJS::Lexer l(0); + QQmlJS::Lexer l(nullptr); l.setCode(script, 0); int token = l.lex(); diff --git a/src/qdoc/qmlcodeparser.cpp b/src/qdoc/qmlcodeparser.cpp index 58939c9c3..cbb649b48 100644 --- a/src/qdoc/qmlcodeparser.cpp +++ b/src/qdoc/qmlcodeparser.cpp @@ -49,8 +49,8 @@ QT_BEGIN_NAMESPACE */ QmlCodeParser::QmlCodeParser() #ifndef QT_NO_DECLARATIVE - : lexer( 0 ), - parser( 0 ) + : lexer(nullptr), + parser(nullptr) #endif { } @@ -211,7 +211,7 @@ void QmlCodeParser::extractPragmas(QString &script) const QString pragma(QLatin1String("pragma")); const QString library(QLatin1String("library")); - QQmlJS::Lexer l(0); + QQmlJS::Lexer l(nullptr); l.setCode(script, 0); int token = l.lex(); diff --git a/src/qdoc/qmlvisitor.cpp b/src/qdoc/qmlvisitor.cpp index 1b22d9d38..901cde98a 100644 --- a/src/qdoc/qmlvisitor.cpp +++ b/src/qdoc/qmlvisitor.cpp @@ -179,7 +179,7 @@ bool QmlDocVisitor::applyDocumentation(QQmlJS::AST::SourceLocation location, Nod else { bool isAttached = topic.contains(QLatin1String("attached")); QmlPropertyNode* n = parent->hasQmlProperty(qpa.name_, isAttached); - if (n == 0) + if (n == nullptr) n = new QmlPropertyNode(parent, qpa.name_, qpa.type_, isAttached); n->setLocation(doc.location()); n->setDoc(doc); @@ -305,7 +305,7 @@ bool QmlSignatureParser::matchTypeAndName(CodeChunk *type, QString *var) */ type->appendHotspot(); - if ((var != 0) && match(Tok_Ident)) + if ((var != nullptr) && match(Tok_Ident)) *var = previousLexeme(); if (tok_ == Tok_LeftBracket) { @@ -354,7 +354,7 @@ bool QmlSignatureParser::matchFunctionDecl() int firstBlank = signature_.indexOf(QChar(' ')); int leftParen = signature_.indexOf(QChar('(')); if ((firstBlank > 0) && (leftParen - firstBlank) > 1) { - if (!matchTypeAndName(&returnType, 0)) + if (!matchTypeAndName(&returnType, nullptr)) return false; } @@ -525,7 +525,7 @@ QString QmlDocVisitor::getFullyQualifiedId(QQmlJS::AST::UiQualifiedId *id) if (id) { result = id->name.toString(); id = id->next; - while (id != 0) { + while (id != nullptr) { result += QChar('.') + id->name.toString(); id = id->next; } @@ -680,7 +680,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member) if (qmlType) { QString name = member->name.toString(); QmlPropertyNode* qmlPropNode = qmlType->hasQmlProperty(name); - if (qmlPropNode == 0) + if (qmlPropNode == nullptr) qmlPropNode = new QmlPropertyNode(qmlType, name, type, false); qmlPropNode->markReadOnly(member->isReadonlyMember); if (member->isDefaultMember) diff --git a/src/qdoc/sections.cpp b/src/qdoc/sections.cpp index 28f9878b8..42cc8e8d9 100644 --- a/src/qdoc/sections.cpp +++ b/src/qdoc/sections.cpp @@ -56,7 +56,7 @@ QVector<Section> Sections::stdQmlTypeDetailsSections_(7, Section(Section::Detail The constructor used when the \a style and \a status must be provided. */ -Section::Section(Style style, Status status) : style_(style), status_(status), aggregate_(0) +Section::Section(Style style, Status status) : style_(style), status_(status), aggregate_(nullptr) { //members_.reserve(100); //obsoleteMembers_.reserve(50); @@ -86,7 +86,7 @@ void Section::clear() if (!classMapList_.isEmpty()) { for (int i = 0; i < classMapList_.size(); i++) { ClassMap* cm = classMapList_[i]; - classMapList_[i] = 0; + classMapList_[i] = nullptr; delete cm; } classMapList_.clear(); @@ -100,12 +100,12 @@ void Section::clear() if (!classKeysNodesList_.isEmpty()) { for (int i = 0; i < classKeysNodesList_.size(); i++) { ClassKeysNodes* ckn = classKeysNodesList_[i]; - classKeysNodesList_[i] = 0; + classKeysNodesList_[i] = nullptr; delete ckn; } classKeysNodesList_.clear(); } - aggregate_ = 0; + aggregate_ = nullptr; } /*! @@ -116,7 +116,7 @@ void Section::clear() QString Section::sortName(const Node *node, const QString* name) { QString nodeName; - if (name != 0) + if (name != nullptr) nodeName = *name; else nodeName = node->name(); @@ -353,7 +353,7 @@ Sections::Sections(Aggregate *aggregate) : aggregate_(aggregate) This constructor builds a vector of sections from the \e since node map, \a nsmap */ -Sections::Sections(const NodeMultiMap& nsmap) : aggregate_(0) +Sections::Sections(const NodeMultiMap& nsmap) : aggregate_(nullptr) { initSections(); if (nsmap.isEmpty()) @@ -468,7 +468,7 @@ Sections::~Sections() allMembersSection().clear(); break; } - aggregate_ = 0; + aggregate_ = nullptr; } else { clear(sinceSections()); @@ -681,7 +681,7 @@ void Sections::stdRefPageSwitch(SectionVector &v, Node *n) */ void Sections::buildStdRefPageSections() { - const NamespaceNode* ns = 0; + const NamespaceNode* ns = nullptr; bool documentAll = true; // document all the children if (aggregate_->isNamespace()) { ns = static_cast<const NamespaceNode*>(aggregate_); @@ -990,7 +990,7 @@ void Sections::buildStdCppClassRefPageSections() */ void Sections::buildStdQmlTypeRefPageSections() { - ClassMap* classMap = 0; + ClassMap* classMap = nullptr; SectionVector &sv = stdQmlTypeSummarySections(); SectionVector &dv = stdQmlTypeDetailsSections(); Section &allMembers = allMembersSection(); @@ -1015,17 +1015,17 @@ void Sections::buildStdQmlTypeRefPageSections() qDebug() << "qdoc internal error: circular type definition." << "QML type" << qtn->name() << "can't be its own base type"; - qtn = 0; + qtn = nullptr; break; } qtn = static_cast<QmlTypeNode*>(qtn->qmlBaseNode()); - if (qtn == 0) + if (qtn == nullptr) break; if (!qtn->isAbstract()) break; } - while (qtn != 0) { + while (qtn != nullptr) { if (!qtn->isAbstract() || !classMap) classMap = allMembers.newClassMap(qtn); NodeList::ConstIterator c = qtn->constBegin(); @@ -1042,7 +1042,7 @@ void Sections::buildStdQmlTypeRefPageSections() qDebug() << "qdoc internal error: circular type definition." << "QML type" << qtn->name() << "can't be its own base type"; - qtn = 0; + qtn = nullptr; break; } qtn = static_cast<QmlTypeNode*>(qtn->qmlBaseNode()); @@ -1060,7 +1060,7 @@ void Sections::buildStdQmlTypeRefPageSections() */ bool Sections::hasObsoleteMembers(SectionPtrVector *summary_spv, SectionPtrVector *details_spv) const { - const SectionVector *sv = 0; + const SectionVector *sv = nullptr; if (aggregate_->isClassNode()) sv = &stdCppClassSummarySections(); else if (aggregate_->isQmlType() || aggregate_->isQmlBasicType()) diff --git a/src/qdoc/sections.h b/src/qdoc/sections.h index 576096e0f..d3af83736 100644 --- a/src/qdoc/sections.h +++ b/src/qdoc/sections.h @@ -49,7 +49,7 @@ class Section enum Status { Obsolete, Active }; public: - Section() : style_(Details), status_(Active), aggregate_(0) { } + Section() : style_(Details), status_(Active), aggregate_(nullptr) { } Section(Style style, Status status); ~Section(); @@ -108,7 +108,7 @@ class Section void setAggregate(Aggregate *t) { aggregate_ = t; } private: - QString sortName(const Node *node, const QString* name = 0); + QString sortName(const Node *node, const QString* name = nullptr); private: Style style_; diff --git a/src/qdoc/text.cpp b/src/qdoc/text.cpp index 7cd0b1a47..0560d45eb 100644 --- a/src/qdoc/text.cpp +++ b/src/qdoc/text.cpp @@ -37,18 +37,18 @@ QT_BEGIN_NAMESPACE Text::Text() - : first(0), last(0) + : first(nullptr), last(nullptr) { } Text::Text(const QString &str) - : first(0), last(0) + : first(nullptr), last(nullptr) { operator<<(str); } Text::Text(const Text& text) - : first(0), last(0) + : first(nullptr), last(nullptr) { operator=(text); } @@ -80,7 +80,7 @@ Text& Text::operator<<(const QString& string) Text& Text::operator<<(const Atom& atom) { if (atom.count() < 2) { - if (first == 0) { + if (first == nullptr) { first = new Atom(atom.type(), atom.string()); last = first; } @@ -88,7 +88,7 @@ Text& Text::operator<<(const Atom& atom) last = new Atom(last, atom.type(), atom.string()); } else { - if (first == 0) { + if (first == nullptr) { first = new Atom(atom.type(), atom.string(), atom.string(1)); last = first; } @@ -105,7 +105,7 @@ Text& Text::operator<<(const Atom& atom) */ Text& Text::operator<<(const LinkAtom& atom) { - if (first == 0) { + if (first == nullptr) { first = new LinkAtom(atom); last = first; } @@ -117,7 +117,7 @@ Text& Text::operator<<(const LinkAtom& atom) Text& Text::operator<<(const Text& text) { const Atom* atom = text.firstAtom(); - while (atom != 0) { + while (atom != nullptr) { operator<<(*atom); atom = atom->next(); } @@ -126,9 +126,9 @@ Text& Text::operator<<(const Text& text) void Text::stripFirstAtom() { - if (first != 0) { + if (first != nullptr) { if (first == last) - last = 0; + last = nullptr; Atom* oldFirst = first; first = first->next(); delete oldFirst; @@ -137,16 +137,16 @@ void Text::stripFirstAtom() void Text::stripLastAtom() { - if (last != 0) { + if (last != nullptr) { Atom* oldLast = last; if (first == last) { - first = 0; - last = 0; + first = nullptr; + last = nullptr; } else { last = first; while (last->next() != oldLast) last = last->next(); - last->setNext(0); + last->setNext(nullptr); } delete oldLast; } @@ -161,7 +161,7 @@ QString Text::toString() const { QString str; const Atom* atom = firstAtom(); - while (atom != 0) { + while (atom != nullptr) { if (atom->type() == Atom::String || atom->type() == Atom::AutoLink || atom->type() == Atom::C) @@ -177,7 +177,7 @@ QString Text::toString() const bool Text::contains(const QString &str) const { const Atom* atom = firstAtom(); - while (atom != 0) { + while (atom != nullptr) { if (atom->type() == Atom::String || atom->type() == Atom::AutoLink || atom->type() == Atom::C) @@ -193,18 +193,18 @@ Text Text::subText(Atom::AtomType left, Atom::AtomType right, const Atom* from, const Atom* begin = from ? from : firstAtom(); const Atom* end; - while (begin != 0 && begin->type() != left) + while (begin != nullptr && begin->type() != left) begin = begin->next(); - if (begin != 0) { + if (begin != nullptr) { if (!inclusive) begin = begin->next(); } end = begin; - while (end != 0 && end->type() != right) + while (end != nullptr && end->type() != right) end = end->next(); - if (end == 0) - begin = 0; + if (end == nullptr) + begin = nullptr; else if (inclusive) end = end->next(); return subText(begin, end); @@ -212,18 +212,18 @@ Text Text::subText(Atom::AtomType left, Atom::AtomType right, const Atom* from, Text Text::sectionHeading(const Atom* sectionLeft) { - if (sectionLeft != 0) { + if (sectionLeft != nullptr) { const Atom* begin = sectionLeft; - while (begin != 0 && begin->type() != Atom::SectionHeadingLeft) + while (begin != nullptr && begin->type() != Atom::SectionHeadingLeft) begin = begin->next(); - if (begin != 0) + if (begin != nullptr) begin = begin->next(); const Atom* end = begin; - while (end != 0 && end->type() != Atom::SectionHeadingRight) + while (end != nullptr && end->type() != Atom::SectionHeadingRight) end = end->next(); - if (end != 0) + if (end != nullptr) return subText(begin, end); } return Text(); @@ -231,22 +231,22 @@ Text Text::sectionHeading(const Atom* sectionLeft) const Atom* Text::sectionHeadingAtom(const Atom* sectionLeft) { - if (sectionLeft != 0) { + if (sectionLeft != nullptr) { const Atom* begin = sectionLeft; - while (begin != 0 && begin->type() != Atom::SectionHeadingLeft) + while (begin != nullptr && begin->type() != Atom::SectionHeadingLeft) begin = begin->next(); - if (begin != 0) + if (begin != nullptr) begin = begin->next(); return begin; } - return 0; + return nullptr; } void Text::dump() const { const Atom* atom = firstAtom(); - while (atom != 0) { + while (atom != nullptr) { QString str = atom->string(); str.replace("\\", "\\\\"); str.replace("\"", "\\\""); @@ -262,7 +262,7 @@ void Text::dump() const Text Text::subText(const Atom* begin, const Atom* end) { Text text; - if (begin != 0) { + if (begin != nullptr) { while (begin != end) { text << *begin; begin = begin->next(); @@ -273,13 +273,13 @@ Text Text::subText(const Atom* begin, const Atom* end) void Text::clear() { - while (first != 0) { + while (first != nullptr) { Atom* atom = first; first = first->next(); delete atom; } - first = 0; - last = 0; + first = nullptr; + last = nullptr; } int Text::compare(const Text &text1, const Text &text2) diff --git a/src/qdoc/text.h b/src/qdoc/text.h index e1f7bd957..d72d38469 100644 --- a/src/qdoc/text.h +++ b/src/qdoc/text.h @@ -57,16 +57,16 @@ public: void stripFirstAtom(); void stripLastAtom(); - bool isEmpty() const { return first == 0; } + bool isEmpty() const { return first == nullptr; } bool contains(const QString& str) const; QString toString() const; const Atom *firstAtom() const { return first; } const Atom *lastAtom() const { return last; } - Text subText(Atom::AtomType left, Atom::AtomType right, const Atom *from = 0, bool inclusive = false) const; + Text subText(Atom::AtomType left, Atom::AtomType right, const Atom *from = nullptr, bool inclusive = false) const; void dump() const; void clear(); - static Text subText(const Atom *begin, const Atom *end = 0); + static Text subText(const Atom *begin, const Atom *end = nullptr); static Text sectionHeading(const Atom *sectionBegin); static const Atom *sectionHeadingAtom(const Atom *sectionLeft); static int compare(const Text &text1, const Text &text2); diff --git a/src/qdoc/tokenizer.cpp b/src/qdoc/tokenizer.cpp index 5f4f7cb80..d36e7bb18 100644 --- a/src/qdoc/tokenizer.cpp +++ b/src/qdoc/tokenizer.cpp @@ -81,17 +81,17 @@ static const char *kwords[] = { static const int KwordHashTableSize = 4096; static int kwordHashTable[KwordHashTableSize]; -static QHash<QByteArray, bool> *ignoredTokensAndDirectives = 0; +static QHash<QByteArray, bool> *ignoredTokensAndDirectives = nullptr; -static QRegExp *comment = 0; -static QRegExp *versionX = 0; -static QRegExp *definedX = 0; +static QRegExp *comment = nullptr; +static QRegExp *versionX = nullptr; +static QRegExp *definedX = nullptr; -static QRegExp *defines = 0; -static QRegExp *falsehoods = 0; +static QRegExp *defines = nullptr; +static QRegExp *falsehoods = nullptr; #ifndef QT_NO_TEXTCODEC -static QTextCodec *sourceCodec = 0; +static QTextCodec *sourceCodec = nullptr; #endif /* @@ -541,17 +541,17 @@ void Tokenizer::initialize(const Config &config) void Tokenizer::terminate() { delete comment; - comment = 0; + comment = nullptr; delete versionX; - versionX = 0; + versionX = nullptr; delete definedX; - definedX = 0; + definedX = nullptr; delete defines; - defines = 0; + defines = nullptr; delete falsehoods; - falsehoods = 0; + falsehoods = nullptr; delete ignoredTokensAndDirectives; - ignoredTokensAndDirectives = 0; + ignoredTokensAndDirectives = nullptr; } void Tokenizer::init() diff --git a/src/qdoc/tree.cpp b/src/qdoc/tree.cpp index d8ec47ced..916f48ace 100644 --- a/src/qdoc/tree.cpp +++ b/src/qdoc/tree.cpp @@ -71,8 +71,8 @@ Tree::Tree(const QString& camelCaseModuleName, QDocDatabase* qdb) camelCaseModuleName_(camelCaseModuleName), physicalModuleName_(camelCaseModuleName.toLower()), qdb_(qdb), - root_(0, QString()), - targetListMap_(0) + root_(nullptr, QString()), + targetListMap_(nullptr) { root_.setPhysicalModuleName(physicalModuleName_); root_.setTree(this); @@ -212,7 +212,7 @@ QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path) Aggregate *Tree::findRelatesNode(const QStringList &path) { Node* n = findNodeRecursive(path, 0, root(), &Node::isRelatableType); - return ((n && n->isAggregate()) ? static_cast<Aggregate*>(n) : 0); + return ((n && n->isAggregate()) ? static_cast<Aggregate*>(n) : nullptr); } /*! @@ -562,7 +562,7 @@ Node* Tree::findNodeRecursive(const QStringList& path, } } } - return 0; + return nullptr; } #endif /*! @@ -585,14 +585,14 @@ const Node* Tree::findNodeForTarget(const QStringList& path, Node::Genus genus, QString& ref) const { - const Node* node = 0; + const Node* node = nullptr; if ((genus == Node::DontCare) || (genus == Node::DOC)) { node = findPageNodeByTitle(path.at(0)); if (node) { if (!target.isEmpty()) { ref = getRef(target, node); if (ref.isEmpty()) - node = 0; + node = nullptr; } if (node) return node; @@ -604,7 +604,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path, if (!target.isEmpty()) { ref = getRef(target, node); if (ref.isEmpty()) - node = 0; + node = nullptr; } if (node) return node; @@ -633,7 +633,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path, ref = getRef(target, current); if (!ref.isEmpty()) return current; - return 0; + return nullptr; } else return current; @@ -651,7 +651,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path, current = current->parent(); path_idx = 0; } - return 0; + return nullptr; } /*! @@ -932,7 +932,7 @@ const Node* Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& ref) const { int numBestTargets = 0; - TargetRec* bestTarget = 0; + TargetRec* bestTarget = nullptr; QList<TargetRec*> bestTargetList; QString key = target; @@ -961,7 +961,7 @@ Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& r } numBestTargets = 0; - bestTarget = 0; + bestTarget = nullptr; key = Doc::canonicalTitle(target); i = nodesByTargetRef_.find(key); while (i != nodesByTargetRef_.constEnd()) { @@ -988,7 +988,7 @@ Tree::findUnambiguousTarget(const QString& target, Node::Genus genus, QString& r } ref.clear(); - return 0; + return nullptr; } /*! @@ -1023,7 +1023,7 @@ const PageNode* Tree::findPageNodeByTitle(const QString& title) const } return i.value(); } - return 0; + return nullptr; } /*! @@ -1077,7 +1077,7 @@ CNMap* Tree::getCollectionMap(Node::NodeType type) default: break; } - return 0; + return nullptr; } /*! @@ -1094,7 +1094,7 @@ CollectionNode* Tree::getCollection(const QString& name, Node::NodeType type) if (i != m->cend()) return i.value(); } - return 0; + return nullptr; } /*! @@ -1116,7 +1116,7 @@ CollectionNode* Tree::findCollection(const QString& name, Node::NodeType type) { CNMap* m = getCollectionMap(type); if (!m) // error - return 0; + return nullptr; CNMap::const_iterator i = m->constFind(name); if (i != m->cend()) return i.value(); @@ -1419,7 +1419,7 @@ QString Tree::getNewLinkTarget(const Node* locNode, incrementLinkCount(); QString target = QString("qa-target-%1").arg(-(linkCount())); TargetLoc* tloc = new TargetLoc(locNode, target, fileName, text, broken); - TargetList* tList = 0; + TargetList* tList = nullptr; TargetListMap::iterator i = targetListMap_->find(physicalModuleName); if (i == targetListMap_->end()) { tList = new TargetList; diff --git a/src/qdoc/tree.h b/src/qdoc/tree.h index abef4cca1..e8a8f261e 100644 --- a/src/qdoc/tree.h +++ b/src/qdoc/tree.h @@ -114,7 +114,7 @@ class Tree private: // The rest of the class is private. Aggregate *findAggregate(const QString &name); Node* findNodeForInclude(const QStringList& path) const; - ClassNode* findClassNode(const QStringList& path, const Node* start = 0) const; + ClassNode* findClassNode(const QStringList& path, const Node* start = nullptr) const; NamespaceNode* findNamespaceNode(const QStringList& path) const; const FunctionNode *findFunctionNode(const QStringList &path, const Parameters ¶meters, @@ -220,8 +220,8 @@ class Tree bool broken); TargetList* getTargetList(const QString& module); QStringList getTargetListKeys() { return targetListMap_->keys(); } - FunctionNode *findFunctionNodeForTag(const QString &tag, Aggregate *parent = 0); - FunctionNode *findMacroNode(const QString &t, const Aggregate *parent = 0); + FunctionNode *findFunctionNodeForTag(const QString &tag, Aggregate *parent = nullptr); + FunctionNode *findMacroNode(const QString &t, const Aggregate *parent = nullptr); private: bool treeHasBeenAnalyzed_; diff --git a/src/qdoc/webxmlgenerator.cpp b/src/qdoc/webxmlgenerator.cpp index f6a9ae916..ec6f2bd2d 100644 --- a/src/qdoc/webxmlgenerator.cpp +++ b/src/qdoc/webxmlgenerator.cpp @@ -664,7 +664,7 @@ const Atom *WebXMLGenerator::addAtomElements(QXmlStreamWriter &writer, if (atom) return atom->next(); - return 0; + return nullptr; } void WebXMLGenerator::startLink(QXmlStreamWriter &writer, const Atom *atom, diff --git a/src/qdoc/yyindent.cpp b/src/qdoc/yyindent.cpp index 1d87981f6..0f6ea4494 100644 --- a/src/qdoc/yyindent.cpp +++ b/src/qdoc/yyindent.cpp @@ -113,11 +113,11 @@ void setIndentSize( int size ) ppContinuationIndentSize = 2 * size; } -static QRegExp *literal = 0; -static QRegExp *label = 0; -static QRegExp *inlineCComment = 0; -static QRegExp *braceX = 0; -static QRegExp *iflikeKeyword = 0; +static QRegExp *literal = nullptr; +static QRegExp *label = nullptr; +static QRegExp *inlineCComment = nullptr; +static QRegExp *braceX = nullptr; +static QRegExp *iflikeKeyword = nullptr; /* Returns the first non-space character in the string t, or @@ -297,13 +297,13 @@ struct LinizerState bool pendingRightBrace; }; -static QStringList *yyProgram = 0; -static LinizerState *yyLinizerState = 0; +static QStringList *yyProgram = nullptr; +static LinizerState *yyLinizerState = nullptr; // shorthands -static const QString *yyLine = 0; -static const int *yyBraceDepth = 0; -static const bool *yyLeftBraceFollows = 0; +static const QString *yyLine = nullptr; +static const int *yyBraceDepth = nullptr; +static const bool *yyLeftBraceFollows = nullptr; /* Saves and restores the state of the global linizer. This enables |