Bug 824397 - Use NS_ENSURE_{TRUE,FALSE,SUCCESS}_VOID(foo) instead of NS_ENSURE_{TRUE,FALSE,SUCCESS}(foo, ). r=derf.
authorNicholas Nethercote <nnethercote@mozilla.com>
Sun, 23 Dec 2012 20:45:57 -0800
changeset 116993 372d779d8f2734674f3edd3992f556753a52ec34
parent 116992 757482ef1bfb55ad7f5cf98b713e30eb3af58900
child 116994 3b56b12b4a70d649fe035b975c4a05f96bae1acc
push id24077
push userryanvm@gmail.com
push dateMon, 24 Dec 2012 13:05:31 +0000
treeherdermozilla-central@dc2abccc2adb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersderf
bugs824397
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 824397 - Use NS_ENSURE_{TRUE,FALSE,SUCCESS}_VOID(foo) instead of NS_ENSURE_{TRUE,FALSE,SUCCESS}(foo, ). r=derf.
content/html/content/src/nsTextEditorState.cpp
content/media/MediaDecoder.cpp
content/media/dash/DASHDecoder.cpp
content/media/dash/DASHReader.cpp
content/media/dash/DASHRepDecoder.h
content/media/webm/WebMReader.cpp
content/media/wmf/WMFReader.cpp
layout/base/nsCaret.cpp
layout/generic/nsObjectFrame.cpp
layout/style/nsHTMLStyleSheet.cpp
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
netwerk/dash/mpd/AdaptationSet.cpp
netwerk/dash/mpd/MPD.cpp
netwerk/dash/mpd/Period.cpp
netwerk/dash/mpd/Representation.cpp
netwerk/dash/mpd/SegmentBase.cpp
netwerk/dash/mpd/nsDASHMPDParser.cpp
netwerk/dash/mpd/nsDASHWebMODManager.cpp
netwerk/sctp/datachannel/DataChannel.cpp
widget/gtk2/nsGtkKeyUtils.cpp
widget/qt/nsWindow.cpp
xpcom/io/nsAnonymousTemporaryFile.cpp
--- a/content/html/content/src/nsTextEditorState.cpp
+++ b/content/html/content/src/nsTextEditorState.cpp
@@ -1421,17 +1421,17 @@ nsTextEditorState::DestroyEditor()
 
 void
 nsTextEditorState::UnbindFromFrame(nsTextControlFrame* aFrame)
 {
   NS_ENSURE_TRUE_VOID(mBoundFrame);
 
   // If it was, however, it should be unbounded from the same frame.
   NS_ASSERTION(!aFrame || aFrame == mBoundFrame, "Unbinding from the wrong frame");
-  NS_ENSURE_TRUE(!aFrame || aFrame == mBoundFrame, );
+  NS_ENSURE_TRUE_VOID(!aFrame || aFrame == mBoundFrame);
 
   // We need to start storing the value outside of the editor if we're not
   // going to use it anymore, so retrieve it for now.
   nsAutoString value;
   GetValue(value, true);
 
   if (mRestoringSelection) {
     mRestoringSelection->Revoke();
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -969,17 +969,17 @@ void MediaDecoder::NotifyPrincipalChange
 {
   if (mOwner) {
     mOwner->NotifyDecoderPrincipalChanged();
   }
 }
 
 void MediaDecoder::NotifyBytesConsumed(int64_t aBytes)
 {
-  NS_ENSURE_TRUE(mDecoderStateMachine, );
+  NS_ENSURE_TRUE_VOID(mDecoderStateMachine);
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
   MOZ_ASSERT(OnStateMachineThread() || mDecoderStateMachine->OnDecodeThread());
   if (!mIgnoreProgressData) {
     mDecoderPosition += aBytes;
     mPlaybackStatistics.AddBytes(aBytes);
   }
 }
 
@@ -1201,17 +1201,17 @@ void MediaDecoder::SetDuration(double aD
   }
 
   // Duration has changed so we should recompute playback rate
   UpdatePlaybackRate();
 }
 
 void MediaDecoder::SetMediaDuration(int64_t aDuration)
 {
-  NS_ENSURE_TRUE(GetStateMachine(), );
+  NS_ENSURE_TRUE_VOID(GetStateMachine());
   GetStateMachine()->SetDuration(aDuration);
 }
 
 void MediaDecoder::SetMediaSeekable(bool aMediaSeekable) {
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
   MOZ_ASSERT(NS_IsMainThread() || OnDecodeThread());
   mMediaSeekable = aMediaSeekable;
   if (mDecoderStateMachine) {
@@ -1269,17 +1269,17 @@ void MediaDecoder::SetFragmentEndTime(do
   if (mDecoderStateMachine) {
     ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
     mDecoderStateMachine->SetFragmentEndTime(static_cast<int64_t>(aTime * USECS_PER_S));
   }
 }
 
 void MediaDecoder::SetMediaEndTime(int64_t aTime)
 {
-  NS_ENSURE_TRUE(GetStateMachine(), );
+  NS_ENSURE_TRUE_VOID(GetStateMachine());
   GetStateMachine()->SetMediaEndTime(aTime);
 }
 
 void MediaDecoder::Suspend()
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (mResource) {
     mResource->Suspend(true);
--- a/content/media/dash/DASHDecoder.cpp
+++ b/content/media/dash/DASHDecoder.cpp
@@ -230,17 +230,17 @@ DASHDecoder::NotifyDownloadEnded(nsresul
     LOG1("MPD downloaded.");
 
     // mPrincipal must be set on main thread before dispatch to parser thread.
     mPrincipal = GetCurrentPrincipal();
 
     // Create reader thread for |ChannelMediaResource|::|Read|.
     nsCOMPtr<nsIRunnable> event =
       NS_NewRunnableMethod(this, &DASHDecoder::ReadMPDBuffer);
-    NS_ENSURE_TRUE(event, );
+    NS_ENSURE_TRUE_VOID(event);
 
     nsresult rv = NS_NewNamedThread("DASH MPD Reader",
                                     getter_AddRefs(mMPDReaderThread),
                                     event,
                                     MEDIA_THREAD_STACK_SIZE);
     if (NS_FAILED(rv) || !mMPDReaderThread) {
       LOG("Error creating MPD reader thread: rv[%x] thread [%p].",
           rv, mMPDReaderThread.get());
@@ -787,22 +787,22 @@ DASHDecoder::Shutdown()
 
   // Notify reader of shutdown first.
   if (mDASHReader) {
     mDASHReader->NotifyDecoderShuttingDown();
   }
 
   // Call parent class shutdown.
   MediaDecoder::Shutdown();
-  NS_ENSURE_TRUE(mShuttingDown, );
+  NS_ENSURE_TRUE_VOID(mShuttingDown);
 
   // Shutdown reader thread if not already done.
   if (mMPDReaderThread) {
     nsresult rv = mMPDReaderThread->Shutdown();
-    NS_ENSURE_SUCCESS(rv, );
+    NS_ENSURE_SUCCESS_VOID(rv);
     mMPDReaderThread = nullptr;
   }
 
   // Forward to sub-decoders.
   for (uint i = 0; i < mAudioRepDecoders.Length(); i++) {
     if (mAudioRepDecoders[i]) {
       mAudioRepDecoders[i]->Shutdown();
     }
--- a/content/media/dash/DASHReader.cpp
+++ b/content/media/dash/DASHReader.cpp
@@ -92,31 +92,31 @@ DASHReader::Init(MediaDecoderReader* aCl
   }
   return NS_OK;
 }
 
 void
 DASHReader::AddAudioReader(DASHRepReader* aAudioReader)
 {
   NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
-  NS_ENSURE_TRUE(aAudioReader, );
+  NS_ENSURE_TRUE_VOID(aAudioReader);
 
   ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
 
   mAudioReaders.AppendElement(aAudioReader);
   // XXX For now, just pick the first reader to be default.
   if (!mAudioReader)
     mAudioReader = aAudioReader;
 }
 
 void
 DASHReader::AddVideoReader(DASHRepReader* aVideoReader)
 {
   NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
-  NS_ENSURE_TRUE(aVideoReader, );
+  NS_ENSURE_TRUE_VOID(aVideoReader);
 
   ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
 
   mVideoReaders.AppendElement(aVideoReader);
   // XXX For now, just pick the first reader to be default.
   if (!mVideoReader)
     mVideoReader = aVideoReader;
 }
@@ -499,32 +499,32 @@ DASHReader::PossiblySwitchVideoReaders()
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
 
   // Flag to switch streams is set in |RequestVideoReaderSwitch|.
   if (!mSwitchVideoReaders) {
     return;
   }
 
   // Only switch if we reached a switch access point.
-  NS_ENSURE_TRUE(0 <= mSwitchCount, );
-  NS_ENSURE_TRUE((uint32_t)mSwitchCount < mSwitchToVideoSubsegmentIndexes.Length(), );
+  NS_ENSURE_TRUE_VOID(0 <= mSwitchCount);
+  NS_ENSURE_TRUE_VOID((uint32_t)mSwitchCount < mSwitchToVideoSubsegmentIndexes.Length());
   uint32_t switchIdx = mSwitchToVideoSubsegmentIndexes[mSwitchCount];
   if (!mVideoReader->HasReachedSubsegment(switchIdx)) {
     return;
   }
 
   // Get Representation index to switch to.
   DASHDecoder* dashDecoder = static_cast<DASHDecoder*>(mDecoder);
   int32_t toReaderIdx = dashDecoder->GetRepIdxForVideoSubsegmentLoad(switchIdx);
-  NS_ENSURE_TRUE(0 <= toReaderIdx, );
-  NS_ENSURE_TRUE((uint32_t)toReaderIdx < mVideoReaders.Length(), );
+  NS_ENSURE_TRUE_VOID(0 <= toReaderIdx);
+  NS_ENSURE_TRUE_VOID((uint32_t)toReaderIdx < mVideoReaders.Length());
 
   DASHRepReader* fromReader = mVideoReader;
   DASHRepReader* toReader = mVideoReaders[toReaderIdx];
-  NS_ENSURE_TRUE(fromReader != toReader, );
+  NS_ENSURE_TRUE_VOID(fromReader != toReader);
 
   LOG("Switching video readers now from [%p] to [%p] at subsegment [%d]: "
       "mSwitchCount [%d].",
       fromReader, toReader, switchIdx, mSwitchCount);
 
   // Switch readers while in the monitor.
   ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
   mVideoReader = toReader;
@@ -533,18 +533,18 @@ DASHReader::PossiblySwitchVideoReaders()
   if ((uint32_t)++mSwitchCount < mSwitchToVideoSubsegmentIndexes.Length()) {
     // Get the subsegment at which to switch.
     switchIdx = mSwitchToVideoSubsegmentIndexes[mSwitchCount];
 
     // Update from and to reader ptrs for next switch.
     fromReader = toReader;
     toReaderIdx = dashDecoder->GetRepIdxForVideoSubsegmentLoad(switchIdx);
     toReader = mVideoReaders[toReaderIdx];
-    NS_ENSURE_TRUE((uint32_t)toReaderIdx < mVideoReaders.Length(), );
-    NS_ENSURE_TRUE(fromReader != toReader, );
+    NS_ENSURE_TRUE_VOID((uint32_t)toReaderIdx < mVideoReaders.Length());
+    NS_ENSURE_TRUE_VOID(fromReader != toReader);
 
     // Tell the SWITCH FROM reader when it should stop reading.
     fromReader->RequestSwitchAtSubsegment(switchIdx, toReader);
 
     // Tell the SWITCH TO reader to seek to the correct offset.
     toReader->RequestSeekToSubsegment(switchIdx);
   } else {
     // If there are no more pending switches, unset the switch readers flag.
--- a/content/media/dash/DASHRepDecoder.h
+++ b/content/media/dash/DASHRepDecoder.h
@@ -173,17 +173,17 @@ public:
   // Overridden to cleanup ref to |DASHDecoder|. Called on main thread only.
   void Shutdown() {
     NS_ASSERTION(NS_IsMainThread(), "Should be on main thread.");
     // Remove ref to state machine before |MediaDecoder|::|Shutdown|, since
     // |DASHDecoder| is responsible for its shutdown.
     mDecoderStateMachine = nullptr;
     // Call parent class shutdown.
     MediaDecoder::Shutdown();
-    NS_ENSURE_TRUE(mShuttingDown, );
+    NS_ENSURE_TRUE_VOID(mShuttingDown);
     // Cleanup ref to main decoder.
     mMainDecoder = nullptr;
   }
 
   // Drop reference to state machine and mReader (owned by state machine).
   // Only called during shutdown dance.
   void ReleaseStateMachine();
 
--- a/content/media/webm/WebMReader.cpp
+++ b/content/media/webm/WebMReader.cpp
@@ -1025,20 +1025,20 @@ WebMReader::RequestSwitchAtSubsegment(in
   NS_ASSERTION(NS_IsMainThread() || mDecoder->OnDecodeThread(),
                "Should be on main thread or decode thread.");
   mDecoder->GetReentrantMonitor().AssertCurrentThreadIn();
 
   // Only allow one switch at a time; ignore if one is already requested.
   if (mSwitchingCluster != -1) {
     return;
   }
-  NS_ENSURE_TRUE((uint32_t)aSubsegmentIdx < mClusterByteRanges.Length(), );
+  NS_ENSURE_TRUE_VOID((uint32_t)aSubsegmentIdx < mClusterByteRanges.Length());
   mSwitchingCluster = aSubsegmentIdx;
-  NS_ENSURE_TRUE(aNextReader, );
-  NS_ENSURE_TRUE(aNextReader != this, );
+  NS_ENSURE_TRUE_VOID(aNextReader);
+  NS_ENSURE_TRUE_VOID(aNextReader != this);
   mNextReader = static_cast<WebMReader*>(aNextReader);
 }
 
 void
 WebMReader::RequestSeekToSubsegment(uint32_t aIdx)
 {
   NS_ASSERTION(NS_IsMainThread() || mDecoder->OnDecodeThread(),
                "Should be on main thread or decode thread.");
@@ -1048,17 +1048,17 @@ WebMReader::RequestSeekToSubsegment(uint
   // Don't seek if we're about to switch to another reader.
   if (mSwitchingCluster != -1) {
     return;
   }
   // Only allow seeking if a request was not already made.
   if (mSeekToCluster != -1) {
     return;
   }
-  NS_ENSURE_TRUE(aIdx < mClusterByteRanges.Length(), );
+  NS_ENSURE_TRUE_VOID(aIdx < mClusterByteRanges.Length());
   mSeekToCluster = aIdx;
 
   // XXX Hack to get the resource to seek to the correct offset if the decode
   // thread is in shutdown, e.g. if the video is not autoplay.
   if (mDecoder->IsShutdown()) {
     ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
     mDecoder->GetResource()->Seek(PR_SEEK_SET,
                                   mClusterByteRanges[mSeekToCluster].mStart);
@@ -1075,22 +1075,22 @@ WebMReader::PrepareToDecode()
   }
 }
 
 void
 WebMReader::SeekToCluster(uint32_t aIdx)
 {
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
   NS_ASSERTION(0 <= mSeekToCluster, "mSeekToCluster should be set.");
-  NS_ENSURE_TRUE(aIdx < mClusterByteRanges.Length(), );
+  NS_ENSURE_TRUE_VOID(aIdx < mClusterByteRanges.Length());
   LOG(PR_LOG_DEBUG, ("Reader [%p] for Decoder [%p]: seeking to "
                      "subsegment [%lld] at offset [%lld]",
                      this, mDecoder, aIdx, mClusterByteRanges[aIdx].mStart));
   int r = nestegg_offset_seek(mContext, mClusterByteRanges[aIdx].mStart);
-  NS_ENSURE_TRUE(r == 0, );
+  NS_ENSURE_TRUE_VOID(r == 0);
   mSeekToCluster = -1;
 }
 
 bool
 WebMReader::HasReachedSubsegment(uint32_t aSubsegmentIndex)
 {
   NS_ASSERTION(mDecoder, "Decoder is null.");
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
--- a/content/media/wmf/WMFReader.cpp
+++ b/content/media/wmf/WMFReader.cpp
@@ -60,17 +60,17 @@ WMFReader::~WMFReader()
   MOZ_COUNT_DTOR(WMFReader);
 }
 
 void
 WMFReader::OnDecodeThreadStart()
 {
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
   HRESULT hr = CoInitializeEx(0, COINIT_MULTITHREADED);
-  NS_ENSURE_TRUE(SUCCEEDED(hr), );
+  NS_ENSURE_TRUE_VOID(SUCCEEDED(hr));
 }
 
 void
 WMFReader::OnDecodeThreadFinish()
 {
   NS_ASSERTION(mDecoder->OnDecodeThread(), "Should be on decode thread.");
   CoUninitialize();
 }
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -981,17 +981,17 @@ bool nsCaret::IsMenuPopupHidingCaret()
 void nsCaret::DrawCaret(bool aInvalidate)
 {
   // Do we need to draw the caret at all?
   if (!MustDrawCaret(false))
     return;
   
   // Can we draw the caret now?
   nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
-  NS_ENSURE_TRUE(presShell, /**/);
+  NS_ENSURE_TRUE_VOID(presShell);
   {
     if (presShell->IsPaintingSuppressed())
     {
       if (!mDrawn)
         mPendingDraw = true;
 
       // PresShell::UnsuppressAndInvalidate() will call CheckCaretDrawingState()
       // to get us drawn.
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -632,17 +632,17 @@ nsObjectFrame::FixupWindow(const nsSize&
   nsPresContext* presContext = PresContext();
 
   if (!mInstanceOwner)
     return;
 
   NPWindow *window;
   mInstanceOwner->GetWindow(window);
 
-  NS_ENSURE_TRUE(window, /**/);
+  NS_ENSURE_TRUE_VOID(window);
 
 #ifdef XP_MACOSX
   nsWeakFrame weakFrame(this);
   mInstanceOwner->FixUpPluginWindow(nsPluginInstanceOwner::ePluginPaintDisable);
   if (!weakFrame.IsAlive()) {
     return;
   }
 #endif
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -459,17 +459,17 @@ nsHTMLStyleSheet::UniqueMappedAttributes
   }
   NS_ADDREF(entry->mAttributes); // for caller
   return entry->mAttributes;
 }
 
 void
 nsHTMLStyleSheet::DropMappedAttributes(nsMappedAttributes* aMapped)
 {
-  NS_ENSURE_TRUE(aMapped, /**/);
+  NS_ENSURE_TRUE_VOID(aMapped);
 
   NS_ASSERTION(mMappedAttrTable.ops, "table uninitialized");
 #ifdef DEBUG
   uint32_t entryCount = mMappedAttrTable.entryCount - 1;
 #endif
 
   PL_DHashTableOperate(&mMappedAttrTable, aMapped, PL_DHASH_REMOVE);
 
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -567,17 +567,17 @@ PeerConnectionImpl::NotifyDataChannel(mo
   MOZ_ASSERT(aChannel);
 
   CSFLogDebugS(logTag, __FUNCTION__ << ": channel: " << static_cast<void*>(aChannel));
 
 #ifdef MOZILLA_INTERNAL_API
    nsCOMPtr<nsIDOMDataChannel> domchannel;
    nsresult rv = NS_NewDOMDataChannel(aChannel, mWindow,
                                       getter_AddRefs(domchannel));
-  NS_ENSURE_SUCCESS(rv,);
+  NS_ENSURE_SUCCESS_VOID(rv);
 
   RUN_ON_THREAD(mThread,
                 WrapRunnableNM(NotifyDataChannel_m,
                                domchannel.get(),
                                mPCObserver),
                 NS_DISPATCH_NORMAL);
 #endif
 }
--- a/netwerk/dash/mpd/AdaptationSet.cpp
+++ b/netwerk/dash/mpd/AdaptationSet.cpp
@@ -74,31 +74,31 @@ void
 AdaptationSet::GetMIMEType(nsAString& aMIMEType) const
 {
   aMIMEType = mMIMEType;
 }
 
 void
 AdaptationSet::SetMIMEType(nsAString const &aMIMEType)
 {
-  NS_ENSURE_FALSE(aMIMEType.IsEmpty(),);
+  NS_ENSURE_FALSE_VOID(aMIMEType.IsEmpty());
   mMIMEType = aMIMEType;
 }
 
 Representation const *
 AdaptationSet::GetRepresentation(uint32_t aIndex) const
 {
   NS_ENSURE_TRUE(aIndex < mRepresentations.Length(), nullptr);
   return mRepresentations[aIndex];
 }
 
 void
 AdaptationSet::AddRepresentation(Representation* aRep)
 {
-  NS_ENSURE_TRUE(aRep,);
+  NS_ENSURE_TRUE_VOID(aRep);
   // Only add if it's not already in the array.
   if (!mRepresentations.Contains(aRep)) {
     mRepresentations.InsertElementSorted(aRep, CompareRepresentationBitrates());
   }
 }
 
 uint16_t
 AdaptationSet::GetNumRepresentations() const
--- a/netwerk/dash/mpd/MPD.cpp
+++ b/netwerk/dash/mpd/MPD.cpp
@@ -45,17 +45,17 @@
 
 
 namespace mozilla {
 namespace net {
 
 void
 MPD::AddPeriod(Period* aPeriod)
 {
-  NS_ENSURE_TRUE(aPeriod,);
+  NS_ENSURE_TRUE_VOID(aPeriod);
   // Only add |Period| if it's not in the array already.
   if (!mPeriods.Contains(aPeriod)) {
     mPeriods.AppendElement(aPeriod);
   }
 }
 
 Period const *
 MPD::GetPeriod(uint32_t aIndex) const
@@ -68,17 +68,17 @@ uint32_t const
 MPD::GetNumPeriods() const
 {
   return mPeriods.Length();
 }
 
 void
 MPD::AddBaseUrl(nsAString const& aUrl)
 {
-  NS_ENSURE_FALSE(aUrl.IsEmpty(),);
+  NS_ENSURE_FALSE_VOID(aUrl.IsEmpty());
   // Only add |BaseUrl| string if it's not in the array already.
   if (!mBaseUrls.Contains(aUrl)) {
     mBaseUrls.AppendElement(aUrl);
   }
 }
 
 nsAString const&
 MPD::GetBaseUrl(uint32_t aIndex) const
--- a/netwerk/dash/mpd/Period.cpp
+++ b/netwerk/dash/mpd/Period.cpp
@@ -52,17 +52,17 @@ Period::GetAdaptationSet(uint32_t aIndex
 {
   NS_ENSURE_TRUE(aIndex < mAdaptationSets.Length(), nullptr);
   return mAdaptationSets[aIndex];
 }
 
 void
 Period::AddAdaptationSet(AdaptationSet* aAdaptationSet)
 {
-  NS_ENSURE_TRUE(aAdaptationSet,);
+  NS_ENSURE_TRUE_VOID(aAdaptationSet);
   // Only add |AdaptationSet| ptr if it's not in the array already.
   if (!mAdaptationSets.Contains(aAdaptationSet)) {
     mAdaptationSets.AppendElement(aAdaptationSet);
   }
 }
 
 uint16_t const
 Period::GetNumAdaptationSets() const
--- a/netwerk/dash/mpd/Representation.cpp
+++ b/netwerk/dash/mpd/Representation.cpp
@@ -80,17 +80,17 @@ int32_t const
 Representation::GetHeight() const
 {
   return mHeight;
 }
 
 void
 Representation::AddBaseUrl(nsAString const& aUrl)
 {
-  NS_ENSURE_FALSE(aUrl.IsEmpty(),);
+  NS_ENSURE_FALSE_VOID(aUrl.IsEmpty());
   // Only add if it's not already in the array.
   if (!mBaseUrls.Contains(aUrl)) {
     mBaseUrls.AppendElement(aUrl);
   }
 }
 
 nsAString const &
 Representation::GetBaseUrl(uint32_t aIndex) const
@@ -103,17 +103,17 @@ SegmentBase const*
 Representation::GetSegmentBase() const
 {
   return mSegmentBase;
 }
 
 void
 Representation::SetSegmentBase(SegmentBase* aBase)
 {
-  NS_ENSURE_TRUE(aBase,);
+  NS_ENSURE_TRUE_VOID(aBase);
   // Don't reassign if the ptrs or contents are equal.
   if (mSegmentBase != aBase
       || (mSegmentBase && (*mSegmentBase != *aBase))) {
     mSegmentBase = aBase;
   }
 }
 
 }//namespace net
--- a/netwerk/dash/mpd/SegmentBase.cpp
+++ b/netwerk/dash/mpd/SegmentBase.cpp
@@ -44,27 +44,27 @@
 
 
 namespace mozilla {
 namespace net {
 
 void
 SegmentBase::GetIndexRange(int64_t* aStartBytes, int64_t* aEndBytes) const
 {
-  NS_ENSURE_TRUE(aStartBytes, );
-  NS_ENSURE_TRUE(aEndBytes, );
+  NS_ENSURE_TRUE_VOID(aStartBytes);
+  NS_ENSURE_TRUE_VOID(aEndBytes);
   *aStartBytes = mIndexRangeStart;
   *aEndBytes = mIndexRangeEnd;
 }
 
 void
 SegmentBase::GetInitRange(int64_t* aStartBytes, int64_t* aEndBytes) const
 {
-  NS_ENSURE_TRUE(aStartBytes, );
-  NS_ENSURE_TRUE(aEndBytes, );
+  NS_ENSURE_TRUE_VOID(aStartBytes);
+  NS_ENSURE_TRUE_VOID(aEndBytes);
   *aStartBytes = mInitRangeStart;
   *aEndBytes = mInitRangeEnd;
 }
 
 void
 SegmentBase::SetIndexRange(nsAString const &aRangeStr)
 {
   SetRange(aRangeStr, mIndexRangeStart, mIndexRangeEnd);
@@ -76,31 +76,31 @@ SegmentBase::SetInitRange(nsAString cons
   SetRange(aRangeStr, mInitRangeStart, mInitRangeEnd);
 }
 
 void
 SegmentBase::SetRange(nsAString const &aRangeStr,
                       int64_t &aStart,
                       int64_t &aEnd)
 {
-  NS_ENSURE_TRUE(!aRangeStr.IsEmpty(), );
+  NS_ENSURE_TRUE_VOID(!aRangeStr.IsEmpty());
 
   nsAString::const_iterator start, end, dashStart, dashEnd;
 
   aRangeStr.BeginReading(start);
   aRangeStr.EndReading(end);
   dashStart = start;
   dashEnd = end;
 
   if (FindInReadable(NS_LITERAL_STRING("-"), dashStart, dashEnd)) {
     nsAutoString temp(Substring(start, dashStart));
     nsresult rv;
     aStart = temp.ToInteger64(&rv);
-    NS_ENSURE_SUCCESS(rv, );
+    NS_ENSURE_SUCCESS_VOID(rv);
 
     temp = Substring(dashEnd, end);
     aEnd = temp.ToInteger64(&rv);
-    NS_ENSURE_SUCCESS(rv, );
+    NS_ENSURE_SUCCESS_VOID(rv);
   }
 }
 
 }//namespace net
 }//namespace mozilla
--- a/netwerk/dash/mpd/nsDASHMPDParser.cpp
+++ b/netwerk/dash/mpd/nsDASHMPDParser.cpp
@@ -131,68 +131,68 @@ nsDASHMPDParser::PrintDOMElement(nsIDOME
 {
   // Populate string ss and then print to LOG().
   nsAutoString ss;
   // Indent.
   for(int32_t i = 0; i < offset; i++)
     ss.Append(NS_LITERAL_STRING(" "));
   // Tag name.
   nsAutoString tagName;
-  NS_ENSURE_SUCCESS(aElem->GetTagName(tagName),);
+  NS_ENSURE_SUCCESS_VOID(aElem->GetTagName(tagName));
   ss += NS_LITERAL_STRING("<");
   ss += tagName;
 
   // Attributes.
   nsCOMPtr<nsIDOMNamedNodeMap> attributes;
-  NS_ENSURE_SUCCESS(aElem->GetAttributes(getter_AddRefs(attributes)),);
+  NS_ENSURE_SUCCESS_VOID(aElem->GetAttributes(getter_AddRefs(attributes)));
 
   uint32_t count;
-  NS_ENSURE_SUCCESS(attributes->GetLength(&count),);
+  NS_ENSURE_SUCCESS_VOID(attributes->GetLength(&count));
 
   for(uint32_t i = 0; i < count; i++)
   {
     ss += NS_LITERAL_STRING(" ");
     nsCOMPtr<nsIDOMNode> node;
-    NS_ENSURE_SUCCESS(attributes->Item(i, getter_AddRefs(node)), );
+    NS_ENSURE_SUCCESS_VOID(attributes->Item(i, getter_AddRefs(node)));
 
     nsAutoString nodeName;
-    NS_ENSURE_SUCCESS(node->GetNodeName(nodeName),);
+    NS_ENSURE_SUCCESS_VOID(node->GetNodeName(nodeName));
     ss += nodeName;
 
     nsAutoString nodeValue;
-    NS_ENSURE_SUCCESS(node->GetNodeValue(nodeValue),);
+    NS_ENSURE_SUCCESS_VOID(node->GetNodeValue(nodeValue));
     if(!nodeValue.IsEmpty()) {
       ss += NS_LITERAL_STRING("=");
       ss += nodeValue;
     }
   }
   ss += NS_LITERAL_STRING(">");
   LOG("%s", NS_ConvertUTF16toUTF8(ss).get());
 
   offset++;
 
   // Print for each child.
   nsCOMPtr<nsIDOMElement> child;
-  NS_ENSURE_SUCCESS(aElem->GetFirstElementChild(getter_AddRefs(child)),);
+  NS_ENSURE_SUCCESS_VOID(aElem->GetFirstElementChild(getter_AddRefs(child)));
 
   while(child)
   {
     PrintDOMElement(child, offset);
-    NS_ENSURE_SUCCESS(child->GetNextElementSibling(getter_AddRefs(child)),);
+    NS_ENSURE_SUCCESS_VOID(child->GetNextElementSibling(getter_AddRefs(child)));
   }
 }
 
 
 void
 nsDASHMPDParser::PrintDOMElements(nsIDOMElement* aRoot)
 {
-  NS_ENSURE_TRUE(aRoot, );
+  NS_ENSURE_TRUE_VOID(aRoot);
 
   DASHMPDProfile profile;
-  NS_ENSURE_SUCCESS(GetProfile(aRoot, profile), );
+  NS_ENSURE_SUCCESS_VOID(GetProfile(aRoot, profile));
   LOG("Profile Is %d",(int32_t)profile);
   PrintDOMElement(aRoot, 0);
 }
 
 
 nsresult
 nsDASHMPDParser::GetProfile(nsIDOMElement* aRoot,
                             DASHMPDProfile &aProfile)
--- a/netwerk/dash/mpd/nsDASHWebMODManager.cpp
+++ b/netwerk/dash/mpd/nsDASHWebMODManager.cpp
@@ -52,17 +52,17 @@ static PRLogModuleInfo* gnsDASHWebMODMan
 #else
 #define LOG(msg, ...)
 #define LOG1(msg)
 #endif
 
 nsDASHWebMODManager::nsDASHWebMODManager(MPD* aMpd)
 {
   MOZ_COUNT_CTOR(nsDASHWebMODManager);
-  NS_ENSURE_TRUE(aMpd,);
+  NS_ENSURE_TRUE_VOID(aMpd);
   mMpd = aMpd;
 #if defined(PR_LOGGING)
   if(!gnsDASHWebMODManagerLog)
     gnsDASHWebMODManagerLog = PR_NewLogModule("nsDASHWebMODManager");
 #endif
   LOG("Created nsDASHWebMODManager with mMpd(%p)", mMpd.get());
 }
 
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -341,17 +341,17 @@ DataChannelConnection::StartDefer()
   if (!mDeferredTimer) {
     mDeferredTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
     MOZ_ASSERT(mDeferredTimer);
   }
 
   if (!mTimerRunning) {
     rv = mDeferredTimer->InitWithCallback(this, mDeferTimeout,
                                           nsITimer::TYPE_ONE_SHOT);
-    NS_ENSURE_TRUE(rv == NS_OK, /* */);
+    NS_ENSURE_TRUE_VOID(rv == NS_OK);
 
     mTimerRunning = true;
   }
 }
 
 // nsITimerCallback
 
 NS_IMETHODIMP
@@ -1053,25 +1053,25 @@ DataChannelConnection::HandleOpenRespons
   uint16_t streamOut;
   DataChannel *channel;
 
   mLock.AssertCurrentThreadOwns();
 
   streamOut = ntohs(rsp->reverse_stream);
   channel = FindChannelByStreamOut(streamOut);
 
-  NS_ENSURE_TRUE(channel, /* */);
-  NS_ENSURE_TRUE(channel->mState == CONNECTING, /* */);
+  NS_ENSURE_TRUE_VOID(channel);
+  NS_ENSURE_TRUE_VOID(channel->mState == CONNECTING);
 
   if (rsp->error) {
     LOG(("%s: error in response to open of channel %d (%s)",
          __FUNCTION__, streamOut, channel->mLabel.get()));
 
   } else {
-    NS_ENSURE_TRUE(!FindChannelByStreamIn(streamIn), /* */);
+    NS_ENSURE_TRUE_VOID(!FindChannelByStreamIn(streamIn));
 
     channel->mStreamIn = streamIn;
     channel->mState = OPEN;
     channel->mReady = true;
     mStreamsIn[streamIn] = channel;
     if (SendOpenAckMessage(streamOut)) {
       channel->mFlags = 0;
     } else {
@@ -1091,18 +1091,18 @@ DataChannelConnection::HandleOpenAckMess
                                             size_t length, uint16_t streamIn)
 {
   DataChannel *channel;
 
   mLock.AssertCurrentThreadOwns();
 
   channel = FindChannelByStreamIn(streamIn);
 
-  NS_ENSURE_TRUE(channel, /* */);
-  NS_ENSURE_TRUE(channel->mState == CONNECTING, /* */);
+  NS_ENSURE_TRUE_VOID(channel);
+  NS_ENSURE_TRUE_VOID(channel->mState == CONNECTING);
 
   channel->mState = channel->mReady ? DataChannel::OPEN : DataChannel::WAITING_TO_OPEN;
   if (channel->mState == OPEN) {
     LOG(("%s: sending ON_CHANNEL_OPEN for %p", __FUNCTION__, channel));
     NS_DispatchToMainThread(new DataChannelOnMessageAvailable(
                               DataChannelOnMessageAvailable::ON_CHANNEL_OPEN, this,
                               channel));
   } else {
@@ -1126,21 +1126,21 @@ DataChannelConnection::HandleDataMessage
   DataChannel *channel;
   const char *buffer = (const char *) data;
 
   mLock.AssertCurrentThreadOwns();
 
   channel = FindChannelByStreamIn(streamIn);
 
   // XXX A closed channel may trip this... check
-  NS_ENSURE_TRUE(channel, /* */);
-  NS_ENSURE_TRUE(channel->mState != CONNECTING, /* */);
+  NS_ENSURE_TRUE_VOID(channel);
+  NS_ENSURE_TRUE_VOID(channel->mState != CONNECTING);
 
   // XXX should this be a simple if, no warnings/debugbreaks?
-  NS_ENSURE_TRUE(channel->mState != CLOSED, /* */);
+  NS_ENSURE_TRUE_VOID(channel->mState != CLOSED);
 
   {
     nsAutoCString recvData(buffer, length);
 
     switch (ppid) {
       case DATA_CHANNEL_PPID_DOMSTRING:
         LOG(("DataChannel: String message received of length %lu on channel %d: %.*s",
              length, channel->mStreamOut, (int)PR_MIN(length, 80), buffer));
@@ -1206,29 +1206,29 @@ DataChannelConnection::HandleMessage(con
   const struct rtcweb_datachannel_open_request *req;
   const struct rtcweb_datachannel_open_response *rsp;
   const struct rtcweb_datachannel_ack *ack, *msg;
 
   mLock.AssertCurrentThreadOwns();
 
   switch (ppid) {
     case DATA_CHANNEL_PPID_CONTROL:
-      NS_ENSURE_TRUE(length >= sizeof(*ack), /* */); // Ack is the smallest
+      NS_ENSURE_TRUE_VOID(length >= sizeof(*ack)); // Ack is the smallest
 
       msg = static_cast<const struct rtcweb_datachannel_ack *>(buffer);
       switch (msg->msg_type) {
         case DATA_CHANNEL_OPEN_REQUEST:
           LOG(("length %u, sizeof(*req) = %u", length, sizeof(*req)));
-          NS_ENSURE_TRUE(length >= sizeof(*req), /* */);
+          NS_ENSURE_TRUE_VOID(length >= sizeof(*req));
 
           req = static_cast<const struct rtcweb_datachannel_open_request *>(buffer);
           HandleOpenRequestMessage(req, length, streamIn);
           break;
         case DATA_CHANNEL_OPEN_RESPONSE:
-          NS_ENSURE_TRUE(length >= sizeof(*rsp), /* */);
+          NS_ENSURE_TRUE_VOID(length >= sizeof(*rsp));
 
           rsp = static_cast<const struct rtcweb_datachannel_open_response *>(buffer);
           HandleOpenResponseMessage(rsp, length, streamIn);
           break;
         case DATA_CHANNEL_ACK:
           // >= sizeof(*ack) checked above
 
           ack = static_cast<const struct rtcweb_datachannel_ack *>(buffer);
--- a/widget/gtk2/nsGtkKeyUtils.cpp
+++ b/widget/gtk2/nsGtkKeyUtils.cpp
@@ -1183,17 +1183,17 @@ KeymapWrapper::GetDOMKeyCodeFromKeyPairs
 
     return 0;
 }
 
 void
 KeymapWrapper::InitKeypressEvent(nsKeyEvent& aKeyEvent,
                                  GdkEventKey* aGdkKeyEvent)
 {
-    NS_ENSURE_TRUE(aKeyEvent.message == NS_KEY_PRESS, );
+    NS_ENSURE_TRUE_VOID(aKeyEvent.message == NS_KEY_PRESS);
 
     aKeyEvent.charCode = GetCharCodeFor(aGdkKeyEvent);
     if (!aKeyEvent.charCode) {
         PR_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS,
             ("KeymapWrapper(%p): InitKeypressEvent, "
              "keyCode=0x%02X, charCode=0x%08X",
              this, aKeyEvent.keyCode, aKeyEvent.charCode));
         return;
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -3246,17 +3246,18 @@ nsWindow::GetInputContext()
     return mInputContext;
 }
 
 void
 nsWindow::SetSoftwareKeyboardState(bool aOpen,
                                    const InputContextAction& aAction)
 {
     if (aOpen) {
-        NS_ENSURE_TRUE(mInputContext.mIMEState.mEnabled != IMEState::DISABLED,);
+        NS_ENSURE_TRUE_VOID(mInputContext.mIMEState.mEnabled !=
+                            IMEState::DISABLED);
 
         // Ensure that opening the virtual keyboard is allowed for this specific
         // InputContext depending on the content.ime.strict.policy pref
         if (mInputContext.mIMEState.mEnabled != IMEState::PLUGIN &&
             Preferences::GetBool("content.ime.strict_policy", false) &&
             !aAction.ContentGotFocusByTrustedCause() &&
             !aAction.UserMightRequestOpenVKB()) {
             return;
--- a/xpcom/io/nsAnonymousTemporaryFile.cpp
+++ b/xpcom/io/nsAnonymousTemporaryFile.cpp
@@ -206,22 +206,22 @@ public:
     if (!idleSvc)
       return NS_ERROR_FAILURE;
     return idleSvc->AddIdleObserver(this, TEMP_FILE_IDLE_TIME_S);
   }
 
   void RemoveAnonTempFileFiles() {
     nsCOMPtr<nsIFile> tmpDir;
     nsresult rv = GetTempDir(getter_AddRefs(tmpDir));
-    NS_ENSURE_SUCCESS(rv,);
+    NS_ENSURE_SUCCESS_VOID(rv);
 
-    // Remove the directory recursively.  
+    // Remove the directory recursively.
     tmpDir->Remove(true);
   }
-  
+
 private:
   nsCOMPtr<nsITimer> mTimer;
 };
 
 NS_IMPL_ISUPPORTS1(nsAnonTempFileRemover, nsIObserver)
 
 nsresult CreateAnonTempFileRemover() {
   // Create a temp file remover. If Init() succeeds, the temp file remover is kept