From 53aec1fe2d298ac98e3d2c846deb2227c12b4eb4 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 4 Feb 2021 14:54:06 -0500 Subject: k_priority_queue: Resolved reserved identifier An identifier containing a starting underscore followed by a capital letter is reserved by the standard. It's trivial to avoid this by moving the underscore to the end of the identifier. While the likelihood of clashing here being minimal, we can turn a "should not break" scenario into a definitive "will not break" one, so why not?. --- src/core/hle/kernel/k_priority_queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h index 13d628b85..afaab9812 100644 --- a/src/core/hle/kernel/k_priority_queue.h +++ b/src/core/hle/kernel/k_priority_queue.h @@ -55,7 +55,7 @@ concept KPriorityQueueMember = !std::is_reference_v && requires(T & t) { ->Common::ConvertibleTo; }; -template +template requires KPriorityQueueMember class KPriorityQueue { public: using AffinityMaskType = typename std::remove_cv_t< @@ -65,7 +65,7 @@ public: static_assert(HighestPriority >= 0); static_assert(LowestPriority >= HighestPriority); static constexpr size_t NumPriority = LowestPriority - HighestPriority + 1; - static constexpr size_t NumCores = _NumCores; + static constexpr size_t NumCores = NumCores_; static constexpr bool IsValidCore(s32 core) { return 0 <= core && core < static_cast(NumCores); -- cgit v1.2.3 From 31e6e5810115726158f86ca1dc75ef01eb08aeea Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 4 Feb 2021 14:57:36 -0500 Subject: k_priority_queue: Simplify affinity mask type alias We can make use of the _t variants of the templates to cut down on a little bit of verbosity. --- src/core/hle/kernel/k_priority_queue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h index afaab9812..103dafd48 100644 --- a/src/core/hle/kernel/k_priority_queue.h +++ b/src/core/hle/kernel/k_priority_queue.h @@ -58,8 +58,8 @@ concept KPriorityQueueMember = !std::is_reference_v && requires(T & t) { template requires KPriorityQueueMember class KPriorityQueue { public: - using AffinityMaskType = typename std::remove_cv_t< - typename std::remove_reference().GetAffinityMask())>::type>; + using AffinityMaskType = std::remove_cv_t< + std::remove_reference_t().GetAffinityMask())>>; static_assert(LowestPriority >= 0); static_assert(HighestPriority >= 0); -- cgit v1.2.3 From b944edc85d3d017d5cf5da7fdfdf8fafbf5604a3 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 4 Feb 2021 15:11:19 -0500 Subject: k_priority_queue: Unfold several declval usages Given these are only used as function existence checks, we can simplify some usages of declval, given they aren't particularly useful here. Reduces a few template instantiations, which at most reduces compile times a tiny bit. --- src/core/hle/kernel/k_priority_queue.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/hle/kernel/k_priority_queue.h b/src/core/hle/kernel/k_priority_queue.h index 103dafd48..4aa669d95 100644 --- a/src/core/hle/kernel/k_priority_queue.h +++ b/src/core/hle/kernel/k_priority_queue.h @@ -24,11 +24,11 @@ template concept KPriorityQueueAffinityMask = !std::is_reference_v && requires(T & t) { { t.GetAffinityMask() } ->Common::ConvertibleTo; - {t.SetAffinityMask(std::declval())}; + {t.SetAffinityMask(0)}; - { t.GetAffinity(std::declval()) } + { t.GetAffinity(0) } ->std::same_as; - {t.SetAffinity(std::declval(), std::declval())}; + {t.SetAffinity(0, false)}; {t.SetAll()}; }; @@ -42,11 +42,11 @@ concept KPriorityQueueMember = !std::is_reference_v && requires(T & t) { ->std::same_as; { (typename T::QueueEntry()).GetPrev() } ->std::same_as; - { t.GetPriorityQueueEntry(std::declval()) } + { t.GetPriorityQueueEntry(0) } ->std::same_as; {t.GetAffinityMask()}; - { typename std::remove_cvref::type() } + { std::remove_cvref_t() } ->KPriorityQueueAffinityMask; { t.GetActiveCore() } -- cgit v1.2.3