mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibGfx/PortableFormat: Use static_cast
instead of C-style casts
This commit is contained in:
parent
fd04b2dc9b
commit
fcaa535dec
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ ErrorOr<void> read_image_data(PGMLoadingContext& context)
|
|||
|
||||
TRY(read_whitespace(context));
|
||||
|
||||
color_data[i] = { (u8)value, (u8)value, (u8)value };
|
||||
color_data[i] = { static_cast<u8>(value), static_cast<u8>(value), static_cast<u8>(value) };
|
||||
}
|
||||
} else if (context.type == PGMLoadingContext::Type::RAWBITS) {
|
||||
for (u64 i = 0; i < context_size; ++i) {
|
||||
|
|
|
@ -29,7 +29,7 @@ ErrorOr<void> read_image_data(PPMLoadingContext& context)
|
|||
auto const blue = TRY(read_number(stream));
|
||||
TRY(read_whitespace(context));
|
||||
|
||||
Color color { (u8)red, (u8)green, (u8)blue };
|
||||
Color color { static_cast<u8>(red), static_cast<u8>(green), static_cast<u8>(blue) };
|
||||
if (context.format_details.max_val < 255)
|
||||
color = adjust_color(context.format_details.max_val, color);
|
||||
color_data[i] = color;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue