From 9b1d8b5fcf02234b62a61fab0a087789e3a573ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Tue, 15 Mar 2022 08:57:16 +0100 Subject: [PATCH] Try to fix GCC error --- include/Nazara/Core/Algorithm.hpp | 2 +- include/Nazara/Core/Algorithm.inl | 2 +- src/Nazara/Shader/LangWriter.cpp | 2 +- src/Nazara/Shader/SpirvAstVisitor.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/Nazara/Core/Algorithm.hpp b/include/Nazara/Core/Algorithm.hpp index 710952bd4..827850c86 100644 --- a/include/Nazara/Core/Algorithm.hpp +++ b/include/Nazara/Core/Algorithm.hpp @@ -40,7 +40,7 @@ namespace Nz template void HashCombine(std::size_t& seed, const T& v); template bool IsPowerOfTwo(T value); template V& Retrieve(std::unordered_map& map, const K& key); - template const V& Retrieve(const std::unordered_map& map, const K& key); + template const V& RetrieveConst(const std::unordered_map& map, const K& key); template T ReverseBits(T integer); template To SafeCast(From&& value); templatestd::unique_ptr StaticUniquePointerCast(std::unique_ptr&& ptr); diff --git a/include/Nazara/Core/Algorithm.inl b/include/Nazara/Core/Algorithm.inl index d3081931e..cd1a971fc 100644 --- a/include/Nazara/Core/Algorithm.inl +++ b/include/Nazara/Core/Algorithm.inl @@ -388,7 +388,7 @@ namespace Nz * \param key Key, has to exist in map */ template - const V& Retrieve(const std::unordered_map& map, const K& key) + const V& RetrieveConst(const std::unordered_map& map, const K& key) { auto it = map.find(key); assert(it != map.end()); diff --git a/src/Nazara/Shader/LangWriter.cpp b/src/Nazara/Shader/LangWriter.cpp index 2360c8c99..f38072fc7 100644 --- a/src/Nazara/Shader/LangWriter.cpp +++ b/src/Nazara/Shader/LangWriter.cpp @@ -605,7 +605,7 @@ namespace Nz template void LangWriter::AppendIdentifier(const T& map, std::size_t id) { - const auto& structIdentifier = Retrieve(map, id); + const auto& structIdentifier = RetrieveConst(map, id); if (structIdentifier.moduleIndex != m_currentState->currentModuleIndex) Append(m_currentState->moduleNames[structIdentifier.moduleIndex], '.'); diff --git a/src/Nazara/Shader/SpirvAstVisitor.cpp b/src/Nazara/Shader/SpirvAstVisitor.cpp index 74ac68961..036b74759 100644 --- a/src/Nazara/Shader/SpirvAstVisitor.cpp +++ b/src/Nazara/Shader/SpirvAstVisitor.cpp @@ -31,7 +31,7 @@ namespace Nz auto SpirvAstVisitor::GetVariable(std::size_t varIndex) const -> const Variable& { - return Retrieve(m_variables, varIndex); + return RetrieveConst(m_variables, varIndex); } void SpirvAstVisitor::Visit(ShaderAst::AccessIndexExpression& node)