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

Unified Diff: third_party/WebKit/Source/wtf/dtoa/cached-powers.cc

Issue 2640163004: Replace ENABLE(ASSERT) with DCHECK_IS_ON(). (Closed)
Patch Set: m_domTreeVersion initialization Created 3 years, 11 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 | « third_party/WebKit/Source/wtf/AssertionsTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/dtoa/cached-powers.cc
diff --git a/third_party/WebKit/Source/wtf/dtoa/cached-powers.cc b/third_party/WebKit/Source/wtf/dtoa/cached-powers.cc
index 4bc1a74cdc2fb2b8acd7061f409b2402c7300869..97b7e9a5e5ca556bfd0502ad819c74f919cc1eea 100644
--- a/third_party/WebKit/Source/wtf/dtoa/cached-powers.cc
+++ b/third_party/WebKit/Source/wtf/dtoa/cached-powers.cc
@@ -138,7 +138,7 @@ namespace double_conversion {
const int PowersOfTenCache::kMinDecimalExponent = -348; // kCachedPowers[0].decimal_exponent
const int PowersOfTenCache::kMaxDecimalExponent = 340; // kCachedPowers[kCachedPowersLength - 1].decimal_exponent
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
// Check that the static constants match the values in kCachedPowers.
@@ -155,20 +155,20 @@ namespace double_conversion {
int max_exponent,
DiyFp* power,
int* decimal_exponent) {
-#if ENABLE(ASSERT)
- validateStaticConstants();
+#if DCHECK_IS_ON()
+ validateStaticConstants();
#endif
- const int kQ = DiyFp::kSignificandSize;
- double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10);
- int foo = kCachedPowersOffset;
- int index =
- (foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1;
- ASSERT(0 <= index && index < kCachedPowersLength);
- CachedPower cached_power = kCachedPowers[index];
- ASSERT(min_exponent <= cached_power.binary_exponent);
- ASSERT(cached_power.binary_exponent <= max_exponent);
- *decimal_exponent = cached_power.decimal_exponent;
- *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
+ const int kQ = DiyFp::kSignificandSize;
+ double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10);
+ int foo = kCachedPowersOffset;
+ int index =
+ (foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1;
+ ASSERT(0 <= index && index < kCachedPowersLength);
+ CachedPower cached_power = kCachedPowers[index];
+ ASSERT(min_exponent <= cached_power.binary_exponent);
+ ASSERT(cached_power.binary_exponent <= max_exponent);
+ *decimal_exponent = cached_power.decimal_exponent;
+ *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
}
@@ -177,7 +177,7 @@ namespace double_conversion {
int* found_exponent) {
ASSERT(kMinDecimalExponent <= requested_exponent);
ASSERT(requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance);
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
validateStaticConstants();
#endif
int index =
« no previous file with comments | « third_party/WebKit/Source/wtf/AssertionsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698