From patchwork Thu Sep 3 09:18:40 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 28181 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 3812EC3349 for ; Thu, 3 Sep 2026 09:18:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 63F42685E6; Thu, 3 Sep 2026 11:18:52 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PDcrAGYv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id F14D0685D8 for ; Thu, 3 Sep 2026 11:18:47 +0200 (CEST) Received: from pb-laptop.local (185.221.143.32.nat.pool.zt.hu [185.221.143.32]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9266A2335 for ; Thu, 3 Sep 2026 11:17:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1788427035; bh=c+4Dnv2JVO/1259DeVJ9EuVZ6GzrAuIFkY961PdA2nc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PDcrAGYvOkheCTZhu7RbEjBqD29odoigbJsa3rYIF3RIIF8TRoSoAvOp9iEPKNIIE SeXFuYjAeCBdCOgosQZg/6ZrYThrQ2HkxvUvRd65Eh2t3UBl+q3i3bh/kt31WQxSbu eh9cKTUlFg7M5UiUOfjWj2Dexo6rgPPV1AGVWMio= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v3 2/5] libcamera: controls: Remove bit fields Date: Thu, 3 Sep 2026 11:18:40 +0200 Message-ID: <20260903091843.85548-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260903091843.85548-1-barnabas.pocze@ideasonboard.com> References: <20260903091843.85548-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Bit fields are inconvenient to use with references, e.g. `std::swap()`, so remove them from the `Control` type as a preparation. `size_t : 32` is replaced with just `uint32_t`, and `ControlType`'s underlying type is forced to be `uint8_t` so that bit field can also be removed. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- include/libcamera/controls.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index da73e41848..e4d5d13a2c 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -26,7 +26,7 @@ namespace libcamera { class ControlValidator; -enum ControlType { +enum ControlType : uint8_t { ControlTypeNone, ControlTypeBool, ControlTypeByte, @@ -242,9 +242,9 @@ public: std::size_t numElements = 1); private: - ControlType type_ : 8; + ControlType type_; bool isArray_; - std::size_t numElements_ : 32; + uint32_t numElements_; union { uint64_t internal; void *external;