Fixing Windows compiler complaints

http://codereview.appspot.com/5991056/



git-svn-id: http://skia.googlecode.com/svn/trunk@3626 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/InterpBench.cpp b/bench/InterpBench.cpp
index 69fbd9b..1db832d 100644
--- a/bench/InterpBench.cpp
+++ b/bench/InterpBench.cpp
@@ -18,8 +18,8 @@
 public:
     InterpBench(void* param, const char name[]) : INHERITED(param) {
         fName.printf("interp_%s", name);
-        fFx = 3.3;
-        fDx = 0.1257;
+        fFx = 3.3f;
+        fDx = 0.1257f;
     }
 
     virtual void performTest(int16_t dst[], float x, float dx, int count) = 0;
diff --git a/gm/gm.h b/gm/gm.h
index bec29bf..97b21d97 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -12,7 +12,6 @@
 #include "SkCanvas.h"
 #include "SkDevice.h"
 #include "SkPaint.h"
-#include "SkRefCnt.h"
 #include "SkSize.h"
 #include "SkString.h"
 #include "SkTRegistry.h"
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 76bd491..def0094 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -29,7 +29,6 @@
 #include "gl/SkDebugGLContext.h"
 #include "SkPicture.h"
 #include "SkStream.h"
-#include "SkRefCnt.h"
 
 static bool gForceBWtext;
 
diff --git a/gm/gradients.cpp b/gm/gradients.cpp
index 3eb5633..ad745df 100644
--- a/gm/gradients.cpp
+++ b/gm/gradients.cpp
@@ -237,9 +237,9 @@
         center.set(SkIntToScalar(dim.width())/2, SkIntToScalar(dim.height())/2);
         SkScalar radius = SkIntToScalar(dim.width())/2;
         const SkColor colors[] = { 0x7f7f7f7f, 0x7f7f7f7f, 0xb2000000 };
-        const SkScalar pos[] = { SkFloatToScalar(0.0),
-                             SkFloatToScalar(0.35),
-                             SkFloatToScalar(1.0) };
+        const SkScalar pos[] = { SkFloatToScalar(0.0f),
+                             SkFloatToScalar(0.35f),
+                             SkFloatToScalar(1.0f) };
         SkShader* shader =
             SkGradientShader::CreateRadial(center, radius, colors,
                                            pos, SK_ARRAY_COUNT(pos),
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 8e39fb5..a57ac00 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -79,7 +79,7 @@
      * @param height        height of rectangle to write in pixels.
      * @param config        the pixel config of the source buffer
      * @param buffer        memory to read pixels from
-     * @param rowBytes      number of bytes bewtween consecutive rows. Zero
+     * @param rowBytes      number of bytes between consecutive rows. Zero
      *                      means rows are tightly packed.
      */
     void writePixels(int left, int top, int width, int height,
diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp
index 062eca3..83f962e 100644
--- a/samplecode/SampleFontScalerTest.cpp
+++ b/samplecode/SampleFontScalerTest.cpp
@@ -104,7 +104,7 @@
                 SkAutoCanvasRestore acr(canvas, true);
                 canvas->translate(SkIntToScalar(50 + i * 230),
                                   SkIntToScalar(20));
-                rotate_about(canvas, i * 5, x, y * 10);
+                rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
 
                 {
                     SkPaint p;
diff --git a/samplecode/TransitionView.cpp b/samplecode/TransitionView.cpp
index 99d1275..76e18b6 100644
--- a/samplecode/TransitionView.cpp
+++ b/samplecode/TransitionView.cpp
@@ -146,7 +146,7 @@
         fEnd[kPrevX] = -lr;
         fEnd[kPrevY] = -ud;
         fEnd[kNextX] = fEnd[kNextY] = 0;
-        SkScalar blend[] = {0.8, 0.0, 0.0, 1.0};
+        SkScalar blend[] = {0.8f, 0.0f, 0.0f, 1.0f};
         fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend);
         fInterp.setKeyFrame(1, SkTime::GetMSecs()+500, fEnd, blend);
     }
diff --git a/src/core/SkDeviceProfile.cpp b/src/core/SkDeviceProfile.cpp
index 2c2cb88..c5abc8e 100644
--- a/src/core/SkDeviceProfile.cpp
+++ b/src/core/SkDeviceProfile.cpp
@@ -2,8 +2,8 @@
 
 #include "SkDeviceProfile.h"
 
-#define DEFAULT_GAMMAEXP        2.2
-#define DEFAULT_CONTRASTSCALE   0.5
+#define DEFAULT_GAMMAEXP        2.2f
+#define DEFAULT_CONTRASTSCALE   0.5f
 #define DEFAULT_LCDCONFIG       SkDeviceProfile::kNone_LCDConfig
 #define DEFAULT_FONTHINTLEVEL   SkDeviceProfile::kSlight_FontHintLevel
 
diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp
index 485b38b..9846e7d 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -69,7 +69,7 @@
     // Test precision of rotation in common cases
     int common_angles[] = { 0, 90, -90, 180, -180, 270, -270, 360, -360 };
     for (int i = 0; i < 9; ++i) {
-        rot.setRotateDegreesAbout(0, 0, -1, common_angles[i]);
+        rot.setRotateDegreesAbout(0, 0, -1, SkIntToScalar(common_angles[i]));
 
         SkMatrix rot3x3 = rot;
         REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 868ce31..c4ad0a6 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -162,7 +162,7 @@
 
 static void check_close(skiatest::Reporter* reporter, const SkPath& path) {
     for (int i = 0; i < 2; ++i) {
-        SkPath::Iter iter(path, (bool)i);
+        SkPath::Iter iter(path, SkToBool(i));
         SkPoint mv;
         SkPoint pts[4];
         SkPath::Verb v;
@@ -943,7 +943,6 @@
             do {
                 nextVerb = static_cast<SkPath::Verb>((rand.nextU() >> 16) % SkPath::kDone_Verb);
             } while (lastWasClose && nextVerb == SkPath::kClose_Verb);
-            int numRequiredPts;
             switch (nextVerb) {
                 case SkPath::kMove_Verb:
                     expectedPts[numPoints] = randomPts[(rand.nextU() >> 16) % 25];