From 9c6d32fcf3198cc83cff6af3c9393e94c88bf9b9 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 12 Jan 2020 01:29:50 +0200 Subject: libcamera: controls: Don't convert 32-bit and 64-bit implicitly The ControlValue::get() method verifies that the T type corresponds to the ControlValue type. It however accepts int32_t as a return type for 64-bit integer controls, and int64_t as a return type for 32-bit integer controls. There's no reason to do so anymore, make the type check stricter. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- src/libcamera/controls.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libcamera/controls.cpp') diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 613e6d76..f632d60a 100644 --- a/src/libcamera/controls.cpp +++ b/src/libcamera/controls.cpp @@ -187,7 +187,7 @@ const bool &ControlValue::get() const template<> const int32_t &ControlValue::get() const { - ASSERT(type_ == ControlTypeInteger32 || type_ == ControlTypeInteger64); + ASSERT(type_ == ControlTypeInteger32); return integer32_; } @@ -195,7 +195,7 @@ const int32_t &ControlValue::get() const template<> const int64_t &ControlValue::get() const { - ASSERT(type_ == ControlTypeInteger32 || type_ == ControlTypeInteger64); + ASSERT(type_ == ControlTypeInteger64); return integer64_; } -- cgit v1.2.1