1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

AK: Run clang-format on Atomic.h

Also use <AK/Types.h> instead of <stddef.h>
This commit is contained in:
Andreas Kling 2020-01-12 18:44:51 +01:00
parent f3eb06a46f
commit 61e6b1fb7c

View file

@ -1,13 +1,10 @@
#pragma once #pragma once
#ifndef KERNEL #include <AK/Types.h>
#include <stddef.h>
#endif
namespace AK { namespace AK {
enum MemoryOrder enum MemoryOrder {
{
memory_order_relaxed = __ATOMIC_RELAXED, memory_order_relaxed = __ATOMIC_RELAXED,
memory_order_consume = __ATOMIC_CONSUME, memory_order_consume = __ATOMIC_CONSUME,
memory_order_acquire = __ATOMIC_ACQUIRE, memory_order_acquire = __ATOMIC_ACQUIRE,
@ -16,9 +13,8 @@ enum MemoryOrder
memory_order_seq_cst = __ATOMIC_SEQ_CST memory_order_seq_cst = __ATOMIC_SEQ_CST
}; };
template <typename T> template<typename T>
class Atomic class Atomic {
{
T m_value { 0 }; T m_value { 0 };
public: public:
@ -26,8 +22,8 @@ public:
Atomic(const Atomic&) = delete; Atomic(const Atomic&) = delete;
Atomic& operator=(const Atomic&) volatile = delete; Atomic& operator=(const Atomic&) volatile = delete;
Atomic(T val) noexcept: Atomic(T val) noexcept
m_value(val) : m_value(val)
{ {
} }
@ -141,10 +137,8 @@ public:
} }
}; };
template<typename T>
template <typename T> class Atomic<T*> {
class Atomic<T*>
{
T* m_value { nullptr }; T* m_value { nullptr };
public: public:
@ -152,8 +146,8 @@ public:
Atomic(const Atomic&) = delete; Atomic(const Atomic&) = delete;
Atomic& operator=(const Atomic&) volatile = delete; Atomic& operator=(const Atomic&) volatile = delete;
Atomic(T* val) noexcept: Atomic(T* val) noexcept
m_value(val) : m_value(val)
{ {
} }