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

Unified Diff: mojo/system/message_in_transit.cc

Issue 603983003: Mojo: COMPILE_ASSERT -> static_assert in mojo/system and mojo/embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « mojo/system/memory_unittest.cc ('k') | mojo/system/options_validation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/message_in_transit.cc
diff --git a/mojo/system/message_in_transit.cc b/mojo/system/message_in_transit.cc
index 2a85dba2d4650c8dd9080bd80d55471006973963..911623c3c70067aa2c7b9046bf09c1d7ac501fe6 100644
--- a/mojo/system/message_in_transit.cc
+++ b/mojo/system/message_in_transit.cc
@@ -38,18 +38,18 @@ STATIC_CONST_MEMBER_DEFINITION const size_t MessageInTransit::kMessageAlignment;
struct MessageInTransit::PrivateStructForCompileAsserts {
// The size of |Header| must be a multiple of the alignment.
- COMPILE_ASSERT(sizeof(Header) % kMessageAlignment == 0,
- sizeof_MessageInTransit_Header_invalid);
+ static_assert(sizeof(Header) % kMessageAlignment == 0,
+ "sizeof(MessageInTransit::Header) invalid");
// Avoid dangerous situations, but making sure that the size of the "header" +
// the size of the data fits into a 31-bit number.
- COMPILE_ASSERT(static_cast<uint64_t>(sizeof(Header)) + kMaxMessageNumBytes <=
- 0x7fffffffULL,
- kMaxMessageNumBytes_too_big);
+ static_assert(static_cast<uint64_t>(sizeof(Header)) + kMaxMessageNumBytes <=
+ 0x7fffffffULL,
+ "kMaxMessageNumBytes too big");
// We assume (to avoid extra rounding code) that the maximum message (data)
// size is a multiple of the alignment.
- COMPILE_ASSERT(kMaxMessageNumBytes % kMessageAlignment == 0,
- kMessageAlignment_not_a_multiple_of_alignment);
+ static_assert(kMaxMessageNumBytes % kMessageAlignment == 0,
+ "kMessageAlignment not a multiple of alignment");
};
MessageInTransit::View::View(size_t message_size, const void* buffer)
« no previous file with comments | « mojo/system/memory_unittest.cc ('k') | mojo/system/options_validation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698