aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-19 19:58:58 +0000
committerGravatar senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-19 19:58:58 +0000
commit64cc579efa7e416c7298ed159d76b074b283c0f9 (patch)
tree67a25945efd79dd7e76afa3126c01032a4086891 /samplecode
parent9e0f2ee0333244de11cc8e41c667bc676bc3d1a5 (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')
-rw-r--r--samplecode/ClockFaceView.cpp2
-rw-r--r--samplecode/SampleAARects.cpp2
-rw-r--r--samplecode/SampleAll.cpp8
-rw-r--r--samplecode/SampleArc.cpp2
-rw-r--r--samplecode/SampleAvoid.cpp2
-rw-r--r--samplecode/SampleBitmapRect.cpp2
-rw-r--r--samplecode/SampleComplexClip.cpp2
-rw-r--r--samplecode/SampleDitherBitmap.cpp2
-rw-r--r--samplecode/SampleDrawLooper.cpp2
-rw-r--r--samplecode/SampleEffects.cpp2
-rw-r--r--samplecode/SampleLayers.cpp2
-rw-r--r--samplecode/SampleLineClipper.cpp2
-rw-r--r--samplecode/SampleMeasure.cpp2
-rw-r--r--samplecode/SamplePatch.cpp5
-rw-r--r--samplecode/SamplePath.cpp4
-rw-r--r--samplecode/SamplePolyToPoly.cpp20
-rw-r--r--samplecode/SampleRegion.cpp2
-rw-r--r--samplecode/SampleShaderText.cpp2
-rw-r--r--samplecode/SampleSlides.cpp7
-rw-r--r--samplecode/SampleText.cpp2
-rw-r--r--samplecode/SampleTextEffects.cpp2
-rw-r--r--samplecode/SampleTiling.cpp16
-rw-r--r--samplecode/SampleVertices.cpp5
23 files changed, 52 insertions, 45 deletions
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index 6d4ef97f9e..c829b69b60 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -17,7 +17,7 @@ static inline SkPMColor rgb2gray(SkPMColor c)
unsigned g = SkGetPackedG32(c);
unsigned b = SkGetPackedB32(c);
- unsigned x = r * 5 + g * 7 + b * 4 >> 4;
+ unsigned x = (r * 5 + g * 7 + b * 4) >> 4;
return SkPackARGB32(0, x, x, x) | (c & (SK_A32_MASK << SK_A32_SHIFT));
}
diff --git a/samplecode/SampleAARects.cpp b/samplecode/SampleAARects.cpp
index b42c1e9e14..34a33b0748 100644
--- a/samplecode/SampleAARects.cpp
+++ b/samplecode/SampleAARects.cpp
@@ -70,7 +70,7 @@ protected:
SkScalar dx = SkIntToScalar(80);
SkScalar dy = SkIntToScalar(100);
SkMatrix matrix;
- for (int p = 0; p < SK_ARRAY_COUNT(paints); ++p) {
+ for (size_t p = 0; p < SK_ARRAY_COUNT(paints); ++p) {
for (int stroke = 0; stroke < 2; ++stroke) {
paints[p].setStyle(stroke ? SkPaint::kStroke_Style : SkPaint::kFill_Style);
for (int a = 0; a < 3; ++ a) {
diff --git a/samplecode/SampleAll.cpp b/samplecode/SampleAll.cpp
index 75d1a317ca..abbf8f991d 100644
--- a/samplecode/SampleAll.cpp
+++ b/samplecode/SampleAll.cpp
@@ -408,7 +408,7 @@ protected:
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 @@ SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect {
}
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 @@ SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect {
}
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 @@ SkCornerPathEffect.h:28:class SkCornerPathEffect : public SkPathEffect {
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);
diff --git a/samplecode/SampleArc.cpp b/samplecode/SampleArc.cpp
index 504d8d812d..8e3ad88cb4 100644
--- a/samplecode/SampleArc.cpp
+++ b/samplecode/SampleArc.cpp
@@ -97,7 +97,7 @@ protected:
225, 90
};
- for (int i = 0; i < SK_ARRAY_COUNT(gAngles); i += 2) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gAngles); i += 2) {
paint.setColor(SK_ColorBLACK);
drawRectWithLines(canvas, r, paint);
diff --git a/samplecode/SampleAvoid.cpp b/samplecode/SampleAvoid.cpp
index 95363505cb..868a67c62f 100644
--- a/samplecode/SampleAvoid.cpp
+++ b/samplecode/SampleAvoid.cpp
@@ -23,7 +23,7 @@ public:
SK_ARRAY_COUNT(colors),
SkShader::kMirror_TileMode);
#else
- SkPoint pts[] = { SkIntToScalar(W)/2, SkIntToScalar(H)/2 };
+ SkPoint pts[] = { { SkIntToScalar(W)/2, SkIntToScalar(H)/2 } };
fShader = SkGradientShader::CreateRadial(pts[0], SkIntToScalar(H)/5,
colors, NULL,
SK_ARRAY_COUNT(colors),
diff --git a/samplecode/SampleBitmapRect.cpp b/samplecode/SampleBitmapRect.cpp
index 2d56db9f00..002b2b9b17 100644
--- a/samplecode/SampleBitmapRect.cpp
+++ b/samplecode/SampleBitmapRect.cpp
@@ -25,7 +25,7 @@ static SkBitmap make_bitmap() {
canvas.drawColor(SK_ColorRED);
SkPaint paint;
paint.setAntiAlias(true);
- const SkPoint pts[] = { 0, 0, 64, 64 };
+ const SkPoint pts[] = { { 0, 0 }, { 64, 64 } };
const SkColor colors[] = { SK_ColorWHITE, SK_ColorBLUE };
paint.setShader(SkGradientShader::CreateLinear(pts, colors, NULL, 2,
SkShader::kClamp_TileMode))->unref();
diff --git a/samplecode/SampleComplexClip.cpp b/samplecode/SampleComplexClip.cpp
index 8ee078b2fa..672d0555c5 100644
--- a/samplecode/SampleComplexClip.cpp
+++ b/samplecode/SampleComplexClip.cpp
@@ -88,7 +88,7 @@ protected:
canvas->save();
for (int invA = 0; invA < 2; ++invA) {
- for (int op = 0; op < SK_ARRAY_COUNT(gOps); ++op) {
+ for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); ++op) {
int idx = invA * SK_ARRAY_COUNT(gOps) + op;
if (!(idx % 3)) {
canvas->restore();
diff --git a/samplecode/SampleDitherBitmap.cpp b/samplecode/SampleDitherBitmap.cpp
index 91199c2ec9..0d62446dec 100644
--- a/samplecode/SampleDitherBitmap.cpp
+++ b/samplecode/SampleDitherBitmap.cpp
@@ -16,7 +16,7 @@ static void draw_rect(SkCanvas* canvas, const SkRect& r, const SkPaint& p) {
static void draw_gradient(SkCanvas* canvas) {
SkRect r = { 0, 0, SkIntToScalar(256), SkIntToScalar(32) };
- SkPoint pts[] = { r.fLeft, r.fTop, r.fRight, r.fTop };
+ SkPoint pts[] = { { r.fLeft, r.fTop }, { r.fRight, r.fTop } };
SkColor colors[] = { 0xFF000000, 0xFFFF0000 };
SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2,
SkShader::kClamp_TileMode);
diff --git a/samplecode/SampleDrawLooper.cpp b/samplecode/SampleDrawLooper.cpp
index abe2c70b93..30879f75fe 100644
--- a/samplecode/SampleDrawLooper.cpp
+++ b/samplecode/SampleDrawLooper.cpp
@@ -35,7 +35,7 @@ public:
info.fPaintBits = SkLayerDrawLooper::kStyle_Bit | SkLayerDrawLooper::kMaskFilter_Bit;
info.fColorMode = SkXfermode::kSrc_Mode;
- for (int i = 0; i < SK_ARRAY_COUNT(gParams); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gParams); i++) {
info.fOffset.set(gParams[i].fOffset, gParams[i].fOffset);
SkPaint* paint = fLooper->addLayer(info);
paint->setAntiAlias(true);
diff --git a/samplecode/SampleEffects.cpp b/samplecode/SampleEffects.cpp
index 158a89f5d9..a63c08d3f5 100644
--- a/samplecode/SampleEffects.cpp
+++ b/samplecode/SampleEffects.cpp
@@ -44,7 +44,7 @@ static void paint_proc2(SkPaint* paint) {
static void paint_proc3(SkPaint* paint) {
SkColor colors[] = { SK_ColorRED, COLOR, SK_ColorBLUE };
- SkPoint pts[] = { 3, 0, 7, 5 };
+ SkPoint pts[] = { { 3, 0 }, { 7, 5 } };
paint->setShader(SkGradientShader::CreateLinear(pts, colors, NULL, SK_ARRAY_COUNT(colors),
SkShader::kMirror_TileMode))->unref();
}
diff --git a/samplecode/SampleLayers.cpp b/samplecode/SampleLayers.cpp
index f1e8dd8973..6fc9c83492 100644
--- a/samplecode/SampleLayers.cpp
+++ b/samplecode/SampleLayers.cpp
@@ -22,7 +22,7 @@
static void make_paint(SkPaint* paint) {
SkColor colors[] = { 0, SK_ColorWHITE };
- SkPoint pts[] = { 0, 0, 0, SK_Scalar1*20 };
+ SkPoint pts[] = { { 0, 0 }, { 0, SK_Scalar1*20 } };
SkShader* s = SkGradientShader::CreateLinear(pts, colors, NULL, 2, SkShader::kClamp_TileMode);
paint->setShader(s)->unref();
diff --git a/samplecode/SampleLineClipper.cpp b/samplecode/SampleLineClipper.cpp
index 2635a3056a..d0a8667f0e 100644
--- a/samplecode/SampleLineClipper.cpp
+++ b/samplecode/SampleLineClipper.cpp
@@ -155,7 +155,7 @@ class LineClipperView : public SkView {
SkPoint fPts[4];
void randPts() {
- for (int i = 0; i < SK_ARRAY_COUNT(fPts); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(fPts); i++) {
fPts[i].set(fRand.nextUScalar1() * 640,
fRand.nextUScalar1() * 480);
}
diff --git a/samplecode/SampleMeasure.cpp b/samplecode/SampleMeasure.cpp
index 70b88126db..eb7a288423 100644
--- a/samplecode/SampleMeasure.cpp
+++ b/samplecode/SampleMeasure.cpp
@@ -46,7 +46,7 @@ static void doMeasure(SkCanvas* canvas, const SkPaint& paint, const char text[])
SkRect bounds;
SkPaint p(paint);
- for (int i = 0; i < SK_ARRAY_COUNT(gSettings); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gSettings); i++) {
p.setLinearText(gSettings[i].fLinearText);
p.setDevKernText(gSettings[i].fDevKernText);
SkScalar scale = gSettings[i].fScale;
diff --git a/samplecode/SamplePatch.cpp b/samplecode/SamplePatch.cpp
index 0bfaa5aa22..ea365c719d 100644
--- a/samplecode/SamplePatch.cpp
+++ b/samplecode/SamplePatch.cpp
@@ -42,7 +42,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);
@@ -316,7 +317,7 @@ protected:
}
virtual SkView::Click* onFindClickHandler(SkScalar x, SkScalar y) {
- for (int i = 0; i < SK_ARRAY_COUNT(fPts); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(fPts); i++) {
if (hittest(fPts[i], x, y)) {
return new PtClick(this, i);
}
diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp
index 4fef377a97..cd45ed95e0 100644
--- a/samplecode/SamplePath.cpp
+++ b/samplecode/SamplePath.cpp
@@ -168,9 +168,9 @@ protected:
SkPaint::kRound_Join
};
- for (int i = 0; i < SK_ARRAY_COUNT(gJoins); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gJoins); i++) {
canvas->save();
- for (int j = 0; j < SK_ARRAY_COUNT(fPath); j++) {
+ for (size_t j = 0; j < SK_ARRAY_COUNT(fPath); j++) {
this->drawPath(canvas, fPath[j], gJoins[i]);
canvas->translate(SkIntToScalar(200), 0);
}
diff --git a/samplecode/SamplePolyToPoly.cpp b/samplecode/SamplePolyToPoly.cpp
index 29a47f7109..aea0cb4457 100644
--- a/samplecode/SamplePolyToPoly.cpp
+++ b/samplecode/SamplePolyToPoly.cpp
@@ -13,8 +13,12 @@ public:
PolyToPolyView() {
// tests
{
- SkPoint src[] = { 0, 0, SK_Scalar1, 0, 0, SK_Scalar1 };
- SkPoint dst[] = { 0, 0, 2*SK_Scalar1, 0, 0, 2*SK_Scalar1 };
+ SkPoint src[] = { { 0, 0 },
+ { SK_Scalar1, 0 },
+ { 0, SK_Scalar1 } };
+ SkPoint dst[] = { { 0, 0 },
+ { 2*SK_Scalar1, 0 },
+ { 0, 2*SK_Scalar1 } };
SkMatrix m1, m2;
bool success;
@@ -42,14 +46,14 @@ public:
{
const SkPoint src[] = {
- SkIntToScalar(1), SkIntToScalar(0),
- SkIntToScalar(4), SkIntToScalar(7),
- SkIntToScalar(10), SkIntToScalar(2)
+ { SkIntToScalar(1), SkIntToScalar(0) },
+ { SkIntToScalar(4), SkIntToScalar(7) },
+ { SkIntToScalar(10), SkIntToScalar(2) }
};
const SkPoint dst[] = {
- SkIntToScalar(4), SkIntToScalar(2),
- SkIntToScalar(45), SkIntToScalar(26),
- SkIntToScalar(32), SkIntToScalar(17)
+ { SkIntToScalar(4), SkIntToScalar(2) },
+ { SkIntToScalar(45), SkIntToScalar(26) },
+ { SkIntToScalar(32), SkIntToScalar(17) }
};
SkMatrix m0, m1;
diff --git a/samplecode/SampleRegion.cpp b/samplecode/SampleRegion.cpp
index 272c722993..822bd6fa47 100644
--- a/samplecode/SampleRegion.cpp
+++ b/samplecode/SampleRegion.cpp
@@ -235,7 +235,7 @@ protected:
canvas->translate(0, SkIntToScalar(200));
- for (int op = 0; op < SK_ARRAY_COUNT(gOps); op++) {
+ for (size_t op = 0; op < SK_ARRAY_COUNT(gOps); op++) {
canvas->drawText(gOps[op].fName, strlen(gOps[op].fName), SkIntToScalar(75), SkIntToScalar(50), textPaint);
this->drawRgnOped(canvas, gOps[op].fOp, gOps[op].fColor);
diff --git a/samplecode/SampleShaderText.cpp b/samplecode/SampleShaderText.cpp
index 790137c1d7..2748b559a2 100644
--- a/samplecode/SampleShaderText.cpp
+++ b/samplecode/SampleShaderText.cpp
@@ -11,7 +11,7 @@ static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) {
SkCanvas canvas(*bm);
SkScalar s = SkIntToScalar(w < h ? w : h);
- SkPoint pts[] = { 0, 0, s, s };
+ SkPoint pts[] = { { 0, 0 }, { s, s } };
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE };
SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 };
SkPaint paint;
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;
diff --git a/samplecode/SampleText.cpp b/samplecode/SampleText.cpp
index a2d6dd2c06..267653006c 100644
--- a/samplecode/SampleText.cpp
+++ b/samplecode/SampleText.cpp
@@ -112,7 +112,7 @@ static void test_breakText() {
mm = m;
}
- SkDEBUGCODE(int length2 =) paint.breakText(text, length, width, &mm);
+ SkDEBUGCODE(size_t length2 =) paint.breakText(text, length, width, &mm);
SkASSERT(length2 == length);
SkASSERT(mm == width);
}
diff --git a/samplecode/SampleTextEffects.cpp b/samplecode/SampleTextEffects.cpp
index 733dd31c24..f256b2ef18 100644
--- a/samplecode/SampleTextEffects.cpp
+++ b/samplecode/SampleTextEffects.cpp
@@ -354,7 +354,7 @@ protected:
paint.setTypeface(fFace);
- 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);
diff --git a/samplecode/SampleTiling.cpp b/samplecode/SampleTiling.cpp
index b3c73d7f58..4752ed1eba 100644
--- a/samplecode/SampleTiling.cpp
+++ b/samplecode/SampleTiling.cpp
@@ -22,7 +22,7 @@ static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) {
bm->eraseColor(0);
SkCanvas canvas(*bm);
- SkPoint pts[] = { 0, 0, SkIntToScalar(w), SkIntToScalar(h) };
+ SkPoint pts[] = { { 0, 0 }, { SkIntToScalar(w), SkIntToScalar(h) } };
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE };
SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 };
SkPaint paint;
@@ -62,7 +62,7 @@ public:
TilingView()
: fLooper(SkIntToScalar(1), SkIntToScalar(2), SkIntToScalar(2),
0x88000000) {
- for (int i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) {
makebm(&fTexture[i], gConfigs[i], gWidth, gHeight);
}
}
@@ -99,8 +99,8 @@ protected:
}
if (textCanvas) {
- for (int kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
- for (int ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) {
+ for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
+ for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) {
SkPaint p;
SkString str;
p.setAntiAlias(true);
@@ -118,11 +118,11 @@ protected:
y += SkIntToScalar(16);
- for (int i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) {
- for (int j = 0; j < SK_ARRAY_COUNT(gFilters); j++) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gConfigs); i++) {
+ for (size_t j = 0; j < SK_ARRAY_COUNT(gFilters); j++) {
x = SkIntToScalar(10);
- for (int kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
- for (int ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) {
+ for (size_t kx = 0; kx < SK_ARRAY_COUNT(gModes); kx++) {
+ for (size_t ky = 0; ky < SK_ARRAY_COUNT(gModes); ky++) {
SkPaint paint;
setup(&paint, fTexture[i], gFilters[j], gModes[kx], gModes[ky]);
paint.setDither(true);
diff --git a/samplecode/SampleVertices.cpp b/samplecode/SampleVertices.cpp
index 4557cc4e17..74e757f43e 100644
--- a/samplecode/SampleVertices.cpp
+++ b/samplecode/SampleVertices.cpp
@@ -38,7 +38,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);
@@ -88,7 +89,7 @@ protected:
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);