Reformat the WebRTC code base
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
diff --git a/rtc_base/logging.h b/rtc_base/logging.h
index 8f9d440..f07ed8d 100644
--- a/rtc_base/logging.h
+++ b/rtc_base/logging.h
@@ -395,7 +395,9 @@
// Android code should use the 'const char*' version since tags are static
// and we want to avoid allocating a std::string copy per log line.
RTC_DEPRECATED
- LogMessage(const char* file, int line, LoggingSeverity sev,
+ LogMessage(const char* file,
+ int line,
+ LoggingSeverity sev,
const std::string& tag);
~LogMessage();
@@ -467,7 +469,7 @@
// Updates min_sev_ appropriately when debug sinks change.
static void UpdateMinLogSeverity();
- // These write out the actual log messages.
+// These write out the actual log messages.
#if defined(WEBRTC_ANDROID)
static void OutputToDebug(const std::string& msg,
LoggingSeverity severity,
@@ -544,17 +546,15 @@
// The _F version prefixes the message with the current function name.
#if (defined(__GNUC__) && !defined(NDEBUG)) || defined(WANT_PRETTY_LOG_F)
#define RTC_LOG_F(sev) RTC_LOG(sev) << __PRETTY_FUNCTION__ << ": "
-#define RTC_LOG_T_F(sev) RTC_LOG(sev) << this << ": " \
- << __PRETTY_FUNCTION__ << ": "
+#define RTC_LOG_T_F(sev) \
+ RTC_LOG(sev) << this << ": " << __PRETTY_FUNCTION__ << ": "
#else
#define RTC_LOG_F(sev) RTC_LOG(sev) << __FUNCTION__ << ": "
#define RTC_LOG_T_F(sev) RTC_LOG(sev) << this << ": " << __FUNCTION__ << ": "
#endif
-#define RTC_LOG_CHECK_LEVEL(sev) \
- rtc::LogCheckLevel(rtc::sev)
-#define RTC_LOG_CHECK_LEVEL_V(sev) \
- rtc::LogCheckLevel(sev)
+#define RTC_LOG_CHECK_LEVEL(sev) rtc::LogCheckLevel(rtc::sev)
+#define RTC_LOG_CHECK_LEVEL_V(sev) rtc::LogCheckLevel(sev)
inline bool LogCheckLevel(LoggingSeverity sev) {
return (LogMessage::GetMinLogSeverity() <= sev);
@@ -571,37 +571,32 @@
#define RTC_LOG_T(sev) RTC_LOG(sev) << this << ": "
-#define RTC_LOG_ERRNO_EX(sev, err) \
- RTC_LOG_E(sev, ERRNO, err)
-#define RTC_LOG_ERRNO(sev) \
- RTC_LOG_ERRNO_EX(sev, errno)
+#define RTC_LOG_ERRNO_EX(sev, err) RTC_LOG_E(sev, ERRNO, err)
+#define RTC_LOG_ERRNO(sev) RTC_LOG_ERRNO_EX(sev, errno)
#if defined(WEBRTC_WIN)
-#define RTC_LOG_GLE_EX(sev, err) \
- RTC_LOG_E(sev, HRESULT, err)
+#define RTC_LOG_GLE_EX(sev, err) RTC_LOG_E(sev, HRESULT, err)
#define RTC_LOG_GLE(sev) RTC_LOG_GLE_EX(sev, static_cast<int>(GetLastError()))
-#define RTC_LOG_ERR_EX(sev, err) \
- RTC_LOG_GLE_EX(sev, err)
-#define RTC_LOG_ERR(sev) \
- RTC_LOG_GLE(sev)
+#define RTC_LOG_ERR_EX(sev, err) RTC_LOG_GLE_EX(sev, err)
+#define RTC_LOG_ERR(sev) RTC_LOG_GLE(sev)
#elif defined(__native_client__) && __native_client__
-#define RTC_LOG_ERR_EX(sev, err) \
- RTC_LOG(sev)
-#define RTC_LOG_ERR(sev) \
- RTC_LOG(sev)
+#define RTC_LOG_ERR_EX(sev, err) RTC_LOG(sev)
+#define RTC_LOG_ERR(sev) RTC_LOG(sev)
#elif defined(WEBRTC_POSIX)
-#define RTC_LOG_ERR_EX(sev, err) \
- RTC_LOG_ERRNO_EX(sev, err)
-#define RTC_LOG_ERR(sev) \
- RTC_LOG_ERRNO(sev)
+#define RTC_LOG_ERR_EX(sev, err) RTC_LOG_ERRNO_EX(sev, err)
+#define RTC_LOG_ERR(sev) RTC_LOG_ERRNO(sev)
#endif // WEBRTC_WIN
#ifdef WEBRTC_ANDROID
namespace webrtc_logging_impl {
// TODO(kwiberg): Replace these with absl::string_view.
-inline const char* AdaptString(const char* str) { return str; }
-inline const char* AdaptString(const std::string& str) { return str.c_str(); }
+inline const char* AdaptString(const char* str) {
+ return str;
+}
+inline const char* AdaptString(const std::string& str) {
+ return str.c_str();
+}
} // namespace webrtc_logging_impl
#define RTC_LOG_TAG(sev, tag) \