-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Use portable types to avoid cast warnings #948
Conversation
6ecbc86
to
1ad8f64
Compare
Ooops, looks like I missed one (or it came in in the meantime):
|
I have added it. |
@farindk Unfortunately we missed another one (I usually built w/o the JPEG codec):
This one actually comes from libjpeg-turbo, so an explicit cast is needed? Haven't checked the API of the IJG libjpeg for this call... |
Yes, seems that we have to cast it. |
@bradh There are also multiple conversion warnings in the uncompressed codec (I haven't been building so far):
|
We can safely add casts for those. That said, it does seem like a pretty basic false positive if the compiler can't tell that 0x80 or 0 will be unchanged when assigned to a uint8_t. |
True - that was w/ gcc 9.4 used by mingw CI action on older Ubuntu, and 13.2 here doesn't seem to complain, so it might not be necessary... |
NB: Requires API version bump (at least when it comes to Windows)
Can of course be solved the other way (explicit casting to
unsigned long
where needed), if deemed safe.This is because LLP64 on Windows vs LP64 everywhere else...