From patchwork Mon Apr 21 15:35:53 2025 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: 23192 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 9E230C32A2 for ; Mon, 21 Apr 2025 15:36:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 88D0468AD0; Mon, 21 Apr 2025 17:36:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VQryxAPW"; dkim-atps=neutral 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 6300868ABA for ; Mon, 21 Apr 2025 17:36:00 +0200 (CEST) Received: from pb-laptop.local (185.221.143.16.nat.pool.zt.hu [185.221.143.16]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C1AD66D5 for ; Mon, 21 Apr 2025 17:33:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1745249633; bh=Wq3YC8y0FCw4YsT9h4BTerhI+7A5jfaxldCogU8rsHM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VQryxAPWRzAKxH/VZ3IcsXltvVw+JOv6LK6axLaJugV80r6HyGaKcnZ1JgUTcBNIN HbbAFr+j/flKvb5tUEHGTI5icgJiCBFAy+NBfSIoCKg6ZegzJPdKU1YZldXd15mHKr ceD7NGPWm59j9Lo4eGEZq8OphHdolotL9vfSBhWU= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 2/5] libcamera: controls: Replace `numElements_` bit field Date: Mon, 21 Apr 2025 17:35:53 +0200 Message-ID: <20250421153556.171192-3-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250421153556.171192-1-barnabas.pocze@ideasonboard.com> References: <20250421153556.171192-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" Instead of using a 32-bit wide bit field of `std::size_t`, simply use a `uint32_t` to store the number of elements. This makes it possible to construct references, and use e.g. `std::swap()`. Signed-off-by: Barnabás Pőcze --- include/libcamera/controls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index 1dc6ccffa..3f3580036 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -236,7 +236,7 @@ public: private: ControlType type_ : 8; bool isArray_; - std::size_t numElements_ : 32; + uint32_t numElements_; union { uint64_t internal; void *external;