summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-20 00:53:51 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-20 16:47:45 +0200
commit916df9e38d3af191853838ab4f2b0049ee207218 (patch)
treeeec096ac64c3a29b77b7107dee28921b7eb42df6
parent79fbecea456ccf05a76e23ee9bf61b5b057950c9 (diff)
libcamera: controls: Move ControlValue size check to controls.cpp
The size of the ControlValue class is checked by a static_assert() to avoid accidental ABI breakages. There's no need to perform the check every time controls.h is included, move it to controls.cpp. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--include/libcamera/controls.h2
-rw-r--r--src/libcamera/controls.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h
index 5cf6280e..56ee8280 100644
--- a/include/libcamera/controls.h
+++ b/include/libcamera/controls.h
@@ -188,8 +188,6 @@ private:
std::size_t numElements, std::size_t elementSize);
};
-static_assert(sizeof(ControlValue) == 16, "Invalid size of ControlValue class");
-
class ControlId
{
public:
diff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp
index 11cec519..fefd292b 100644
--- a/src/libcamera/controls.cpp
+++ b/src/libcamera/controls.cpp
@@ -86,6 +86,8 @@ static constexpr size_t ControlValueSize[] = {
* \brief Abstract type representing the value of a control
*/
+static_assert(sizeof(ControlValue) == 16, "Invalid size of ControlValue class");
+
/**
* \brief Construct an empty ControlValue.
*/