aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkFloatingPoint.h
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-06-05 10:46:05 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-05 16:01:28 +0000
commit12f25a2c220449ad42080bb6896e74d2198f9213 (patch)
treefb3301a17561beb74a27df87e940d3b2fdda0b50 /include/private/SkFloatingPoint.h
parent8f9c325df591f5f63813376578e6287aace4aaae (diff)
simplify SK_FloatNaN
math.h contains NAN, an expression that evaluates to a quiet float NaN While here, INFINITY is also a float, so the casts aren't needed. Change-Id: Ibdd8f5a2767651cd4382d700e9125b832473a304 Reviewed-on: https://skia-review.googlesource.com/132087 Auto-Submit: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'include/private/SkFloatingPoint.h')
-rw-r--r--include/private/SkFloatingPoint.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h
index 6cb4cf1542..8fe4cb404e 100644
--- a/include/private/SkFloatingPoint.h
+++ b/include/private/SkFloatingPoint.h
@@ -137,10 +137,9 @@ static inline float sk_double_to_float(double x) {
return static_cast<float>(x);
}
-static const uint32_t kIEEENotANumber = 0x7fffffff;
-#define SK_FloatNaN (*SkTCast<const float*>(&kIEEENotANumber))
-#define SK_FloatInfinity (+(float)INFINITY)
-#define SK_FloatNegativeInfinity (-(float)INFINITY)
+#define SK_FloatNaN NAN
+#define SK_FloatInfinity (+INFINITY)
+#define SK_FloatNegativeInfinity (-INFINITY)
static inline float sk_float_rsqrt_portable(float x) {
// Get initial estimate.