1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:37:46 +00:00

Everywhere: Run clang-format

This commit is contained in:
Idan Horowitz 2022-04-01 20:58:27 +03:00 committed by Linus Groh
parent 0376c127f6
commit 086969277e
1665 changed files with 8479 additions and 8479 deletions

View file

@ -82,13 +82,13 @@ public:
{
VERIFY(!(m_bits & 1));
}
ALWAYS_INLINE NonnullRefPtr(const NonnullRefPtr& other)
ALWAYS_INLINE NonnullRefPtr(NonnullRefPtr const& other)
: m_bits((FlatPtr)other.add_ref())
{
VERIFY(!(m_bits & 1));
}
template<typename U>
ALWAYS_INLINE NonnullRefPtr(const NonnullRefPtr<U>& other) requires(IsConvertible<U*, T*>)
ALWAYS_INLINE NonnullRefPtr(NonnullRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
: m_bits((FlatPtr)other.add_ref())
{
VERIFY(!(m_bits & 1));
@ -102,18 +102,18 @@ public:
}
template<typename U>
NonnullRefPtr(const OwnPtr<U>&) = delete;
NonnullRefPtr(OwnPtr<U> const&) = delete;
template<typename U>
NonnullRefPtr& operator=(const OwnPtr<U>&) = delete;
NonnullRefPtr& operator=(OwnPtr<U> const&) = delete;
template<typename U>
NonnullRefPtr(const RefPtr<U>&) = delete;
NonnullRefPtr(RefPtr<U> const&) = delete;
template<typename U>
NonnullRefPtr& operator=(const RefPtr<U>&) = delete;
NonnullRefPtr(const RefPtr<T>&) = delete;
NonnullRefPtr& operator=(const RefPtr<T>&) = delete;
NonnullRefPtr& operator=(RefPtr<U> const&) = delete;
NonnullRefPtr(RefPtr<T> const&) = delete;
NonnullRefPtr& operator=(RefPtr<T> const&) = delete;
NonnullRefPtr& operator=(const NonnullRefPtr& other)
NonnullRefPtr& operator=(NonnullRefPtr const& other)
{
if (this != &other)
assign(other.add_ref());
@ -121,7 +121,7 @@ public:
}
template<typename U>
NonnullRefPtr& operator=(const NonnullRefPtr<U>& other) requires(IsConvertible<U*, T*>)
NonnullRefPtr& operator=(NonnullRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
{
assign(other.add_ref());
return *this;
@ -324,7 +324,7 @@ inline NonnullRefPtr<T> adopt_ref(T& object)
template<typename T>
struct Formatter<NonnullRefPtr<T>> : Formatter<const T*> {
ErrorOr<void> format(FormatBuilder& builder, const NonnullRefPtr<T>& value)
ErrorOr<void> format(FormatBuilder& builder, NonnullRefPtr<T> const& value)
{
return Formatter<const T*>::format(builder, value.ptr());
}
@ -342,8 +342,8 @@ template<typename T>
struct Traits<NonnullRefPtr<T>> : public GenericTraits<NonnullRefPtr<T>> {
using PeekType = T*;
using ConstPeekType = const T*;
static unsigned hash(const NonnullRefPtr<T>& p) { return ptr_hash(p.ptr()); }
static bool equals(const NonnullRefPtr<T>& a, const NonnullRefPtr<T>& b) { return a.ptr() == b.ptr(); }
static unsigned hash(NonnullRefPtr<T> const& p) { return ptr_hash(p.ptr()); }
static bool equals(NonnullRefPtr<T> const& a, NonnullRefPtr<T> const& b) { return a.ptr() == b.ptr(); }
};
using AK::adopt_ref;

View file

@ -151,12 +151,12 @@ public:
: m_bits(other.leak_ref_raw())
{
}
ALWAYS_INLINE RefPtr(const NonnullRefPtr<T>& other)
ALWAYS_INLINE RefPtr(NonnullRefPtr<T> const& other)
: m_bits(PtrTraits::as_bits(const_cast<T*>(other.add_ref())))
{
}
template<typename U>
ALWAYS_INLINE RefPtr(const NonnullRefPtr<U>& other) requires(IsConvertible<U*, T*>)
ALWAYS_INLINE RefPtr(NonnullRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
: m_bits(PtrTraits::as_bits(const_cast<U*>(other.add_ref())))
{
}
@ -171,12 +171,12 @@ public:
: m_bits(PtrTraits::template convert_from<U, P>(other.leak_ref_raw()))
{
}
RefPtr(const RefPtr& other)
RefPtr(RefPtr const& other)
: m_bits(other.add_ref_raw())
{
}
template<typename U, typename P = RefPtrTraits<U>>
RefPtr(const RefPtr<U, P>& other) requires(IsConvertible<U*, T*>)
RefPtr(RefPtr<U, P> const& other) requires(IsConvertible<U*, T*>)
: m_bits(other.add_ref_raw())
{
}
@ -189,9 +189,9 @@ public:
}
template<typename U>
RefPtr(const OwnPtr<U>&) = delete;
RefPtr(OwnPtr<U> const&) = delete;
template<typename U>
RefPtr& operator=(const OwnPtr<U>&) = delete;
RefPtr& operator=(OwnPtr<U> const&) = delete;
void swap(RefPtr& other)
{
@ -234,20 +234,20 @@ public:
return *this;
}
ALWAYS_INLINE RefPtr& operator=(const NonnullRefPtr<T>& other)
ALWAYS_INLINE RefPtr& operator=(NonnullRefPtr<T> const& other)
{
assign_raw(PtrTraits::as_bits(other.add_ref()));
return *this;
}
template<typename U>
ALWAYS_INLINE RefPtr& operator=(const NonnullRefPtr<U>& other) requires(IsConvertible<U*, T*>)
ALWAYS_INLINE RefPtr& operator=(NonnullRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
{
assign_raw(PtrTraits::as_bits(other.add_ref()));
return *this;
}
ALWAYS_INLINE RefPtr& operator=(const RefPtr& other)
ALWAYS_INLINE RefPtr& operator=(RefPtr const& other)
{
if (this != &other)
assign_raw(other.add_ref_raw());
@ -255,7 +255,7 @@ public:
}
template<typename U>
ALWAYS_INLINE RefPtr& operator=(const RefPtr<U>& other) requires(IsConvertible<U*, T*>)
ALWAYS_INLINE RefPtr& operator=(RefPtr<U> const& other) requires(IsConvertible<U*, T*>)
{
assign_raw(other.add_ref_raw());
return *this;
@ -347,8 +347,8 @@ public:
bool operator==(std::nullptr_t) const { return is_null(); }
bool operator!=(std::nullptr_t) const { return !is_null(); }
bool operator==(const RefPtr& other) const { return as_ptr() == other.as_ptr(); }
bool operator!=(const RefPtr& other) const { return as_ptr() != other.as_ptr(); }
bool operator==(RefPtr const& other) const { return as_ptr() == other.as_ptr(); }
bool operator!=(RefPtr const& other) const { return as_ptr() != other.as_ptr(); }
bool operator==(RefPtr& other) { return as_ptr() == other.as_ptr(); }
bool operator!=(RefPtr& other) { return as_ptr() != other.as_ptr(); }
@ -456,18 +456,18 @@ template<typename T>
struct Traits<RefPtr<T>> : public GenericTraits<RefPtr<T>> {
using PeekType = T*;
using ConstPeekType = const T*;
static unsigned hash(const RefPtr<T>& p) { return ptr_hash(p.ptr()); }
static bool equals(const RefPtr<T>& a, const RefPtr<T>& b) { return a.ptr() == b.ptr(); }
static unsigned hash(RefPtr<T> const& p) { return ptr_hash(p.ptr()); }
static bool equals(RefPtr<T> const& a, RefPtr<T> const& b) { return a.ptr() == b.ptr(); }
};
template<typename T, typename U>
inline NonnullRefPtr<T> static_ptr_cast(const NonnullRefPtr<U>& ptr)
inline NonnullRefPtr<T> static_ptr_cast(NonnullRefPtr<U> const& ptr)
{
return NonnullRefPtr<T>(static_cast<const T&>(*ptr));
}
template<typename T, typename U, typename PtrTraits = RefPtrTraits<T>>
inline RefPtr<T> static_ptr_cast(const RefPtr<U>& ptr)
inline RefPtr<T> static_ptr_cast(RefPtr<U> const& ptr)
{
return RefPtr<T, PtrTraits>(static_cast<const T*>(ptr.ptr()));
}

View file

@ -19,7 +19,7 @@ public:
WeakPtr() = default;
template<typename U>
WeakPtr(const WeakPtr<U>& other) requires(IsBaseOf<T, U>)
WeakPtr(WeakPtr<U> const& other) requires(IsBaseOf<T, U>)
: m_link(other.m_link)
{
}
@ -38,9 +38,9 @@ public:
}
template<typename U>
WeakPtr& operator=(const WeakPtr<U>& other) requires(IsBaseOf<T, U>)
WeakPtr& operator=(WeakPtr<U> const& other) requires(IsBaseOf<T, U>)
{
if ((const void*)this != (const void*)&other)
if ((void const*)this != (void const*)&other)
m_link = other.m_link;
return *this;
}
@ -65,7 +65,7 @@ public:
}
template<typename U>
WeakPtr(const RefPtr<U>& object) requires(IsBaseOf<T, U>)
WeakPtr(RefPtr<U> const& object) requires(IsBaseOf<T, U>)
{
object.do_while_locked([&](U* obj) {
if (obj)
@ -74,7 +74,7 @@ public:
}
template<typename U>
WeakPtr(const NonnullRefPtr<U>& object) requires(IsBaseOf<T, U>)
WeakPtr(NonnullRefPtr<U> const& object) requires(IsBaseOf<T, U>)
{
object.do_while_locked([&](U* obj) {
if (obj)
@ -100,7 +100,7 @@ public:
}
template<typename U>
WeakPtr& operator=(const RefPtr<U>& object) requires(IsBaseOf<T, U>)
WeakPtr& operator=(RefPtr<U> const& object) requires(IsBaseOf<T, U>)
{
object.do_while_locked([&](U* obj) {
if (obj)
@ -112,7 +112,7 @@ public:
}
template<typename U>
WeakPtr& operator=(const NonnullRefPtr<U>& object) requires(IsBaseOf<T, U>)
WeakPtr& operator=(NonnullRefPtr<U> const& object) requires(IsBaseOf<T, U>)
{
object.do_while_locked([&](U* obj) {
if (obj)
@ -156,7 +156,7 @@ public:
[[nodiscard]] RefPtr<WeakLink> take_link() { return move(m_link); }
private:
WeakPtr(const RefPtr<WeakLink>& link)
WeakPtr(RefPtr<WeakLink> const& link)
: m_link(link)
{
}