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/bind_unittest.cc b/rtc_base/bind_unittest.cc
index 8703be4..ed0913f 100644
--- a/rtc_base/bind_unittest.cc
+++ b/rtc_base/bind_unittest.cc
@@ -24,10 +24,20 @@
struct MethodBindTester {
void NullaryVoid() { ++call_count; }
- int NullaryInt() { ++call_count; return 1; }
- int NullaryConst() const { ++call_count; return 2; }
+ int NullaryInt() {
+ ++call_count;
+ return 1;
+ }
+ int NullaryConst() const {
+ ++call_count;
+ return 2;
+ }
void UnaryVoid(int dummy) { ++call_count; }
- template <class T> T Identity(T value) { ++call_count; return value; }
+ template <class T>
+ T Identity(T value) {
+ ++call_count;
+ return value;
+ }
int UnaryByPointer(int* value) const {
++call_count;
return ++(*value);
@@ -36,7 +46,10 @@
++call_count;
return ++const_cast<int&>(value);
}
- int Multiply(int a, int b) const { ++call_count; return a * b; }
+ int Multiply(int a, int b) const {
+ ++call_count;
+ return a * b;
+ }
void RefArgument(const scoped_refptr<LifeTimeCheck>& object) {
EXPECT_TRUE(object.get() != nullptr);
}
@@ -44,13 +57,17 @@
mutable int call_count;
};
-struct A { int dummy; };
-struct B: public RefCountInterface { int dummy; };
-struct C: public A, B {};
+struct A {
+ int dummy;
+};
+struct B : public RefCountInterface {
+ int dummy;
+};
+struct C : public A, B {};
struct D {
int AddRef();
};
-struct E: public D {
+struct E : public D {
int Release();
};
struct F {
@@ -66,9 +83,15 @@
int ref_count_;
};
-int Return42() { return 42; }
-int Negate(int a) { return -a; }
-int Multiply(int a, int b) { return a * b; }
+int Return42() {
+ return 42;
+}
+int Negate(int a) {
+ return -a;
+}
+int Multiply(int a, int b) {
+ return a * b;
+}
} // namespace
@@ -76,7 +99,8 @@
// compile time.
#define EXPECT_IS_CAPTURED_AS_PTR(T) \
static_assert(is_same<detail::PointerType<T>::type, T*>::value, \
- "PointerType")
+ "PointerTyp" \
+ "e")
#define EXPECT_IS_CAPTURED_AS_SCOPED_REFPTR(T) \
static_assert( \
is_same<detail::PointerType<T>::type, scoped_refptr<T>>::value, \
@@ -206,7 +230,9 @@
namespace {
-const int* Ref(const int& a) { return &a; }
+const int* Ref(const int& a) {
+ return &a;
+}
} // anonymous namespace