[Bug 799407] Fix build warnings in layout r=roc
authorDavid Zbarsky <dzbarsky@gmail.com>
Wed, 10 Oct 2012 01:00:05 -0400
changeset 109837 53edf545ee94906943a116da7f780e205b3055fb
parent 109836 a7acfcb014f909a420a5d3a2e0d18d372393b8c9
child 109838 e16d4075ad64e1853e295915261928e56bec2d7e
push id23657
push useremorley@mozilla.com
push dateThu, 11 Oct 2012 13:47:00 +0000
treeherdermozilla-central@2fae8bd461da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs799407
milestone19.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 799407] Fix build warnings in layout r=roc
layout/base/FrameLayerBuilder.cpp
layout/base/nsBidiPresUtils.cpp
layout/base/nsCSSRendering.cpp
layout/base/nsFrameManager.cpp
layout/build/Makefile.in
layout/forms/Makefile.in
layout/forms/nsIListControlFrame.h
layout/forms/nsListControlFrame.cpp
layout/forms/nsListControlFrame.h
layout/forms/nsTextControlFrame.cpp
layout/generic/Makefile.in
layout/generic/nsAbsoluteContainingBlock.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsBlockReflowState.cpp
layout/generic/nsCanvasFrame.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsObjectFrame.cpp
layout/generic/nsSimplePageSequence.cpp
layout/generic/nsTextFrameUtils.cpp
layout/generic/nsViewportFrame.cpp
layout/inspector/src/Makefile.in
layout/mathml/Makefile.in
layout/mathml/nsMathMLChar.cpp
layout/printing/Makefile.in
layout/style/nsComputedDOMStyle.cpp
layout/xul/base/src/Makefile.in
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -1474,16 +1474,17 @@ ContainerState::CreateOrRecycleThebesLay
   } else if (didResetScrollPositionForLayerPixelAlignment) {
     data->mActiveScrolledRootPosition = activeScrolledRootTopLeft;
   }
 #endif
 
   return layer.forget();
 }
 
+#ifdef DEBUG
 /**
  * Returns the appunits per dev pixel for the item's frame. The item must
  * have a frame because only nsDisplayClip items don't have a frame,
  * and those items are flattened away by ProcessDisplayItems.
  */
 static int32_t
 AppUnitsPerDevPixel(nsDisplayItem* aItem)
 {
@@ -1491,16 +1492,17 @@ AppUnitsPerDevPixel(nsDisplayItem* aItem
   // But zoom display items report their bounds etc using the parent document's
   // APD because zoom items act as a conversion layer between the two different
   // APDs.
   if (aItem->GetType() == nsDisplayItem::TYPE_ZOOM) {
     return static_cast<nsDisplayZoom*>(aItem)->GetParentAppUnitsPerDevPixel();
   }
   return aItem->GetUnderlyingFrame()->PresContext()->AppUnitsPerDevPixel();
 }
+#endif
 
 /**
  * Restrict the visible region of aLayer to the region that is actually visible.
  * Because we only reduce the visible region here, we don't need to worry
  * about whether CONTENT_OPAQUE is set; if layer was opauqe in the old
  * visible region, it will still be opaque in the new one.
  * @param aItemVisible the visible region of the display item (that is,
  * after any layer transform has been applied)
@@ -2211,20 +2213,20 @@ ContainerState::ProcessDisplayItems(cons
 }
 
 void
 ContainerState::InvalidateForLayerChange(nsDisplayItem* aItem, 
                                          Layer* aNewLayer,
                                          const FrameLayerBuilder::Clip& aClip,
                                          const nsPoint& aTopLeft)
 {
-  nsIFrame* f = aItem->GetUnderlyingFrame();
-  NS_ASSERTION(f, "Display items that render using Thebes must have a frame");
-  uint32_t key = aItem->GetPerFrameKey();
-  NS_ASSERTION(key, "Display items that render using Thebes must have a key");
+  NS_ASSERTION(aItem->GetUnderlyingFrame(),
+               "Display items that render using Thebes must have a frame");
+  NS_ASSERTION(aItem->GetPerFrameKey(),
+               "Display items that render using Thebes must have a key");
   nsDisplayItemGeometry *oldGeometry = NULL;
   FrameLayerBuilder::Clip* oldClip = NULL;
   nsAutoPtr<nsDisplayItemGeometry> geometry(aItem->AllocateGeometry(mBuilder));
   Layer* oldLayer = mLayerBuilder->GetOldLayerFor(aItem, &oldGeometry, &oldClip);
   if (aNewLayer != oldLayer && oldLayer) {
     // The item has changed layers.
     // Invalidate the old bounds in the old layer and new bounds in the new layer.
     ThebesLayer* t = oldLayer->AsThebesLayer();
@@ -2903,18 +2905,18 @@ FrameLayerBuilder::BuildContainerLayerFo
 
   return containerLayer.forget();
 }
 
 Layer*
 FrameLayerBuilder::GetLeafLayerFor(nsDisplayListBuilder* aBuilder,
                                    nsDisplayItem* aItem)
 {
-  nsIFrame* f = aItem->GetUnderlyingFrame();
-  NS_ASSERTION(f, "Can only call GetLeafLayerFor on items that have a frame");
+  NS_ASSERTION(aItem->GetUnderlyingFrame(),
+               "Can only call GetLeafLayerFor on items that have a frame");
   Layer* layer = GetOldLayerFor(aItem);
   if (!layer)
     return nullptr;
   if (layer->HasUserData(&gThebesDisplayItemLayerUserData)) {
     // This layer was created to render Thebes-rendered content for this
     // display item. The display item should not use it for its own
     // layer rendering.
     return nullptr;
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -2005,17 +2005,16 @@ public:
   }
 
 private:
   nsRenderingContext* mCtx;
   nsRenderingContext* mTextRunConstructionContext;
   nsPoint mPt;
   const PRUnichar* mText;
   int32_t mLength;
-  nsBidiDirection mDirection;
 };
 
 nsresult nsBidiPresUtils::ProcessTextForRenderingContext(const PRUnichar*       aText,
                                                          int32_t                aLength,
                                                          nsBidiDirection        aBaseDirection,
                                                          nsPresContext*         aPresContext,
                                                          nsRenderingContext&   aRenderingContext,
                                                          nsRenderingContext&   aTextRunConstructionContext,
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -1950,16 +1950,17 @@ ComputeRadialGradientLine(nsPresContext*
     int32_t appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
     radiusX = ConvertGradientValueToPixels(aGradient->mRadiusX,
                                            aBoxSize.width, appUnitsPerPixel);
     radiusY = ConvertGradientValueToPixels(aGradient->mRadiusY,
                                            aBoxSize.height, appUnitsPerPixel);
     break;
   }
   default:
+    radiusX = radiusY = 0;
     NS_ABORT_IF_FALSE(false, "unknown radial gradient sizing method");
   }
   *aRadiusX = radiusX;
   *aRadiusY = radiusY;
 
   double angle;
   if (aGradient->mAngle.IsAngleValue()) {
     angle = aGradient->mAngle.GetAngleValueInRadians();
@@ -2398,17 +2399,18 @@ nsCSSRendering::PaintBackgroundWithSC(ns
                                              aBackgroundSC,
                                              aForFrame,
                                              drawBackgroundImage,
                                              drawBackgroundColor);
 
   // If we're not drawing the back-most layer, we don't want to draw the
   // background color.
   const nsStyleBackground *bg = aBackgroundSC->GetStyleBackground();
-  if (drawBackgroundColor && aLayer >= 0 && aLayer != bg->mImageCount - 1) {
+  if (drawBackgroundColor && aLayer >= 0 &&
+      static_cast<uint32_t>(aLayer) != bg->mImageCount - 1) {
     drawBackgroundColor = false;
   }
 
   // At this point, drawBackgroundImage and drawBackgroundColor are
   // true if and only if we are actually supposed to paint an image or
   // color into aDirtyRect, respectively.
   if (!drawBackgroundImage && !drawBackgroundColor)
     return;
--- a/layout/base/nsFrameManager.cpp
+++ b/layout/base/nsFrameManager.cpp
@@ -447,18 +447,18 @@ nsFrameManager::AppendFrames(nsIFrame*  
 
 nsresult
 nsFrameManager::InsertFrames(nsIFrame*       aParentFrame,
                              ChildListID     aListID,
                              nsIFrame*       aPrevFrame,
                              nsFrameList&    aFrameList)
 {
   NS_PRECONDITION(!aPrevFrame || (!aPrevFrame->GetNextContinuation()
-                  || (aPrevFrame->GetNextContinuation()->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER))
-                  && !(aPrevFrame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER),
+                  || ((aPrevFrame->GetNextContinuation()->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER))
+                  && !(aPrevFrame->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)),
                   "aPrevFrame must be the last continuation in its chain!");
 
   if (aParentFrame->IsAbsoluteContainer() &&
       aListID == aParentFrame->GetAbsoluteListID()) {
     return aParentFrame->GetAbsoluteContainingBlock()->
            InsertFrames(aParentFrame, aListID, aPrevFrame, aFrameList);
   } else {
     return aParentFrame->InsertFrames(aListID, aPrevFrame, aFrameList);
--- a/layout/build/Makefile.in
+++ b/layout/build/Makefile.in
@@ -17,16 +17,17 @@ endif
 
 MODULE		= layout
 LIBRARY_NAME	= gklayout
 EXPORT_LIBRARY = 1
 IS_COMPONENT	= 1
 MODULE_NAME	= nsLayoutModule
 GRE_MODULE	= 1
 LIBXUL_LIBRARY	= 1
+FAIL_ON_WARNINGS = 1
 
 
 CPPSRCS		= \
 		nsLayoutModule.cpp \
 		nsContentDLF.cpp \
 		nsLayoutStatics.cpp \
 		$(NULL)
 
--- a/layout/forms/Makefile.in
+++ b/layout/forms/Makefile.in
@@ -13,16 +13,17 @@ include $(DEPTH)/config/autoconf.mk
 DIRS = $(NULL)
 
 TEST_DIRS += test
 
 MODULE		= layout
 XPIDL_MODULE	= layout_forms
 LIBRARY_NAME	= gkforms_s
 LIBXUL_LIBRARY	= 1
+FAIL_ON_WARNINGS = 1
 
 XPIDLSRCS       = nsICapturePicker.idl
 
 EXPORTS		= \
 		nsIListControlFrame.h \
 		nsIComboboxControlFrame.h \
 		nsIFormControlFrame.h \
 		nsISelectControlFrame.h \
--- a/layout/forms/nsIListControlFrame.h
+++ b/layout/forms/nsIListControlFrame.h
@@ -54,17 +54,17 @@ public:
    * maximum of the heights of all the options/optgroups.
    */
   virtual nscoord GetHeightOfARow() = 0;
 
   /**
    * Returns the number of options in the listbox
    */
 
-  virtual int32_t GetNumberOfOptions() = 0; 
+  virtual uint32_t GetNumberOfOptions() = 0;
 
   /**
    * Called by combobox when it's about to drop down
    */
   virtual void AboutToDropDown() = 0;
 
   /**
    * Called by combobox when it's about to roll up
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -47,17 +47,17 @@
 #include "nsDisplayList.h"
 #include "nsContentUtils.h"
 #include "mozilla/LookAndFeel.h"
 #include "mozilla/Attributes.h"
 
 using namespace mozilla;
 
 // Constants
-const int32_t kMaxDropDownRows          = 20; // This matches the setting for 4.x browsers
+const uint32_t kMaxDropDownRows         = 20; // This matches the setting for 4.x browsers
 const int32_t kNothingSelected          = -1;
 
 // Static members
 nsListControlFrame * nsListControlFrame::mFocused = nullptr;
 nsString * nsListControlFrame::sIncrementalString = nullptr;
 
 // Using for incremental typing navigation
 #define INCREMENTAL_SEARCH_KEYPRESS_TIME 1000
@@ -572,29 +572,29 @@ nsListControlFrame::ReflowAsDropdown(nsP
     if (above <= 0 && below <= 0) {
       state.SetComputedHeight(heightOfARow);
       mNumDisplayRows = 1;
       mDropdownCanGrow = GetNumberOfOptions() > 1;
     } else {
       nscoord bp = aReflowState.mComputedBorderPadding.TopBottom();
       nscoord availableHeight = NS_MAX(above, below) - bp;
       nscoord newHeight;
-      int32_t rows;
+      uint32_t rows;
       if (visibleHeight <= availableHeight) {
         // The dropdown fits in the available height.
         rows = GetNumberOfOptions();
-        mNumDisplayRows = clamped(rows, 1, kMaxDropDownRows);
+        mNumDisplayRows = clamped<uint32_t>(rows, 1, kMaxDropDownRows);
         if (mNumDisplayRows == rows) {
           newHeight = visibleHeight;  // use the exact height
         } else {
           newHeight = mNumDisplayRows * heightOfARow; // approximate
         }
       } else {
         rows = availableHeight / heightOfARow;
-        mNumDisplayRows = clamped(rows, 1, kMaxDropDownRows);
+        mNumDisplayRows = clamped<uint32_t>(rows, 1, kMaxDropDownRows);
         newHeight = mNumDisplayRows * heightOfARow; // approximate
       }
       state.SetComputedHeight(newHeight);
       mDropdownCanGrow = visibleHeight - newHeight >= heightOfARow &&
                          mNumDisplayRows != kMaxDropDownRows;
     }
   }
 
@@ -1260,31 +1260,31 @@ nsListControlFrame::GetCurrentOption()
 }
 
 bool 
 nsListControlFrame::IsInDropDownMode() const
 {
   return (mComboboxFrame != nullptr);
 }
 
-int32_t
+uint32_t
 nsListControlFrame::GetNumberOfOptions()
 {
-  if (mContent != nullptr) {
-    nsCOMPtr<nsIDOMHTMLOptionsCollection> options = GetOptions(mContent);
+  if (!mContent) {
+    return 0;
+  }
 
-    if (!options) {
-      return 0;
-    } else {
-      uint32_t length = 0;
-      options->GetLength(&length);
-      return (int32_t)length;
-    }
+  nsCOMPtr<nsIDOMHTMLOptionsCollection> options = GetOptions(mContent);
+  if (!options) {
+    return 0;
   }
-  return 0;
+
+  uint32_t length = 0;
+  options->GetLength(&length);
+  return length;
 }
 
 //----------------------------------------------------------------------
 // nsISelectControlFrame
 //----------------------------------------------------------------------
 bool nsListControlFrame::CheckIfAllFramesHere()
 {
   // Get the number of optgroups and options
@@ -1327,20 +1327,20 @@ nsListControlFrame::AddOption(int32_t aI
 #endif
 
   if (!mIsAllContentHere) {
     mIsAllContentHere = mContent->IsDoneAddingChildren();
     if (!mIsAllContentHere) {
       mIsAllFramesHere    = false;
       mHasBeenInitialized = false;
     } else {
-      mIsAllFramesHere = (aIndex == GetNumberOfOptions()-1);
+      mIsAllFramesHere = (aIndex == static_cast<int32_t>(GetNumberOfOptions()-1));
     }
   }
-  
+
   // Make sure we scroll to the selected option as needed
   mNeedToReset = true;
 
   if (!mHasBeenInitialized) {
     return NS_OK;
   }
 
   mPostChildrenLoadedReset = mIsAllContentHere;
--- a/layout/forms/nsListControlFrame.h
+++ b/layout/forms/nsListControlFrame.h
@@ -121,17 +121,17 @@ public:
    * Gets the text of the currently selected item.
    * If the there are zero items then an empty string is returned
    * If there is nothing selected, then the 0th item's text is returned.
    */
   virtual void GetOptionText(int32_t aIndex, nsAString & aStr) MOZ_OVERRIDE;
 
   virtual void CaptureMouseEvents(bool aGrabMouseEvents) MOZ_OVERRIDE;
   virtual nscoord GetHeightOfARow() MOZ_OVERRIDE;
-  virtual int32_t GetNumberOfOptions() MOZ_OVERRIDE;  
+  virtual uint32_t GetNumberOfOptions() MOZ_OVERRIDE;
   virtual void AboutToDropDown() MOZ_OVERRIDE;
 
   /**
    * @note This method might destroy |this|.
    */
   virtual void AboutToRollup() MOZ_OVERRIDE;
 
   /**
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -439,17 +439,17 @@ nsTextControlFrame::AppendAnonymousConte
   if (!(aFilter & nsIContent::eSkipPlaceholderContent))
     aElements.MaybeAppendElement(txtCtrl->GetPlaceholderNode());
   
 }
 
 nscoord
 nsTextControlFrame::GetPrefWidth(nsRenderingContext* aRenderingContext)
 {
-    nscoord result = 0;
+    DebugOnly<nscoord> result = 0;
     DISPLAY_PREF_WIDTH(this, result);
 
     float inflation = nsLayoutUtils::FontSizeInflationFor(this);
     nsSize autoSize;
     CalcIntrinsicSize(aRenderingContext, autoSize, inflation);
 
     return autoSize.width; 
 }
--- a/layout/generic/Makefile.in
+++ b/layout/generic/Makefile.in
@@ -11,17 +11,16 @@ include $(DEPTH)/config/autoconf.mk
 
 TEST_DIRS += test
 
 MODULE		= layout
 LIBRARY_NAME	= gkgeneric_s
 LIBXUL_LIBRARY	= 1
 
 
-
 EXPORTS		= \
 		nsQueryFrame.h \
 		nsFrameIdList.h \
 		nsFrameList.h \
 		nsCanvasFrame.h \
 		nsHTMLParts.h \
 		nsHTMLReflowMetrics.h \
 		nsHTMLReflowState.h \
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -359,34 +359,28 @@ nsAbsoluteContainingBlock::ReflowAbsolut
     printf(" a=%s,%s ", width, height);
     PrettyUC(aReflowState.ComputedWidth(), width);
     PrettyUC(aReflowState.ComputedHeight(), height);
     printf("c=%s,%s \n", width, height);
   }
   AutoNoisyIndenter indent(nsBlockFrame::gNoisy);
 #endif // DEBUG
 
-  // Store position and overflow rect so taht we can invalidate the correct
-  // area if the position changes
-  nsRect oldOverflowRect(aKidFrame->GetVisualOverflowRect() +
-                         aKidFrame->GetPosition());
-  nsRect oldRect = aKidFrame->GetRect();
-
   nsresult  rv;
   // Get the border values
   const nsMargin& border = aReflowState.mStyleBorder->GetComputedBorder();
 
   nscoord availWidth = aContainingBlockWidth;
   if (availWidth == -1) {
     NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
                  "Must have a useful width _somewhere_");
     availWidth =
       aReflowState.ComputedWidth() + aReflowState.mComputedPadding.LeftRight();
   }
-    
+
   nsHTMLReflowMetrics kidDesiredSize;
   nsHTMLReflowState kidReflowState(aPresContext, aReflowState, aKidFrame,
                                    nsSize(availWidth, NS_UNCONSTRAINEDSIZE),
                                    aContainingBlockWidth,
                                    aContainingBlockHeight);
 
   // Send the WillReflow() notification and position the frame
   aKidFrame->WillReflow(aPresContext);
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1548,23 +1548,23 @@ nsBlockFrame::MarkLineDirty(line_iterato
  * resizing optimizations
  */
 static inline bool
 IsAlignedLeft(uint8_t aAlignment,
               uint8_t aDirection,
               uint8_t aUnicodeBidi,
               nsIFrame* aFrame)
 {
-  return (aFrame->IsSVGText() ||
-          NS_STYLE_TEXT_ALIGN_LEFT == aAlignment ||
-          ((NS_STYLE_TEXT_ALIGN_DEFAULT == aAlignment &&
-            NS_STYLE_DIRECTION_LTR == aDirection) ||
-           (NS_STYLE_TEXT_ALIGN_END == aAlignment &&
-            NS_STYLE_DIRECTION_RTL == aDirection)) &&
-          !(NS_STYLE_UNICODE_BIDI_PLAINTEXT & aUnicodeBidi));
+  return aFrame->IsSVGText() ||
+         NS_STYLE_TEXT_ALIGN_LEFT == aAlignment ||
+         (((NS_STYLE_TEXT_ALIGN_DEFAULT == aAlignment &&
+           NS_STYLE_DIRECTION_LTR == aDirection) ||
+          (NS_STYLE_TEXT_ALIGN_END == aAlignment &&
+           NS_STYLE_DIRECTION_RTL == aDirection)) &&
+         !(NS_STYLE_UNICODE_BIDI_PLAINTEXT & aUnicodeBidi));
 }
 
 nsresult
 nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState)
 {
   const nsStyleText* styleText = GetStyleText();
   const nsStyleTextReset* styleTextReset = GetStyleTextReset();
   // See if we can try and avoid marking all the lines as dirty
@@ -5403,18 +5403,18 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aD
 #endif
       nsLineBox *cur = line;
       if (!searchingOverflowList) {
         line = mLines.erase(line);
         // Invalidate the space taken up by the line.
         // XXX We need to do this if we're removing a frame as a result of
         // a call to RemoveFrame(), but we may not need to do this in all
         // cases...
+#ifdef NOISY_BLOCK_INVALIDATE
         nsRect visOverflow(cur->GetVisualOverflowArea());
-#ifdef NOISY_BLOCK_INVALIDATE
         printf("%p invalidate 10 (%d, %d, %d, %d)\n",
                this, visOverflow.x, visOverflow.y,
                visOverflow.width, visOverflow.height);
 #endif
       } else {
         // XXX update searchingOverflowList directly, remove only when empty
         FrameLines* overflowLines = RemoveOverflowLines();
         line = overflowLines->mLines.erase(line);
--- a/layout/generic/nsBlockReflowState.cpp
+++ b/layout/generic/nsBlockReflowState.cpp
@@ -799,18 +799,18 @@ nsBlockReflowState::FlowAndPlaceFloat(ns
   // Place the float in the float manager
   // calculate region
   nsRect region = nsFloatManager::CalculateRegionFor(aFloat, floatMargin);
   // if the float split, then take up all of the vertical height
   if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus) &&
       (NS_UNCONSTRAINEDSIZE != mContentArea.height)) {
     region.height = NS_MAX(region.height, mContentArea.height - floatY);
   }
-  nsresult rv =
-  mFloatManager->AddFloat(aFloat, region);
+  DebugOnly<nsresult> rv =
+    mFloatManager->AddFloat(aFloat, region);
   NS_ABORT_IF_FALSE(NS_SUCCEEDED(rv), "bad float placement");
   // store region
   nsFloatManager::StoreRegionFor(aFloat, region);
 
   // If the float's dimensions have changed, note the damage in the
   // float manager.
   if (!region.IsEqualEdges(oldRegion)) {
     // XXXwaterson conservative: we could probably get away with noting
--- a/layout/generic/nsCanvasFrame.cpp
+++ b/layout/generic/nsCanvasFrame.cpp
@@ -434,17 +434,16 @@ nsCanvasFrame::Reflow(nsPresContext*    
   // the fixed-pos placeholders, because we insert it at the start
   // of the child list, above.
   nsHTMLReflowMetrics kidDesiredSize;
   if (mFrames.IsEmpty()) {
     // We have no child frame, so return an empty size
     aDesiredSize.width = aDesiredSize.height = 0;
   } else {
     nsIFrame* kidFrame = mFrames.FirstChild();
-    nsRect oldKidRect = kidFrame->GetRect();
     bool kidDirty = (kidFrame->GetStateBits() & NS_FRAME_IS_DIRTY) != 0;
 
     nsHTMLReflowState kidReflowState(aPresContext, aReflowState, kidFrame,
                                      nsSize(aReflowState.availableWidth,
                                             aReflowState.availableHeight));
 
     if (aReflowState.mFlags.mVResize &&
         (kidFrame->GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_HEIGHT)) {
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3049,24 +3049,21 @@ void
 nsXULScrollFrame::LayoutScrollArea(nsBoxLayoutState& aState,
                                    const nsPoint& aScrollPosition)
 {
   uint32_t oldflags = aState.LayoutFlags();
   nsRect childRect = nsRect(mInner.mScrollPort.TopLeft() - aScrollPosition,
                             mInner.mScrollPort.Size());
   int32_t flags = NS_FRAME_NO_MOVE_VIEW;
 
-  nsRect originalRect = mInner.mScrolledFrame->GetRect();
-  nsRect originalVisOverflow = mInner.mScrolledFrame->GetVisualOverflowRect();
-
   nsSize minSize = mInner.mScrolledFrame->GetMinSize(aState);
-  
+
   if (minSize.height > childRect.height)
     childRect.height = minSize.height;
-  
+
   if (minSize.width > childRect.width)
     childRect.width = minSize.width;
 
   aState.SetLayoutFlags(flags);
   ClampAndSetBounds(aState, childRect, aScrollPosition);
   mInner.mScrolledFrame->Layout(aState);
 
   childRect = mInner.mScrolledFrame->GetRect();
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -1256,18 +1256,18 @@ nsObjectFrame::BuildDisplayList(nsDispla
     bool isVisible = window && window->width > 0 && window->height > 0;
     if (isVisible && aBuilder->ShouldSyncDecodeImages()) {
   #ifndef XP_MACOSX
       mInstanceOwner->UpdateWindowVisibility(true);
   #endif
     }
 
     nsRefPtr<ImageContainer> container = GetImageContainer();
-    if (container && container->HasCurrentImage() || !isVisible ||
-        container->GetCurrentSize() != gfxIntSize(window->width, window->height)) {
+    if (container && (container->HasCurrentImage() || !isVisible ||
+        container->GetCurrentSize() != gfxIntSize(window->width, window->height))) {
       mInstanceOwner->NotifyPaintWaiter(aBuilder);
     }
   }
 
   // determine if we are printing
   if (type == nsPresContext::eContext_Print) {
     rv = replacedContent.AppendNewToTop(new (aBuilder)
         nsDisplayGeneric(aBuilder, this, PaintPrintPlugin, "PrintPlugin",
--- a/layout/generic/nsSimplePageSequence.cpp
+++ b/layout/generic/nsSimplePageSequence.cpp
@@ -81,20 +81,20 @@ NS_NewSimplePageSequenceFrame(nsIPresShe
   return new (aPresShell) nsSimplePageSequenceFrame(aContext);
 }
 
 NS_IMPL_FRAMEARENA_HELPERS(nsSimplePageSequenceFrame)
 
 nsSimplePageSequenceFrame::nsSimplePageSequenceFrame(nsStyleContext* aContext) :
   nsContainerFrame(aContext),
   mTotalPages(-1),
-  mCurrentCanvasListSetup(false),
   mSelectionHeight(-1),
   mYSelOffset(0),
-  mCalledBeginPage(false)
+  mCalledBeginPage(false),
+  mCurrentCanvasListSetup(false)
 {
   nscoord halfInch = PresContext()->CSSTwipsToAppUnits(NS_INCHES_TO_TWIPS(0.5));
   mMargin.SizeTo(halfInch, halfInch, halfInch, halfInch);
 
   // XXX Unsafe to assume successful allocation
   mPageData = new nsSharedPageData();
   mPageData->mHeadFootFont =
     new nsFont(*PresContext()->GetDefaultFont(kGenericFont_serif,
--- a/layout/generic/nsTextFrameUtils.cpp
+++ b/layout/generic/nsTextFrameUtils.cpp
@@ -160,18 +160,18 @@ nsTextFrameUtils::TransformText(const ui
   uint8_t* outputStart = aOutput;
 
   if (aCompression == COMPRESS_NONE ||
       aCompression == DISCARD_NEWLINE) {
     // Skip discardables.
     uint32_t i;
     for (i = 0; i < aLength; ++i) {
       uint8_t ch = *aText++;
-      if (IsDiscardable(ch, &flags) || 
-          ch == '\n' && aCompression == DISCARD_NEWLINE) {
+      if (IsDiscardable(ch, &flags) ||
+          (ch == '\n' && aCompression == DISCARD_NEWLINE)) {
         aSkipChars->SkipChar();
       } else {
         aSkipChars->KeepChar();
         if (ch == '\t') {
           flags |= TEXT_HAS_TAB;
         }
         *aOutput++ = ch;
       }
--- a/layout/generic/nsViewportFrame.cpp
+++ b/layout/generic/nsViewportFrame.cpp
@@ -230,17 +230,20 @@ ViewportFrame::Reflow(nsPresContext*    
 
   if (mFrames.NotEmpty()) {
     ConsiderChildOverflow(aDesiredSize.mOverflowAreas, mFrames.FirstChild());
   }
 
   // Make a copy of the reflow state and change the computed width and height
   // to reflect the available space for the fixed items
   nsHTMLReflowState reflowState(aReflowState);
-  nsPoint offset = AdjustReflowStateForScrollbars(&reflowState);
+#ifdef DEBUG
+  nsPoint offset =
+#endif
+    AdjustReflowStateForScrollbars(&reflowState);
 
   if (IsAbsoluteContainer()) {
     NS_ASSERTION(GetAbsoluteContainingBlock()->GetChildList().IsEmpty() ||
                  (offset.x == 0 && offset.y == 0),
                  "We don't handle correct positioning of fixed frames with "
                  "scrollbars in odd positions");
 
     // If a scroll position clamping scroll-port size has been set, layout
--- a/layout/inspector/src/Makefile.in
+++ b/layout/inspector/src/Makefile.in
@@ -8,16 +8,17 @@ topsrcdir=@top_srcdir@
 srcdir=@srcdir@
 VPATH=@srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = inspector
 LIBRARY_NAME = inspector_s
 LIBXUL_LIBRARY = 1
+FAIL_ON_WARNINGS = 1
 
 EXPORTS = \
   nsFontFace.h \
   nsFontFaceList.h \
   $(NULL)
 
 CPPSRCS= \
   inDeepTreeWalker.cpp \
--- a/layout/mathml/Makefile.in
+++ b/layout/mathml/Makefile.in
@@ -9,16 +9,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE = layout
 LIBRARY_NAME = gkmathml_s
 LIBXUL_LIBRARY	= 1
+FAIL_ON_WARNINGS = 1
 
 
 LOCAL_INCLUDES = \
 	-I$(srcdir)/../style \
 	-I$(srcdir)/../base \
 	-I$(srcdir)/../generic \
 	-I$(srcdir)/../tables \
 	-I$(topsrcdir)/content/base/src \
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -104,18 +104,17 @@ LoadProperties(const nsString& aName,
                                                 NS_ConvertUTF16toUTF8(uriStr));
 }
 
 // -----------------------------------------------------------------------------
 
 class nsGlyphTable {
 public:
   explicit nsGlyphTable(const nsString& aPrimaryFontName)
-    : mType(NS_TABLE_TYPE_UNICODE),
-      mFontName(1), // ensure space for primary font name.
+    : mFontName(1), // ensure space for primary font name.
       mState(NS_TABLE_STATE_EMPTY),
       mCharCache(0)
   {
     MOZ_COUNT_CTOR(nsGlyphTable);
     mFontName.AppendElement(aPrimaryFontName);
   }
 
   // not a virtual destructor: this class is not intended to be subclassed
@@ -167,24 +166,21 @@ public:
   nsGlyphCode RightOf(nsPresContext* aPresContext, nsMathMLChar* aChar) {
     return ElementAt(aPresContext, aChar, 2);
   }
 
 private:
   nsGlyphCode ElementAt(nsPresContext* aPresContext, nsMathMLChar* aChar,
                         uint32_t aPosition);
 
-  // The type is either NS_TABLE_TYPE_UNICODE or NS_TABLE_TYPE_GLYPH_INDEX
-  int32_t mType;    
-                           
   // mFontName[0] is the primary font associated to this table. The others 
   // are possible "external" fonts for glyphs not in the primary font
   // but which are needed to stretch certain characters in the table
-  nsTArray<nsString> mFontName; 
-                               
+  nsTArray<nsString> mFontName;
+
   // Tri-state variable for error/empty/ready
   int32_t mState;
 
   // The set of glyph data in this table, as provided by the MathFont Property
   // File
   nsCOMPtr<nsIPersistentProperties> mGlyphProperties;
 
   // For speedy re-use, we always cache the last data used in the table.
@@ -194,18 +190,17 @@ private:
   // mCharCache will retain the 'key' -- which is a Unicode point, while
   // mGlyphCache will retain the 'value', which is a consecutive list of
   // nsGlyphCodes, i.e., the pairs of 'code@font' needed by the char -- in
   // which 'code@0' can be specified
   // without the optional '@0'. However, to ease subsequent processing,
   // mGlyphCache excludes the '@' symbol and explicitly inserts all optional '0'
   // that indicates the primary font identifier. Specifically therefore, the
   // k-th glyph is characterized by :
-  // 1) mGlyphCache[3*k],mGlyphCache[3*k+1] : its Unicode point (or glyph index
-  // -- depending on mType),
+  // 1) mGlyphCache[3*k],mGlyphCache[3*k+1] : its Unicode point
   // 2) mGlyphCache[3*k+2] : the numeric identifier of the font where it comes
   // from.
   // A font identifier of '0' means the default primary font associated to this
   // table. Other digits map to the "external" fonts that may have been
   // specified in the MathFont Property File.
   nsString  mGlyphCache;
   PRUnichar mCharCache;
 };
--- a/layout/printing/Makefile.in
+++ b/layout/printing/Makefile.in
@@ -9,17 +9,17 @@ VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= layout
 XPIDL_MODULE	= layout_printing
 GRE_MODULE	= 1
 LIBRARY_NAME	= gkprinting_s
 LIBXUL_LIBRARY	= 1
-
+FAIL_ON_WARNINGS = 1
 
 XPIDLSRCS	= \
 		nsIPrintProgress.idl  \
 		nsIPrintProgressParams.idl  \
 		nsIPrintStatusFeedback.idl  \
 		$(NULL)
 
 CPPSRCS		= \
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -1240,17 +1240,17 @@ nsIDOMCSSValue*
 nsComputedDOMStyle::DoGetFontWeight()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
 
   const nsStyleFont* font = GetStyleFont();
 
   uint16_t weight = font->mFont.weight;
   NS_ASSERTION(weight % 100 == 0, "unexpected value of font-weight");
-  val->SetNumber(font->mFont.weight);
+  val->SetNumber(weight);
 
   return val;
 }
 
 nsIDOMCSSValue*
 nsComputedDOMStyle::DoGetFontVariant()
 {
   nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();
--- a/layout/xul/base/src/Makefile.in
+++ b/layout/xul/base/src/Makefile.in
@@ -8,17 +8,17 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= layout
 LIBRARY_NAME	= gkxulbase_s
 LIBXUL_LIBRARY	= 1
-
+FAIL_ON_WARNINGS = 1
 
 
 ifdef MOZ_XUL
 PARALLEL_DIRS = tree/public tree/src grid
 endif
 
 CPPSRCS		= \
 		nsScrollBoxFrame.cpp \