diff options
author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-26 13:08:56 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-09-26 13:08:56 +0000 |
commit | 373ebc634573364c27b1ebd35bb537ef1285cba4 (patch) | |
tree | de677b3d81e81875c85dee3c838959425057a9f7 /bench | |
parent | 5c83dcc371b68e4cda2d533e247684ea1a32d1bc (diff) |
Suppress some warnings on linux.
R=reed@google.com
Review URL: https://codereview.appspot.com/6572046
git-svn-id: http://skia.googlecode.com/svn/trunk@5687 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench')
-rw-r--r-- | bench/MathBench.cpp | 4 | ||||
-rw-r--r-- | bench/PathBench.cpp | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/bench/MathBench.cpp b/bench/MathBench.cpp index df3d3a53c2..bdb89cab62 100644 --- a/bench/MathBench.cpp +++ b/bench/MathBench.cpp @@ -110,9 +110,9 @@ private: static inline float SkFastInvSqrt(float x) { float xhalf = 0.5f*x; - int i = *(int*)&x; + int i = *SkTCast<int*>(&x); i = 0x5f3759df - (i>>1); - x = *(float*)&i; + x = *SkTCast<float*>(&i); x = x*(1.5f-xhalf*x*x); // x = x*(1.5f-xhalf*x*x); // this line takes err from 10^-3 to 10^-6 return x; diff --git a/bench/PathBench.cpp b/bench/PathBench.cpp index dd5041d94b..12e456ab06 100644 --- a/bench/PathBench.cpp +++ b/bench/PathBench.cpp @@ -272,13 +272,15 @@ protected: path->lineTo(fPoints[(fCurrPoint++) & (kNumPoints - 1)]); break; case SkPath::kQuad_Verb: - path->quadTo(fPoints[(fCurrPoint++) & (kNumPoints - 1)], - fPoints[(fCurrPoint++) & (kNumPoints - 1)]); + path->quadTo(fPoints[(fCurrPoint + 0) & (kNumPoints - 1)], + fPoints[(fCurrPoint + 1) & (kNumPoints - 1)]); + fCurrPoint += 2; break; case SkPath::kCubic_Verb: - path->cubicTo(fPoints[(fCurrPoint++) & (kNumPoints - 1)], - fPoints[(fCurrPoint++) & (kNumPoints - 1)], - fPoints[(fCurrPoint++) & (kNumPoints - 1)]); + path->cubicTo(fPoints[(fCurrPoint + 0) & (kNumPoints - 1)], + fPoints[(fCurrPoint + 1) & (kNumPoints - 1)], + fPoints[(fCurrPoint + 2) & (kNumPoints - 1)]); + fCurrPoint += 3; break; case SkPath::kClose_Verb: path->close(); |