From patchwork Fri Mar 6 15:59:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2980 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8564460424 for ; Fri, 6 Mar 2020 17:00:17 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A972D1265 for ; Fri, 6 Mar 2020 17:00:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1583510417; bh=pPpRtPzwTtWPqbAc8jW+/g6UiGXbaLBzXNluwdBV0KA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n2QPOjJ/6XDaQT4dPXmgQEGP4Fvn6hf5S/gEkgMRkI/mvoRikuh7fH/S+7nHKfuqk z4t29aoPOnNHKVs3ASqFTswpxgvOjM1JSIDUR+HRrCV8NXM43vmPeHzI+LkjyciBBV MOXFA9mSOEn6GYrVfU82r5zylIdS99PPjElRIYaA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 6 Mar 2020 17:59:38 +0200 Message-Id: <20200306160002.30549-9-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200306160002.30549-1-laurent.pinchart@ideasonboard.com> References: <20200306160002.30549-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 08/32] libcamera: controls: Don't convert 32-bit and 64-bit implicitly X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2020 16:00:17 -0000 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(-) diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp index 613e6d768c0f..f632d60adc8b 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_; }