aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ColorTest.cpp
diff options
context:
space:
mode:
authorGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-07 16:47:43 +0000
committerGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-01-07 16:47:43 +0000
commit05af1afd429808913683da75644e48bece12e820 (patch)
treeb7f0ec33f2cbbb9312deb9e0e566c8bea4a97320 /tests/ColorTest.cpp
parent30454293fd4fae81238c582c18232692bff32b1e (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/ColorTest.cpp')
-rw-r--r--tests/ColorTest.cpp18
1 files changed, 9 insertions, 9 deletions
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;