1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

Libraries: Fix -Wunreachable-code warnings from clang

This commit is contained in:
Nico Weber 2021-10-08 08:34:12 -04:00 committed by Andreas Kling
parent 96666f3209
commit b8dc3661ac
10 changed files with 7 additions and 27 deletions

View file

@ -784,7 +784,8 @@ static bool decode_dds(DDSLoadingContext& context)
return false;
}
for (size_t mipmap_level = 0; mipmap_level < max(context.header.mip_map_count, 1u); mipmap_level++) {
// We support parsing mipmaps, but we only care about the largest one :^) (At least for now)
if (size_t mipmap_level = 0; mipmap_level < max(context.header.mip_map_count, 1u)) {
u64 width = get_width(context.header, mipmap_level);
u64 height = get_height(context.header, mipmap_level);
@ -795,9 +796,6 @@ static bool decode_dds(DDSLoadingContext& context)
context.bitmap = Bitmap::try_create(BitmapFormat::BGRA8888, { width, height });
decode_bitmap(stream, context, format, width, height);
// We support parsing mipmaps, but we only care about the largest one :^) (At least for now)
break;
}
context.state = DDSLoadingContext::State::BitmapDecoded;