Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: include/private/SkFloatingPoint.h

Issue 2233853002: constexpr NaN,+Inf,-Inf (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkLiteDL.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkFloatingPoint.h
diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h
index a7aa50cf9f061ca307a015d981de790b726f28d0..8d8843eb58b95dc78210875411204484a96aeabf 100644
--- a/include/private/SkFloatingPoint.h
+++ b/include/private/SkFloatingPoint.h
@@ -100,13 +100,10 @@ static inline float sk_float_pow(float base, float exp) {
#define sk_double_round2int(x) (int)floor((x) + 0.5f)
#define sk_double_ceil2int(x) (int)ceil(x)
-extern const uint32_t gIEEENotANumber;
-extern const uint32_t gIEEEInfinity;
-extern const uint32_t gIEEENegativeInfinity;
-
-#define SK_FloatNaN (*SkTCast<const float*>(&gIEEENotANumber))
-#define SK_FloatInfinity (*SkTCast<const float*>(&gIEEEInfinity))
-#define SK_FloatNegativeInfinity (*SkTCast<const float*>(&gIEEENegativeInfinity))
+static const uint32_t kIEEENotANumber = 0x7fffffff;
+#define SK_FloatNaN (*SkTCast<const float*>(&kIEEENotANumber))
+#define SK_FloatInfinity (+(float)INFINITY)
+#define SK_FloatNegativeInfinity (-(float)INFINITY)
static inline float sk_float_rsqrt_portable(float x) {
// Get initial estimate.
« no previous file with comments | « no previous file | src/core/SkLiteDL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698