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

Unified Diff: mojo/converters/input_events/input_events_type_converters.cc

Issue 1468803002: Switch to static_assert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@assert1
Patch Set: message cleanup Created 5 years, 1 month 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/converters/ime/ime_type_converters.cc ('k') | mojo/converters/surfaces/surfaces_type_converters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/converters/input_events/input_events_type_converters.cc
diff --git a/mojo/converters/input_events/input_events_type_converters.cc b/mojo/converters/input_events/input_events_type_converters.cc
index 200a738ce516ce1f77f8675584f7a6433f7b4baa..215c6460199aab4c0edffaeb920d0ff824362c98 100644
--- a/mojo/converters/input_events/input_events_type_converters.cc
+++ b/mojo/converters/input_events/input_events_type_converters.cc
@@ -83,46 +83,45 @@ void SetPointerDataLocationFromEvent(const ui::LocatedEvent& located_event,
} // namespace
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_NONE) ==
- static_cast<int32>(ui::EF_NONE),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_CAPS_LOCK_DOWN) ==
- static_cast<int32>(ui::EF_CAPS_LOCK_DOWN),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_SHIFT_DOWN) ==
- static_cast<int32>(ui::EF_SHIFT_DOWN),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_CONTROL_DOWN) ==
- static_cast<int32>(ui::EF_CONTROL_DOWN),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_ALT_DOWN) ==
- static_cast<int32>(ui::EF_ALT_DOWN),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_LEFT_MOUSE_BUTTON) ==
- static_cast<int32>(ui::EF_LEFT_MOUSE_BUTTON),
- event_flags_should_match);
-COMPILE_ASSERT(
- static_cast<int32>(mus::mojom::EVENT_FLAGS_MIDDLE_MOUSE_BUTTON) ==
- static_cast<int32>(ui::EF_MIDDLE_MOUSE_BUTTON),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_RIGHT_MOUSE_BUTTON) ==
- static_cast<int32>(ui::EF_RIGHT_MOUSE_BUTTON),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_COMMAND_DOWN) ==
- static_cast<int32>(ui::EF_COMMAND_DOWN),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_EXTENDED) ==
- static_cast<int32>(ui::EF_EXTENDED),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_IS_SYNTHESIZED) ==
- static_cast<int32>(ui::EF_IS_SYNTHESIZED),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_ALTGR_DOWN) ==
- static_cast<int32>(ui::EF_ALTGR_DOWN),
- event_flags_should_match);
-COMPILE_ASSERT(static_cast<int32>(mus::mojom::EVENT_FLAGS_MOD3_DOWN) ==
- static_cast<int32>(ui::EF_MOD3_DOWN),
- event_flags_should_match);
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_NONE) ==
+ static_cast<int32>(ui::EF_NONE),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_CAPS_LOCK_DOWN) ==
+ static_cast<int32>(ui::EF_CAPS_LOCK_DOWN),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_SHIFT_DOWN) ==
+ static_cast<int32>(ui::EF_SHIFT_DOWN),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_CONTROL_DOWN) ==
+ static_cast<int32>(ui::EF_CONTROL_DOWN),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_ALT_DOWN) ==
+ static_cast<int32>(ui::EF_ALT_DOWN),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_LEFT_MOUSE_BUTTON) ==
+ static_cast<int32>(ui::EF_LEFT_MOUSE_BUTTON),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_MIDDLE_MOUSE_BUTTON) ==
+ static_cast<int32>(ui::EF_MIDDLE_MOUSE_BUTTON),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_RIGHT_MOUSE_BUTTON) ==
+ static_cast<int32>(ui::EF_RIGHT_MOUSE_BUTTON),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_COMMAND_DOWN) ==
+ static_cast<int32>(ui::EF_COMMAND_DOWN),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_EXTENDED) ==
+ static_cast<int32>(ui::EF_EXTENDED),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_IS_SYNTHESIZED) ==
+ static_cast<int32>(ui::EF_IS_SYNTHESIZED),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_ALTGR_DOWN) ==
+ static_cast<int32>(ui::EF_ALTGR_DOWN),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_MOD3_DOWN) ==
+ static_cast<int32>(ui::EF_MOD3_DOWN),
+ "EVENT_FLAGS must match");
// static
mus::mojom::EventType
« no previous file with comments | « mojo/converters/ime/ime_type_converters.cc ('k') | mojo/converters/surfaces/surfaces_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698