Skip to content

[Core] fix frame int_cast for 24 bit types#1985

Merged
MFransen69 merged 7 commits intomasterfrom
development/fixFrameIntCast
Nov 3, 2025
Merged

[Core] fix frame int_cast for 24 bit types#1985
MFransen69 merged 7 commits intomasterfrom
development/fixFrameIntCast

Conversation

@MFransen69
Copy link
Copy Markdown
Contributor

@MFransen69 MFransen69 commented Oct 31, 2025

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

sebaszm
sebaszm previously approved these changes Nov 2, 2025
sebaszm
sebaszm previously approved these changes Nov 3, 2025
@MFransen69 MFransen69 merged commit fa958b1 into master Nov 3, 2025
40 of 46 checks passed
@MFransen69 MFransen69 deleted the development/fixFrameIntCast branch November 3, 2025 20:21
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants