diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-06 12:09:18 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-06 12:09:18 +0000 |
commit | 383d5d494992554cde776c8b5b359d30e431bc78 (patch) | |
tree | e9d014146a348f58104da06be0024be11e48c404 /src/effects/SkGradientShader.cpp | |
parent | cf6285b89b8820641ffb6871d4b3275bfe783f51 (diff) |
fix warnings on Mac in src/effects
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/6299049
git-svn-id: http://skia.googlecode.com/svn/trunk@4181 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkGradientShader.cpp')
-rw-r--r-- | src/effects/SkGradientShader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/effects/SkGradientShader.cpp b/src/effects/SkGradientShader.cpp index 1ef6446afc..8203d60ebd 100644 --- a/src/effects/SkGradientShader.cpp +++ b/src/effects/SkGradientShader.cpp @@ -2093,6 +2093,7 @@ private: const SkPoint fCenter; }; +#ifndef SK_SCALAR_IS_FLOAT #ifdef COMPUTE_SWEEP_TABLE #define PI 3.14159265 static bool gSweepTableReady; @@ -2129,12 +2130,14 @@ static const uint8_t gSweepTable[] = { }; static const uint8_t* build_sweep_table() { return gSweepTable; } #endif +#endif // divide numer/denom, with a bias of 6bits. Assumes numer <= denom // and denom != 0. Since our table is 6bits big (+1), this is a nice fit. // Same as (but faster than) SkFixedDiv(numer, denom) >> 10 //unsigned div_64(int numer, int denom); +#ifndef SK_SCALAR_IS_FLOAT static unsigned div_64(int numer, int denom) { SkASSERT(numer <= denom); SkASSERT(numer > 0); @@ -2201,8 +2204,10 @@ static unsigned div_64(int numer, int denom) { } return result; } +#endif // Given x,y in the first quadrant, return 0..63 for the angle [0..90] +#ifndef SK_SCALAR_IS_FLOAT static unsigned atan_0_90(SkFixed y, SkFixed x) { #ifdef SK_DEBUG { @@ -2256,6 +2261,7 @@ static unsigned atan_0_90(SkFixed y, SkFixed x) { SkASSERT(result <= 63); return result; } +#endif // returns angle in a circle [0..2PI) -> [0..255] #ifdef SK_SCALAR_IS_FLOAT |