Fixed remaining clang compiler warnings

https://codereview.appspot.com/6865053/



git-svn-id: http://skia.googlecode.com/svn/trunk@6646 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index b9e71f7..4391626 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -59,8 +59,8 @@
         fBitmap.eraseColor(SK_ColorBLACK);
         drawIntoBitmap(fBitmap);
 
-        fSrcR.set(0, 0, w, h);
-        fDstR.set(0, 0, w, h);
+        fSrcR.iset(0, 0, w, h);
+        fDstR.iset(0, 0, w, h);
     }
 
 protected:
diff --git a/gm/bitmaprect.cpp b/gm/bitmaprect.cpp
index 4af6f0b..9c6d472 100644
--- a/gm/bitmaprect.cpp
+++ b/gm/bitmaprect.cpp
@@ -94,9 +94,9 @@
     static const int gYSize = 3;
 
     SkColor textureData[gXSize][gYSize] = {
-        SK_ColorRED,    SK_ColorWHITE, SK_ColorBLUE,
-        SK_ColorGREEN,  SK_ColorBLACK, SK_ColorCYAN,
-        SK_ColorYELLOW, SK_ColorGRAY,  SK_ColorMAGENTA
+        { SK_ColorRED,    SK_ColorWHITE, SK_ColorBLUE },
+        { SK_ColorGREEN,  SK_ColorBLACK, SK_ColorCYAN },
+        { SK_ColorYELLOW, SK_ColorGRAY,  SK_ColorMAGENTA }
     };
 
 
diff --git a/gm/fatpathfill.cpp b/gm/fatpathfill.cpp
index c86dfcb..c583d64 100644
--- a/gm/fatpathfill.cpp
+++ b/gm/fatpathfill.cpp
@@ -81,7 +81,8 @@
 
         for (int i = 0; i < REPEAT_LOOP; ++i) {
             SkPath line, path;
-            line.moveTo(1, 2); line.lineTo(4 + i, 1);
+            line.moveTo(SkIntToScalar(1), SkIntToScalar(2)); 
+            line.lineTo(SkIntToScalar(4 + i), SkIntToScalar(1));
             paint.getFillPath(line, &path);
             draw_fatpath(canvas, surface, &path, 1);
 
diff --git a/gm/modecolorfilters.cpp b/gm/modecolorfilters.cpp
index 3515033..4f04dd4 100644
--- a/gm/modecolorfilters.cpp
+++ b/gm/modecolorfilters.cpp
@@ -123,11 +123,11 @@
         int idx = 0;
         static const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
         for (size_t cfm = 0; cfm < SK_ARRAY_COUNT(modes); ++cfm) {
-            for (int cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
+            for (size_t cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
                 SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(colors[cfc],
                                                                                modes[cfm]));
                 paint.setColorFilter(cf);
-                for (int s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
+                for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
                     paint.setShader(shaders[s]);
                     bool hasShader = NULL == paint.getShader();
                     int paintColorCnt = hasShader ? SK_ARRAY_COUNT(alphas) : SK_ARRAY_COUNT(colors);
@@ -146,7 +146,7 @@
             }
         }
 
-        for (int i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
+        for (size_t i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
             SkSafeUnref(shaders[i]);
         }
     }
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index f2fbe77..ab4ea0a 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -170,6 +170,8 @@
         case 2:
             return SkGradientShader::CreateSweep(center.fX, center.fY, colors, NULL, SK_ARRAY_COUNT(colors));
     }
+
+    return NULL;
 }
 
 static SkShader* make_radial(SkShader::TileMode tx, SkShader::TileMode ty) {
diff --git a/include/utils/SkRunnable.h b/include/utils/SkRunnable.h
index c7bedcc..84e4375 100644
--- a/include/utils/SkRunnable.h
+++ b/include/utils/SkRunnable.h
@@ -10,6 +10,7 @@
 
 class SkRunnable {
 public:
+    virtual ~SkRunnable() {};
     virtual void run() = 0;
 };
 
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 435d7ee..1b86d43 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -417,7 +417,7 @@
                                         GrContext*,
                                         GrTexture* dummyTextures[2]) {
     SkColorMatrix colorMatrix;
-    for (int i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
+    for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
         colorMatrix.fMat[i] = random->nextSScalar1();
     }
     return SkNEW_ARGS(ColorMatrixEffect, (colorMatrix));
diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp
index a69111c..43caacd 100644
--- a/src/utils/SkMatrix44.cpp
+++ b/src/utils/SkMatrix44.cpp
@@ -102,7 +102,7 @@
     memcpy(dst, src, 16 * sizeof(double));
 #elif defined SK_MSCALAR_IS_FLOAT
     for (int i = 0; i < 16; ++i) {
-        dst[i] = SkMScalarToDouble(src[i]);
+        dst[i] = SkDoubleToMScalar(src[i]);
     }
 #endif
     fIdentity = false;
@@ -124,10 +124,10 @@
 void SkMatrix44::setRowMajord(const double src[]) {
     SkMScalar* dst = &fMat[0][0];
     for (int i = 0; i < 4; ++i) {
-        dst[0] = SkMScalarToDouble(src[0]);
-        dst[4] = SkMScalarToDouble(src[1]);
-        dst[8] = SkMScalarToDouble(src[2]);
-        dst[12] = SkMScalarToDouble(src[3]);
+        dst[0] = SkDoubleToMScalar(src[0]);
+        dst[4] = SkDoubleToMScalar(src[1]);
+        dst[8] = SkDoubleToMScalar(src[2]);
+        dst[12] = SkDoubleToMScalar(src[3]);
         src += 4;
         dst += 1;
     }
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index efbd02d..ed2be1d 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -98,7 +98,8 @@
 
     dst.fRight += SK_Scalar1;
     matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
-    REPORTER_ASSERT(reporter, SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask == matrix.getType());
+    REPORTER_ASSERT(reporter, 
+                    (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask) == matrix.getType());
     REPORTER_ASSERT(reporter, matrix.rectStaysRect());
 
     dst = src;
diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp
index a358c5a..e88ed8a 100644
--- a/tests/RoundRectTest.cpp
+++ b/tests/RoundRectTest.cpp
@@ -136,7 +136,7 @@
     REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
     r = rr1.rect();
     REPORTER_ASSERT(reporter, rect == r);
-    for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+    for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
         REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
     }
 
@@ -149,7 +149,7 @@
     REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
     r = rr2.rect();
     REPORTER_ASSERT(reporter, rect == r);
-    for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+    for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
         REPORTER_ASSERT(reporter, isIn[i] == rr2.contains(pts[i].fX, pts[i].fY));
     }
 
@@ -195,7 +195,7 @@
     REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type());
     oval = rr1.rect();
     REPORTER_ASSERT(reporter, oval == rect);
-    for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+    for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
         REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
     }
 }
@@ -230,7 +230,7 @@
     rr1.setRectXY(rect, 20, 20);
 
     REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type());
-    for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+    for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
         REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
     }
 
@@ -261,7 +261,7 @@
     rr2.setRectRadii(rect, radii);
 
     REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type());
-    for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+    for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
         REPORTER_ASSERT(reporter, isIn[i] == rr2.contains(pts2[i].fX, pts2[i].fY));
     }
 }