diff options
-rw-r--r-- | base/linked_list.h | 6 | ||||
-rw-r--r-- | base/logging.h | 23 | ||||
-rw-r--r-- | base/message_loop_unittest.cc | 12 | ||||
-rw-r--r-- | base/message_pump_libevent.cc | 12 | ||||
-rw-r--r-- | base/string_util.h | 8 | ||||
-rw-r--r-- | base/third_party/dmg_fp/dtoa.cc | 2 | ||||
-rw-r--r-- | build/common.gypi | 12 | ||||
-rw-r--r-- | chrome/browser/zygote_main_linux.cc | 5 | ||||
-rw-r--r-- | ipc/ipc_message_utils.h | 6 | ||||
-rw-r--r-- | media/audio/linux/alsa_output.cc | 3 | ||||
-rw-r--r-- | media/audio/linux/alsa_output.h | 2 | ||||
-rw-r--r-- | net/socket/tcp_client_socket_libevent.cc | 3 | ||||
-rw-r--r-- | sandbox/sandbox.gyp | 4 | ||||
-rw-r--r-- | skia/skia.gyp | 1 | ||||
-rw-r--r-- | testing/gmock/include/gmock/gmock-actions.h | 2 | ||||
-rw-r--r-- | testing/gtest.gyp | 2 |
16 files changed, 32 insertions, 71 deletions
diff --git a/base/linked_list.h b/base/linked_list.h index 7464997..5b5184f 100644 --- a/base/linked_list.h +++ b/base/linked_list.h @@ -125,10 +125,6 @@ class LinkNode { return static_cast<T*>(this); } - void set(LinkNode<T>* prev, LinkNode<T>* next) { - previous_ = prev; next_ = next; - } - private: LinkNode<T>* previous_; LinkNode<T>* next_; @@ -140,7 +136,7 @@ class LinkedList { // The "root" node is self-referential, and forms the basis of a circular // list (root_.next() will point back to the start of the list, // and root_->previous() wraps around to the end of the list). - LinkedList() { root_.set(&root_, &root_); } + LinkedList() : root_(&root_, &root_) {} // Appends |e| to the end of the linked list. void Append(LinkNode<T>* e) { diff --git a/base/logging.h b/base/logging.h index f11d3b2..07a0d0f 100644 --- a/base/logging.h +++ b/base/logging.h @@ -101,18 +101,6 @@ // There is also the special severity of DFATAL, which logs FATAL in // debug mode, ERROR_REPORT in normal mode. -// XXX better comment -- must be before we use << and in global namespace -// These functions are provided as a convenience for logging, which is where we -// use streams (it is against Google style to use streams in other places). It -// is designed to allow you to emit non-ASCII Unicode strings to the log file, -// which is normally ASCII. It is relatively slow, so try not to use it for -// common cases. Non-ASCII characters will be converted to UTF-8 by these -// operators. -std::ostream& operator<<(std::ostream& out, const wchar_t* wstr); -inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { - return out << wstr.c_str(); -} - namespace logging { // Where to record logging output? A flat file and/or system debug log via @@ -825,6 +813,17 @@ void RawLog(int level, const char* message); } // namespace logging +// These functions are provided as a convenience for logging, which is where we +// use streams (it is against Google style to use streams in other places). It +// is designed to allow you to emit non-ASCII Unicode strings to the log file, +// which is normally ASCII. It is relatively slow, so try not to use it for +// common cases. Non-ASCII characters will be converted to UTF-8 by these +// operators. +std::ostream& operator<<(std::ostream& out, const wchar_t* wstr); +inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { + return out << wstr.c_str(); +} + // The NOTIMPLEMENTED() macro annotates codepaths which have // not been implemented yet. // diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 6069f20..6208e99 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -1578,10 +1578,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) { // and don't run the message loop, just destroy it. } } - if (HANDLE_EINTR(close(pipefds[0])) < 0) - PLOG(WARNING) << "close"; - if (HANDLE_EINTR(close(pipefds[1])) < 0) - PLOG(WARNING) << "close"; + HANDLE_EINTR(close(pipefds[0])); + HANDLE_EINTR(close(pipefds[1])); } TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) { @@ -1603,10 +1601,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) { controller.StopWatchingFileDescriptor(); } } - if (HANDLE_EINTR(close(pipefds[0])) < 0) - PLOG(WARNING) << "close"; - if (HANDLE_EINTR(close(pipefds[1])) < 0) - PLOG(WARNING) << "close"; + HANDLE_EINTR(close(pipefds[0])); + HANDLE_EINTR(close(pipefds[1])); } } // namespace diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc index 3a749b4..c2390b4 100644 --- a/base/message_pump_libevent.cc +++ b/base/message_pump_libevent.cc @@ -160,14 +160,10 @@ MessagePumpLibevent::~MessagePumpLibevent() { DCHECK(event_base_); event_del(wakeup_event_); delete wakeup_event_; - if (wakeup_pipe_in_ >= 0) { - if (HANDLE_EINTR(close(wakeup_pipe_in_)) < 0) - PLOG(WARNING) << "close"; - } - if (wakeup_pipe_out_ >= 0) { - if (HANDLE_EINTR(close(wakeup_pipe_out_)) < 0) - PLOG(WARNING) << "close"; - } + if (wakeup_pipe_in_ >= 0) + HANDLE_EINTR(close(wakeup_pipe_in_)); + if (wakeup_pipe_out_ >= 0) + HANDLE_EINTR(close(wakeup_pipe_out_)); event_base_free(event_base_); } diff --git a/base/string_util.h b/base/string_util.h index 87865b6..11a9fd2 100644 --- a/base/string_util.h +++ b/base/string_util.h @@ -54,10 +54,6 @@ int vswprintf(wchar_t* buffer, size_t size, // Some of these implementations need to be inlined. -// CLANG NOTE -// Qualified calls with base:: is to work around -// http://llvm.org/bugs/show_bug.cgi?id=6762 - // We separate the declaration from the implementation of this inline // function just so the PRINTF_FORMAT works. inline int snprintf(char* buffer, size_t size, const char* format, ...) @@ -65,7 +61,7 @@ inline int snprintf(char* buffer, size_t size, const char* format, ...) inline int snprintf(char* buffer, size_t size, const char* format, ...) { va_list arguments; va_start(arguments, format); - int result = base::vsnprintf(buffer, size, format, arguments); + int result = vsnprintf(buffer, size, format, arguments); va_end(arguments); return result; } @@ -77,7 +73,7 @@ inline int swprintf(wchar_t* buffer, size_t size, const wchar_t* format, ...) inline int swprintf(wchar_t* buffer, size_t size, const wchar_t* format, ...) { va_list arguments; va_start(arguments, format); - int result = base::vswprintf(buffer, size, format, arguments); + int result = vswprintf(buffer, size, format, arguments); va_end(arguments); return result; } diff --git a/base/third_party/dmg_fp/dtoa.cc b/base/third_party/dmg_fp/dtoa.cc index ad71fb6..3f7e794 100644 --- a/base/third_party/dmg_fp/dtoa.cc +++ b/base/third_party/dmg_fp/dtoa.cc @@ -1559,7 +1559,7 @@ hexnan CONST char *s; int c1, havedig, udx0, xshift; - if (!hexdig[(int)'0']) + if (!hexdig['0']) hexdig_init(); x[0] = x[1] = 0; havedig = xshift = 0; diff --git a/build/common.gypi b/build/common.gypi index 5f7740a..e2da12b 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -229,14 +229,11 @@ # Set this to true to enable SELinux support. 'selinux%': 0, - # Set this to true when building with Clang. - 'clang%': 1, - # Strip the binary after dumping symbols. 'linux_strip_binary%': 0, - # Disable TCMalloc. It uses variable length arrays which aren't in C++. - 'linux_use_tcmalloc%': 0, + # Enable TCMalloc. + 'linux_use_tcmalloc%': 1, # Disable TCMalloc's debugallocation. 'linux_use_debugallocation%': 0, @@ -813,11 +810,6 @@ '-Wno-unused-parameter', # Don't warn about the "struct foo f = {0};" initialization pattern. '-Wno-missing-field-initializers', - # Don't warn about unused variables, due to a common pattern: - # scoped_deleter_of_some_sort unused_variable(&thing_to_delete); - '-Wno-unused-variable', - # gtest confuses clang. - '-Wno-bool-conversions', '-D_FILE_OFFSET_BITS=64', # Don't export any symbols (for example, to plugins we dlopen()). # Note: this is *required* to make some plugins work. diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc index d58173a..fc2d441 100644 --- a/chrome/browser/zygote_main_linux.cc +++ b/chrome/browser/zygote_main_linux.cc @@ -616,11 +616,6 @@ static bool EnterSandbox() { #endif // CHROMIUM_SELINUX -// CLANG HACK -int SupportsSeccompSandbox(int) { return 0; } -void SeccompSandboxSetProcSelfMaps(int) {} -void StartSeccompSandbox() {} - bool ZygoteMain(const MainFunctionParams& params) { #if !defined(CHROMIUM_SELINUX) g_am_zygote_or_renderer = true; diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index f4cd245..df2c6c7 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -112,8 +112,7 @@ struct SimilarTypeTraits { template <class P> static inline void WriteParam(Message* m, const P& p) { typedef typename SimilarTypeTraits<P>::Type Type; - const Type& t = p; - ParamTraits<Type>::Write(m, t); + ParamTraits<Type>::Write(m, static_cast<const Type& >(p)); } template <class P> @@ -126,8 +125,7 @@ static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter, template <class P> static inline void LogParam(const P& p, std::wstring* l) { typedef typename SimilarTypeTraits<P>::Type Type; - const Type& t = p; - ParamTraits<Type>::Log(t, l); + ParamTraits<Type>::Log(static_cast<const Type& >(p), l); } template <> diff --git a/media/audio/linux/alsa_output.cc b/media/audio/linux/alsa_output.cc index 1b433ba..b4c4dd2 100644 --- a/media/audio/linux/alsa_output.cc +++ b/media/audio/linux/alsa_output.cc @@ -210,8 +210,7 @@ static void Swizzle51Layout(Format* b, uint32 filled) { } // namespace -// Not in an anonymous namespace so that it can be a friend to -// AlsaPcmOutputStream. +// Not in an anonymous so that it can be a friend to AlsaPcmOutputStream. std::ostream& operator<<(std::ostream& os, AlsaPcmOutputStream::InternalState state) { switch (state) { diff --git a/media/audio/linux/alsa_output.h b/media/audio/linux/alsa_output.h index 6a2795b..5f54d3b 100644 --- a/media/audio/linux/alsa_output.h +++ b/media/audio/linux/alsa_output.h @@ -114,7 +114,6 @@ class AlsaPcmOutputStream : virtual ~AlsaPcmOutputStream(); - public: // clang workaround // Flags indicating the state of the stream. enum InternalState { kInError = 0, @@ -124,7 +123,6 @@ class AlsaPcmOutputStream : kIsStopped, kIsClosed }; - private: friend std::ostream& operator<<(std::ostream& os, InternalState); // Various tasks that complete actions started in the public API. diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc index fc0e33b..102a8fb 100644 --- a/net/socket/tcp_client_socket_libevent.cc +++ b/net/socket/tcp_client_socket_libevent.cc @@ -256,8 +256,7 @@ void TCPClientSocketLibevent::DoDisconnect() { DCHECK(ok); ok = write_socket_watcher_.StopWatchingFileDescriptor(); DCHECK(ok); - if (HANDLE_EINTR(close(socket_)) < 0) - PLOG(WARNING) << "close"; + HANDLE_EINTR(close(socket_)); socket_ = kInvalidSocket; } diff --git a/sandbox/sandbox.gyp b/sandbox/sandbox.gyp index ab89665..706cba2 100644 --- a/sandbox/sandbox.gyp +++ b/sandbox/sandbox.gyp @@ -135,7 +135,7 @@ }, ], }], - [ 'OS=="linux" and selinux==0 and clang==0', { + [ 'OS=="linux" and selinux==0', { 'targets': [ { 'target_name': 'chrome_sandbox', @@ -168,7 +168,7 @@ }, ], }], - [ 'OS=="linux" and (selinux==1 or clang==1)', { + [ 'OS=="linux" and selinux==1', { # GYP requires that each file have at least one target defined. 'targets': [ { diff --git a/skia/skia.gyp b/skia/skia.gyp index 38e8423..2b17094 100644 --- a/skia/skia.gyp +++ b/skia/skia.gyp @@ -552,7 +552,6 @@ ], 'defines': [ 'SK_BUILD_NO_IMAGE_ENCODE', - 'SK_RESTRICT=', # Remove use of __restrict__ -- not sure it's correct. ], 'sources!': [ '../third_party/skia/include/core/SkTypes.h', diff --git a/testing/gmock/include/gmock/gmock-actions.h b/testing/gmock/include/gmock/gmock-actions.h index d7baa5d..007ad9d 100644 --- a/testing/gmock/include/gmock/gmock-actions.h +++ b/testing/gmock/include/gmock/gmock-actions.h @@ -680,7 +680,7 @@ class SetArgumentPointeeAction { template <typename Result, typename ArgumentTuple> void Perform(const ArgumentTuple& args) const { - // CompileAssertTypesEqual<void, Result>(); + CompileAssertTypesEqual<void, Result>(); *::std::tr1::get<N>(args) = value_; } diff --git a/testing/gtest.gyp b/testing/gtest.gyp index 706f11d..c8f64e5 100644 --- a/testing/gtest.gyp +++ b/testing/gtest.gyp @@ -69,12 +69,10 @@ # must be instructed that RTTI is disabled here, and for any # direct dependents that might include gtest headers. 'GTEST_HAS_RTTI=0', - 'GTEST_USE_OWN_TR1_TUPLE=1', ], 'direct_dependent_settings': { 'defines': [ 'GTEST_HAS_RTTI=0', - 'GTEST_USE_OWN_TR1_TUPLE=1', ], }, }], |