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}
This commit is contained in:
Yves Gerey
2018-06-19 15:03:05 +02:00
parent b602123a5a
commit 665174fdbb
1569 changed files with 30495 additions and 30309 deletions

View File

@ -24,10 +24,20 @@ struct LifeTimeCheck;
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 @@ struct MethodBindTester {
++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 @@ struct MethodBindTester {
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 @@ struct LifeTimeCheck {
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 @@ int Multiply(int a, int b) { return a * b; }
// 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 @@ TEST(BindTest, ScopedRefPointerArgument) {
namespace {
const int* Ref(const int& a) { return &a; }
const int* Ref(const int& a) {
return &a;
}
} // anonymous namespace