diff options
author | 2013-01-07 16:47:43 +0000 | |
---|---|---|
committer | 2013-01-07 16:47:43 +0000 | |
commit | 05af1afd429808913683da75644e48bece12e820 (patch) | |
tree | b7f0ec33f2cbbb9312deb9e0e566c8bea4a97320 /tests | |
parent | 30454293fd4fae81238c582c18232692bff32b1e (diff) |
eliminate all warnings in non-thirdparty code on mac
Most of these issues were due to functions whose definitions appear in header files; I changed those functions to be 'static inline' instead of just 'static' or 'inline', which kills the warning for such functions.
Other functions that were static or anonymous-namespaced but were unused in cpp files were probably called at some point but are no longer; someone who knows more than I do should probably scrub all the functions I either deleted or #if 0'ed out and make sure that the right thing is happening here.
Lots of unused variables removed, and one nasty const issue handled.
There remains a single warning in thirdparty/externals/cityhash/src/city.cc on line 146 related to a signed/unsigned mismatch. I don't know if we have control over this library so I didn't fix this one, but perhaps someone could do something about that one.
BUG=
Review URL: https://codereview.appspot.com/7067044
git-svn-id: http://skia.googlecode.com/svn/trunk@7051 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ClipStackTest.cpp | 2 | ||||
-rw-r--r-- | tests/ColorTest.cpp | 18 | ||||
-rw-r--r-- | tests/DataRefTest.cpp | 4 | ||||
-rw-r--r-- | tests/DrawPathTest.cpp | 6 | ||||
-rw-r--r-- | tests/MathTest.cpp | 2 | ||||
-rw-r--r-- | tests/TLSTest.cpp | 2 |
6 files changed, 19 insertions, 15 deletions
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp index d4391d7af6..4709d22871 100644 --- a/tests/ClipStackTest.cpp +++ b/tests/ClipStackTest.cpp @@ -758,7 +758,7 @@ static void add_elem_to_region(const SkClipStack::Element& element, } // This can assist with debugging the clip stack reduction code when the test below fails. -static void print_clip(const SkClipStack::Element& element) { +static inline void print_clip(const SkClipStack::Element& element) { static const char* kOpStrs[] = { "DF", "IS", diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp index a038a060bd..8985dbddbc 100644 --- a/tests/ColorTest.cpp +++ b/tests/ColorTest.cpp @@ -16,7 +16,7 @@ #define GetPackedG16As32(packed) (SkGetPackedG16(dc) << (8 - SK_G16_BITS)) #define GetPackedB16As32(packed) (SkGetPackedB16(dc) << (8 - SK_B16_BITS)) -static bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) { +static inline bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) { unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale); unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale); @@ -30,7 +30,7 @@ static bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) { return false; } -static bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) { +static inline bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) { unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(SkGetPackedR16(dc) << 3, dst_scale); unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(SkGetPackedG16(dc) << 2, dst_scale); @@ -44,7 +44,7 @@ static bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) { return false; } -static bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) { +static inline bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) { unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(GetPackedR16As32(dc), dst_scale); unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(GetPackedG16As32(dc), dst_scale); @@ -62,7 +62,7 @@ static bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) { return false; } -static bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) { +static inline bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) { unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); unsigned dr = (SkMulS16(SkGetPackedR32(sc), alpha) >> 3) + SkMulS16(SkGetPackedR16(dc), dst_scale); unsigned dg = (SkMulS16(SkGetPackedG32(sc), alpha) >> 2) + SkMulS16(SkGetPackedG16(dc), dst_scale); @@ -76,11 +76,11 @@ static bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) { return false; } -static int SkDiv65025Round(int x) { +static inline int SkDiv65025Round(int x) { return (x + 65025/2) / 65025; // return x / 65025; } -static bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) { +static inline bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) { unsigned dst_scale = 255*255 - SkGetPackedA32(sc) * alpha; alpha *= 255; unsigned dr = (SkGetPackedR32(sc) >> 3) * alpha + SkGetPackedR16(dc) * dst_scale; @@ -95,7 +95,7 @@ static bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) { return false; } -static void test_565blend(skiatest::Reporter* reporter) { +static inline void test_565blend(skiatest::Reporter* reporter) { int total_failures = 0; for (int global_alpha = 0; global_alpha <= 255; ++global_alpha) { int failures = 0; @@ -118,7 +118,7 @@ static void test_565blend(skiatest::Reporter* reporter) { SkDebugf("total failures %d\n", total_failures); } -static void test_premul(skiatest::Reporter* reporter) { +static inline void test_premul(skiatest::Reporter* reporter) { for (int a = 0; a <= 255; a++) { for (int x = 0; x <= 255; x++) { SkColor c0 = SkColorSetARGB(a, x, x, x); @@ -162,7 +162,7 @@ static void test_interp(skiatest::Reporter* reporter) { } */ -static void test_fast_interp(skiatest::Reporter* reporter) { +static inline void test_fast_interp(skiatest::Reporter* reporter) { SkRandom r; U8CPU a0 = 0; diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp index d6ba775ccd..8c002c80c0 100644 --- a/tests/DataRefTest.cpp +++ b/tests/DataRefTest.cpp @@ -54,8 +54,8 @@ static void test_dataset(skiatest::Reporter* reporter, const SkDataSet& ds, SkDataSet::Iter iter(ds); int index = 0; for (; !iter.done(); iter.next()) { - const char* name = iter.key(); - SkData* data = iter.value(); +// const char* name = iter.key(); +// SkData* data = iter.value(); // SkDebugf("[%d] %s:%s\n", index, name, (const char*)data->bytes()); index += 1; } diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp index e8cfa54d36..370559e25b 100644 --- a/tests/DrawPathTest.cpp +++ b/tests/DrawPathTest.cpp @@ -46,6 +46,9 @@ static void cubicToH(SkPath* path, const uint32_t raw[]) { // // http://code.google.com/p/chromium/issues/detail?id=131181 // + +// we're not calling this test anymore; is that for a reason? + static void test_crbug131181(skiatest::Reporter*) { /* fX = 18.8943768, @@ -269,7 +272,8 @@ static void TestDrawPath(skiatest::Reporter* reporter) { test_crbug_140642(reporter); test_crbug_140803(reporter); test_inversepathwithclip(reporter); -// test_crbug131181(reporter); + // why? + if (false) test_crbug131181(reporter); test_infinite_dash(reporter); test_crbug_165432(reporter); } diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp index c0babeecea..7fc53a9285 100644 --- a/tests/MathTest.cpp +++ b/tests/MathTest.cpp @@ -591,7 +591,7 @@ static void TestMath(skiatest::Reporter* reporter) { test_blend(reporter); #endif -// test_floor(reporter); + if (false) test_floor(reporter); // disable for now if (false) test_blend31(); // avoid bit rot, suppress warning diff --git a/tests/TLSTest.cpp b/tests/TLSTest.cpp index 17f7dcba25..38eb32215a 100644 --- a/tests/TLSTest.cpp +++ b/tests/TLSTest.cpp @@ -71,7 +71,7 @@ static void TestTLS(skiatest::Reporter* reporter) { // TODO: Disabled for now to work around // http://code.google.com/p/skia/issues/detail?id=619 // ('flaky segfault in TLS test on Shuttle_Ubuntu12 buildbots') - //test_threads(&thread_main); + if( false ) test_threads(&thread_main); // Test to ensure that at thread destruction, TLS destructors // have been called. |