fix warnings on Mac in tests
Fix these class of warnings:
- unused functions
- unused locals
- sign mismatch
- missing function prototypes
- missing newline at end of file
- 64 to 32 bit truncation
The changes prefer to link in dead code in the debug build
with 'if (false)' than to comment it out, but trivial cases
are commented out or sometimes deleted if it appears to be
a copy/paste error.
Review URL: https://codereview.appspot.com/6301045
git-svn-id: http://skia.googlecode.com/svn/trunk@4175 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/ParsePathTest.cpp b/tests/ParsePathTest.cpp
index 831cd8e..116dbd0 100644
--- a/tests/ParsePathTest.cpp
+++ b/tests/ParsePathTest.cpp
@@ -27,18 +27,18 @@
#endif
}
+static struct {
+ const char* fStr;
+ const SkRect fBounds;
+} gRec[] = {
+ { "", { 0, 0, 0, 0 } },
+ { "M0,0L10,10", { 0, 0, SkIntToScalar(10), SkIntToScalar(10) } },
+ { "M-5.5,-0.5 Q 0 0 6,6.50",
+ { SkFloatToScalar(-5.5f), SkFloatToScalar(-0.5f),
+ SkFloatToScalar(6), SkFloatToScalar(6.5f) } }
+};
+
static void TestParsePath(skiatest::Reporter* reporter) {
- static const struct {
- const char* fStr;
- SkRect fBounds;
- } gRec[] = {
- { "", { 0, 0, 0, 0 } },
- { "M0,0L10,10", { 0, 0, SkIntToScalar(10), SkIntToScalar(10) } },
- { "M-5.5,-0.5 Q 0 0 6,6.50",
- { SkFloatToScalar(-5.5f), SkFloatToScalar(-0.5f),
- SkFloatToScalar(6), SkFloatToScalar(6.5f) } }
- };
-
for (size_t i = 0; i < SK_ARRAY_COUNT(gRec); i++) {
SkPath path;
bool success = SkParsePath::FromSVGString(gRec[i].fStr, &path);
@@ -51,13 +51,13 @@
}
SkRect r;
- r.set(0, 0, SkFloatToScalar(10), SkFloatToScalar(10.5));
+ r.set(0, 0, SkFloatToScalar(10), SkFloatToScalar(10.5f));
SkPath p;
p.addRect(r);
test_to_from(reporter, p);
p.addOval(r);
test_to_from(reporter, p);
- p.addRoundRect(r, SkFloatToScalar(4), SkFloatToScalar(4.5));
+ p.addRoundRect(r, SkFloatToScalar(4), SkFloatToScalar(4.5f));
test_to_from(reporter, p);
}