From b8b76adc732ad145ba8503e786c3b602b833b663 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sun, 10 Dec 2023 21:33:02 +0100 Subject: [PATCH] fix(menus): make functions case insensitive --- .../Parsing/Menu/Matcher/MenuExpressionMatchers.cpp | 1 + src/Utils/Utils/StringUtils.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp b/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp index 684257b1a..9ec73c373 100644 --- a/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp +++ b/src/ObjLoading/Parsing/Menu/Matcher/MenuExpressionMatchers.cpp @@ -92,6 +92,7 @@ std::unique_ptr MenuExpressionMatchers::ProcessOperandExtensi const auto& functionCallToken = result.NextCapture(CAPTURE_FUNCTION_NAME); auto functionCallName = functionCallToken.IdentifierValue(); + utils::MakeStringLowerCase(functionCallName); const auto& baseFunctionMap = GetBaseFunctionMapForFeatureLevel(m_state->m_feature_level); const auto foundBaseFunction = baseFunctionMap.find(functionCallName); diff --git a/src/Utils/Utils/StringUtils.cpp b/src/Utils/Utils/StringUtils.cpp index cffa5ed61..bf8904da9 100644 --- a/src/Utils/Utils/StringUtils.cpp +++ b/src/Utils/Utils/StringUtils.cpp @@ -92,12 +92,12 @@ namespace utils void MakeStringLowerCase(std::string& str) { for (auto& c : str) - c = static_cast(tolower(c)); + c = static_cast(tolower(static_cast(c))); } void MakeStringUpperCase(std::string& str) { for (auto& c : str) - c = static_cast(toupper(c)); + c = static_cast(toupper(static_cast(c))); } } // namespace utils