[v2,2/5] libcamera: controls: Replace `numElements_` bit field
diff mbox series

Message ID 20250421153556.171192-3-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • libcamera: controls: Move constructor/assignment + swap
Related show

Commit Message

Barnabás Pőcze April 21, 2025, 3:35 p.m. UTC
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 <barnabas.pocze@ideasonboard.com>
---
 include/libcamera/controls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

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;