mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 11:20:56 +00:00
DIRECTOR: Really fix warning
The purpose of Common::remove_const is not to remove the const specifier from a variable, but to remove it from a type and define a non-const type in the process. The previous commit to fix the warning thus did not fix anything as the code was still doing a C cast to remove the const specifier. The proper way to fix that warning is to use a const_cast.
This commit is contained in:
parent
c22f5ded21
commit
d48326e54c
@ -105,7 +105,7 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) {
|
||||
for (int x = 0; x < _surface->w; x++) {
|
||||
// We're not su[pposed to modify the image that is coming from the decoder
|
||||
// However, in this case, we know what we're doing.
|
||||
*Common::remove_const<byte *>::type(_surface->getBasePtr(x, y)) = 255 - *(const byte *)_surface->getBasePtr(x, y);
|
||||
*const_cast<byte *>((const byte *)_surface->getBasePtr(x, y)) = 255 - *(const byte *)_surface->getBasePtr(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user