diff options
author | 2011-05-19 19:58:58 +0000 | |
---|---|---|
committer | 2011-05-19 19:58:58 +0000 | |
commit | 64cc579efa7e416c7298ed159d76b074b283c0f9 (patch) | |
tree | 67a25945efd79dd7e76afa3126c01032a4086891 /samplecode/SampleSlides.cpp | |
parent | 9e0f2ee0333244de11cc8e41c667bc676bc3d1a5 (diff) |
The plain Makefile was using -Wall, but the gyp build wasn't. This CL turns on
-Wall -Wextra and -Wno-unused in common.gypi. This revealed a lot of warnings
(and some actual bugs), all of which I fixed here. This is pretty mindless
stuff for the most part (order of intialization, missing initializers, && within
||, etc), but will allow us to build cleanly with -Wall and -Wextra (and
-Werror, if we so choose).
I put defaults into switches that were missing cases. I could put in the actual
missing enums instead if that's desired. I could also assert on missing enums
instead of break, if that's desired. I wasn't sure how to test the stuff in
"animator", so that should be looked at a bit more closely.
Review URL: http://codereview.appspot.com/4547055/
git-svn-id: http://skia.googlecode.com/svn/trunk@1386 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleSlides.cpp')
-rw-r--r-- | samplecode/SampleSlides.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp index f57cb5af49..3d2a61e5fb 100644 --- a/samplecode/SampleSlides.cpp +++ b/samplecode/SampleSlides.cpp @@ -324,7 +324,8 @@ static SkShader* make_shader0(SkIPoint* size) { } static SkShader* make_shader1(const SkIPoint& size) { - SkPoint pts[] = { 0, 0, SkIntToScalar(size.fX), SkIntToScalar(size.fY) }; + SkPoint pts[] = { { 0, 0 }, + { SkIntToScalar(size.fX), SkIntToScalar(size.fY) } }; SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorRED }; return SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode, NULL); @@ -439,7 +440,7 @@ static void mesh_slide(SkCanvas* canvas) { paint.setDither(true); paint.setFilterBitmap(true); - for (int i = 0; i < SK_ARRAY_COUNT(fRecs); i++) { + for (size_t i = 0; i < SK_ARRAY_COUNT(fRecs); i++) { canvas->save(); paint.setShader(NULL); @@ -725,7 +726,7 @@ static void texteffect_slide(SkCanvas* canvas) { paint.setTextSize(75); paint.setAntiAlias(true); paint.setColor(SK_ColorBLUE); - for (int i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { + for (size_t i = 0; i < SK_ARRAY_COUNT(gRastProcs); i++) { apply_shader(&paint, i); canvas->drawText(str, len, x, y, paint); y += 80; |