[Core] fix frame int_cast for 24 bit types#1985
Merged
MFransen69 merged 7 commits intomasterfrom Nov 3, 2025
Merged
Conversation
sebaszm
previously approved these changes
Nov 2, 2025
sebaszm
previously approved these changes
Nov 3, 2025
sebaszm
approved these changes
Nov 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some remarks.
Okay, see the removed assert below, in the end the whole cast did not add too much value but okay it is there now, working correctly for re-use :)
I fixed it locally in Frame as the existing Max infrastructure was already there so that seemed the easiest solution (alternative could have been to add a std::numeric_limits<>::min and max specialization for SInt24/UInt24 but seen the already existing Max infrastructure that did not make much sense, but this as a hint might we have a future similar challenge with int_cast)
I left the int_cast in Number.h, you might never know if someone would need it in the future but I think it is unused now (considered adding a static_assert to check if NEW_TYPE is a scalar_type to prevent a similar issue from going unnoticed but as numeric_limits can be used with more types, e.g. with custom specializations, I did not do that)
One remark I see that int_cast is now in the global namespace, guess because you can then use it like the other language casts (like static_cast) but I would just place it inside Thunder::Core. The name is quite generic so possible collision can easily happen and what is the problem with typing Core::int_cast, then it is at least also clear we created it :) but okay my 2 cents.
(oh and I was a little lazy, the type for the Frame::Min must next to the Min member also have a Max member now, which I think is logical, and the check even makes it better and now, min cannot be higher than max :) , but of course you could solve this without that requirement but that was more work and not needed)
Oh I also sneaked in the Request::INCOMPLETE: , almost forgot about it. I'll create the Jira issue once this PR is merged so I can link to the code in the issue