From f14a49dfea5e3c4b940b2043650490efb56d7f15 Mon Sep 17 00:00:00 2001 From: thirumalai-qcom Date: Wed, 17 Jul 2024 00:28:10 +0530 Subject: [PATCH] Fix max function usage for std::numeric_limits on ARM Win11 Update the code to use the correct max function for std::numeric_limits in Windows on ARM architecture. Previously, the max function was not correctly utilized, leading to potential issues. --- src/requesthandler/RequestHandler_SceneItems.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/requesthandler/RequestHandler_SceneItems.cpp b/src/requesthandler/RequestHandler_SceneItems.cpp index 146fb654..ab3cadf5 100644 --- a/src/requesthandler/RequestHandler_SceneItems.cpp +++ b/src/requesthandler/RequestHandler_SceneItems.cpp @@ -440,8 +440,13 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request) } if (r.Contains("alignment")) { +#if defined(_M_ARM64) + if (!r.ValidateOptionalNumber("alignment", statusCode, comment, 0, (std::numeric_limits::max)())) + return RequestResult::Error(statusCode, comment); +#else if (!r.ValidateOptionalNumber("alignment", statusCode, comment, 0, std::numeric_limits::max())) return RequestResult::Error(statusCode, comment); +#endif sceneItemTransform.alignment = r.RequestData["alignment"]; transformChanged = true; } @@ -458,8 +463,13 @@ RequestResult RequestHandler::SetSceneItemTransform(const Request &request) } if (r.Contains("boundsAlignment")) { +#if defined(_M_ARM64) + if (!r.ValidateOptionalNumber("boundsAlignment", statusCode, comment, 0, (std::numeric_limits::max)())) + return RequestResult::Error(statusCode, comment); +#else if (!r.ValidateOptionalNumber("boundsAlignment", statusCode, comment, 0, std::numeric_limits::max())) return RequestResult::Error(statusCode, comment); +#endif sceneItemTransform.bounds_alignment = r.RequestData["boundsAlignment"]; transformChanged = true; }