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
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 75d1a31..abbf8f9 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -408,7 +408,7 @@
pos2[index].set(SkIntToScalar(index * 10), SkIntToScalar(20));
// shaders
- SkPoint linearPoints[] = { 0, 0, SkIntToScalar(40), SkIntToScalar(40) };
+ SkPoint linearPoints[] = { { 0, 0, }, { SkIntToScalar(40), SkIntToScalar(40) } };
SkColor linearColors[] = { SK_ColorRED, SK_ColorBLUE };
SkScalar* linearPos = NULL;
int linearCount = 2;
@@ -624,7 +624,7 @@
}
SkShader* shaderTest() {
- SkPoint pts[] = {0, 0, SkIntToScalar(100), 0 };
+ SkPoint pts[] = { { 0, 0, }, { SkIntToScalar(100), 0 } };
SkColor colors[] = { SK_ColorRED, SK_ColorBLUE };
SkShader* shaderA = SkGradientShader::CreateLinear(pts, colors, NULL,
2, SkShader::kClamp_TileMode);
@@ -647,7 +647,7 @@
}
void drawRaster(SkCanvas* canvas) {
- for (int index = 0; index < SK_ARRAY_COUNT(gRastProcs); index++)
+ for (size_t index = 0; index < SK_ARRAY_COUNT(gRastProcs); index++)
drawOneRaster(canvas);
}
@@ -665,7 +665,7 @@
SkString str("GOOGLE");
- 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);
// paint.setMaskFilter(NULL);