diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index 9580a4acfa07..4efb1df9a3e3 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -1393,10 +1393,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsPresContext* aPresContext, } // Take the next-in-flow out of the parent's child list -#ifdef DEBUG - nsresult rv = -#endif - StealFrame(aPresContext, aNextInFlow); + DebugOnly rv = StealFrame(aPresContext, aNextInFlow); NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame failure"); #ifdef DEBUG diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 8ab262ec7b88..da9d81989ace 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -878,10 +878,7 @@ nsIFrame::GetUsedMargin() const if (m) { margin = *m; } else { -#ifdef DEBUG - bool hasMargin = -#endif - StyleMargin()->GetMargin(margin); + DebugOnly hasMargin = StyleMargin()->GetMargin(margin); NS_ASSERTION(hasMargin, "We should have a margin here! (out of memory?)"); } return margin; @@ -956,10 +953,7 @@ nsIFrame::GetUsedPadding() const if (p) { padding = *p; } else { -#ifdef DEBUG - bool hasPadding = -#endif - StylePadding()->GetPadding(padding); + DebugOnly hasPadding = StylePadding()->GetPadding(padding); NS_ASSERTION(hasPadding, "We should have padding here! (out of memory?)"); } return padding; @@ -5069,10 +5063,7 @@ ComputeOutlineAndEffectsRect(nsIFrame* aFrame, uint8_t outlineStyle = outline->GetOutlineStyle(); if (outlineStyle != NS_STYLE_BORDER_STYLE_NONE) { nscoord width; -#ifdef DEBUG - bool result = -#endif - outline->GetOutlineWidth(width); + DebugOnly result = outline->GetOutlineWidth(width); NS_ASSERTION(result, "GetOutlineWidth had no cached outline width"); if (width > 0) { if (aStoreRectProperties) { diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 8abfcd9e0248..bcdecb9e0ee0 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -3181,10 +3181,7 @@ void nsXULScrollFrame::RemoveHorizontalScrollbar(nsBoxLayoutState& aState, bool aOnBottom) { // removing a scrollbar should always fit -#ifdef DEBUG - bool result = -#endif - AddRemoveScrollbar(aState, aOnBottom, true, false); + DebugOnly result = AddRemoveScrollbar(aState, aOnBottom, true, false); NS_ASSERTION(result, "Removing horizontal scrollbar failed to fit??"); } @@ -3192,10 +3189,7 @@ void nsXULScrollFrame::RemoveVerticalScrollbar(nsBoxLayoutState& aState, bool aOnRight) { // removing a scrollbar should always fit -#ifdef DEBUG - bool result = -#endif - AddRemoveScrollbar(aState, aOnRight, false, false); + DebugOnly result = AddRemoveScrollbar(aState, aOnRight, false, false); NS_ASSERTION(result, "Removing vertical scrollbar failed to fit??"); } diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index 3b657577762d..a1b4c9ffe61f 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -17,6 +17,7 @@ #include "nsDisplayList.h" #include "imgIContainer.h" #include "mozilla/Attributes.h" +#include "mozilla/DebugOnly.h" #include "nsIReflowCallback.h" class nsImageMap; @@ -327,11 +328,8 @@ private: } void RemoveIconObserver(nsImageFrame *frame) { -#ifdef DEBUG - bool rv = -#endif - mIconObservers.RemoveElement(frame); - NS_ABORT_IF_FALSE(rv, "Observer not in array"); + mozilla::DebugOnly didRemove = mIconObservers.RemoveElement(frame); + NS_ABORT_IF_FALSE(didRemove, "Observer not in array"); } private: