From 5fd18af2330b9338c705d8590007acd706b83827 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Sat, 3 Sep 2022 23:33:30 +0200 Subject: libcamera: controls: initialise control info to ControlTypeNone by default The default ControlInfo constructor allows partially initialising the min/max/def values. Uninitialised values are assigned to 0 by default. This implicit initialisation makes it impossible to distinguish between an uninitialised and an explicitly 0-initialised ControlValue. Default construct the ControlValue in the ControlInfo default contructor to explicitly represent uninitialised values by the ControlTypeNone type. Signed-off-by: Christian Rauch Reviewed-by: Paul Elder Reviewed-by: Umang Jain Signed-off-by: Paul Elder --- test/controls/control_info.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/controls/control_info.cpp b/test/controls/control_info.cpp index 2827473b..56b4101f 100644 --- a/test/controls/control_info.cpp +++ b/test/controls/control_info.cpp @@ -26,8 +26,8 @@ protected: */ ControlInfo brightness; - if (brightness.min().get() != 0 || - brightness.max().get() != 0) { + if (brightness.min().type() != ControlType::ControlTypeNone || + brightness.max().type() != ControlType::ControlTypeNone) { cout << "Invalid control range for Brightness" << endl; return TestFail; } -- cgit v1.2.1