yuzu icon indicating copy to clipboard operation
yuzu copied to clipboard

core/k_priority_queue: Fix formatting

Open FearlessTobi opened this issue 2 years ago • 3 comments

Clang-format keeps complaining about this when running it locally.

FearlessTobi avatar Jul 30 '22 04:07 FearlessTobi

Welp, I will investigate what is happening here.

FearlessTobi avatar Jul 30 '22 04:07 FearlessTobi

The clang format on my local machine, downloaded from ext-windows-bin is version 12.0.1, while our buildbots use version 12.0.0. This could be the cause of this issue.

FearlessTobi avatar Jul 30 '22 17:07 FearlessTobi

I took a look at it as well, looks like either 12.0.0 or 13.0.0 would be fine


MSVC 2019 ships with 12.0.0 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\Llvm\x64\bin

MSVC 2022 ships with 13.0.0 C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\Llvm\x64\bin

I ran that version of clang-format on the repo and it's okay with the contents. Also since LLVM 13.0.0's clang-format.exe is different, ran that too, also no complaints on master

LLVM 14.0.0's clang-format wants to do a change that the older versions want to put back:

diff --git a/src/common/intrusive_red_black_tree.h b/src/common/intrusive_red_black_tree.h
index 93046615e..42fd1821a 100644
--- a/src/common/intrusive_red_black_tree.h
+++ b/src/common/intrusive_red_black_tree.h
@@ -247,14 +247,14 @@ concept HasRedBlackKeyType = requires {

 namespace impl {

-    template <typename T, typename Default>
-    consteval auto* GetRedBlackKeyType() {
-        if constexpr (HasRedBlackKeyType<T>) {
-            return static_cast<typename T::RedBlackKeyType*>(nullptr);
-        } else {
-            return static_cast<Default*>(nullptr);
-        }
+template <typename T, typename Default>
+consteval auto* GetRedBlackKeyType() {
+    if constexpr (HasRedBlackKeyType<T>) {
+        return static_cast<typename T::RedBlackKeyType*>(nullptr);
+    } else {
+        return static_cast<Default*>(nullptr);
     }
+}

 } // namespace impl

I spend too much time looking for win64 in the clang+llvm-12.0.0- options at the top of their releases so, a note: To get a copy of clang-format for llvm12, https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.0 and go for the LLVM-12.0.0-win64.exe option, this 182 MB chunk can be opened in 7zip to extract just clang-format.exe

Docteh avatar Aug 04 '22 11:08 Docteh