mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 05:39:11 +00:00
Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t)
This function did a const_cast internally which made the call side look "safe". This method is removed completely and call sites are replaced with ByteBuffer::wrap(const_cast<void*>(data), size) which makes the behaviour obvious.
This commit is contained in:
parent
ac9f6fd1f8
commit
b3d1a05261
Notes:
sideshowbarker
2024-07-19 04:14:15 +09:00
Author: https://github.com/asynts
Commit: b3d1a05261
Pull-request: https://github.com/SerenityOS/serenity/pull/3007
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/nico
15 changed files with 42 additions and 36 deletions
|
@ -1104,7 +1104,7 @@ static bool decode_bmp_pixel_data(BMPLoadingContext& context)
|
|||
return false;
|
||||
}
|
||||
|
||||
auto buffer = ByteBuffer::wrap(context.data + context.data_offset, context.data_size);
|
||||
auto buffer = ByteBuffer::wrap(const_cast<u8*>(context.data + context.data_offset), context.data_size);
|
||||
|
||||
if (context.dib.info.compression == Compression::RLE4 || context.dib.info.compression == Compression::RLE8
|
||||
|| context.dib.info.compression == Compression::RLE24) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue