From 44ff5a18e42ad26a1621edf00f309c86304f13ac Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 1 Mar 2020 17:56:59 +0200 Subject: libcamera: control_serializer: Use explicit ControlTypeNone case Replace the default case with an explicit ControlTypeNone case in ControlSerializer::load() to catch omissions when adding new control types. A return statement needs to be added to the end of the function to avoid gcc incorrectly reporting that some exit paths don't contain a return statement. The compiler will still warn that not all cases are handled when adding a new control type. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/control_serializer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libcamera/control_serializer.cpp') diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp index 6c676811..edf3e5ca 100644 --- a/src/libcamera/control_serializer.cpp +++ b/src/libcamera/control_serializer.cpp @@ -361,9 +361,11 @@ ControlValue ControlSerializer::load(ControlType type, return ControlValue(value); } - default: + case ControlTypeNone: return ControlValue(); } + + return ControlValue(); } template<> -- cgit v1.2.1