|
From: | Gregory Casamento |
Subject: | Re: scary warning about casts |
Date: | Thu, 2 Dec 2021 19:19:01 -0500 |
Hello
I noticed I get these warnings, which look a bit scary.
Compiling file XGServerWindow.m ...
XGServerWindow.m:3960:40: warning: implicit conversion from 'unsigned
int' to 'float' changes value from 4294967295 to
4294967296 [-Wimplicit-int-float-conversion]
opacity = (unsigned int)(alpha * 0xffffffffU);
~ ^~~~~~~~~~~
XGServerWindow.m:3996:31: warning: implicit conversion from 'unsigned
int' to 'float' changes value from 4294967295 to
4294967296 [-Wimplicit-int-float-conversion]
alpha = (float)*num / 0xffffffffU;
I think the warning is legit: alpha is float and is multiplied with an
explicit unsigned constant 0xffffffffU.
What is the code trying to achieve here?
Riccardo
[Prev in Thread] | Current Thread | [Next in Thread] |