[libcamera-devel] [PATCH] libcamera: Use C++17 [[fallthrough]] everywhere

Matti Lehtimäki matti.lehtimaki at gmail.com
Wed Jan 4 17:15:01 CET 2023


Fixes build failure on some build environments.

Signed-off-by: Matti Lehtimäki <matti.lehtimaki at gmail.com>
---
 src/gstreamer/gstlibcamera-utils.cpp | 2 +-
 src/libcamera/camera_sensor.cpp      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp
index 16aac441..750ec351 100644
--- a/src/gstreamer/gstlibcamera-utils.cpp
+++ b/src/gstreamer/gstlibcamera-utils.cpp
@@ -154,7 +154,7 @@ colorspace_from_colorimetry(const GstVideoColorimetry &colorimetry)
 	case GST_VIDEO_TRANSFER_GAMMA22:
 	case GST_VIDEO_TRANSFER_GAMMA28:
 		GST_WARNING("GAMMA 18, 20, 22, 28 transfer functions not supported");
-	/* fallthrough */
+		[[fallthrough]];
 	case GST_VIDEO_TRANSFER_GAMMA10:
 		colorspace->transferFunction = ColorSpace::TransferFunction::Linear;
 		break;
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index ae3127d6..a210aa4f 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -427,7 +427,7 @@ int CameraSensor::initProperties()
 			LOG(CameraSensor, Warning)
 				<< "Unsupported camera location "
 				<< v4l2Orientation << ", setting to External";
-			/* Fall-through */
+			[[fallthrough]];
 		case V4L2_CAMERA_ORIENTATION_EXTERNAL:
 			propertyValue = properties::CameraLocationExternal;
 			break;
-- 
2.34.1



More information about the libcamera-devel mailing list