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; |