From 0affeb4ab074981f79cb4677d686802733558a5c Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Thu, 10 Nov 2016 14:11:27 +1100 Subject: [PATCH] Bug 1316432 - Fix nsCOMPtr constructions&assignments from 0 - r=froydnj Giving '0' (literal zero) to nsCOMPtr is now ambiguous, as both nsCOMPtr(decltype(nullptr)) and nsCOMPtr(T*) could be used. In any case, our coding standards mandate the use of 'nullptr' for pointers. So I'm changing all zeroes into nullptr's where necessary. MozReview-Commit-ID: LXiZTu87Ck6 --HG-- extra : rebase_source : f9dcc6b06e9ebf9c30a576f9319f76a51b6dc26f --- dom/base/nsContentSink.cpp | 2 +- .../base/nsPluginStreamListenerPeer.cpp | 6 +++--- dom/xslt/xpath/txNameTest.cpp | 2 +- dom/xslt/xpath/txVariableRefExpr.cpp | 2 +- dom/xul/templates/nsRDFPropertyTestNode.cpp | 4 ++-- editor/composer/nsEditorSpellCheck.cpp | 2 +- editor/libeditor/HTMLEditRules.cpp | 8 ++++---- editor/libeditor/HTMLURIRefObject.cpp | 2 +- embedding/browser/nsEmbedStream.cpp | 2 +- embedding/components/find/nsFind.cpp | 2 +- .../windowwatcher/nsWindowWatcher.cpp | 4 ++-- layout/generic/nsSelection.cpp | 2 +- modules/libjar/nsJARChannel.cpp | 10 +++++----- netwerk/base/nsIncrementalStreamLoader.cpp | 8 ++++---- netwerk/base/nsInputStreamPump.cpp | 10 +++++----- netwerk/base/nsLoadGroup.cpp | 2 +- netwerk/base/nsSocketTransport2.cpp | 4 ++-- netwerk/base/nsStandardURL.cpp | 4 ++-- netwerk/base/nsStreamListenerTee.cpp | 6 +++--- netwerk/base/nsStreamLoader.cpp | 6 +++--- netwerk/protocol/about/nsAboutCacheEntry.cpp | 2 +- .../protocol/ftp/nsFtpControlConnection.cpp | 2 +- netwerk/protocol/http/HttpChannelChild.cpp | 4 ++-- netwerk/protocol/http/HttpChannelParent.cpp | 2 +- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 2 +- netwerk/protocol/http/nsHttpTransaction.cpp | 2 +- .../protocol/wyciwyg/WyciwygChannelChild.cpp | 8 ++++---- netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp | 20 +++++++++---------- .../streamconv/converters/nsBinHexDecoder.cpp | 2 +- .../streamconv/converters/nsIndexedToHTML.cpp | 2 +- .../converters/nsUnknownDecoder.cpp | 2 +- parser/htmlparser/nsParser.cpp | 2 +- parser/htmlparser/nsScanner.cpp | 4 ++-- security/manager/ssl/nsNSSCertHelper.cpp | 2 +- security/manager/ssl/nsPKCS12Blob.cpp | 4 ++-- toolkit/components/places/nsNavHistory.cpp | 2 +- uriloader/base/nsDocLoader.cpp | 4 ++-- uriloader/base/nsURILoader.cpp | 2 +- .../exthandler/nsExternalProtocolHandler.cpp | 2 +- xpcom/io/nsInputStreamTee.cpp | 6 +++--- xpcom/io/nsPipe3.cpp | 12 +++++------ 41 files changed, 88 insertions(+), 88 deletions(-) diff --git a/dom/base/nsContentSink.cpp b/dom/base/nsContentSink.cpp index cb66e5355f6d..44703f8464d8 100644 --- a/dom/base/nsContentSink.cpp +++ b/dom/base/nsContentSink.cpp @@ -1506,7 +1506,7 @@ nsContentSink::DidBuildModelImpl(bool aTerminated) ("nsContentSink::DidBuildModel: canceling notification " "timeout")); mNotificationTimer->Cancel(); - mNotificationTimer = 0; + mNotificationTimer = nullptr; } } diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp index a10c547e10db..2c82b965a80e 100644 --- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp +++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp @@ -72,8 +72,8 @@ nsPluginByteRangeStreamListener::nsPluginByteRangeStreamListener(nsIWeakReferenc nsPluginByteRangeStreamListener::~nsPluginByteRangeStreamListener() { - mStreamConverter = 0; - mWeakPtrPluginStreamListenerPeer = 0; + mStreamConverter = nullptr; + mWeakPtrPluginStreamListenerPeer = nullptr; } /** @@ -123,7 +123,7 @@ nsPluginByteRangeStreamListener::OnStartRequest(nsIRequest *request, nsISupports return rv; } } - mStreamConverter = 0; + mStreamConverter = nullptr; nsCOMPtr httpChannel(do_QueryInterface(request)); if (!httpChannel) { diff --git a/dom/xslt/xpath/txNameTest.cpp b/dom/xslt/xpath/txNameTest.cpp index 8330e075de3f..bad0432825ea 100644 --- a/dom/xslt/xpath/txNameTest.cpp +++ b/dom/xslt/xpath/txNameTest.cpp @@ -15,7 +15,7 @@ txNameTest::txNameTest(nsIAtom* aPrefix, nsIAtom* aLocalName, int32_t aNSID, mNodeType(aNodeType) { if (aPrefix == nsGkAtoms::_empty) - mPrefix = 0; + mPrefix = nullptr; NS_ASSERTION(aLocalName, "txNameTest without a local name?"); NS_ASSERTION(aNodeType == txXPathNodeType::DOCUMENT_NODE || aNodeType == txXPathNodeType::ELEMENT_NODE || diff --git a/dom/xslt/xpath/txVariableRefExpr.cpp b/dom/xslt/xpath/txVariableRefExpr.cpp index 74eda7d1d335..813e17b8f514 100644 --- a/dom/xslt/xpath/txVariableRefExpr.cpp +++ b/dom/xslt/xpath/txVariableRefExpr.cpp @@ -22,7 +22,7 @@ VariableRefExpr::VariableRefExpr(nsIAtom* aPrefix, nsIAtom* aLocalName, { NS_ASSERTION(mLocalName, "VariableRefExpr without local name?"); if (mPrefix == nsGkAtoms::_empty) - mPrefix = 0; + mPrefix = nullptr; } /** diff --git a/dom/xul/templates/nsRDFPropertyTestNode.cpp b/dom/xul/templates/nsRDFPropertyTestNode.cpp index 07bd0a8d0625..2fa08f2b8706 100644 --- a/dom/xul/templates/nsRDFPropertyTestNode.cpp +++ b/dom/xul/templates/nsRDFPropertyTestNode.cpp @@ -54,7 +54,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, nsIAtom* aTargetVariable) : nsRDFTestNode(aParent), mProcessor(aProcessor), - mSourceVariable(0), + mSourceVariable(nullptr), mSource(aSource), mProperty(aProperty), mTargetVariable(aTargetVariable), @@ -90,7 +90,7 @@ nsRDFPropertyTestNode::nsRDFPropertyTestNode(TestNode* aParent, mSourceVariable(aSourceVariable), mSource(nullptr), mProperty(aProperty), - mTargetVariable(0), + mTargetVariable(nullptr), mTarget(aTarget) { if (MOZ_LOG_TEST(gXULTemplateLog, LogLevel::Debug)) { diff --git a/editor/composer/nsEditorSpellCheck.cpp b/editor/composer/nsEditorSpellCheck.cpp index 62344dd890c7..4d339f7c98a0 100644 --- a/editor/composer/nsEditorSpellCheck.cpp +++ b/editor/composer/nsEditorSpellCheck.cpp @@ -642,7 +642,7 @@ nsEditorSpellCheck::UninitSpellChecker() DeleteSuggestedWordList(); mDictionaryList.Clear(); mDictionaryIndex = 0; - mSpellChecker = 0; + mSpellChecker = nullptr; return NS_OK; } diff --git a/editor/libeditor/HTMLEditRules.cpp b/editor/libeditor/HTMLEditRules.cpp index 34ecb3e40731..6398dba9b6f7 100644 --- a/editor/libeditor/HTMLEditRules.cpp +++ b/editor/libeditor/HTMLEditRules.cpp @@ -500,7 +500,7 @@ HTMLEditRules::AfterEditInner(EditAction action, // if we created a new block, make sure selection lands in it if (mNewBlock) { rv = PinSelectionToNewBlock(selection); - mNewBlock = 0; + mNewBlock = nullptr; } // adjust selection for insert text, html paste, and delete actions @@ -3079,7 +3079,7 @@ HTMLEditRules::WillMakeList(Selection* aSelection, NS_ENSURE_STATE(mHTMLEditor); rv = mHTMLEditor->DeleteNode(curNode); NS_ENSURE_SUCCESS(rv, rv); - prevListItem = 0; + prevListItem = nullptr; continue; } else if (IsEmptyInline(curNode)) { // if curNode is an empty inline container, delete it @@ -3112,7 +3112,7 @@ HTMLEditRules::WillMakeList(Selection* aSelection, NS_ENSURE_SUCCESS(rv, rv); curList = newBlock; } - prevListItem = 0; + prevListItem = nullptr; continue; } @@ -3206,7 +3206,7 @@ HTMLEditRules::WillMakeList(Selection* aSelection, // remember our new block for postprocessing mNewBlock = curList; // curList is now the correct thing to put curNode in - prevListItem = 0; + prevListItem = nullptr; } // if curNode isn't a list item, we must wrap it in one diff --git a/editor/libeditor/HTMLURIRefObject.cpp b/editor/libeditor/HTMLURIRefObject.cpp index c87f7394dce8..612451d85414 100644 --- a/editor/libeditor/HTMLURIRefObject.cpp +++ b/editor/libeditor/HTMLURIRefObject.cpp @@ -243,7 +243,7 @@ HTMLURIRefObject::SetNode(nsIDOMNode* aNode) // If there weren't any URIs in the attributes, // then don't accept this node. - mNode = 0; + mNode = nullptr; return NS_ERROR_INVALID_ARG; } diff --git a/embedding/browser/nsEmbedStream.cpp b/embedding/browser/nsEmbedStream.cpp index fc2f3bae088f..35347060c68e 100644 --- a/embedding/browser/nsEmbedStream.cpp +++ b/embedding/browser/nsEmbedStream.cpp @@ -95,7 +95,7 @@ nsEmbedStream::CloseStream(void) // satisfied; this is exactly what we want to return. NS_ENSURE_STATE(mOutputStream); mOutputStream->Close(); - mOutputStream = 0; + mOutputStream = nullptr; return rv; } diff --git a/embedding/components/find/nsFind.cpp b/embedding/components/find/nsFind.cpp index d88171a6b454..e3697c8ce963 100644 --- a/embedding/components/find/nsFind.cpp +++ b/embedding/components/find/nsFind.cpp @@ -1044,7 +1044,7 @@ nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange, tc = do_QueryInterface(mIterNode); if (!tc || !(frag = tc->GetText())) { // Out of nodes mIterator = nullptr; - mLastBlockParent = 0; + mLastBlockParent = nullptr; ResetAll(); return NS_OK; } diff --git a/embedding/components/windowwatcher/nsWindowWatcher.cpp b/embedding/components/windowwatcher/nsWindowWatcher.cpp index 2bc8fa185cbb..f88bf47c3d3a 100644 --- a/embedding/components/windowwatcher/nsWindowWatcher.cpp +++ b/embedding/components/windowwatcher/nsWindowWatcher.cpp @@ -100,7 +100,7 @@ struct nsWatcherWindowEntry supportsweak->GetWeakReference(getter_AddRefs(mChromeWeak)); } else { mChrome = aChrome; - mChromeWeak = 0; + mChromeWeak = nullptr; } ReferenceSelf(); } @@ -1491,7 +1491,7 @@ nsWindowWatcher::AddWindow(mozIDOMWindowProxy* aWindow, nsIWebBrowserChrome* aCh supportsweak->GetWeakReference(getter_AddRefs(info->mChromeWeak)); } else { info->mChrome = aChrome; - info->mChromeWeak = 0; + info->mChromeWeak = nullptr; } return NS_OK; } diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index a571c540a392..fa22634b2c4c 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -280,7 +280,7 @@ public: if (mTimer) { mTimer->Cancel(); - mTimer = 0; + mTimer = nullptr; } mContent = nullptr; diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index 6904712f5a2f..4b6b78c6d299 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -1017,19 +1017,19 @@ nsJARChannel::OnStopRequest(nsIRequest *req, nsISupports *ctx, nsresult status) if (mListener) { mListener->OnStopRequest(this, mListenerContext, status); - mListener = 0; - mListenerContext = 0; + mListener = nullptr; + mListenerContext = nullptr; } if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, status); - mPump = 0; + mPump = nullptr; mIsPending = false; // Drop notification callbacks to prevent cycles. - mCallbacks = 0; - mProgressSink = 0; + mCallbacks = nullptr; + mProgressSink = nullptr; #if defined(XP_WIN) || defined(MOZ_WIDGET_COCOA) #else diff --git a/netwerk/base/nsIncrementalStreamLoader.cpp b/netwerk/base/nsIncrementalStreamLoader.cpp index 545f7500177d..a7298be3f02d 100644 --- a/netwerk/base/nsIncrementalStreamLoader.cpp +++ b/netwerk/base/nsIncrementalStreamLoader.cpp @@ -104,9 +104,9 @@ nsIncrementalStreamLoader::OnStopRequest(nsIRequest* request, nsISupports *ctxt, } // done.. cleanup ReleaseData(); - mRequest = 0; - mObserver = 0; - mContext = 0; + mRequest = nullptr; + mObserver = nullptr; + mContext = nullptr; } return NS_OK; } @@ -197,7 +197,7 @@ nsIncrementalStreamLoader::OnDataAvailable(nsIRequest* request, nsISupports *ctx } uint32_t countRead; nsresult rv = inStr->ReadSegments(WriteSegmentFun, this, count, &countRead); - mRequest = 0; + mRequest = nullptr; return rv; } diff --git a/netwerk/base/nsInputStreamPump.cpp b/netwerk/base/nsInputStreamPump.cpp index d10dfff2e752..19c2a790abd4 100644 --- a/netwerk/base/nsInputStreamPump.cpp +++ b/netwerk/base/nsInputStreamPump.cpp @@ -361,7 +361,7 @@ nsInputStreamPump::AsyncRead(nsIStreamListener *listener, nsISupports *ctxt) // release our reference to the original stream. from this point forward, // we only reference the "stream" via mAsyncStream. - mStream = 0; + mStream = nullptr; // mStreamOffset now holds the number of bytes currently read. we use this // to enforce the mStreamLength restriction. @@ -703,8 +703,8 @@ nsInputStreamPump::OnStateStop() else if (mCloseWhenDone) mAsyncStream->Close(); - mAsyncStream = 0; - mTargetThread = 0; + mAsyncStream = nullptr; + mTargetThread = nullptr; mIsPending = false; { // Note: Must exit monitor for call to OnStartRequest to avoid @@ -714,8 +714,8 @@ nsInputStreamPump::OnStateStop() mListener->OnStopRequest(this, mListenerContext, mStatus); mMonitor.Enter(); } - mListener = 0; - mListenerContext = 0; + mListener = nullptr; + mListenerContext = nullptr; if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus); diff --git a/netwerk/base/nsLoadGroup.cpp b/netwerk/base/nsLoadGroup.cpp index 927a99203888..3b8cf44342c6 100644 --- a/netwerk/base/nsLoadGroup.cpp +++ b/netwerk/base/nsLoadGroup.cpp @@ -123,7 +123,7 @@ nsLoadGroup::~nsLoadGroup() DebugOnly rv = Cancel(NS_BINDING_ABORTED); NS_ASSERTION(NS_SUCCEEDED(rv), "Cancel failed"); - mDefaultLoadRequest = 0; + mDefaultLoadRequest = nullptr; if (mRequestContext) { nsID rcid; diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp index 456cc561438f..535592534ef9 100644 --- a/netwerk/base/nsSocketTransport2.cpp +++ b/netwerk/base/nsSocketTransport2.cpp @@ -1874,7 +1874,7 @@ nsSocketTransport::OnSocketEvent(uint32_t type, nsresult status, nsISupports *pa SendStatus(NS_NET_STATUS_RESOLVED_HOST); SOCKET_LOG((" MSG_DNS_LOOKUP_COMPLETE\n")); - mDNSRequest = 0; + mDNSRequest = nullptr; if (param) { mDNSRecord = static_cast(param); mDNSRecord->GetNextAddr(SocketPort(), &mNetAddr); @@ -2092,7 +2092,7 @@ nsSocketTransport::OnSocketDetached(PRFileDesc *fd) // make sure there isn't any pending DNS request if (mDNSRequest) { mDNSRequest->Cancel(NS_ERROR_ABORT); - mDNSRequest = 0; + mDNSRequest = nullptr; } // diff --git a/netwerk/base/nsStandardURL.cpp b/netwerk/base/nsStandardURL.cpp index a51be51e1b28..77dfc827ad4d 100644 --- a/netwerk/base/nsStandardURL.cpp +++ b/netwerk/base/nsStandardURL.cpp @@ -393,7 +393,7 @@ void nsStandardURL::InvalidateCache(bool invalidateCachedFile) { if (invalidateCachedFile) - mFile = 0; + mFile = nullptr; if (mHostA) { free(mHostA); mHostA = nullptr; @@ -3107,7 +3107,7 @@ nsStandardURL::SetFile(nsIFile *file) if (NS_FAILED(file->Clone(getter_AddRefs(mFile)))) { NS_WARNING("nsIFile::Clone failed"); // failure to clone is not fatal (GetFile will generate mFile) - mFile = 0; + mFile = nullptr; } } return rv; diff --git a/netwerk/base/nsStreamListenerTee.cpp b/netwerk/base/nsStreamListenerTee.cpp index bf505eff3ff5..d88370b2bf86 100644 --- a/netwerk/base/nsStreamListenerTee.cpp +++ b/netwerk/base/nsStreamListenerTee.cpp @@ -37,7 +37,7 @@ nsStreamListenerTee::OnStopRequest(nsIRequest *request, // it is critical that we close out the input stream tee if (mInputTee) { mInputTee->SetSink(nullptr); - mInputTee = 0; + mInputTee = nullptr; } // release sink on the same thread where the data was written (bug 716293) @@ -45,13 +45,13 @@ nsStreamListenerTee::OnStopRequest(nsIRequest *request, NS_ProxyRelease(mEventTarget, mSink.forget()); } else { - mSink = 0; + mSink = nullptr; } nsresult rv = mListener->OnStopRequest(request, context, status); if (mObserver) mObserver->OnStopRequest(request, context, status); - mObserver = 0; + mObserver = nullptr; return rv; } diff --git a/netwerk/base/nsStreamLoader.cpp b/netwerk/base/nsStreamLoader.cpp index 580fc679b1ab..a73b038a7ec3 100644 --- a/netwerk/base/nsStreamLoader.cpp +++ b/netwerk/base/nsStreamLoader.cpp @@ -111,9 +111,9 @@ nsStreamLoader::OnStopRequest(nsIRequest* request, nsISupports *ctxt, } // done.. cleanup ReleaseData(); - mRequest = 0; - mObserver = 0; - mContext = 0; + mRequest = nullptr; + mObserver = nullptr; + mContext = nullptr; } if (mRequestObserver) { diff --git a/netwerk/protocol/about/nsAboutCacheEntry.cpp b/netwerk/protocol/about/nsAboutCacheEntry.cpp index 553bd7de52fa..6692e5292e38 100644 --- a/netwerk/protocol/about/nsAboutCacheEntry.cpp +++ b/netwerk/protocol/about/nsAboutCacheEntry.cpp @@ -386,7 +386,7 @@ nsAboutCacheEntry::Channel::WriteCacheEntryDescription(nsICacheEntry *entry) buffer.AppendLiteral("\">"); buffer.Append(escapedStr); buffer.AppendLiteral(""); - uri = 0; + uri = nullptr; } else { buffer.Append(escapedStr); } diff --git a/netwerk/protocol/ftp/nsFtpControlConnection.cpp b/netwerk/protocol/ftp/nsFtpControlConnection.cpp index d3db9d7b66d9..ab55cd4f6a38 100644 --- a/netwerk/protocol/ftp/nsFtpControlConnection.cpp +++ b/netwerk/protocol/ftp/nsFtpControlConnection.cpp @@ -161,7 +161,7 @@ nsFtpControlConnection::Disconnect(nsresult status) if (NS_FAILED(status)) { // break cyclic reference! mSocket->Close(status); - mSocket = 0; + mSocket = nullptr; mSocketInput->AsyncWait(nullptr, 0, 0, nullptr); // clear any observer mSocketInput = nullptr; mSocketOutput = nullptr; diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index bad9ef15c052..acda7f47adc5 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -977,8 +977,8 @@ HttpChannelChild::DoOnStopRequest(nsIRequest* aRequest, nsresult aChannelStatus, } mOnStopRequestCalled = true; - mListener = 0; - mListenerContext = 0; + mListener = nullptr; + mListenerContext = nullptr; mCacheEntryAvailable = false; if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus); diff --git a/netwerk/protocol/http/HttpChannelParent.cpp b/netwerk/protocol/http/HttpChannelParent.cpp index 3907b1e151c7..672c5370d4dd 100644 --- a/netwerk/protocol/http/HttpChannelParent.cpp +++ b/netwerk/protocol/http/HttpChannelParent.cpp @@ -788,7 +788,7 @@ HttpChannelParent::RecvDocumentChannelCleanup() { // From now on only using mAssociatedContentSecurity. Free everything else. mChannel = nullptr; // Reclaim some memory sooner. - mCacheEntry = 0; // Else we'll block other channels reading same URI + mCacheEntry = nullptr; // Else we'll block other channels reading same URI return true; } diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 164ed6747a4e..b7efae52fb28 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -178,7 +178,7 @@ nsHttpConnectionMgr::Shutdown() // from being posted. this is how we indicate that we are // shutting down. mIsShuttingDown = true; - mSocketThreadTarget = 0; + mSocketThreadTarget = nullptr; if (NS_FAILED(rv)) { NS_WARNING("unable to post SHUTDOWN message"); diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 5b7d89270b02..ea779d3815ce 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -1298,7 +1298,7 @@ nsHttpTransaction::Restart() seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0); // clear old connection state... - mSecurityInfo = 0; + mSecurityInfo = nullptr; if (mConnection) { if (!mReuseOnRestart) { mConnection->DontReuse(); diff --git a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp index 842aeb8cb07e..2a794df3b47f 100644 --- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp +++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp @@ -291,14 +291,14 @@ WyciwygChannelChild::OnStopRequest(const nsresult& statusCode) mListener->OnStopRequest(this, mListenerContext, statusCode); - mListener = 0; - mListenerContext = 0; + mListener = nullptr; + mListenerContext = nullptr; if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus); - mCallbacks = 0; - mProgressSink = 0; + mCallbacks = nullptr; + mProgressSink = nullptr; } if (mIPCOpen) diff --git a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp index d58b3b866f79..665693fcae37 100644 --- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp +++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp @@ -572,13 +572,13 @@ nsWyciwygChannel::CloseCacheEntryInternal(nsresult reason) if (mCacheEntry) { LOG(("nsWyciwygChannel::CloseCacheEntryInternal [this=%p ]", this)); - mCacheOutputStream = 0; - mCacheInputStream = 0; + mCacheOutputStream = nullptr; + mCacheInputStream = nullptr; if (NS_FAILED(reason)) mCacheEntry->AsyncDoom(nullptr); // here we were calling Doom() ... - mCacheEntry = 0; + mCacheEntry = nullptr; } return NS_OK; } @@ -756,19 +756,19 @@ nsWyciwygChannel::OnStopRequest(nsIRequest *request, nsISupports *ctx, nsresult mStatus = status; mListener->OnStopRequest(this, mListenerContext, mStatus); - mListener = 0; - mListenerContext = 0; + mListener = nullptr; + mListenerContext = nullptr; if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus); CloseCacheEntry(mStatus); - mPump = 0; + mPump = nullptr; mIsPending = false; // Drop notification callbacks to prevent cycles. - mCallbacks = 0; - mProgressSink = 0; + mCallbacks = nullptr; + mProgressSink = nullptr; return NS_OK; } @@ -854,8 +854,8 @@ nsWyciwygChannel::NotifyListener() if (mListener) { mListener->OnStartRequest(this, mListenerContext); mListener->OnStopRequest(this, mListenerContext, mStatus); - mListener = 0; - mListenerContext = 0; + mListener = nullptr; + mListenerContext = nullptr; } mIsPending = false; diff --git a/netwerk/streamconv/converters/nsBinHexDecoder.cpp b/netwerk/streamconv/converters/nsBinHexDecoder.cpp index 972aba048bc5..ce9dc81734c1 100644 --- a/netwerk/streamconv/converters/nsBinHexDecoder.cpp +++ b/netwerk/streamconv/converters/nsBinHexDecoder.cpp @@ -274,7 +274,7 @@ nsresult nsBinHexDecoder::ProcessNextState(nsIRequest * aRequest, nsISupports * { // when we reach the finished state...fire an on stop request on the event listener... mNextListener->OnStopRequest(aRequest, aContext, NS_OK); - mNextListener = 0; + mNextListener = nullptr; /* now We are done with everything. */ ++mState; diff --git a/netwerk/streamconv/converters/nsIndexedToHTML.cpp b/netwerk/streamconv/converters/nsIndexedToHTML.cpp index efa607308dac..f75069850bd2 100644 --- a/netwerk/streamconv/converters/nsIndexedToHTML.cpp +++ b/netwerk/streamconv/converters/nsIndexedToHTML.cpp @@ -665,7 +665,7 @@ nsIndexedToHTML::OnStopRequest(nsIRequest* request, nsISupports *aContext, } mParser->OnStopRequest(request, aContext, aStatus); - mParser = 0; + mParser = nullptr; return mListener->OnStopRequest(request, aContext, aStatus); } diff --git a/netwerk/streamconv/converters/nsUnknownDecoder.cpp b/netwerk/streamconv/converters/nsUnknownDecoder.cpp index 29b8d871b29a..6382a9cb6fff 100644 --- a/netwerk/streamconv/converters/nsUnknownDecoder.cpp +++ b/netwerk/streamconv/converters/nsUnknownDecoder.cpp @@ -299,7 +299,7 @@ nsUnknownDecoder::OnStopRequest(nsIRequest* request, nsISupports *aCtxt, } rv = mNextListener->OnStopRequest(request, aCtxt, aStatus); - mNextListener = 0; + mNextListener = nullptr; return rv; } diff --git a/parser/htmlparser/nsParser.cpp b/parser/htmlparser/nsParser.cpp index 1d10a336c305..4dcbca153cfb 100644 --- a/parser/htmlparser/nsParser.cpp +++ b/parser/htmlparser/nsParser.cpp @@ -910,7 +910,7 @@ nsParser::DidBuildModel(nsresult anErrorCode) } //Ref. to bug 61462. - mParserContext->mRequest = 0; + mParserContext->mRequest = nullptr; } } diff --git a/parser/htmlparser/nsScanner.cpp b/parser/htmlparser/nsScanner.cpp index eac1758bb2df..e1ddd785b26e 100644 --- a/parser/htmlparser/nsScanner.cpp +++ b/parser/htmlparser/nsScanner.cpp @@ -67,7 +67,7 @@ nsScanner::nsScanner(const nsAString& anHTMLString) } mMarkPosition = mCurrentPosition; mIncremental = false; - mUnicodeDecoder = 0; + mUnicodeDecoder = nullptr; mCharsetSource = kCharsetUninitialized; mHasInvalidCharacter = false; mReplacementCharacter = char16_t(0x0); @@ -99,7 +99,7 @@ nsScanner::nsScanner(nsString& aFilename, bool aCreateStream) mFirstNonWhitespacePosition = -1; mCountRemaining = 0; - mUnicodeDecoder = 0; + mUnicodeDecoder = nullptr; mCharsetSource = kCharsetUninitialized; mHasInvalidCharacter = false; mReplacementCharacter = char16_t(0x0); diff --git a/security/manager/ssl/nsNSSCertHelper.cpp b/security/manager/ssl/nsNSSCertHelper.cpp index 4f1f6c0fe599..568a11dc3209 100644 --- a/security/manager/ssl/nsNSSCertHelper.cpp +++ b/security/manager/ssl/nsNSSCertHelper.cpp @@ -1884,7 +1884,7 @@ nsNSSCertificate::CreateTBSCertificateASN1Struct(nsIASN1Sequence **retSequence, validityData->GetNotBefore(¬Before); validityData->GetNotAfter(¬After); - validityData = 0; + validityData = nullptr; rv = ProcessTime(notBefore, text.get(), validitySequence); if (NS_FAILED(rv)) return rv; diff --git a/security/manager/ssl/nsPKCS12Blob.cpp b/security/manager/ssl/nsPKCS12Blob.cpp index 55dfa98622da..e3d80a39876a 100644 --- a/security/manager/ssl/nsPKCS12Blob.cpp +++ b/security/manager/ssl/nsPKCS12Blob.cpp @@ -42,7 +42,7 @@ extern LazyLogModule gPIPNSSLog; #define PIP_PKCS12_NSS_ERROR 7 // constructor -nsPKCS12Blob::nsPKCS12Blob():mCertArray(0), +nsPKCS12Blob::nsPKCS12Blob():mCertArray(nullptr), mTmpFile(nullptr), mTokenSet(false) { @@ -77,7 +77,7 @@ nsPKCS12Blob::SetToken(nsIPK11Token *token) PK11SlotInfo *slot; rv = GetSlotWithMechanism(CKM_RSA_PKCS, mUIContext, &slot, locker); if (NS_FAILED(rv)) { - mToken = 0; + mToken = nullptr; } else { mToken = new nsPK11Token(slot); PK11_FreeSlot(slot); diff --git a/toolkit/components/places/nsNavHistory.cpp b/toolkit/components/places/nsNavHistory.cpp index f5f520d94833..1d7773cb4c5a 100644 --- a/toolkit/components/places/nsNavHistory.cpp +++ b/toolkit/components/places/nsNavHistory.cpp @@ -677,7 +677,7 @@ void nsNavHistory::expireNowTimerCallback(nsITimer* aTimer, void* aClosure) nsNavHistory *history = static_cast(aClosure); if (history) { history->mCachedNow = 0; - history->mExpireNowTimer = 0; + history->mExpireNowTimer = nullptr; } } diff --git a/uriloader/base/nsDocLoader.cpp b/uriloader/base/nsDocLoader.cpp index 44cf297cc89a..69885b93f8aa 100644 --- a/uriloader/base/nsDocLoader.cpp +++ b/uriloader/base/nsDocLoader.cpp @@ -356,7 +356,7 @@ nsDocLoader::Destroy() mListenerInfoList.Clear(); mListenerInfoList.Compact(); - mDocumentRequest = 0; + mDocumentRequest = nullptr; if (mLoadGroup) mLoadGroup->SetGroupObserver(nullptr); @@ -699,7 +699,7 @@ void nsDocLoader::DocLoaderIsEmpty(bool aFlushLayout) nsCOMPtr docRequest = mDocumentRequest; - mDocumentRequest = 0; + mDocumentRequest = nullptr; mIsLoadingDocument = false; // Update the progress status state - the document is done diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index 0e357ff3a4fe..69475d68fdcf 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -333,7 +333,7 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStopRequest(nsIRequest *request, nsISupports // If this is a multipart stream, we could get another // OnStartRequest after this... reset state. - m_targetStreamListener = 0; + m_targetStreamListener = nullptr; mContentType.Truncate(); listener->OnStopRequest(request, aCtxt, aStatus); } diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index c570e2340f90..61ee3bec67a1 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -183,7 +183,7 @@ nsresult nsExtProtocolChannel::OpenURL() } finish: - mCallbacks = 0; + mCallbacks = nullptr; return rv; } diff --git a/xpcom/io/nsInputStreamTee.cpp b/xpcom/io/nsInputStreamTee.cpp index 0353a121320b..8f01cb87e131 100644 --- a/xpcom/io/nsInputStreamTee.cpp +++ b/xpcom/io/nsInputStreamTee.cpp @@ -179,7 +179,7 @@ nsInputStreamTee::TeeSegment(const char* aBuf, uint32_t aCount) NS_WARNING("Write failed (non-fatal)"); // catch possible misuse of the input stream tee NS_ASSERTION(rv != NS_BASE_STREAM_WOULD_BLOCK, "sink must be a blocking stream"); - mSink = 0; + mSink = nullptr; break; } totalBytesWritten += bytesWritten; @@ -217,8 +217,8 @@ nsInputStreamTee::Close() return NS_ERROR_NOT_INITIALIZED; } nsresult rv = mSource->Close(); - mSource = 0; - mSink = 0; + mSource = nullptr; + mSink = nullptr; return rv; } diff --git a/xpcom/io/nsPipe3.cpp b/xpcom/io/nsPipe3.cpp index 9e7eca63ba18..7bae9761a23a 100644 --- a/xpcom/io/nsPipe3.cpp +++ b/xpcom/io/nsPipe3.cpp @@ -1200,7 +1200,7 @@ nsPipeInputStream::OnInputReadable(uint32_t aBytesWritten, if (mCallback && !(mCallbackFlags & WAIT_CLOSURE_ONLY)) { aEvents.NotifyInputReady(this, mCallback); - mCallback = 0; + mCallback = nullptr; mCallbackFlags = 0; } else if (mBlocked) { result = NotifyMonitor; @@ -1229,7 +1229,7 @@ nsPipeInputStream::OnInputException(nsresult aReason, nsPipeEvents& aEvents, if (mCallback) { aEvents.NotifyInputReady(this, mCallback); - mCallback = 0; + mCallback = nullptr; mCallbackFlags = 0; } else if (mBlocked) { result = NotifyMonitor; @@ -1370,7 +1370,7 @@ nsPipeInputStream::AsyncWait(nsIInputStreamCallback* aCallback, ReentrantMonitorAutoEnter mon(mPipe->mReentrantMonitor); // replace a pending callback - mCallback = 0; + mCallback = nullptr; mCallbackFlags = 0; if (!aCallback) { @@ -1594,7 +1594,7 @@ nsPipeOutputStream::OnOutputWritable(nsPipeEvents& aEvents) if (mCallback && !(mCallbackFlags & WAIT_CLOSURE_ONLY)) { aEvents.NotifyOutputReady(this, mCallback); - mCallback = 0; + mCallback = nullptr; mCallbackFlags = 0; } else if (mBlocked) { result = NotifyMonitor; @@ -1616,7 +1616,7 @@ nsPipeOutputStream::OnOutputException(nsresult aReason, nsPipeEvents& aEvents) if (mCallback) { aEvents.NotifyOutputReady(this, mCallback); - mCallback = 0; + mCallback = nullptr; mCallbackFlags = 0; } else if (mBlocked) { result = NotifyMonitor; @@ -1802,7 +1802,7 @@ nsPipeOutputStream::AsyncWait(nsIOutputStreamCallback* aCallback, ReentrantMonitorAutoEnter mon(mPipe->mReentrantMonitor); // replace a pending callback - mCallback = 0; + mCallback = nullptr; mCallbackFlags = 0; if (!aCallback) {