{"id":3205,"url":"https://patchwork.libcamera.org/api/patches/3205/?format=json","web_url":"https://patchwork.libcamera.org/patch/3205/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20200320005551.10226-1-laurent.pinchart@ideasonboard.com>","date":"2020-03-20T00:55:50","name":"[libcamera-devel,1/2] libcamera: controls: Move ControlValue size check to controls.cpp","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"d863f6954758b35f8dbbca422b994dedca201234","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/3205/mbox/","series":[{"id":747,"url":"https://patchwork.libcamera.org/api/series/747/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=747","date":"2020-03-20T00:55:50","name":"[libcamera-devel,1/2] libcamera: controls: Move ControlValue size check to controls.cpp","version":1,"mbox":"https://patchwork.libcamera.org/series/747/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/3205/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/3205/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9BA4860418\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Mar 2020 01:56:02 +0100 (CET)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 01E64E1D;\n\tFri, 20 Mar 2020 01:56:01 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1584665762;\n\tbh=wivTZG+dnHFrO0BmwO5Ww8Mz+ud4I3wgLGw7071qp04=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=g3zt44Eqdo8QJGXLYUvKkX7yqND41pyjlZEWGh+ffVMe2KHY7Ol/gO8FQunwJaKQz\n\tPh91koh0Vlb0vS7b77e+Iv71G4TlcWEPLBt20UDtH7n9P2wHth1FVC76rpSTytrolq\n\t/tAUdd0VDHNmJ57PLc0mjdxICzU72i2bV7TnfkE8=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Jan Engelhardt <jengelh@inai.de>","Date":"Fri, 20 Mar 2020 02:55:50 +0200","Message-Id":"<20200320005551.10226-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.24.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/2] libcamera: controls: Move\n\tControlValue size check to controls.cpp","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 20 Mar 2020 00:56:02 -0000"},"content":"The size of the ControlValue class is checked by a static_assert() to\navoid accidental ABI breakages. There's no need to perform the check\nevery time controls.h is included, move it to controls.cpp.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h | 2 --\n src/libcamera/controls.cpp   | 2 ++\n 2 files changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex 0e111ab72bce..2fca975f7512 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -170,8 +170,6 @@ private:\n \t\t std::size_t numElements, std::size_t elementSize);\n };\n \n-static_assert(sizeof(ControlValue) == 16, \"Invalid size of ControlValue class\");\n-\n class ControlId\n {\n public:\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 4326174adf86..4615e71d7e3c 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -83,6 +83,8 @@ static constexpr size_t ControlValueSize[] = {\n  * \\brief Abstract type representing the value of a control\n  */\n \n+static_assert(sizeof(ControlValue) == 16, \"Invalid size of ControlValue class\");\n+\n /**\n  * \\brief Construct an empty ControlValue.\n  */\n","prefixes":["libcamera-devel","1/2"]}