diff options
author | Hidehiko Abe <hidehiko@google.com> | 2018-02-22 00:57:53 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-02-22 00:57:53 +0000 |
commit | 5cbee2f9e9bb4fffabb58337e79e524df7cf906e (patch) | |
tree | ed2b17ad15909d4e760b62854d1c41f3e31aca3c | |
parent | f20835d6491c822cdb557f8baa5ee989a2fb9a01 (diff) | |
parent | 29844bf51cad9d41337106c9a9cd2ab8ba96285d (diff) | |
download | libchrome-5cbee2f9e9bb4fffabb58337e79e524df7cf906e.tar.gz |
Remove modification for missing-field-initializers from sources. am: d5a42bb516 am: 66b47eb3e1
am: 29844bf51c
Change-Id: I20daf940bc9ec5c45d34a91f0182784c37a1ca09
-rw-r--r-- | Android.bp | 2 | ||||
-rw-r--r-- | base/logging.cc | 1 | ||||
-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/threading/thread_local_storage.h | 2 | ||||
-rw-r--r-- | base/trace_event/malloc_dump_provider.cc | 2 |
7 files changed, 5 insertions, 18 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/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/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/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; |