diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-02-22 08:28:11 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-02-22 08:28:11 +0000 |
commit | 0949aabd636513c1b4fc79c0eea75b1bf2651782 (patch) | |
tree | ed2b17ad15909d4e760b62854d1c41f3e31aca3c | |
parent | 2af72859776fc2154a5cd077d6705e0102d85ba0 (diff) | |
parent | 5cbee2f9e9bb4fffabb58337e79e524df7cf906e (diff) | |
download | libchrome-0949aabd636513c1b4fc79c0eea75b1bf2651782.tar.gz |
Snap for 4615953 from 5cbee2f9e9bb4fffabb58337e79e524df7cf906e to pi-release
Change-Id: I4f27cf7c337a0c3426000cb049ecfecb8db092cc
-rw-r--r-- | Android.bp | 2 | ||||
-rw-r--r-- | base/base64.cc | 2 | ||||
-rw-r--r-- | base/base64url.cc | 3 | ||||
-rw-r--r-- | base/debug/debugger_posix.cc | 2 | ||||
-rw-r--r-- | base/debug/stack_trace_posix.cc | 2 | ||||
-rw-r--r-- | base/logging.cc | 1 | ||||
-rw-r--r-- | base/memory/shared_memory_android.cc | 5 | ||||
-rw-r--r-- | base/memory/shared_memory_posix.cc | 4 | ||||
-rw-r--r-- | base/posix/unix_domain_socket_linux.cc | 6 | ||||
-rw-r--r-- | base/process/launch_posix.cc | 5 | ||||
-rw-r--r-- | base/process/process_posix.cc | 5 | ||||
-rw-r--r-- | base/third_party/symbolize/symbolize.h | 15 | ||||
-rw-r--r-- | base/threading/thread_local_storage.h | 2 | ||||
-rw-r--r-- | base/trace_event/malloc_dump_provider.cc | 2 | ||||
-rw-r--r-- | third_party/ashmem/ashmem.h | 17 | ||||
-rw-r--r-- | third_party/modp_b64/modp_b64.h | 16 |
16 files changed, 59 insertions, 30 deletions
diff --git a/Android.bp b/Android.bp index c208ed4e9a..ac00435be8 100644 --- a/Android.bp +++ b/Android.bp @@ -36,6 +36,7 @@ cc_defaults { "-Wall", "-Werror", "-Wno-deprecated-declarations", + "-Wno-missing-field-initializers", "-Wno-unused-parameter", ], include_dirs: [ @@ -67,7 +68,6 @@ cc_defaults { cflags: [ "-Wno-unused-function", "-Wno-unused-variable", - "-Wno-missing-field-initializers", ], clang_cflags: [ diff --git a/base/base64.cc b/base/base64.cc index 61d853897b..ca8ee93907 100644 --- a/base/base64.cc +++ b/base/base64.cc @@ -6,7 +6,7 @@ #include <stddef.h> -#include <modp_b64/modp_b64.h> +#include "third_party/modp_b64/modp_b64.h" namespace base { diff --git a/base/base64url.cc b/base/base64url.cc index 942229e76a..0a2c04511f 100644 --- a/base/base64url.cc +++ b/base/base64url.cc @@ -10,8 +10,7 @@ #include "base/macros.h" #include "base/numerics/safe_math.h" #include "base/strings/string_util.h" - -#include <modp_b64/modp_b64.h> +#include "third_party/modp_b64/modp_b64.h" namespace base { diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc index ebe9d611f7..3255552333 100644 --- a/base/debug/debugger_posix.cc +++ b/base/debug/debugger_posix.cc @@ -46,7 +46,7 @@ #include "base/strings/string_piece.h" #if defined(USE_SYMBOLIZE) -#error "symbolize support was removed from libchrome" +#include "base/third_party/symbolize/symbolize.h" #endif #if defined(OS_ANDROID) diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc index c134f494eb..ab4c34b021 100644 --- a/base/debug/stack_trace_posix.cc +++ b/base/debug/stack_trace_posix.cc @@ -49,7 +49,7 @@ #include "build/build_config.h" #if defined(USE_SYMBOLIZE) -#error "symbolize support was removed from libchrome" +#include "base/third_party/symbolize/symbolize.h" #endif namespace base { diff --git a/base/logging.cc b/base/logging.cc index ad9d84a07f..01e311b1b6 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -796,7 +796,6 @@ void LogMessage::Init(const char* file, int line) { gettimeofday(&tv, nullptr); time_t t = tv.tv_sec; struct tm local_time; - memset(&local_time, 0, sizeof(local_time)); localtime_r(&t, &local_time); struct tm* tm_time = &local_time; stream_ << std::setfill('0') diff --git a/base/memory/shared_memory_android.cc b/base/memory/shared_memory_android.cc index dffd1e3712..6f1d9cb874 100644 --- a/base/memory/shared_memory_android.cc +++ b/base/memory/shared_memory_android.cc @@ -8,12 +8,7 @@ #include <sys/mman.h> #include "base/logging.h" - -#if defined(__ANDROID__) -#include <cutils/ashmem.h> -#else #include "third_party/ashmem/ashmem.h" -#endif namespace base { diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc index e5f67bd1e6..287e55d823 100644 --- a/base/memory/shared_memory_posix.cc +++ b/base/memory/shared_memory_posix.cc @@ -27,9 +27,9 @@ #if defined(OS_ANDROID) #include "base/os_compat_android.h" +#endif +#if defined(OS_ANDROID) || defined(__ANDROID__) #include "third_party/ashmem/ashmem.h" -#elif defined(__ANDROID__) -#include <cutils/ashmem.h> #endif namespace base { diff --git a/base/posix/unix_domain_socket_linux.cc b/base/posix/unix_domain_socket_linux.cc index 25ddb5470a..8b3094eedf 100644 --- a/base/posix/unix_domain_socket_linux.cc +++ b/base/posix/unix_domain_socket_linux.cc @@ -50,8 +50,7 @@ bool UnixDomainSocket::SendMsg(int fd, const void* buf, size_t length, const std::vector<int>& fds) { - struct msghdr msg; - memset(&msg, 0, sizeof(msg)); + struct msghdr msg = {}; struct iovec iov = { const_cast<void*>(buf), length }; msg.msg_iov = &iov; msg.msg_iovlen = 1; @@ -109,8 +108,7 @@ ssize_t UnixDomainSocket::RecvMsgWithFlags(int fd, ProcessId* out_pid) { fds->clear(); - struct msghdr msg; - memset(&msg, 0, sizeof(msg)); + struct msghdr msg = {}; struct iovec iov = { buf, length }; msg.msg_iov = &iov; msg.msg_iovlen = 1; diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc index 1c4df40665..2184051552 100644 --- a/base/process/launch_posix.cc +++ b/base/process/launch_posix.cc @@ -163,12 +163,7 @@ int sys_rt_sigaction(int sig, const struct kernel_sigaction* act, // See crbug.com/177956. void ResetChildSignalHandlersToDefaults(void) { for (int signum = 1; ; ++signum) { -#if defined(ANDROID) - struct kernel_sigaction act; - memset(&act, 0, sizeof(act)); -#else struct kernel_sigaction act = {0}; -#endif int sigaction_get_ret = sys_rt_sigaction(signum, nullptr, &act); if (sigaction_get_ret && errno == EINVAL) { #if !defined(NDEBUG) diff --git a/base/process/process_posix.cc b/base/process/process_posix.cc index db525f0355..3da6793afb 100644 --- a/base/process/process_posix.cc +++ b/base/process/process_posix.cc @@ -102,12 +102,7 @@ static bool WaitForSingleNonChildProcess(base::ProcessHandle handle, return false; } -#if defined(ANDROID) - struct kevent change; - memset(&change, 0, sizeof(change)); -#else struct kevent change = {0}; -#endif EV_SET(&change, handle, EVFILT_PROC, EV_ADD, NOTE_EXIT, 0, NULL); int result = HANDLE_EINTR(kevent(kq.get(), &change, 1, NULL, 0, NULL)); if (result == -1) { diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h new file mode 100644 index 0000000000..59beafb7cb --- /dev/null +++ b/base/third_party/symbolize/symbolize.h @@ -0,0 +1,15 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#error "symbolize support was removed from libchrome" diff --git a/base/threading/thread_local_storage.h b/base/threading/thread_local_storage.h index 5e70410af9..fd2a789d01 100644 --- a/base/threading/thread_local_storage.h +++ b/base/threading/thread_local_storage.h @@ -94,7 +94,7 @@ class BASE_EXPORT ThreadLocalStorage { // initialization, as base's LINKER_INITIALIZED requires a constructor and on // some compilers (notably gcc 4.4) this still ends up needing runtime // initialization. -#define TLS_INITIALIZER {false, 0, 0} + #define TLS_INITIALIZER {0} // A key representing one value stored in TLS. // Initialize like diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc index d78de9b548..7f2706092e 100644 --- a/base/trace_event/malloc_dump_provider.cc +++ b/base/trace_event/malloc_dump_provider.cc @@ -211,7 +211,7 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args, &allocated_objects_size); DCHECK(res); #elif defined(OS_MACOSX) || defined(OS_IOS) - malloc_statistics_t stats = {}; + malloc_statistics_t stats = {0}; malloc_zone_statistics(nullptr, &stats); total_virtual_size = stats.size_allocated; allocated_objects_size = stats.size_in_use; diff --git a/third_party/ashmem/ashmem.h b/third_party/ashmem/ashmem.h new file mode 100644 index 0000000000..3ef9f73c80 --- /dev/null +++ b/third_party/ashmem/ashmem.h @@ -0,0 +1,17 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// third_party/ashmem is Android shared memory. Instead of clone it here, +// use cutils/ashmem.h directly. +#include <cutils/ashmem.h> diff --git a/third_party/modp_b64/modp_b64.h b/third_party/modp_b64/modp_b64.h new file mode 100644 index 0000000000..ed24ac8494 --- /dev/null +++ b/third_party/modp_b64/modp_b64.h @@ -0,0 +1,16 @@ +// Copyright (C) 2018 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Redirect to system header. +#include <modp_b64/modp_b64.h> |