aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathCoverageTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 12:03:39 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-06 12:03:39 +0000
commit42639cddc33746b351bbf07c540711eefffe191a (patch)
tree2032cc41146f1d05732f5e666b1189097dca02f0 /tests/PathCoverageTest.cpp
parent06c279e42a9c69de8d5e8a4a59537422e074a79e (diff)
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
Diffstat (limited to 'tests/PathCoverageTest.cpp')
-rw-r--r--tests/PathCoverageTest.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/PathCoverageTest.cpp b/tests/PathCoverageTest.cpp
index 4f2f1bee62..9734f75e1e 100644
--- a/tests/PathCoverageTest.cpp
+++ b/tests/PathCoverageTest.cpp
@@ -66,22 +66,22 @@ static inline uint32_t compute_pointCount(SkScalar d, SkScalar tol) {
}
}
-uint32_t quadraticPointCount_EE(const SkPoint points[], SkScalar tol) {
+static uint32_t quadraticPointCount_EE(const SkPoint points[], SkScalar tol) {
int distance = estimate_distance(points);
return estimate_pointCount(distance);
}
-uint32_t quadraticPointCount_EC(const SkPoint points[], SkScalar tol) {
+static uint32_t quadraticPointCount_EC(const SkPoint points[], SkScalar tol) {
int distance = estimate_distance(points);
return compute_pointCount(SkIntToScalar(distance), tol);
}
-uint32_t quadraticPointCount_CE(const SkPoint points[], SkScalar tol) {
+static uint32_t quadraticPointCount_CE(const SkPoint points[], SkScalar tol) {
SkScalar distance = compute_distance(points);
return estimate_pointCount(SkScalarRound(distance));
}
-uint32_t quadraticPointCount_CC(const SkPoint points[], SkScalar tol) {
+static uint32_t quadraticPointCount_CC(const SkPoint points[], SkScalar tol) {
SkScalar distance = compute_distance(points);
return compute_pointCount(distance, tol);
}
@@ -123,6 +123,13 @@ static bool one_d_pe(const int* array, const unsigned int count,
quadraticPointCount_CC(path, SkIntToScalar(1));
uint32_t estimatedCount =
quadraticPointCount_EE(path, SkIntToScalar(1));
+
+ if (false) { // avoid bit rot, suppress warning
+ computedCount =
+ quadraticPointCount_EC(path, SkIntToScalar(1));
+ estimatedCount =
+ quadraticPointCount_CE(path, SkIntToScalar(1));
+ }
// Allow estimated to be high by a factor of two, but no less than
// the computed value.
bool isAccurate = (estimatedCount >= computedCount) &&