Enable warnings-as-errors on Windows.

Review URL: https://codereview.appspot.com/7066054

git-svn-id: http://skia.googlecode.com/svn/trunk@7094 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2013-01-08 20:31:53 +00:00
parent 15655b241b
commit 50c79d886b
10 changed files with 47 additions and 7 deletions

View File

@ -7,12 +7,22 @@
*/
#include <iostream>
#include "SkDebugCanvas.h"
#include "SkDrawCommand.h"
#include "SkDevice.h"
#include "SkImageWidget.h"
#ifdef SK_BUILD_FOR_WIN
// iostream includes xlocale which generates warning 4530 because we're compiling without
// exceptions
#pragma warning(push)
#pragma warning(disable : 4530)
#endif
#include <iostream>
#ifdef SK_BUILD_FOR_WIN
#pragma warning(pop)
#endif
static SkBitmap make_noconfig_bm(int width, int height) {
SkBitmap bm;
bm.setConfig(SkBitmap::kNo_Config, width, height);

View File

@ -164,11 +164,11 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkRect r;
r.setWH( fRectWidth, fRectHeight );
r.setWH(SkIntToScalar(fRectWidth), SkIntToScalar(fRectHeight));
SkMask mask;
makeMask( &mask, r );
makeMask(&mask, r);
SkBitmap bm;
bm.setConfig(SkBitmap::kA8_Config, mask.fBounds.width(), mask.fBounds.height());

View File

@ -33,7 +33,16 @@
#include "SkTileGridPicture.h"
#include "SamplePipeControllers.h"
#ifdef SK_BUILD_FOR_WIN
// json includes xlocale which generates warning 4530 because we're compiling without
// exceptions
#pragma warning(push)
#pragma warning(disable : 4530)
#endif
#include "json/value.h"
#ifdef SK_BUILD_FOR_WIN
#pragma warning(pop)
#endif
#if SK_SUPPORT_GPU
#include "GrContextFactory.h"

View File

@ -30,7 +30,7 @@
'msvs_settings': {
'VCCLCompilerTool': {
'WarningLevel': '1',
'WarnAsError': 'false',
'WarnAsError': 'true',
'DebugInformationFormat': '3',
'AdditionalOptions': [ '/MP' ],
},

View File

@ -53,6 +53,13 @@
]
},
}],
[ 'skia_os == "win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'false',
},
},
}],
],
},
],

View File

@ -227,6 +227,13 @@
]
},
}],
[ 'skia_os == "win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'WarnAsError': 'false',
},
},
}],
],
},
],

View File

@ -89,8 +89,9 @@ static inline float sk_float_copysign(float x, float y) {
extern const uint32_t gIEEENotANumber;
extern const uint32_t gIEEEInfinity;
extern const uint32_t gIEEENegativeInfinity;
#define SK_FloatNaN (*reinterpret_cast<const float*>(&gIEEENotANumber))
#define SK_FloatInfinity (*reinterpret_cast<const float*>(&gIEEEInfinity))
#define SK_FloatNegativeInfinity (*reinterpret_cast<const float*>(&gIEEENegativeInfinity))
#endif

View File

@ -39,6 +39,9 @@
/** SK_ScalarInfinity is defined to be infinity as an SkScalar
*/
#define SK_ScalarInfinity SK_FloatInfinity
/** SK_ScalarNegativeInfinity is defined to be negative infinity as an SkScalar
*/
#define SK_ScalarNegativeInfinity SK_FloatNegativeInfinity
/** SK_ScalarMax is defined to be the largest value representable as an SkScalar
*/
#define SK_ScalarMax (3.402823466e+38f)
@ -220,7 +223,8 @@
#define SK_Scalar1 SK_Fixed1
#define SK_ScalarHalf SK_FixedHalf
#define SK_ScalarInfinity SK_FixedMax
#define SK_ScalarInfinity SK_FixedMax
#define SK_ScalarNegativeInfinity SK_FixedMin
#define SK_ScalarMax SK_FixedMax
#define SK_ScalarMin SK_FixedMin
#define SK_ScalarNaN SK_FixedNaN

View File

@ -15,6 +15,7 @@
#ifdef SK_SCALAR_IS_FLOAT
const uint32_t gIEEENotANumber = 0x7FFFFFFF;
const uint32_t gIEEEInfinity = 0x7F800000;
const uint32_t gIEEENegativeInfinity = 0xFF800000;
#endif
#define sub_shift(zeros, x, n) \

View File

@ -239,6 +239,7 @@ static void test_rect_isfinite(skiatest::Reporter* reporter) {
static void test_path_isfinite(skiatest::Reporter* reporter) {
const SkScalar inf = SK_ScalarInfinity;
const SkScalar negInf = SK_ScalarNegativeInfinity;
const SkScalar nan = SK_ScalarNaN;
SkPath path;
@ -252,7 +253,7 @@ static void test_path_isfinite(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, path.isFinite());
path.reset();
path.moveTo(inf, -inf);
path.moveTo(inf, negInf);
REPORTER_ASSERT(reporter, !path.isFinite());
path.reset();