summaryrefslogtreecommitdiff
path: root/Kernel/Library/NonnullLockRefPtr.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-10-17 00:06:11 +0200
committerLinus Groh <mail@linusgroh.de>2022-12-03 23:52:23 +0000
commitd26aabff0401690d6dd1332558b40f5cb64e4428 (patch)
treefd56d0ab5b672814a1a2fb7b8a92fefb01f24e6f /Kernel/Library/NonnullLockRefPtr.h
parent8639d8bc212dcb45aff80405b4b0f6b1ef1087e7 (diff)
downloadserenity-d26aabff0401690d6dd1332558b40f5cb64e4428.zip
Everywhere: Run clang-format
Diffstat (limited to 'Kernel/Library/NonnullLockRefPtr.h')
-rw-r--r--Kernel/Library/NonnullLockRefPtr.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/Kernel/Library/NonnullLockRefPtr.h b/Kernel/Library/NonnullLockRefPtr.h
index 44289a3b55..685b6dfe8d 100644
--- a/Kernel/Library/NonnullLockRefPtr.h
+++ b/Kernel/Library/NonnullLockRefPtr.h
@@ -47,7 +47,8 @@ public:
const_cast<T&>(object).ref();
}
template<typename U>
- ALWAYS_INLINE NonnullLockRefPtr(U const& object) requires(IsConvertible<U*, T*>)
+ ALWAYS_INLINE NonnullLockRefPtr(U const& object)
+ requires(IsConvertible<U*, T*>)
: m_bits((FlatPtr) static_cast<T const*>(&object))
{
VERIFY(!(m_bits & 1));
@@ -64,7 +65,8 @@ public:
VERIFY(!(m_bits & 1));
}
template<typename U>
- ALWAYS_INLINE NonnullLockRefPtr(NonnullLockRefPtr<U>&& other) requires(IsConvertible<U*, T*>)
+ ALWAYS_INLINE NonnullLockRefPtr(NonnullLockRefPtr<U>&& other)
+ requires(IsConvertible<U*, T*>)
: m_bits((FlatPtr)&other.leak_ref())
{
VERIFY(!(m_bits & 1));
@@ -75,7 +77,8 @@ public:
VERIFY(!(m_bits & 1));
}
template<typename U>
- ALWAYS_INLINE NonnullLockRefPtr(NonnullLockRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
+ ALWAYS_INLINE NonnullLockRefPtr(NonnullLockRefPtr<U> const& other)
+ requires(IsConvertible<U*, T*>)
: m_bits((FlatPtr)other.add_ref())
{
VERIFY(!(m_bits & 1));
@@ -108,7 +111,8 @@ public:
}
template<typename U>
- NonnullLockRefPtr& operator=(NonnullLockRefPtr<U> const& other) requires(IsConvertible<U*, T*>)
+ NonnullLockRefPtr& operator=(NonnullLockRefPtr<U> const& other)
+ requires(IsConvertible<U*, T*>)
{
assign(other.add_ref());
return *this;
@@ -122,7 +126,8 @@ public:
}
template<typename U>
- NonnullLockRefPtr& operator=(NonnullLockRefPtr<U>&& other) requires(IsConvertible<U*, T*>)
+ NonnullLockRefPtr& operator=(NonnullLockRefPtr<U>&& other)
+ requires(IsConvertible<U*, T*>)
{
assign(&other.leak_ref());
return *this;
@@ -202,7 +207,8 @@ public:
}
template<typename U>
- void swap(NonnullLockRefPtr<U>& other) requires(IsConvertible<U*, T*>)
+ void swap(NonnullLockRefPtr<U>& other)
+ requires(IsConvertible<U*, T*>)
{
// NOTE: swap is not atomic!
U* other_ptr = other.exchange(nullptr);
@@ -318,7 +324,8 @@ struct Formatter<NonnullLockRefPtr<T>> : Formatter<T const*> {
};
template<typename T, typename U>
-inline void swap(NonnullLockRefPtr<T>& a, NonnullLockRefPtr<U>& b) requires(IsConvertible<U*, T*>)
+inline void swap(NonnullLockRefPtr<T>& a, NonnullLockRefPtr<U>& b)
+requires(IsConvertible<U*, T*>)
{
a.swap(b);
}