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

Unified Diff: net/disk_cache/blockfile/stats.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 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 | « net/disk_cache/blockfile/file_win.cc ('k') | net/disk_cache/entry_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/stats.cc
diff --git a/net/disk_cache/blockfile/stats.cc b/net/disk_cache/blockfile/stats.cc
index 70592e4bded3fb9fabab08ebff0b6d8f11479d38..fae006d7617600125ddf39c7eeacbfb515469609 100644
--- a/net/disk_cache/blockfile/stats.cc
+++ b/net/disk_cache/blockfile/stats.cc
@@ -24,7 +24,7 @@ struct OnDiskStats {
int data_sizes[disk_cache::Stats::kDataSizesLength];
int64 counters[disk_cache::Stats::MAX_COUNTER];
};
-COMPILE_ASSERT(sizeof(OnDiskStats) < 512, needs_more_than_2_blocks);
+static_assert(sizeof(OnDiskStats) < 512, "needs more than 2 blocks");
// Returns the "floor" (as opposed to "ceiling") of log base 2 of number.
int LogBase2(int32 number) {
@@ -67,8 +67,8 @@ static const char* kCounterNames[] = {
"Doom recent entries",
"unused"
};
-COMPILE_ASSERT(arraysize(kCounterNames) == disk_cache::Stats::MAX_COUNTER,
- update_the_names);
+static_assert(arraysize(kCounterNames) == disk_cache::Stats::MAX_COUNTER,
+ "update the names");
} // namespace
@@ -155,7 +155,7 @@ void Stats::InitSizeHistogram() {
int Stats::StorageSize() {
// If we have more than 512 bytes of counters, change kDiskSignature so we
// don't overwrite something else (LoadStats must fail).
- COMPILE_ASSERT(sizeof(OnDiskStats) <= 256 * 2, use_more_blocks);
+ static_assert(sizeof(OnDiskStats) <= 256 * 2, "use more blocks");
return 256 * 2;
}
@@ -300,7 +300,7 @@ int Stats::GetStatsBucket(int32 size) {
// From this point on, use a logarithmic scale.
int result = LogBase2(size) + 1;
- COMPILE_ASSERT(kDataSizesLength > 16, update_the_scale);
+ static_assert(kDataSizesLength > 16, "update the scale");
if (result >= kDataSizesLength)
result = kDataSizesLength - 1;
« no previous file with comments | « net/disk_cache/blockfile/file_win.cc ('k') | net/disk_cache/entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698