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:
Thierry Crozat 2023-02-18 21:51:17 +00:00 committed by Eugene Sandulenko
parent c22f5ded21
commit d48326e54c

View File

@ -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);
}
}
}