Use nullptr in C++ code (solves #4348) (#5043)

* chore(CppParser): 0, NULL --> nullptr

* chore(Crypto): 0, NULL --> nullptr

* chore(DNSSD): 0, NULL --> nullptr

* chore(Encodings): 0, NULL --> nullptr

* chore(CppUnit): Correct indentation.

* chore(Foundation): 0, NULL --> nullptr

* chore(CMake): Always warn about wrong nullptr usage when compiling with GCC or CLang

* chore(Net): 0, NULL --> nullptr

* chore(Foundation): 0, NULL --> nullptr

* chore(Data): 0, NULL --> nullptr

* chore(macOS): 0, NULL --> nullptr

* chore(XML): 0, NULL --> nullptr

* chore(Zip): 0, NULL --> nullptr

* chore(Util): 0, NULL --> nullptr

* chore(Net/NetSSL): 0, NULL --> nullptr

* chore(Bonjour): 0, NULL --> nullptr

* chore(MongoDB, Redis): 0, NULL --> nullptr

* chore(Poco): 0, NULL --> nullptr

* chore(Win32): 0, NULL --> nullptr

* chore(CMake): Only warn about nullptr when verbose warnings are enabled.

* Potential fix for code scanning alert no. 1634: Guarded Free

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* chore(Net): Fix warning reported by gitlab.

* chore(gitlab CI): attempt to clean to gain disk space on the runner.

* chore(gitlab CI): Run build with  --parallel 4, correct docker cleanup.

---------

Co-authored-by: Aleksandar Fabijanic <aleks-f@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Matej Kenda
2025-10-30 15:20:53 +01:00
committed by GitHub
parent 3e10fb2b0f
commit 8a4a2955d5
480 changed files with 10963 additions and 10932 deletions

View File

@@ -32,14 +32,14 @@ const XMLString AbstractContainerNode::WILDCARD(toXMLString("*"));
AbstractContainerNode::AbstractContainerNode(Document* pOwnerDocument):
AbstractNode(pOwnerDocument),
_pFirstChild(0)
_pFirstChild(nullptr)
{
}
AbstractContainerNode::AbstractContainerNode(Document* pOwnerDocument, const AbstractContainerNode& node):
AbstractNode(pOwnerDocument, node),
_pFirstChild(0)
_pFirstChild(nullptr)
{
}
@@ -72,7 +72,7 @@ Node* AbstractContainerNode::lastChild() const
while (pChild->_pNext) pChild = pChild->_pNext;
return pChild;
}
return 0;
return nullptr;
}
@@ -343,7 +343,7 @@ Node* AbstractContainerNode::removeChild(Node* oldChild)
Node* AbstractContainerNode::appendChild(Node* newChild)
{
return insertBefore(newChild, 0);
return insertBefore(newChild, nullptr);
}
@@ -402,13 +402,13 @@ Node* AbstractContainerNode::getNodeByPath(const XMLString& path) const
for (unsigned long i = 0; i < length; i++)
{
XMLString::const_iterator beg = it;
const Node* pNode = findNode(beg, path.end(), pList->item(i), 0, indexBound);
const Node* pNode = findNode(beg, path.end(), pList->item(i), nullptr, indexBound);
if (pNode) return const_cast<Node*>(pNode);
}
return 0;
return nullptr;
}
}
return const_cast<Node*>(findNode(it, path.end(), this, 0, indexBound));
return const_cast<Node*>(findNode(it, path.end(), this, nullptr, indexBound));
}
@@ -448,7 +448,7 @@ Node* AbstractContainerNode::getNodeByPathNS(const XMLString& path, const NSMap&
if (pNode) return const_cast<Node*>(pNode);
}
}
return 0;
return nullptr;
}
}
return const_cast<Node*>(findNode(it, path.end(), this, &nsMap, indexBound));
@@ -540,7 +540,7 @@ const Node* AbstractContainerNode::findElement(const XMLString& name, const Node
return pNode;
pNode = pNode->nextSibling();
}
return 0;
return nullptr;
}
@@ -586,7 +586,7 @@ const Node* AbstractContainerNode::findElement(const XMLString& attr, const XMLS
const Attr* AbstractContainerNode::findAttribute(const XMLString& name, const Node* pNode, const NSMap* pNSMap)
{
const Attr* pResult(0);
const Attr* pResult(nullptr);
const Element* pElem = dynamic_cast<const Element*>(pNode);
if (pElem)
{