Skip to content

Commit

Permalink
Fix max function usage for std::numeric_limits on ARM Win11
Browse files Browse the repository at this point in the history
Update the code to use the correct max function for
std::numeric_limits<uint32_t> in Windows on ARM architecture.
Previously, the max function was not correctly utilized, leading
to potential issues.
  • Loading branch information
thirumalai-qcom committed Jul 17, 2024
1 parent 7e3f2a8 commit d62246b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/requesthandler/RequestHandler_SceneItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint32_t>::max)()))
return RequestResult::Error(statusCode, comment);
#else
if (!r.ValidateOptionalNumber("alignment", statusCode, comment, 0, std::numeric_limits<uint32_t>::max()))
return RequestResult::Error(statusCode, comment);
#endif
sceneItemTransform.alignment = r.RequestData["alignment"];
transformChanged = true;
}
Expand All @@ -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<uint32_t>::max)()))
return RequestResult::Error(statusCode, comment);
#else
if (!r.ValidateOptionalNumber("boundsAlignment", statusCode, comment, 0, std::numeric_limits<uint32_t>::max()))
return RequestResult::Error(statusCode, comment);
#endif
sceneItemTransform.bounds_alignment = r.RequestData["boundsAlignment"];
transformChanged = true;
}
Expand Down

0 comments on commit d62246b

Please sign in to comment.