Apply clang-format to all C, C++ and ObjC files (issue #2171)

This commit is contained in:
Marshall Greenblatt
2017-05-17 11:29:28 +02:00
parent a566549e04
commit 31d9407ee2
1331 changed files with 33014 additions and 32258 deletions

View File

@ -274,20 +274,20 @@ class SupportsAddRefAndRelease {
// instantiate Base is made. We disable the warning for this definition.
#if defined(OS_WIN)
#pragma warning(push)
#pragma warning(disable:4624)
#pragma warning(disable : 4624)
#endif
struct Base : public T, public BaseMixin {
};
struct Base : public T, public BaseMixin {};
#if defined(OS_WIN)
#pragma warning(pop)
#endif
template <void(BaseMixin::*)(void)> struct Helper {};
template <void (BaseMixin::*)(void)>
struct Helper {};
template <typename C>
static No& Check(Helper<&C::AddRef>*);
template <typename >
template <typename>
static Yes& Check(...);
public:
@ -297,22 +297,18 @@ class SupportsAddRefAndRelease {
// Helpers to assert that arguments of a recounted type are bound with a
// scoped_refptr.
template <bool IsClasstype, typename T>
struct UnsafeBindtoRefCountedArgHelper : false_type {
};
struct UnsafeBindtoRefCountedArgHelper : false_type {};
template <typename T>
struct UnsafeBindtoRefCountedArgHelper<true, T>
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {
};
: integral_constant<bool, SupportsAddRefAndRelease<T>::value> {};
template <typename T>
struct UnsafeBindtoRefCountedArg : false_type {
};
struct UnsafeBindtoRefCountedArg : false_type {};
template <typename T>
struct UnsafeBindtoRefCountedArg<T*>
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {
};
: UnsafeBindtoRefCountedArgHelper<is_class<T>::value, T> {};
template <typename T>
class HasIsMethodTag {
@ -334,6 +330,7 @@ class UnretainedWrapper {
public:
explicit UnretainedWrapper(T* o) : ptr_(o) {}
T* get() const { return ptr_; }
private:
T* ptr_;
};
@ -343,6 +340,7 @@ class ConstRefWrapper {
public:
explicit ConstRefWrapper(const T& o) : ptr_(&o) {}
const T& get() const { return *ptr_; }
private:
const T* ptr_;
};
@ -355,7 +353,7 @@ struct IgnoreResultHelper {
};
template <typename T>
struct IgnoreResultHelper<Callback<T> > {
struct IgnoreResultHelper<Callback<T>> {
explicit IgnoreResultHelper(const Callback<T>& functor) : functor_(functor) {}
const Callback<T>& functor_;
@ -409,8 +407,7 @@ class PassedWrapper {
public:
explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {}
PassedWrapper(const PassedWrapper& other)
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {
}
: is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) {}
T Pass() const {
CHECK(is_valid_);
is_valid_ = false;
@ -430,7 +427,7 @@ struct UnwrapTraits {
};
template <typename T>
struct UnwrapTraits<UnretainedWrapper<T> > {
struct UnwrapTraits<UnretainedWrapper<T>> {
typedef T* ForwardType;
static ForwardType Unwrap(UnretainedWrapper<T> unretained) {
return unretained.get();
@ -438,7 +435,7 @@ struct UnwrapTraits<UnretainedWrapper<T> > {
};
template <typename T>
struct UnwrapTraits<ConstRefWrapper<T> > {
struct UnwrapTraits<ConstRefWrapper<T>> {
typedef const T& ForwardType;
static ForwardType Unwrap(ConstRefWrapper<T> const_ref) {
return const_ref.get();
@ -446,31 +443,27 @@ struct UnwrapTraits<ConstRefWrapper<T> > {
};
template <typename T>
struct UnwrapTraits<scoped_refptr<T> > {
struct UnwrapTraits<scoped_refptr<T>> {
typedef T* ForwardType;
static ForwardType Unwrap(const scoped_refptr<T>& o) { return o.get(); }
};
template <typename T>
struct UnwrapTraits<WeakPtr<T> > {
struct UnwrapTraits<WeakPtr<T>> {
typedef const WeakPtr<T>& ForwardType;
static ForwardType Unwrap(const WeakPtr<T>& o) { return o; }
};
template <typename T>
struct UnwrapTraits<OwnedWrapper<T> > {
struct UnwrapTraits<OwnedWrapper<T>> {
typedef T* ForwardType;
static ForwardType Unwrap(const OwnedWrapper<T>& o) {
return o.get();
}
static ForwardType Unwrap(const OwnedWrapper<T>& o) { return o.get(); }
};
template <typename T>
struct UnwrapTraits<PassedWrapper<T> > {
struct UnwrapTraits<PassedWrapper<T>> {
typedef T ForwardType;
static T Unwrap(PassedWrapper<T>& o) {
return o.Pass();
}
static T Unwrap(PassedWrapper<T>& o) { return o.Pass(); }
};
// Utility for handling different refcounting semantics in the Bind()
@ -505,7 +498,7 @@ struct MaybeRefcount<true, T*> {
// No need to additionally AddRef() and Release() since we are storing a
// scoped_refptr<> inside the storage object already.
template <typename T>
struct MaybeRefcount<true, scoped_refptr<T> > {
struct MaybeRefcount<true, scoped_refptr<T>> {
static void AddRef(const scoped_refptr<T>& o) {}
static void Release(const scoped_refptr<T>& o) {}
};
@ -526,10 +519,10 @@ template <bool IsMethod, typename P1>
struct IsWeakMethod : public false_type {};
template <typename T>
struct IsWeakMethod<true, WeakPtr<T> > : public true_type {};
struct IsWeakMethod<true, WeakPtr<T>> : public true_type {};
template <typename T>
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T> > > : public true_type {};
struct IsWeakMethod<true, ConstRefWrapper<WeakPtr<T>>> : public true_type {};
} // namespace cef_internal
@ -567,14 +560,14 @@ static inline cef_internal::IgnoreResultHelper<T> IgnoreResult(T data) {
}
template <typename T>
static inline cef_internal::IgnoreResultHelper<Callback<T> >
IgnoreResult(const Callback<T>& data) {
return cef_internal::IgnoreResultHelper<Callback<T> >(data);
static inline cef_internal::IgnoreResultHelper<Callback<T>> IgnoreResult(
const Callback<T>& data) {
return cef_internal::IgnoreResultHelper<Callback<T>>(data);
}
void DoNothing();
template<typename T>
template <typename T>
void DeletePointer(T* obj) {
delete obj;
}