diff options
author | Tobias Markmann <tm@ayena.de> | 2016-04-01 12:36:16 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2016-04-01 15:56:34 (GMT) |
commit | eddd92ed76ae68cb1e202602fd3ebd11b69191a2 (patch) | |
tree | 8d396e5801d77a2f0ee4ab8e4c5093d8cf8118e6 /Swiften/Client | |
parent | a79db8d446e152b715f435550c2a6e10a36ee532 (diff) | |
download | swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.zip swift-eddd92ed76ae68cb1e202602fd3ebd11b69191a2.tar.bz2 |
Modernize code to use C++11 nullptr using clang-tidy
Run 'clang-tidy -fix -checks=modernize-use-nullptr' on all
source code files on OS X. This does not modernize platform
specific code on Linux and Windows
Test-Information:
Code builds and unit tests pass on OS X 10.11.4.
Change-Id: Ic43ffeb1b76c1a933a55af03db3c54977f5f60dd
Diffstat (limited to 'Swiften/Client')
-rw-r--r-- | Swiften/Client/Client.cpp | 4 | ||||
-rw-r--r-- | Swiften/Client/Client.h | 2 | ||||
-rw-r--r-- | Swiften/Client/ClientSession.cpp | 10 | ||||
-rw-r--r-- | Swiften/Client/CoreClient.cpp | 4 | ||||
-rw-r--r-- | Swiften/Client/MemoryStorages.cpp | 6 | ||||
-rw-r--r-- | Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp | 16 | ||||
-rw-r--r-- | Swiften/Client/XMLBeautifier.cpp | 2 |
7 files changed, 22 insertions, 22 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp index 89b66b8..48576d4 100644 --- a/Swiften/Client/Client.cpp +++ b/Swiften/Client/Client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -72,7 +72,7 @@ Client::Client(const JID& jid, const SafeString& password, NetworkFactories* net jingleSessionManager = new JingleSessionManager(getIQRouter()); blockListManager = new ClientBlockListManager(getIQRouter()); - whiteboardSessionManager = NULL; + whiteboardSessionManager = nullptr; #ifdef SWIFT_EXPERIMENTAL_WB whiteboardSessionManager = new WhiteboardSessionManager(getIQRouter(), getStanzaChannel(), presenceOracle, getEntityCapsProvider()); #endif diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h index a3d11a1..7763745 100644 --- a/Swiften/Client/Client.h +++ b/Swiften/Client/Client.h @@ -55,7 +55,7 @@ namespace Swift { * this is NULL, * all data will be stored in memory (and be lost on shutdown) */ - Client(const JID& jid, const SafeString& password, NetworkFactories* networkFactories, Storages* storages = NULL); + Client(const JID& jid, const SafeString& password, NetworkFactories* networkFactories, Storages* storages = nullptr); virtual ~Client(); diff --git a/Swiften/Client/ClientSession.cpp b/Swiften/Client/ClientSession.cpp index e38dde8..1b67c96 100644 --- a/Swiften/Client/ClientSession.cpp +++ b/Swiften/Client/ClientSession.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -73,8 +73,8 @@ ClientSession::ClientSession( needResourceBind(false), needAcking(false), rosterVersioningSupported(false), - authenticator(NULL), - certificateTrustChecker(NULL), + authenticator(nullptr), + certificateTrustChecker(nullptr), singleSignOn(false), authenticationPort(-1) { #ifdef SWIFTEN_PLATFORM_WIN32 @@ -348,7 +348,7 @@ void ClientSession::handleElement(boost::shared_ptr<ToplevelElement> element) { else { state = WaitingForStreamStart; delete authenticator; - authenticator = NULL; + authenticator = nullptr; stream->resetXMPPParser(); sendStreamHeader(); } @@ -493,7 +493,7 @@ void ClientSession::finishSession(boost::shared_ptr<Swift::Error> error) { } if (authenticator) { delete authenticator; - authenticator = NULL; + authenticator = nullptr; } stream->writeFooter(); stream->close(); diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp index fd7f894..44fadc6 100644 --- a/Swiften/Client/CoreClient.cpp +++ b/Swiften/Client/CoreClient.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -31,7 +31,7 @@ namespace Swift { -CoreClient::CoreClient(const JID& jid, const SafeByteArray& password, NetworkFactories* networkFactories) : jid_(jid), password_(password), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(NULL) { +CoreClient::CoreClient(const JID& jid, const SafeByteArray& password, NetworkFactories* networkFactories) : jid_(jid), password_(password), networkFactories(networkFactories), disconnectRequested_(false), certificateTrustChecker(nullptr) { stanzaChannel_ = new ClientSessionStanzaChannel(); stanzaChannel_->onMessageReceived.connect(boost::bind(&CoreClient::handleMessageReceived, this, _1)); stanzaChannel_->onPresenceReceived.connect(boost::bind(&CoreClient::handlePresenceReceived, this, _1)); diff --git a/Swiften/Client/MemoryStorages.cpp b/Swiften/Client/MemoryStorages.cpp index 14aa63a..5e52799 100644 --- a/Swiften/Client/MemoryStorages.cpp +++ b/Swiften/Client/MemoryStorages.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2015 Isode Limited. + * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -23,7 +23,7 @@ MemoryStorages::MemoryStorages(CryptoProvider* crypto) { #ifdef SWIFT_EXPERIMENTAL_HISTORY historyStorage = new SQLiteHistoryStorage(":memory:"); #else - historyStorage = NULL; + historyStorage = nullptr; #endif } @@ -57,7 +57,7 @@ HistoryStorage* MemoryStorages::getHistoryStorage() const { #ifdef SWIFT_EXPERIMENTAL_HISTORY return historyStorage; #else - return NULL; + return nullptr; #endif } diff --git a/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp b/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp index ef2f537..2f33984 100644 --- a/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp +++ b/Swiften/Client/UnitTest/ClientBlockListManagerTest.cpp @@ -60,9 +60,9 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { GenericRequest<BlockPayload>::ref blockRequest = clientBlockListManager_->createBlockJIDRequest(JID("romeo@montague.net")); blockRequest->send(); IQ::ref request = stanzaChannel_->getStanzaAtIndex<IQ>(2); - CPPUNIT_ASSERT(request.get() != NULL); + CPPUNIT_ASSERT(request.get() != nullptr); boost::shared_ptr<BlockPayload> blockPayload = request->getPayload<BlockPayload>(); - CPPUNIT_ASSERT(blockPayload.get() != NULL); + CPPUNIT_ASSERT(blockPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(JID("romeo@montague.net"), blockPayload->getItems().at(0)); IQ::ref blockRequestResponse = IQ::createResult(request->getFrom(), JID(), request->getID()); @@ -94,9 +94,9 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { GenericRequest<UnblockPayload>::ref unblockRequest = clientBlockListManager_->createUnblockJIDRequest(JID("romeo@montague.net")); unblockRequest->send(); IQ::ref request = stanzaChannel_->getStanzaAtIndex<IQ>(2); - CPPUNIT_ASSERT(request.get() != NULL); + CPPUNIT_ASSERT(request.get() != nullptr); boost::shared_ptr<UnblockPayload> unblockPayload = request->getPayload<UnblockPayload>(); - CPPUNIT_ASSERT(unblockPayload.get() != NULL); + CPPUNIT_ASSERT(unblockPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(JID("romeo@montague.net"), unblockPayload->getItems().at(0)); IQ::ref unblockRequestResponse = IQ::createResult(request->getFrom(), JID(), request->getID()); @@ -129,9 +129,9 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { GenericRequest<UnblockPayload>::ref unblockRequest = clientBlockListManager_->createUnblockAllRequest(); unblockRequest->send(); IQ::ref request = stanzaChannel_->getStanzaAtIndex<IQ>(2); - CPPUNIT_ASSERT(request.get() != NULL); + CPPUNIT_ASSERT(request.get() != nullptr); boost::shared_ptr<UnblockPayload> unblockPayload = request->getPayload<UnblockPayload>(); - CPPUNIT_ASSERT(unblockPayload.get() != NULL); + CPPUNIT_ASSERT(unblockPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(true, unblockPayload->getItems().empty()); IQ::ref unblockRequestResponse = IQ::createResult(request->getFrom(), JID(), request->getID()); @@ -162,9 +162,9 @@ class ClientBlockListManagerTest : public CppUnit::TestFixture { // check for IQ request IQ::ref request = stanzaChannel_->getStanzaAtIndex<IQ>(0); - CPPUNIT_ASSERT(request.get() != NULL); + CPPUNIT_ASSERT(request.get() != nullptr); boost::shared_ptr<BlockListPayload> requestPayload = request->getPayload<BlockListPayload>(); - CPPUNIT_ASSERT(requestPayload.get() != NULL); + CPPUNIT_ASSERT(requestPayload.get() != nullptr); CPPUNIT_ASSERT_EQUAL(BlockList::Requesting, blockList->getState()); CPPUNIT_ASSERT_EQUAL(BlockList::Requesting, clientBlockListManager_->getBlockList()->getState()); diff --git a/Swiften/Client/XMLBeautifier.cpp b/Swiften/Client/XMLBeautifier.cpp index f084bb3..9e9c4c5 100644 --- a/Swiften/Client/XMLBeautifier.cpp +++ b/Swiften/Client/XMLBeautifier.cpp @@ -21,7 +21,7 @@ namespace Swift { -XMLBeautifier::XMLBeautifier(bool indention, bool coloring) : doIndention(indention), doColoring(coloring), intLevel(0), parser(NULL), lastWasStepDown(false) { +XMLBeautifier::XMLBeautifier(bool indention, bool coloring) : doIndention(indention), doColoring(coloring), intLevel(0), parser(nullptr), lastWasStepDown(false) { factory = new PlatformXMLParserFactory(); } |