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

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

Issue 1636873005: blink: Fix naming and const-ness of constants and non-constants. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants: indents Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 #endif 151 #endif
152 152
153 void PowersOfTenCache::GetCachedPowerForBinaryExponentRange( 153 void PowersOfTenCache::GetCachedPowerForBinaryExponentRange(
154 int min_exponent , 154 int min_exponent ,
155 int max_exponent , 155 int max_exponent ,
156 DiyFp* power, 156 DiyFp* power,
157 int* decimal_exp onent) { 157 int* decimal_exp onent) {
158 #if ENABLE(ASSERT) 158 #if ENABLE(ASSERT)
159 validateStaticConstants(); 159 validateStaticConstants();
160 #endif 160 #endif
161 int kQ = DiyFp::kSignificandSize; 161 const int kQ = DiyFp::kSignificandSize;
162 double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10); 162 double k = ceil((min_exponent + kQ - 1) * kD_1_LOG2_10);
163 int foo = kCachedPowersOffset; 163 int foo = kCachedPowersOffset;
164 int index = 164 int index =
165 (foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1; 165 (foo + static_cast<int>(k) - 1) / kDecimalExponentDistance + 1;
166 ASSERT(0 <= index && index < kCachedPowersLength); 166 ASSERT(0 <= index && index < kCachedPowersLength);
167 CachedPower cached_power = kCachedPowers[index]; 167 CachedPower cached_power = kCachedPowers[index];
168 ASSERT(min_exponent <= cached_power.binary_exponent); 168 ASSERT(min_exponent <= cached_power.binary_exponent);
169 ASSERT(cached_power.binary_exponent <= max_exponent); 169 ASSERT(cached_power.binary_exponent <= max_exponent);
170 *decimal_exponent = cached_power.decimal_exponent; 170 *decimal_exponent = cached_power.decimal_exponent;
171 *power = DiyFp(cached_power.significand, cached_power.binary_exponent); 171 *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
(...skipping 13 matching lines...) Expand all
185 CachedPower cached_power = kCachedPowers[index]; 185 CachedPower cached_power = kCachedPowers[index];
186 *power = DiyFp(cached_power.significand, cached_power.binary_exponent); 186 *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
187 *found_exponent = cached_power.decimal_exponent; 187 *found_exponent = cached_power.decimal_exponent;
188 ASSERT(*found_exponent <= requested_exponent); 188 ASSERT(*found_exponent <= requested_exponent);
189 ASSERT(requested_exponent < *found_exponent + kDecimalExponentDistance); 189 ASSERT(requested_exponent < *found_exponent + kDecimalExponentDistance);
190 } 190 }
191 191
192 } // namespace double_conversion 192 } // namespace double_conversion
193 193
194 } // namespace WTF 194 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/PartitionAllocTest.cpp ('k') | third_party/WebKit/public/platform/WebMediaConstraints.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698