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

@@ -115,8 +115,8 @@ void HTTPTestServer::run()
bool HTTPTestServer::requestComplete() const
{
return ((_lastRequest.substr(0, 3) == "GET" || _lastRequest.substr(0, 4) == "HEAD") &&
(_lastRequest.find("\r\n\r\n") != std::string::npos)) ||
(_lastRequest.find("\r\n0\r\n") != std::string::npos);
(_lastRequest.find("\r\n\r\n") != std::string::npos)) ||
(_lastRequest.find("\r\n0\r\n") != std::string::npos);
}
@@ -125,7 +125,7 @@ std::string HTTPTestServer::handleRequest() const
std::string response;
response.reserve(16000);
if (_lastRequest.substr(0, 10) == "GET /small" ||
_lastRequest.substr(0, 11) == "HEAD /small")
_lastRequest.substr(0, 11) == "HEAD /small")
{
std::string body(SMALL_BODY);
response.append("HTTP/1.0 200 OK\r\n");
@@ -139,8 +139,8 @@ std::string HTTPTestServer::handleRequest() const
response.append(body);
}
else if (_lastRequest.substr(0, 10) == "GET /large" ||
_lastRequest.substr(0, 11) == "HEAD /large" ||
_lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large")
_lastRequest.substr(0, 11) == "HEAD /large" ||
_lastRequest.substr(0, 36) == "GET http://www.somehost.com:80/large")
{
std::string body(LARGE_BODY);
response.append("HTTP/1.0 200 OK\r\n");
@@ -261,7 +261,7 @@ std::string HTTPTestServer::handleRequest() const
response.append("\r\n");
}
else if (_lastRequest.substr(0, 5) == "GET /" ||
_lastRequest.substr(0, 6) == "HEAD /")
_lastRequest.substr(0, 6) == "HEAD /")
{
std::string body(SMALL_BODY);
response.append("HTTP/1.0 200 OK\r\n");