Fix more VS2010 warnings.
Review URL: http://codereview.appspot.com/5169053/
git-svn-id: http://skia.googlecode.com/svn/trunk@2432 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/experimental/Debugger/DebuggerStateView.cpp b/experimental/Debugger/DebuggerStateView.cpp
index dd65c55..fdf2af7 100644
--- a/experimental/Debugger/DebuggerStateView.cpp
+++ b/experimental/Debugger/DebuggerStateView.cpp
@@ -40,7 +40,7 @@
SkPaint p;
p.setTextSize(SKDEBUGGER_TEXTSIZE);
p.setAntiAlias(true);
- int x = 50;
+ SkScalar x = 50 * SK_Scalar1;
canvas->drawText(fPaintInfo.c_str(), fPaintInfo.size(), x, 30, p);
canvas->drawText(fMatrix.c_str(), fMatrix.size(), x, 60, p);
canvas->drawText(fClip.c_str(), fClip.size(), x, 90, p);
diff --git a/experimental/SkSetPoly3To3_D.cpp b/experimental/SkSetPoly3To3_D.cpp
index 29526c9..810e6b2 100644
--- a/experimental/SkSetPoly3To3_D.cpp
+++ b/experimental/SkSetPoly3To3_D.cpp
@@ -11,7 +11,7 @@
static SkScalar SkDScalar_toScalar(SkDScalar value) {
SkDScalar result = (value + (1 << 15)) >> 16;
- int top = result >> 31;
+ SkDEBUGCODE(int top = static_cast<int>(result >> 31);)
SkASSERT(top == 0 || top == -1);
return (SkScalar)result;
}
diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp
index 04b0dc0..6d202a7 100644
--- a/tools/skdiff_main.cpp
+++ b/tools/skdiff_main.cpp
@@ -179,12 +179,12 @@
/// Comparison routine for qsort; sorts by max(fMaxMismatch{RGB})
/// from largest to smallest.
static int compare_diff_max_mismatches (DiffRecord** lhs, DiffRecord** rhs) {
- float leftValue = MAX3((*lhs)->fMaxMismatchR,
- (*lhs)->fMaxMismatchG,
- (*lhs)->fMaxMismatchB);
- float rightValue = MAX3((*rhs)->fMaxMismatchR,
- (*rhs)->fMaxMismatchG,
- (*rhs)->fMaxMismatchB);
+ uint32_t leftValue = MAX3((*lhs)->fMaxMismatchR,
+ (*lhs)->fMaxMismatchG,
+ (*lhs)->fMaxMismatchB);
+ uint32_t rightValue = MAX3((*rhs)->fMaxMismatchR,
+ (*rhs)->fMaxMismatchG,
+ (*rhs)->fMaxMismatchB);
if (leftValue < rightValue) {
return 1;
}
@@ -507,7 +507,7 @@
float scale = (float) retval / height;
if (width * scale > 360) {
scale = (float) 360 / width;
- retval = height * scale;
+ retval = static_cast<int>(height * scale);
}
return retval;
}
@@ -549,9 +549,9 @@
static void print_pixel_count (SkFILEWStream* stream,
const DiffRecord& diff) {
stream->writeText("<br>(");
- stream->writeDecAsText(diff.fFractionDifference *
- diff.fBaseWidth *
- diff.fBaseHeight);
+ stream->writeDecAsText(static_cast<int>(diff.fFractionDifference *
+ diff.fBaseWidth *
+ diff.fBaseHeight));
stream->writeText(" pixels)");
/*
stream->writeDecAsText(diff.fWeightedFraction *
@@ -579,9 +579,9 @@
print_pixel_count(stream, diff);
}
stream->writeText("<br>Average color mismatch ");
- stream->writeDecAsText(MAX3(diff.fAverageMismatchR,
- diff.fAverageMismatchG,
- diff.fAverageMismatchB));
+ stream->writeDecAsText(static_cast<int>(MAX3(diff.fAverageMismatchR,
+ diff.fAverageMismatchG,
+ diff.fAverageMismatchB)));
stream->writeText("<br>Max color mismatch ");
stream->writeDecAsText(MAX3(diff.fMaxMismatchR,
diff.fMaxMismatchG,