Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress compiler possible loss of data warning with explicit cast #606

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

pabdulin
Copy link
Contributor

Hi! Building Nuklear with MSVC (Microsoft (R) C/C++ Optimizing Compiler Version 19.38.33134 for x64) results in following W3+ level warnings:

Nuklear\nuklear.h(7665): error C2220: the following warning is treated as an error
Nuklear\nuklear.h(7665): warning C4244: '=': conversion from 'const float' to 'nk_byte', possible loss of data
Nuklear\nuklear.h(7666): warning C4244: '=': conversion from 'const float' to 'nk_byte', possible loss of data
Nuklear\nuklear.h(7667): warning C4244: '=': conversion from 'const float' to 'nk_byte', possible loss of data

This fix resolves the issue by explicit safe cast which assumed to be safe. Thanks!

Copy link
Contributor

@RobLoach RobLoach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you also make the change in nuklear_color.c ?

@pabdulin
Copy link
Contributor Author

@RobLoach I've made the changes to nuklear_color.c, thanks!

@RobLoach RobLoach self-requested a review January 23, 2024 02:57
@RobLoach RobLoach merged commit 9d9781d into Immediate-Mode-UI:master Jan 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants