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

Unified Diff: net/disk_cache/blockfile/disk_format_v3.h

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/disk_format_base.h ('k') | net/disk_cache/blockfile/entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/disk_format_v3.h
diff --git a/net/disk_cache/blockfile/disk_format_v3.h b/net/disk_cache/blockfile/disk_format_v3.h
index f5811cc0fc42c85fd0a89e94e3b63e610f2e20bc..f16648b5bf1a456d86a6cc2c66acc75d0e98bd30 100644
--- a/net/disk_cache/blockfile/disk_format_v3.h
+++ b/net/disk_cache/blockfile/disk_format_v3.h
@@ -97,7 +97,7 @@ struct IndexBitmap {
IndexHeaderV3 header;
uint32 bitmap[kBaseBitmapBytes / 4]; // First page of the bitmap.
};
-COMPILE_ASSERT(sizeof(IndexBitmap) == 4096, bad_IndexHeader);
+static_assert(sizeof(IndexBitmap) == 4096, "bad IndexHeader");
// Possible states for a given entry.
enum EntryState {
@@ -109,7 +109,7 @@ enum EntryState {
ENTRY_FIXING, // Inconsistent state. The entry is being verified.
ENTRY_USED // The slot is in use (entry is present).
};
-COMPILE_ASSERT(ENTRY_USED <= 7, state_uses_3_bits);
+static_assert(ENTRY_USED <= 7, "state uses 3 bits");
enum EntryGroup {
ENTRY_NO_USE = 0, // The entry has not been reused.
@@ -118,7 +118,7 @@ enum EntryGroup {
ENTRY_RESERVED, // Reserved for future use.
ENTRY_EVICTED // The entry was deleted.
};
-COMPILE_ASSERT(ENTRY_USED <= 7, group_uses_3_bits);
+static_assert(ENTRY_USED <= 7, "group uses 3 bits");
#pragma pack(push, 1)
struct IndexCell {
@@ -183,7 +183,7 @@ struct IndexCell {
uint64 first_part;
uint8 last_part;
};
-COMPILE_ASSERT(sizeof(IndexCell) == 9, bad_IndexCell);
+static_assert(sizeof(IndexCell) == 9, "bad IndexCell");
const int kCellsPerBucket = 4;
struct IndexBucket {
@@ -191,7 +191,7 @@ struct IndexBucket {
int32 next;
uint32 hash; // The high order byte is reserved (should be zero).
};
-COMPILE_ASSERT(sizeof(IndexBucket) == 44, bad_IndexBucket);
+static_assert(sizeof(IndexBucket) == 44, "bad IndexBucket");
const int kBytesPerCell = 44 / kCellsPerBucket;
// The main cache index. Backed by a file named index_tb1.
@@ -225,7 +225,7 @@ struct EntryRecord {
int32 pad[3];
uint32 self_hash;
};
-COMPILE_ASSERT(sizeof(EntryRecord) == 104, bad_EntryRecord);
+static_assert(sizeof(EntryRecord) == 104, "bad EntryRecord");
struct ShortEntryRecord {
uint32 hash;
@@ -239,7 +239,7 @@ struct ShortEntryRecord {
uint32 long_hash[5];
uint32 self_hash;
};
-COMPILE_ASSERT(sizeof(ShortEntryRecord) == 48, bad_ShortEntryRecord);
+static_assert(sizeof(ShortEntryRecord) == 48, "bad ShortEntryRecord");
} // namespace disk_cache
« no previous file with comments | « net/disk_cache/blockfile/disk_format_base.h ('k') | net/disk_cache/blockfile/entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698