Skip to content

Commit

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

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

Cr-Commit-Position: refs/heads/master@{#366895}
  • Loading branch information
avi authored and Commit bot committed Dec 26, 2015
1 parent 36b6aec commit cab0f83
Show file tree
Hide file tree
Showing 136 changed files with 387 additions and 164 deletions.
3 changes: 3 additions & 0 deletions tools/android/common/adb_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@

#include <arpa/inet.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>

#include "base/logging.h"
#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"
#include "tools/android/common/net.h"

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

#include <stddef.h>

#include <string>

namespace tools {
Expand Down
1 change: 1 addition & 0 deletions tools/android/file_poller/file_poller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
Expand Down
2 changes: 2 additions & 0 deletions tools/android/forwarder/forwarder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <netinet/tcp.h>
#include <pthread.h>
#include <signal.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand All @@ -18,6 +19,7 @@

#include "base/command_line.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"
#include "tools/android/common/adb_connection.h"
#include "tools/android/common/daemon.h"
Expand Down
1 change: 0 additions & 1 deletion tools/android/forwarder2/command.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef TOOLS_ANDROID_FORWARDER2_COMMAND_H_
#define TOOLS_ANDROID_FORWARDER2_COMMAND_H_

#include "base/basictypes.h"

namespace forwarder2 {

Expand Down
4 changes: 2 additions & 2 deletions tools/android/forwarder2/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
#ifndef TOOLS_ANDROID_FORWARDER2_COMMON_H_
#define TOOLS_ANDROID_FORWARDER2_COMMON_H_

#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <errno.h>

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"

// Preserving errno for Close() is important because the function is very often
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <errno.h>
#include <fcntl.h>
#include <signal.h>
#include <string.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
Expand All @@ -17,7 +18,6 @@
#include <cstring>
#include <string>

#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/daemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <string>

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

namespace forwarder2 {
Expand Down
1 change: 0 additions & 1 deletion tools/android/forwarder2/device_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <utility>

#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/logging.h"
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/device_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

#include <string>

#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/device_listener.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#ifndef TOOLS_ANDROID_FORWARDER2_DEVICE_LISTENER_H_
#define TOOLS_ANDROID_FORWARDER2_DEVICE_LISTENER_H_

#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread.h"
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/forwarder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

#include "tools/android/forwarder2/forwarder.h"

#include "base/basictypes.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"
#include "tools/android/forwarder2/socket.h"

Expand Down
3 changes: 2 additions & 1 deletion tools/android/forwarder2/forwarders_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

#include "tools/android/forwarder2/forwarders_manager.h"

#include <stddef.h>
#include <sys/select.h>
#include <unistd.h>

#include <algorithm>

#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/posix/eintr_wrapper.h"
#include "tools/android/forwarder2/forwarder.h"
#include "tools/android/forwarder2/socket.h"
Expand Down
1 change: 0 additions & 1 deletion tools/android/forwarder2/host_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <string>

#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/host_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

#include <string>

#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread.h"
Expand Down
6 changes: 4 additions & 2 deletions tools/android/forwarder2/host_forwarder_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#include <errno.h>
#include <signal.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
Expand All @@ -16,14 +18,14 @@
#include <vector>

#include "base/at_exit.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/linked_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/pickle.h"
Expand Down Expand Up @@ -414,7 +416,7 @@ int PortToInt(const std::string& s) {
int value;
// Note that 0 is a valid port (used for dynamic port allocation).
if (!base::StringToInt(s, &value) || value < 0 ||
value > std::numeric_limits<uint16>::max()) {
value > std::numeric_limits<uint16_t>::max()) {
LOG(ERROR) << "Could not convert string " << s << " to port";
ExitWithUsage();
}
Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/pipe_notifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef TOOLS_ANDROID_FORWARDER2_PIPE_NOTIFIER_H_
#define TOOLS_ANDROID_FORWARDER2_PIPE_NOTIFIER_H_

#include "base/basictypes.h"
#include "base/macros.h"

namespace forwarder2 {

Expand Down
2 changes: 1 addition & 1 deletion tools/android/forwarder2/self_deleter_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#ifndef TOOLS_ANDROID_FORWARDER2_SELF_DELETER_HELPER_H_
#define TOOLS_ANDROID_FORWARDER2_SELF_DELETER_HELPER_H_

#include "base/basictypes.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
Expand Down
3 changes: 2 additions & 1 deletion tools/android/forwarder2/socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -183,7 +184,7 @@ bool Socket::BindAndListen() {
memset(&addr, 0, sizeof(addr));
socklen_t addrlen = 0;
sockaddr* addr_ptr = NULL;
uint16* port_ptr = NULL;
uint16_t* port_ptr = NULL;
if (family_ == AF_INET) {
addr_ptr = reinterpret_cast<sockaddr*>(&addr.addr4);
port_ptr = &addr.addr4.sin_port;
Expand Down
3 changes: 2 additions & 1 deletion tools/android/forwarder2/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

#include <fcntl.h>
#include <netinet/in.h>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/un.h>

#include <string>
#include <vector>

#include "base/basictypes.h"
#include "base/macros.h"

namespace forwarder2 {

Expand Down
7 changes: 4 additions & 3 deletions tools/android/heap_profiler/heap_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@
#include <fcntl.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/ptrace.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>

#include "tools/android/heap_profiler/heap_profiler.h"


static void lseek_abs(int fd, size_t off);
static void read_proc_cmdline(char* cmdline, int size);
static ssize_t read_safe(int fd, void* buf, size_t count);
Expand Down
2 changes: 2 additions & 0 deletions tools/android/heap_profiler/heap_profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#ifndef TOOLS_ANDROID_HEAP_PROFILER_HEAP_PROFILER_H_
#define TOOLS_ANDROID_HEAP_PROFILER_HEAP_PROFILER_H_

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

#include "third_party/bsdtrees/tree.h"

#define HEAP_PROFILER_MAGIC_MARKER 0x42beef42L
Expand Down
2 changes: 2 additions & 0 deletions tools/android/heap_profiler/heap_profiler_hooks_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <dlfcn.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
Expand Down
1 change: 1 addition & 0 deletions tools/android/heap_profiler/heap_profiler_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// 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 <string.h>
#include <map>
Expand Down
2 changes: 2 additions & 0 deletions tools/android/md5sum/md5sum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Md5sum implementation for Android. This version handles files as well as
// directories. Its output is sorted by file path.

#include <stddef.h>

#include <fstream>
#include <iostream>
#include <set>
Expand Down
Loading

0 comments on commit cab0f83

Please sign in to comment.