Skip to content

Commit

Permalink
Switch to standard integer types in mojo/.
Browse files Browse the repository at this point in the history
BUG=138542
TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/1543603002 .

Cr-Commit-Position: refs/heads/master@{#366417}
  • Loading branch information
Avi Drissman committed Dec 21, 2015
1 parent 57afbca commit 2e88ac3
Show file tree
Hide file tree
Showing 312 changed files with 753 additions and 118 deletions.
3 changes: 3 additions & 0 deletions mojo/android/javatests/validation_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "mojo/android/javatests/validation_test_util.h"

#include <stddef.h>
#include <stdint.h>

#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
Expand Down
3 changes: 3 additions & 0 deletions mojo/android/system/core_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "mojo/android/system/core_impl.h"

#include <stddef.h>
#include <stdint.h>

#include "base/android/base_jni_registrar.h"
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
Expand Down
2 changes: 1 addition & 1 deletion mojo/application/public/cpp/app_lifetime_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef MOJO_APPLICATION_PUBLIC_CPP_APP_LIFETIME_HELPER_H_
#define MOJO_APPLICATION_PUBLIC_CPP_APP_LIFETIME_HELPER_H_

#include "base/basictypes.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/single_thread_task_runner.h"

Expand Down
2 changes: 2 additions & 0 deletions mojo/application/public/cpp/application_connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_
#define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_CONNECTION_H_

#include <stdint.h>

#include <string>
#include <utility>

Expand Down
1 change: 1 addition & 0 deletions mojo/application/public/cpp/content_handler_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#ifndef MOJO_APPLICATION_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_
#define MOJO_APPLICATION_PUBLIC_CPP_CONTENT_HANDLER_FACTORY_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "mojo/application/public/cpp/interface_factory.h"
#include "mojo/application/public/interfaces/content_handler.mojom.h"
Expand Down
4 changes: 3 additions & 1 deletion mojo/application/public/cpp/initialize_base_and_icu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
// which means that it can't use mojo. Our runners will dig around in the
// symbol table and run this before the mojo system is initialized.

#include <stdint.h>

#include "base/files/file.h"
#include "base/i18n/icu_util.h"
#include "base/rand_util.h"
Expand All @@ -23,7 +25,7 @@ __declspec(dllexport) void __cdecl
#else
void __attribute__((visibility("default")))
#endif
InitializeBase(const uint8* icu_data) {
InitializeBase(const uint8_t* icu_data) {
base::RandUint64();
base::SysInfo::AmountOfPhysicalMemory();
base::SysInfo::NumberOfProcessors();
Expand Down
1 change: 1 addition & 0 deletions mojo/application/public/cpp/lib/content_handler_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "base/bind.h"
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/thread_task_runner_handle.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/application/public/cpp/lib/service_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/application/public/cpp/lib/service_registry.h"

#include <stdint.h>

#include <utility>

#include "base/bind.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/application/public/cpp/lib/service_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_
#define MOJO_APPLICATION_PUBLIC_CPP_LIB_SERVICE_REGISTRY_H_

#include <stdint.h>

#include <set>
#include <string>

Expand Down
2 changes: 2 additions & 0 deletions mojo/common/common_type_converters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/common/common_type_converters.h"

#include <stdint.h>

#include <string>

#include "base/strings/utf_string_conversions.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/common/common_type_converters.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
#define MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_

#include <stdint.h>

#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "mojo/common/mojo_common_export.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/common/common_type_converters_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/common/common_type_converters.h"

#include <stdint.h>

#include "base/strings/utf_string_conversions.h"
#include "mojo/common/url_type_converters.h"
#include "testing/gtest/include/gtest/gtest.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/common/data_pipe_drainer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/common/data_pipe_drainer.h"

#include <stdint.h>

#include <utility>

#include "base/bind.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/common/data_pipe_drainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef MOJO_COMMON_DATA_PIPE_DRAINER_H_
#define MOJO_COMMON_DATA_PIPE_DRAINER_H_

#include <stddef.h>

#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "mojo/common/mojo_common_export.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/common/data_pipe_file_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/common/data_pipe_utils.h"

#include <stdint.h>

#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/files/scoped_file.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/common/data_pipe_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/common/data_pipe_utils.h"

#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <utility>

Expand Down
2 changes: 2 additions & 0 deletions mojo/common/data_pipe_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef MOJO_SHELL_DATA_PIPE_UTILS_H_
#define MOJO_SHELL_DATA_PIPE_UTILS_H_

#include <stdint.h>

#include <string>

#include "base/callback_forward.h"
Expand Down
1 change: 1 addition & 0 deletions mojo/common/weak_binding_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <utility>
#include <vector>

#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/bindings/binding.h"

Expand Down
1 change: 1 addition & 0 deletions mojo/common/weak_interface_ptr_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <utility>
#include <vector>

#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "mojo/public/cpp/bindings/interface_ptr.h"

Expand Down
15 changes: 8 additions & 7 deletions mojo/converters/ime/ime_type_converters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

#include "mojo/converters/ime/ime_type_converters.h"

#include "base/basictypes.h"
#include <stdint.h>

#include "base/macros.h"

namespace mojo {

#define TEXT_INPUT_TYPE_ASSERT(NAME) \
static_assert(static_cast<int32>(TEXT_INPUT_TYPE_##NAME) == \
static_cast<int32>(ui::TEXT_INPUT_TYPE_##NAME), \
#define TEXT_INPUT_TYPE_ASSERT(NAME) \
static_assert(static_cast<int32_t>(TEXT_INPUT_TYPE_##NAME) == \
static_cast<int32_t>(ui::TEXT_INPUT_TYPE_##NAME), \
"TEXT_INPUT_TYPE must match")
TEXT_INPUT_TYPE_ASSERT(NONE);
TEXT_INPUT_TYPE_ASSERT(TEXT);
Expand All @@ -29,9 +30,9 @@ TEXT_INPUT_TYPE_ASSERT(TIME);
TEXT_INPUT_TYPE_ASSERT(WEEK);
TEXT_INPUT_TYPE_ASSERT(TEXT_AREA);

#define TEXT_INPUT_FLAG_ASSERT(NAME) \
static_assert(static_cast<int32>(TEXT_INPUT_FLAG_##NAME) == \
static_cast<int32>(ui::TEXT_INPUT_FLAG_##NAME), \
#define TEXT_INPUT_FLAG_ASSERT(NAME) \
static_assert(static_cast<int32_t>(TEXT_INPUT_FLAG_##NAME) == \
static_cast<int32_t>(ui::TEXT_INPUT_FLAG_##NAME), \
"TEXT_INPUT_FLAG must match")
TEXT_INPUT_FLAG_ASSERT(NONE);
TEXT_INPUT_FLAG_ASSERT(AUTOCOMPLETE_ON);
Expand Down
62 changes: 33 additions & 29 deletions mojo/converters/input_events/input_events_type_converters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include "mojo/converters/input_events/input_events_type_converters.h"

#include <stdint.h>

#include <utility>

#if defined(USE_X11)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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());
Expand Down
2 changes: 2 additions & 0 deletions mojo/converters/input_events/mojo_extended_key_event_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdint.h>

#include "mojo/converters/input_events/mojo_extended_key_event_data.h"

namespace mojo {
Expand Down
3 changes: 3 additions & 0 deletions mojo/converters/input_events/mojo_extended_key_event_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#ifndef MOJO_CONVERTERS_INPUT_EVENTS_MOJO_EXTENDED_KEY_EVENT_DATA_H_
#define MOJO_CONVERTERS_INPUT_EVENTS_MOJO_EXTENDED_KEY_EVENT_DATA_H_

#include <stdint.h>

#include "base/macros.h"
#include "mojo/converters/input_events/mojo_input_events_export.h"
#include "ui/events/event.h"

Expand Down
3 changes: 3 additions & 0 deletions mojo/converters/surfaces/surfaces_type_converters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "mojo/converters/surfaces/surfaces_type_converters.h"

#include <stddef.h>
#include <stdint.h>

#include <utility>

#include "base/macros.h"
Expand Down
3 changes: 3 additions & 0 deletions mojo/converters/surfaces/tests/surface_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stddef.h>
#include <stdint.h>

#include <utility>

#include "cc/quads/debug_border_draw_quad.h"
Expand Down
1 change: 1 addition & 0 deletions mojo/edk/embedder/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#define MOJO_EDK_EMBEDDER_CONFIGURATION_H_

#include <stddef.h>
#include <stdint.h>

namespace mojo {
namespace edk {
Expand Down
3 changes: 3 additions & 0 deletions mojo/edk/embedder/embedder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "mojo/edk/embedder/embedder.h"

#include <stddef.h>
#include <stdint.h>

#include <utility>

#include "base/atomicops.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/edk/embedder/embedder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#ifndef MOJO_EDK_EMBEDDER_EMBEDDER_H_
#define MOJO_EDK_EMBEDDER_EMBEDDER_H_

#include <stddef.h>

#include <string>

#include "base/callback.h"
Expand Down
3 changes: 3 additions & 0 deletions mojo/edk/embedder/embedder_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "mojo/edk/embedder/embedder.h"

#include <stddef.h>
#include <stdint.h>

#include <utility>

#include "base/bind.h"
Expand Down
2 changes: 2 additions & 0 deletions mojo/edk/embedder/entrypoints.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <stdint.h>

#include "mojo/edk/embedder/embedder_internal.h"
#include "mojo/edk/system/core.h"
#include "mojo/public/c/system/buffer.h"
Expand Down
1 change: 1 addition & 0 deletions mojo/edk/embedder/platform_channel_pair_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "mojo/edk/embedder/platform_channel_pair.h"

#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/socket.h>
#include <sys/types.h>
Expand Down
Loading

0 comments on commit 2e88ac3

Please sign in to comment.