From 8e076915dca56a6efc6ecf2657a2b0da8827bdd5 Mon Sep 17 00:00:00 2001 From: CristiFati Date: Tue, 24 Oct 2023 03:29:27 +0300 Subject: [PATCH] fix -Wswitch (encountered on GCC - might also apply to CLang) --- image/imageFormat.inl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/image/imageFormat.inl b/image/imageFormat.inl index afcd08eb..5a77159e 100644 --- a/image/imageFormat.inl +++ b/image/imageFormat.inl @@ -52,10 +52,9 @@ inline const char* imageFormatToStr( imageFormat format ) case IMAGE_BAYER_RGGB: return "bayer-rggb"; case IMAGE_GRAY8: return "gray8"; case IMAGE_GRAY32F: return "gray32f"; - case IMAGE_UNKNOWN: return "unknown"; + case IMAGE_UNKNOWN: + default: return "unknown"; }; - - return "unknown"; } // imageFormatIsRGB @@ -143,12 +142,11 @@ inline imageBaseType imageFormatBaseType( imageFormat format ) { case IMAGE_GRAY32F: case IMAGE_RGB32F: - case IMAGE_BGR32F: + case IMAGE_BGR32F: case IMAGE_RGBA32F: case IMAGE_BGRA32F: return IMAGE_FLOAT; + default: return IMAGE_UINT8; } - - return IMAGE_UINT8; } @@ -177,9 +175,8 @@ inline size_t imageFormatChannels( imageFormat format ) case IMAGE_BAYER_GBRG: case IMAGE_BAYER_GRBG: case IMAGE_BAYER_RGGB: return 1; + default: return 0; } - - return 0; } @@ -208,9 +205,8 @@ inline size_t imageFormatDepth( imageFormat format ) case IMAGE_BAYER_GBRG: case IMAGE_BAYER_GRBG: case IMAGE_BAYER_RGGB: return sizeof(unsigned char) * 8; + default: return 0; } - - return 0; }