Patch Detail
Show a patch.
GET /api/1.1/patches/13524/?format=api
{ "id": 13524, "url": "https://patchwork.libcamera.org/api/1.1/patches/13524/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13524/", "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": "<20210827023829.5871-4-laurent.pinchart@ideasonboard.com>", "date": "2021-08-27T02:38:26", "name": "[libcamera-devel,v1,3/6] libcamera: base: bound_method: Remove BoundMethodArgs specialization", "commit_ref": "c4e2b00d51f150632b203f81866604168d2ac1ff", "pull_url": null, "state": "accepted", "archived": false, "hash": "59bae4059e89c7ed79919ddb09ed2f9edcd7f609", "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/13524/mbox/", "series": [ { "id": 2402, "url": "https://patchwork.libcamera.org/api/1.1/series/2402/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2402", "date": "2021-08-27T02:38:23", "name": "libcamera: Drop emitter object pointer from signal arguments", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2402/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13524/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13524/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id ADDA8C3242\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Aug 2021 02:38:51 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 56CE86894D;\n\tFri, 27 Aug 2021 04:38:51 +0200 (CEST)", "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 DE3B968932\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Aug 2021 04:38:46 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 820795A1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Aug 2021 04:38:46 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Dq7xO4El\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630031926;\n\tbh=/CT9LXBbuiJs722tlb64o45gG2f7PBV52Oe+OkIU0Tk=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=Dq7xO4ElalIJoTnFQqDg1XfiYBDdoPSAhRWbyu06qTU9+ocMBzhEJoyPgJ2NWfboR\n\tjCESsTh7SWBoNTiKslWAhUHViYt4SZvDfUPkq/5TQLM0qf79ArE/fw2ZBXzehrZ60D\n\tRINDkZ+rc314itXEM/bgETFS+8s0NQrPQxOO1EmY=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 27 Aug 2021 05:38:26 +0300", "Message-Id": "<20210827023829.5871-4-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.31.1", "In-Reply-To": "<20210827023829.5871-1-laurent.pinchart@ideasonboard.com>", "References": "<20210827023829.5871-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v1 3/6] libcamera: base: bound_method:\n\tRemove BoundMethodArgs specialization", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The BoundMethodArgs specialization for the void return type is only\nneeded to avoid accessing the ret_ member variable that is lacking from\nthe corresponding BoundMethodPack specialization. As the member variable\nis only accessed in a single function, instead of specializing the whole\nclass we can use SFINAE to select between two different implementations\nof the function.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/base/bound_method.h | 34 +++++++--------------------\n 1 file changed, 8 insertions(+), 26 deletions(-)", "diff": "diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h\nindex 9c212f1ecc3a..76ce8017e721 100644\n--- a/include/libcamera/base/bound_method.h\n+++ b/include/libcamera/base/bound_method.h\n@@ -98,35 +98,17 @@ public:\n \tusing PackType = BoundMethodPack<R, Args...>;\n \n private:\n-\ttemplate<std::size_t... I>\n-\tvoid invokePack(BoundMethodPackBase *pack, std::index_sequence<I...>)\n+\ttemplate<std::size_t... I, typename T = R>\n+\tstd::enable_if_t<!std::is_void<T>::value, void>\n+\tinvokePack(BoundMethodPackBase *pack, std::index_sequence<I...>)\n \t{\n \t\tPackType *args = static_cast<PackType *>(pack);\n \t\targs->ret_ = invoke(std::get<I>(args->args_)...);\n \t}\n \n-public:\n-\tBoundMethodArgs(void *obj, Object *object, ConnectionType type)\n-\t\t: BoundMethodBase(obj, object, type) {}\n-\n-\tvoid invokePack(BoundMethodPackBase *pack) override\n-\t{\n-\t\tinvokePack(pack, std::make_index_sequence<sizeof...(Args)>{});\n-\t}\n-\n-\tvirtual R activate(Args... args, bool deleteMethod = false) = 0;\n-\tvirtual R invoke(Args... args) = 0;\n-};\n-\n-template<typename... Args>\n-class BoundMethodArgs<void, Args...> : public BoundMethodBase\n-{\n-public:\n-\tusing PackType = BoundMethodPack<void, Args...>;\n-\n-private:\n-\ttemplate<std::size_t... I>\n-\tvoid invokePack(BoundMethodPackBase *pack, std::index_sequence<I...>)\n+\ttemplate<std::size_t... I, typename T = R>\n+\tstd::enable_if_t<std::is_void<T>::value, void>\n+\tinvokePack(BoundMethodPackBase *pack, std::index_sequence<I...>)\n \t{\n \t\t/* args is effectively unused when the sequence I is empty. */\n \t\tPackType *args [[gnu::unused]] = static_cast<PackType *>(pack);\n@@ -142,8 +124,8 @@ public:\n \t\tinvokePack(pack, std::make_index_sequence<sizeof...(Args)>{});\n \t}\n \n-\tvirtual void activate(Args... args, bool deleteMethod = false) = 0;\n-\tvirtual void invoke(Args... args) = 0;\n+\tvirtual R activate(Args... args, bool deleteMethod = false) = 0;\n+\tvirtual R invoke(Args... args) = 0;\n };\n \n template<typename T, typename R, typename... Args>\n", "prefixes": [ "libcamera-devel", "v1", "3/6" ] }