File 0002-Fix-local-variable-hash-shadowing-the-struct.patch of Package eden

From 3ca21011182d6cc1ada59ff1cb40a6f1ea3e00d0 Mon Sep 17 00:00:00 2001
From: Mook <mook@nowhere.invalid>
Date: Sat, 20 Sep 2025 10:44:02 -0700
Subject: [PATCH 2/2] Fix local variable `hash` shadowing the struct
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In file included from src/core/loader/nso.cpp:27:
src/core/arm/nce/patcher.h: In member function ‘std::size_t std::hash<PatchCacheKey>::operator()(const PatchCacheKey&) const’:
src/core/arm/nce/patcher.h:30:16: error: declaration of ‘hash’ shadows a member of ‘std::hash<PatchCacheKey>’ [-Werror=shadow]
   30 |         size_t hash = 0;
      |                ^~~~
src/core/arm/nce/patcher.h:27:33: note: shadowed declaration is here
   27 | struct std::hash<PatchCacheKey> {
      |                                 ^
cc1plus: some warnings being treated as errors
---
 src/core/arm/nce/patcher.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/core/arm/nce/patcher.h b/src/core/arm/nce/patcher.h
index 7f54608e3f..bd81d18e3d 100644
--- a/src/core/arm/nce/patcher.h
+++ b/src/core/arm/nce/patcher.h
@@ -27,11 +27,11 @@ template <>
 struct std::hash<PatchCacheKey> {
     size_t operator()(const PatchCacheKey& key) const {
         // Simple XOR hash of first few bytes
-        size_t hash = 0;
+        size_t result = 0;
         for (size_t i = 0; i < key.module_id.size(); ++i) {
-            hash ^= static_cast<size_t>(key.module_id[i]) << ((i % sizeof(size_t)) * 8);
+            result ^= static_cast<size_t>(key.module_id[i]) << ((i % sizeof(size_t)) * 8);
         }
-        return hash ^ std::hash<uintptr_t>{}(key.offset);
+        return result ^ std::hash<uintptr_t>{}(key.offset);
     }
 };
 
-- 
2.51.0

openSUSE Build Service is sponsored by