From b1e977e18abc52dda2413964b749422d386fa28b Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 31 Dec 2022 11:49:57 -0500 Subject: [PATCH] LibGfx: Use VERIFY_NOT_REACHED() for impossible states in ICC code The `parse_` functions reject invalid values, so we know the default is unreachable. --- Userland/Libraries/LibGfx/ICCProfile.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibGfx/ICCProfile.cpp b/Userland/Libraries/LibGfx/ICCProfile.cpp index 0e8d6d4482..b1527781ee 100644 --- a/Userland/Libraries/LibGfx/ICCProfile.cpp +++ b/Userland/Libraries/LibGfx/ICCProfile.cpp @@ -208,9 +208,8 @@ StringView device_class_name(DeviceClass device_class) return "Abstract"sv; case DeviceClass::NamedColor: return "NamedColor"sv; - default: - return "(unknown device class)"sv; } + VERIFY_NOT_REACHED(); } StringView color_space_name(ColorSpace color_space) @@ -266,9 +265,8 @@ StringView color_space_name(ColorSpace color_space) return "14 color"sv; case ColorSpace::FifteenColor: return "15 color"sv; - default: - return {}; } + VERIFY_NOT_REACHED(); } StringView rendering_intent_name(RenderingIntent rendering_intent) @@ -282,9 +280,8 @@ StringView rendering_intent_name(RenderingIntent rendering_intent) return "Saturation"sv; case RenderingIntent::ICCAbsoluteColorimetric: return "ICC-absolute colorimetric"sv; - default: - return {}; } + VERIFY_NOT_REACHED(); } ErrorOr> Profile::try_load_from_externally_owned_memory(ReadonlyBytes bytes)