Bug 826613 - Enable FAIL_ON_WARNINGS on MSVC in image/. r=joe

This commit is contained in:
Masatoshi Kimura 2013-01-05 12:55:23 +09:00
parent a8274df1f4
commit a8668b3606
9 changed files with 30 additions and 14 deletions

View File

@ -38,8 +38,8 @@ class SVGPreserveAspectRatio
friend class SVGAnimatedPreserveAspectRatio;
public:
SVGPreserveAspectRatio(uint16_t aAlign, uint16_t aMeetOrSlice, bool aDefer = false)
: mAlign(aAlign)
, mMeetOrSlice(aMeetOrSlice)
: mAlign(static_cast<uint8_t>(aAlign))
, mMeetOrSlice(static_cast<uint8_t>(aMeetOrSlice))
, mDefer(aDefer)
{}

View File

@ -17,9 +17,7 @@ IS_COMPONENT = 1
MODULE_NAME = nsImageLib2Module
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
ifndef _MSC_VER
FAIL_ON_WARNINGS = 1
endif # !_MSC_VER
CPPSRCS = \
nsImageModule.cpp \

View File

@ -35,8 +35,10 @@ namespace mozilla {
#define WIN_V3_HEADER_LENGTH (BFH_INTERNAL_LENGTH + WIN_V3_INTERNAL_BIH_LENGTH)
#define WIN_V5_HEADER_LENGTH (BFH_INTERNAL_LENGTH + WIN_V5_INTERNAL_BIH_LENGTH)
#ifndef LCS_sRGB
#define LCS_sRGB 0x73524742
#endif
struct xyz {
int32_t x, y, z;
};

View File

@ -17,8 +17,9 @@ namespace image {
extern const char* SVG_MIMETYPE;
struct ImageFactory
class ImageFactory
{
public:
/**
* Creates a new image with the given properties.
*

View File

@ -16,9 +16,7 @@ FORCE_STATIC_LIB = 1
MODULE_NAME = nsImageLib2Module
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
ifndef _MSC_VER
FAIL_ON_WARNINGS = 1
endif # !_MSC_VER
EXPORTS = imgLoader.h \

View File

@ -150,8 +150,9 @@ DiscardingEnabled()
return enabled;
}
struct ScaleRequest
class ScaleRequest
{
public:
ScaleRequest(RasterImage* aImage, const gfxSize& aScale, imgFrame* aSrcFrame)
: scale(aScale)
, dstLocked(false)
@ -364,7 +365,16 @@ RasterImage::RasterImage(imgStatusTracker* aStatusTracker,
mLoopCount(-1),
mLockCount(0),
mDecoder(nullptr),
// We know DecodeRequest won't touch members of RasterImage
// until this constructor completes
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4355)
#endif
mDecodeRequest(this),
#ifdef _MSC_VER
#pragma warning(pop)
#endif
mBytesDecoded(0),
mDecodeCount(0),
#ifdef DEBUG
@ -842,10 +852,12 @@ RasterImage::GetCurrentImgFrameEndTime() const
// doesn't work correctly if we have a negative timeout value. The reason
// this positive infinity was chosen was because it works with the loop in
// RequestRefresh() above.
return TimeStamp() + TimeDuration::FromMilliseconds(UINT64_MAX);
return TimeStamp() +
TimeDuration::FromMilliseconds(static_cast<double>(UINT64_MAX));
}
TimeDuration durationOfTimeout = TimeDuration::FromMilliseconds(timeout);
TimeDuration durationOfTimeout =
TimeDuration::FromMilliseconds(static_cast<double>(timeout));
TimeStamp currentFrameEndTime = currentFrameTime + durationOfTimeout;
return currentFrameEndTime;

View File

@ -767,7 +767,8 @@ imgRequest::OnDataAvailable(nsIRequest *aRequest, nsISupports *ctxt,
// Now we can create a new image to hold the data. If we don't have a decoder
// for this mimetype we'll find out about it here.
mImage = ImageFactory::CreateImage(aRequest, mStatusTracker, mContentType,
mURI, mIsMultiPartChannel, mInnerWindowId);
mURI, mIsMultiPartChannel,
static_cast<uint32_t>(mInnerWindowId));
// Release our copy of the status tracker since the image owns it now.
mStatusTracker = nullptr;

View File

@ -186,13 +186,14 @@ private:
imgStatusTracker::imgStatusTracker(Image* aImage)
: mImage(aImage),
mTrackerObserver(new imgStatusTrackerObserver(this)),
mState(0),
mImageStatus(imgIRequest::STATUS_NONE),
mIsMultipart(false),
mHadLastPart(false),
mBlockingOnload(false)
{}
{
mTrackerObserver = new imgStatusTrackerObserver(this);
}
imgStatusTracker::imgStatusTracker(const imgStatusTracker& aOther)
: mImage(aOther.mImage),

View File

@ -196,8 +196,11 @@ typedef unsigned int JDIMENSION;
*/
#ifdef NEED_FAR_POINTERS
#ifndef FAR
#define FAR far
#endif
#else
#undef FAR
#define FAR
#endif