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

Unified Diff: mojo/system/handle_table.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/handle_signals_state.h ('k') | mojo/system/local_data_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/handle_table.cc
diff --git a/mojo/system/handle_table.cc b/mojo/system/handle_table.cc
index 5c7c74c3abea6627c0e9989c23702434cad89a15..8cfa26702d2d37e703b1fa4bc067e0a803fb5468 100644
--- a/mojo/system/handle_table.cc
+++ b/mojo/system/handle_table.cc
@@ -79,11 +79,11 @@ bool HandleTable::AddDispatcherVector(const DispatcherVector& dispatchers,
DCHECK(handles);
// TODO(vtl): |std::numeric_limits<size_t>::max()| isn't a compile-time
// expression in C++03.
- COMPILE_ASSERT(
+ static_assert(
static_cast<uint64_t>(kMaxHandleTableSize) + kMaxMessageNumHandles <
(sizeof(size_t) == 8 ? kuint64max
: static_cast<uint64_t>(kuint32max)),
- addition_may_overflow);
+ "Addition may overflow");
if (handle_to_entry_map_.size() + dispatchers.size() > kMaxHandleTableSize)
return false;
« no previous file with comments | « mojo/system/handle_signals_state.h ('k') | mojo/system/local_data_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698