Patch Detail
Show a patch.
GET /api/1.1/patches/2932/?format=api
{ "id": 2932, "url": "https://patchwork.libcamera.org/api/1.1/patches/2932/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2932/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20200229164254.23604-15-laurent.pinchart@ideasonboard.com>", "date": "2020-02-29T16:42:37", "name": "[libcamera-devel,14/31] libcamera: controls: Move Control constructor to controls.h", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e46a43573de388a219be00448817bd29d57621c5", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2932/mbox/", "series": [ { "id": 696, "url": "https://patchwork.libcamera.org/api/1.1/series/696/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=696", "date": "2020-02-29T16:42:23", "name": "libcamera: Add support for array controls", "version": 1, "mbox": "https://patchwork.libcamera.org/series/696/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2932/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2932/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 18BFD627AA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Feb 2020 17:43:27 +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 A68A7A28\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 29 Feb 2020 17:43:26 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1582994606;\n\tbh=kcM3gADstjTOGmi790G+bL0EPl9Pw37NnY1W7LB3//Y=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=WgDiDtP/Xco5ikT/+mOsFLZyWo9JhC7Se++tWdBqGooMD7GVhF/8rtNhAS9Zlealk\n\t/JqR/lCGlfQ9vfMt0R/s47HNG9ueB8Cg1DCnD/161IR9oxRz3JuwW2H1Z3QEBOTIAn\n\tjZfxrfRBVcOe0qZXTqOhgtos1n4EXMqnVgDMRMvg=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 29 Feb 2020 18:42:37 +0200", "Message-Id": "<20200229164254.23604-15-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.24.1", "In-Reply-To": "<20200229164254.23604-1-laurent.pinchart@ideasonboard.com>", "References": "<20200229164254.23604-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 14/31] libcamera: controls: Move Control\n\tconstructor to controls.h", "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": "Sat, 29 Feb 2020 16:43:31 -0000" }, "content": "To avoid defining all specializations of the Control constructor\nmanually, move the definition of those functions to controls.h.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/controls.h | 5 ++++-\n src/libcamera/controls.cpp | 26 --------------------------\n 2 files changed, 4 insertions(+), 27 deletions(-)", "diff": "diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h\nindex dfe69916cd64..6f0ebf4f3ca5 100644\n--- a/include/libcamera/controls.h\n+++ b/include/libcamera/controls.h\n@@ -146,7 +146,10 @@ class Control : public ControlId\n public:\n \tusing type = T;\n \n-\tControl(unsigned int id, const char *name);\n+\tControl(unsigned int id, const char *name)\n+\t\t: ControlId(id, name, details::control_type<std::remove_cv_t<T>>::value)\n+\t{\n+\t}\n \n private:\n \tControl(const Control &) = delete;\ndiff --git a/src/libcamera/controls.cpp b/src/libcamera/controls.cpp\nindex 5cc8ce2199d0..76230a052de1 100644\n--- a/src/libcamera/controls.cpp\n+++ b/src/libcamera/controls.cpp\n@@ -249,32 +249,6 @@ bool ControlValue::operator==(const ControlValue &other) const\n * \\brief The Control template type T\n */\n \n-#ifndef __DOXYGEN__\n-template<>\n-Control<void>::Control(unsigned int id, const char *name)\n-\t: ControlId(id, name, ControlTypeNone)\n-{\n-}\n-\n-template<>\n-Control<bool>::Control(unsigned int id, const char *name)\n-\t: ControlId(id, name, ControlTypeBool)\n-{\n-}\n-\n-template<>\n-Control<int32_t>::Control(unsigned int id, const char *name)\n-\t: ControlId(id, name, ControlTypeInteger32)\n-{\n-}\n-\n-template<>\n-Control<int64_t>::Control(unsigned int id, const char *name)\n-\t: ControlId(id, name, ControlTypeInteger64)\n-{\n-}\n-#endif /* __DOXYGEN__ */\n-\n /**\n * \\class ControlRange\n * \\brief Describe the limits of valid values for a Control\n", "prefixes": [ "libcamera-devel", "14/31" ] }