aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-07 18:58:35 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-07 18:58:35 +0000
commitefbe8e9bedda21a3e061ebf3d96431a0f250a654 (patch)
tree4841675c513e4756e18bcba29f16943ff28fec05 /include
parent365d78762d0878bb3c9d4bfc90c99eab5f2c896a (diff)
Fix errors when compiling with -Wall -Werror on Android.
This CL also turns those features on by default on Android Review URL: https://codereview.appspot.com/7313049 git-svn-id: http://skia.googlecode.com/svn/trunk@7645 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkFloatingPoint.h6
-rw-r--r--include/utils/SkRandom.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h
index 96270b09e2..02880f3d23 100644
--- a/include/core/SkFloatingPoint.h
+++ b/include/core/SkFloatingPoint.h
@@ -91,7 +91,7 @@ extern const uint32_t gIEEENotANumber;
extern const uint32_t gIEEEInfinity;
extern const uint32_t gIEEENegativeInfinity;
-#define SK_FloatNaN (*reinterpret_cast<const float*>(&gIEEENotANumber))
-#define SK_FloatInfinity (*reinterpret_cast<const float*>(&gIEEEInfinity))
-#define SK_FloatNegativeInfinity (*reinterpret_cast<const float*>(&gIEEENegativeInfinity))
+#define SK_FloatNaN (*SkTCast<const float*>(&gIEEENotANumber))
+#define SK_FloatInfinity (*SkTCast<const float*>(&gIEEEInfinity))
+#define SK_FloatNegativeInfinity (*SkTCast<const float*>(&gIEEENegativeInfinity))
#endif
diff --git a/include/utils/SkRandom.h b/include/utils/SkRandom.h
index 150384de0f..6ab1cd1723 100644
--- a/include/utils/SkRandom.h
+++ b/include/utils/SkRandom.h
@@ -197,7 +197,7 @@ public:
*/
float nextF() {
unsigned int floatint = 0x3f800000 | (this->nextU() >> 9);
- float f = *(float*)(&floatint) - 1.0f;
+ float f = *SkTCast<float*>(&floatint) - 1.0f;
return f;
}