Bug 859018 - Remove the MSVC exemption for FAIL_ON_WARNINGS in layout. r=dbaron

This commit is contained in:
Masatoshi Kimura 2013-04-28 19:02:35 +09:00
parent c1b5bf869b
commit edb82c4095
17 changed files with 36 additions and 44 deletions

View File

@ -1312,8 +1312,8 @@ ContainerState::CreateOrRecycleThebesLayer(const nsIFrame* aActiveScrolledRoot,
// transform. See nsGfxScrollFrame::InvalidateInternal, where
// we ensure that mInvalidThebesContent is updated according to the
// scroll position as of the most recent paint.
if (!FuzzyEqual(data->mXScale, mParameters.mXScale, 0.00001) ||
!FuzzyEqual(data->mYScale, mParameters.mYScale, 0.00001) ||
if (!FuzzyEqual(data->mXScale, mParameters.mXScale, 0.00001f) ||
!FuzzyEqual(data->mYScale, mParameters.mYScale, 0.00001f) ||
data->mAppUnitsPerDevPixel != mAppUnitsPerDevPixel) {
InvalidateEntireThebesLayer(layer, aActiveScrolledRoot);
#ifndef MOZ_ANDROID_OMTC

View File

@ -12,9 +12,7 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkbase_s
LIBXUL_LIBRARY = 1
ifndef _MSC_VER
FAIL_ON_WARNINGS = 1
endif # !_MSC_VER

View File

@ -173,9 +173,8 @@ class RestyleTracker {
public:
typedef mozilla::dom::Element Element;
RestyleTracker(uint32_t aRestyleBits,
nsCSSFrameConstructor* aFrameConstructor) :
mRestyleBits(aRestyleBits), mFrameConstructor(aFrameConstructor),
RestyleTracker(uint32_t aRestyleBits) :
mRestyleBits(aRestyleBits),
mHaveLaterSiblingRestyles(false)
{
NS_PRECONDITION((mRestyleBits & ~ELEMENT_ALL_RESTYLE_FLAGS) == 0,
@ -192,7 +191,8 @@ public:
"Shouldn't have both root flags");
}
void Init() {
void Init(nsCSSFrameConstructor* aFrameConstructor) {
mFrameConstructor = aFrameConstructor;
mPendingRestyles.Init();
}

View File

@ -1429,13 +1429,12 @@ nsCSSFrameConstructor::nsCSSFrameConstructor(nsIDocument *aDocument,
, mRebuildAllExtraHint(nsChangeHint(0))
, mAnimationGeneration(0)
, mPendingRestyles(ELEMENT_HAS_PENDING_RESTYLE |
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT, this)
ELEMENT_IS_POTENTIAL_RESTYLE_ROOT)
, mPendingAnimationRestyles(ELEMENT_HAS_PENDING_ANIMATION_RESTYLE |
ELEMENT_IS_POTENTIAL_ANIMATION_RESTYLE_ROOT, this)
ELEMENT_IS_POTENTIAL_ANIMATION_RESTYLE_ROOT)
{
// XXXbz this should be in Init() or something!
mPendingRestyles.Init();
mPendingAnimationRestyles.Init();
mPendingRestyles.Init(this);
mPendingAnimationRestyles.Init(this);
#ifdef DEBUG
static bool gFirstTime = true;

View File

@ -92,7 +92,7 @@ nsBlockReflowContext::ComputeCollapsedTopMargin(const nsHTMLReflowState& aRS,
// B->nextinflow, we'll traverse B->nextinflow twice. But this is
// OK because our traversal is idempotent.
for ( ;block; block = static_cast<nsBlockFrame*>(block->GetNextInFlow())) {
for (int overflowLines = false; overflowLines <= true; ++overflowLines) {
for (int overflowLines = 0; overflowLines <= 1; ++overflowLines) {
nsBlockFrame::line_iterator line;
nsBlockFrame::line_iterator line_end;
bool anyLines = true;

View File

@ -4863,7 +4863,7 @@ nsIFrame::TryUpdateTransformOnly()
// non-translation change, bail and schedule an invalidating paint.
// (We can often do better than this, for example for scale-down
// changes.)
static const gfx::Float kError = 0.0001;
static const gfx::Float kError = 0.0001f;
if (!transform3d.Is2D(&transform) ||
!layer->GetBaseTransform().Is2D(&previousTransform) ||
!gfx::FuzzyEqual(transform.xx, previousTransform.xx, kError) ||

View File

@ -5,6 +5,7 @@
/* rendering object to wrap rendering objects that should be scrollable */
#include "base/compiler_specific.h"
#include "nsCOMPtr.h"
#include "nsHTMLParts.h"
#include "nsPresContext.h"
@ -74,7 +75,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsHTMLScrollFrame)
nsHTMLScrollFrame::nsHTMLScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot)
: nsContainerFrame(aContext),
mInner(this, aIsRoot)
mInner(ALLOW_THIS_IN_INITIALIZER_LIST(this), aIsRoot)
{
}
@ -883,7 +884,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsXULScrollFrame)
nsXULScrollFrame::nsXULScrollFrame(nsIPresShell* aShell, nsStyleContext* aContext, bool aIsRoot)
: nsBoxFrame(aShell, aContext, aIsRoot),
mInner(this, aIsRoot)
mInner(ALLOW_THIS_IN_INITIALIZER_LIST(this), aIsRoot)
{
SetLayoutManager(nullptr);
}
@ -2341,7 +2342,7 @@ nsGfxScrollFrameInner::ScrollBy(nsIntPoint aDelta,
if (isGenericOrigin){
aOrigin = nsGkAtoms::pixels;
}
negativeTolerance = positiveTolerance = 0.5;
negativeTolerance = positiveTolerance = 0.5f;
break;
}
case nsIScrollableFrame::LINES: {
@ -2349,7 +2350,7 @@ nsGfxScrollFrameInner::ScrollBy(nsIntPoint aDelta,
if (isGenericOrigin){
aOrigin = nsGkAtoms::lines;
}
negativeTolerance = positiveTolerance = 0.1;
negativeTolerance = positiveTolerance = 0.1f;
break;
}
case nsIScrollableFrame::PAGES: {
@ -2357,7 +2358,7 @@ nsGfxScrollFrameInner::ScrollBy(nsIntPoint aDelta,
if (isGenericOrigin){
aOrigin = nsGkAtoms::pages;
}
negativeTolerance = 0.05;
negativeTolerance = 0.05f;
positiveTolerance = 0;
break;
}

View File

@ -1882,6 +1882,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
frag->Get2b() + contentStart, contentLength, bufStart,
compression, &mNextRunContextInfo, &builder, &analysisFlags);
aTextBuffer = bufEnd;
currentTransformedTextOffset = bufEnd - static_cast<const PRUnichar*>(textPtr);
} else {
if (mDoubleByteText) {
// Need to expand the text. First transform it into a temporary buffer,
@ -1897,18 +1898,18 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer)
bufStart, compression, &mNextRunContextInfo, &builder, &analysisFlags);
aTextBuffer = ExpandBuffer(static_cast<PRUnichar*>(aTextBuffer),
tempBuf.Elements(), end - tempBuf.Elements());
currentTransformedTextOffset =
static_cast<PRUnichar*>(aTextBuffer) - static_cast<const PRUnichar*>(textPtr);
} else {
uint8_t* bufStart = static_cast<uint8_t*>(aTextBuffer);
uint8_t* end = nsTextFrameUtils::TransformText(
reinterpret_cast<const uint8_t*>(frag->Get1b()) + contentStart, contentLength,
bufStart, compression, &mNextRunContextInfo, &builder, &analysisFlags);
aTextBuffer = end;
currentTransformedTextOffset = end - static_cast<const uint8_t*>(textPtr);
}
}
textFlags |= analysisFlags;
currentTransformedTextOffset =
(static_cast<const uint8_t*>(aTextBuffer) - static_cast<const uint8_t*>(textPtr)) >> mDoubleByteText;
}
// Check for out-of-memory in gfxSkipCharsBuilder

View File

@ -13,9 +13,7 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkmathml_s
LIBXUL_LIBRARY = 1
ifndef _MSC_VER
FAIL_ON_WARNINGS = 1
endif # !_MSC_VER
LOCAL_INCLUDES = \

View File

@ -1503,7 +1503,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext,
// apply a scale transform to the base char.
if (!glyphFound && largeop) {
float scale;
float largeopFactor = M_SQRT2;
float largeopFactor = float(M_SQRT2);
// increase the width if it is not largeopFactor times larger
// than the initial one.

View File

@ -341,13 +341,13 @@ nsMathMLmoFrame::ProcessOperatorData()
// Use the default value suggested by the MathML REC.
// http://www.w3.org/TR/MathML/chapter3.html#presm.mo.attrs
// thickmathspace = 5/18em
float lspace = 5.0/18.0;
float rspace = 5.0/18.0;
float lspace = 5.0f/18.0f;
float rspace = 5.0f/18.0f;
if (NS_MATHML_OPERATOR_IS_INVISIBLE(mFlags)) {
// mMathMLChar has been reset in ProcessTextData so we can not find it
// in the operator dictionary. The operator dictionary always uses
// lspace = rspace = 0 for invisible operators.
lspace = rspace = 0.0;
lspace = rspace = 0;
} else {
// lookup the operator dictionary
nsAutoString data;
@ -508,7 +508,7 @@ nsMathMLmoFrame::ProcessOperatorData()
// give a multiple of the defaut value but a multiple of the operator at
// normal size.
//
mMinSize = 0.0;
mMinSize = 0;
GetAttribute(mContent, mPresentationData.mstyle, nsGkAtoms::minsize_,
value);
if (!value.IsEmpty()) {

View File

@ -11,9 +11,7 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gkstyle_s
LIBXUL_LIBRARY = 1
ifndef _MSC_VER
FAIL_ON_WARNINGS = 1
endif # !_MSC_VER
ifdef GNU_CC
OS_CFLAGS := $(OS_CFLAGS) -Wshadow

View File

@ -1146,6 +1146,8 @@ CSSParserImpl::ParseRule(const nsAString& aRule,
// See Bug 723197
#ifdef _MSC_VER
#pragma optimize( "", off )
#pragma warning( push )
#pragma warning( disable : 4748 )
#endif
nsresult
CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
@ -1222,6 +1224,7 @@ CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,
return NS_OK;
}
#ifdef _MSC_VER
#pragma warning( pop )
#pragma optimize( "", on )
#endif

View File

@ -1992,11 +1992,11 @@ void nsTimingFunction::AssignFromKeyword(int32_t aTimingFunctionType)
"transition timing function constants not as expected");
static const float timingFunctionValues[5][4] = {
{ 0.25, 0.10, 0.25, 1.00 }, // ease
{ 0.00, 0.00, 1.00, 1.00 }, // linear
{ 0.42, 0.00, 1.00, 1.00 }, // ease-in
{ 0.00, 0.00, 0.58, 1.00 }, // ease-out
{ 0.42, 0.00, 0.58, 1.00 } // ease-in-out
{ 0.25f, 0.10f, 0.25f, 1.00f }, // ease
{ 0.00f, 0.00f, 1.00f, 1.00f }, // linear
{ 0.42f, 0.00f, 1.00f, 1.00f }, // ease-in
{ 0.00f, 0.00f, 0.58f, 1.00f }, // ease-out
{ 0.42f, 0.00f, 0.58f, 1.00f } // ease-in-out
};
NS_ABORT_IF_FALSE(0 <= aTimingFunctionType && aTimingFunctionType < 5,

View File

@ -12,9 +12,7 @@ include $(DEPTH)/config/autoconf.mk
LIBRARY_NAME = gktable_s
LIBXUL_LIBRARY = 1
ifndef _MSC_VER
FAIL_ON_WARNINGS = 1
endif # !_MSC_VER

View File

@ -160,9 +160,6 @@ nsTableFrame::nsTableFrame(nsStyleContext* aContext)
memset(&mBits, 0, sizeof(mBits));
}
NS_QUERYFRAME_HEAD(nsTableFrame)
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
void
nsTableFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
@ -2801,7 +2798,7 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
// nonzero YMost, then we can't be at the top of the page.
// We ignore a repeated head row group in this check to avoid causing
// infinite loops in some circumstances - see bug 344883.
if (childX > ((thead && IsRepeatedFrame(thead)) ? 1 : 0) &&
if (childX > ((thead && IsRepeatedFrame(thead)) ? 1u : 0u) &&
(rowGroups[childX - 1]->GetRect().YMost() > 0)) {
kidReflowState.mFlags.mIsTopOfPage = false;
}

View File

@ -108,7 +108,6 @@ private:
class nsTableFrame : public nsContainerFrame
{
public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
/** nsTableOuterFrame has intimate knowledge of the inner table frame */