From d5fc56db4bdebcf4f45e39e9c9d0f40229de8cea Mon Sep 17 00:00:00 2001 From: Levi Behunin Date: Sun, 29 Jan 2023 13:54:13 -0700 Subject: Move to Clang Format 15 Depends on https://github.com/yuzu-emu/build-environments/pull/69 clang-15 primary run --- src/common/tree.h | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'src/common/tree.h') diff --git a/src/common/tree.h b/src/common/tree.h index f77859209..f4fc43de3 100644 --- a/src/common/tree.h +++ b/src/common/tree.h @@ -103,12 +103,12 @@ concept IsRBEntry = CheckRBEntry::value; template concept HasRBEntry = requires(T& t, const T& ct) { - { t.GetRBEntry() } -> std::same_as&>; - { ct.GetRBEntry() } -> std::same_as&>; -}; + { t.GetRBEntry() } -> std::same_as&>; + { ct.GetRBEntry() } -> std::same_as&>; + }; template -requires HasRBEntry + requires HasRBEntry class RBHead { private: T* m_rbh_root = nullptr; @@ -130,90 +130,90 @@ public: }; template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr RBEntry& RB_ENTRY(T* t) { return t->GetRBEntry(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const RBEntry& RB_ENTRY(const T* t) { return t->GetRBEntry(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr T* RB_LEFT(T* t) { return RB_ENTRY(t).Left(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const T* RB_LEFT(const T* t) { return RB_ENTRY(t).Left(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr T* RB_RIGHT(T* t) { return RB_ENTRY(t).Right(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const T* RB_RIGHT(const T* t) { return RB_ENTRY(t).Right(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr T* RB_PARENT(T* t) { return RB_ENTRY(t).Parent(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr const T* RB_PARENT(const T* t) { return RB_ENTRY(t).Parent(); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_LEFT(T* t, T* e) { RB_ENTRY(t).SetLeft(e); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_RIGHT(T* t, T* e) { RB_ENTRY(t).SetRight(e); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_PARENT(T* t, T* e) { RB_ENTRY(t).SetParent(e); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr bool RB_IS_BLACK(const T* t) { return RB_ENTRY(t).IsBlack(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr bool RB_IS_RED(const T* t) { return RB_ENTRY(t).IsRed(); } template -requires HasRBEntry + requires HasRBEntry [[nodiscard]] constexpr RBColor RB_COLOR(const T* t) { return RB_ENTRY(t).Color(); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_COLOR(T* t, RBColor c) { RB_ENTRY(t).SetColor(c); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET(T* elm, T* parent) { auto& rb_entry = RB_ENTRY(elm); rb_entry.SetParent(parent); @@ -223,14 +223,14 @@ constexpr void RB_SET(T* elm, T* parent) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_SET_BLACKRED(T* black, T* red) { RB_SET_COLOR(black, RBColor::RB_BLACK); RB_SET_COLOR(red, RBColor::RB_RED); } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_ROTATE_LEFT(RBHead& head, T* elm, T*& tmp) { tmp = RB_RIGHT(elm); if (RB_SET_RIGHT(elm, RB_LEFT(tmp)); RB_RIGHT(elm) != nullptr) { @@ -252,7 +252,7 @@ constexpr void RB_ROTATE_LEFT(RBHead& head, T* elm, T*& tmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_ROTATE_RIGHT(RBHead& head, T* elm, T*& tmp) { tmp = RB_LEFT(elm); if (RB_SET_LEFT(elm, RB_RIGHT(tmp)); RB_LEFT(elm) != nullptr) { @@ -274,7 +274,7 @@ constexpr void RB_ROTATE_RIGHT(RBHead& head, T* elm, T*& tmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_REMOVE_COLOR(RBHead& head, T* parent, T* elm) { T* tmp; while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head.Root()) { @@ -358,7 +358,7 @@ constexpr void RB_REMOVE_COLOR(RBHead& head, T* parent, T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_REMOVE(RBHead& head, T* elm) { T* child = nullptr; T* parent = nullptr; @@ -451,7 +451,7 @@ constexpr T* RB_REMOVE(RBHead& head, T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr void RB_INSERT_COLOR(RBHead& head, T* elm) { T *parent = nullptr, *tmp = nullptr; while ((parent = RB_PARENT(elm)) != nullptr && RB_IS_RED(parent)) { @@ -499,7 +499,7 @@ constexpr void RB_INSERT_COLOR(RBHead& head, T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_INSERT(RBHead& head, T* elm, Compare cmp) { T* parent = nullptr; T* tmp = head.Root(); @@ -534,7 +534,7 @@ constexpr T* RB_INSERT(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND(RBHead& head, T* elm, Compare cmp) { T* tmp = head.Root(); @@ -553,7 +553,7 @@ constexpr T* RB_FIND(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_NFIND(RBHead& head, T* elm, Compare cmp) { T* tmp = head.Root(); T* res = nullptr; @@ -574,7 +574,7 @@ constexpr T* RB_NFIND(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND_KEY(RBHead& head, const U& key, Compare cmp) { T* tmp = head.Root(); @@ -593,7 +593,7 @@ constexpr T* RB_FIND_KEY(RBHead& head, const U& key, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_NFIND_KEY(RBHead& head, const U& key, Compare cmp) { T* tmp = head.Root(); T* res = nullptr; @@ -614,7 +614,7 @@ constexpr T* RB_NFIND_KEY(RBHead& head, const U& key, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND_EXISTING(RBHead& head, T* elm, Compare cmp) { T* tmp = head.Root(); @@ -631,7 +631,7 @@ constexpr T* RB_FIND_EXISTING(RBHead& head, T* elm, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_FIND_EXISTING_KEY(RBHead& head, const U& key, Compare cmp) { T* tmp = head.Root(); @@ -648,7 +648,7 @@ constexpr T* RB_FIND_EXISTING_KEY(RBHead& head, const U& key, Compare cmp) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_NEXT(T* elm) { if (RB_RIGHT(elm)) { elm = RB_RIGHT(elm); @@ -669,7 +669,7 @@ constexpr T* RB_NEXT(T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_PREV(T* elm) { if (RB_LEFT(elm)) { elm = RB_LEFT(elm); @@ -690,7 +690,7 @@ constexpr T* RB_PREV(T* elm) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_MIN(RBHead& head) { T* tmp = head.Root(); T* parent = nullptr; @@ -704,7 +704,7 @@ constexpr T* RB_MIN(RBHead& head) { } template -requires HasRBEntry + requires HasRBEntry constexpr T* RB_MAX(RBHead& head) { T* tmp = head.Root(); T* parent = nullptr; -- cgit v1.2.3