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

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

Issue 1543603002: Switch to standard integer types in mojo/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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
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 91a9820c7a22a22d18c36f3f85fce6871c28a548..bc17f8ae8f38aa076646dcf5b9e052cbf30902b2 100644
--- a/mojo/converters/input_events/input_events_type_converters.cc
+++ b/mojo/converters/input_events/input_events_type_converters.cc
@@ -4,6 +4,8 @@
#include "mojo/converters/input_events/input_events_type_converters.h"
+#include <stdint.h>
+
#include <utility>
#if defined(USE_X11)
@@ -85,44 +87,46 @@ void SetPointerDataLocationFromEvent(const ui::LocatedEvent& located_event,
} // namespace
-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),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_NONE) ==
+ static_cast<int32_t>(ui::EF_NONE),
"EVENT_FLAGS must match");
-static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_CONTROL_DOWN) ==
- static_cast<int32>(ui::EF_CONTROL_DOWN),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_CAPS_LOCK_DOWN) ==
+ static_cast<int32_t>(ui::EF_CAPS_LOCK_DOWN),
"EVENT_FLAGS must match");
-static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_ALT_DOWN) ==
- static_cast<int32>(ui::EF_ALT_DOWN),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_SHIFT_DOWN) ==
+ static_cast<int32_t>(ui::EF_SHIFT_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),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_CONTROL_DOWN) ==
+ static_cast<int32_t>(ui::EF_CONTROL_DOWN),
"EVENT_FLAGS must match");
-static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_MIDDLE_MOUSE_BUTTON) ==
- static_cast<int32>(ui::EF_MIDDLE_MOUSE_BUTTON),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_ALT_DOWN) ==
+ static_cast<int32_t>(ui::EF_ALT_DOWN),
"EVENT_FLAGS must match");
-static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_RIGHT_MOUSE_BUTTON) ==
- static_cast<int32>(ui::EF_RIGHT_MOUSE_BUTTON),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_LEFT_MOUSE_BUTTON) ==
+ static_cast<int32_t>(ui::EF_LEFT_MOUSE_BUTTON),
"EVENT_FLAGS must match");
-static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_COMMAND_DOWN) ==
- static_cast<int32>(ui::EF_COMMAND_DOWN),
+static_assert(
+ static_cast<int32_t>(mus::mojom::EVENT_FLAGS_MIDDLE_MOUSE_BUTTON) ==
+ static_cast<int32_t>(ui::EF_MIDDLE_MOUSE_BUTTON),
+ "EVENT_FLAGS must match");
+static_assert(
+ static_cast<int32_t>(mus::mojom::EVENT_FLAGS_RIGHT_MOUSE_BUTTON) ==
+ static_cast<int32_t>(ui::EF_RIGHT_MOUSE_BUTTON),
+ "EVENT_FLAGS must match");
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_COMMAND_DOWN) ==
+ static_cast<int32_t>(ui::EF_COMMAND_DOWN),
"EVENT_FLAGS must match");
-static_assert(static_cast<int32>(mus::mojom::EVENT_FLAGS_EXTENDED) ==
- static_cast<int32>(ui::EF_EXTENDED),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_EXTENDED) ==
+ static_cast<int32_t>(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),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_IS_SYNTHESIZED) ==
+ static_cast<int32_t>(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),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_ALTGR_DOWN) ==
+ static_cast<int32_t>(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),
+static_assert(static_cast<int32_t>(mus::mojom::EVENT_FLAGS_MOD3_DOWN) ==
+ static_cast<int32_t>(ui::EF_MOD3_DOWN),
"EVENT_FLAGS must match");
// static
@@ -180,7 +184,7 @@ mus::mojom::EventPtr TypeConverter<mus::mojom::EventPtr, ui::Event>::Convert(
static_cast<const ui::LocatedEvent*>(&input);
mus::mojom::PointerDataPtr pointer_data(mus::mojom::PointerData::New());
// TODO(sky): come up with a better way to handle this.
- pointer_data->pointer_id = std::numeric_limits<int32>::max();
+ pointer_data->pointer_id = std::numeric_limits<int32_t>::max();
pointer_data->kind = mus::mojom::POINTER_KIND_MOUSE;
mus::mojom::LocationDataPtr location_data(mus::mojom::LocationData::New());
SetPointerDataLocationFromEvent(*located_event, location_data.get());
« no previous file with comments | « mojo/converters/ime/ime_type_converters.cc ('k') | mojo/converters/input_events/mojo_extended_key_event_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698