{"id":12008,"url":"https://patchwork.libcamera.org/api/patches/12008/?format=json","web_url":"https://patchwork.libcamera.org/patch/12008/","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":"<20210420093859.14280-2-jacopo@jmondi.org>","date":"2021-04-20T09:38:58","name":"[libcamera-devel,v2,1/2] libcamera: Drop argument from LIBCAMERA_DECLARE_PRIVATE","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"00593bc1fdac2c28d255c4f3561d8a58d3fbac75","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"delegate":{"id":15,"url":"https://patchwork.libcamera.org/api/users/15/?format=json","username":"jmondi","first_name":"Jacopo","last_name":"Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/patch/12008/mbox/","series":[{"id":1951,"url":"https://patchwork.libcamera.org/api/series/1951/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1951","date":"2021-04-20T09:38:57","name":"Minor fixes to src/libcamera/class.cpp","version":2,"mbox":"https://patchwork.libcamera.org/series/1951/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12008/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12008/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 94A99BD816\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Apr 2021 09:38:26 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 853CD68845;\n\tTue, 20 Apr 2021 11:38:24 +0200 (CEST)","from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 10F1B68835\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Apr 2021 11:38:23 +0200 (CEST)","from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 78CA01BF214;\n\tTue, 20 Apr 2021 09:38:22 +0000 (UTC)"],"X-Originating-IP":"93.34.118.233","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 20 Apr 2021 11:38:58 +0200","Message-Id":"<20210420093859.14280-2-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.31.1","In-Reply-To":"<20210420093859.14280-1-jacopo@jmondi.org>","References":"<20210420093859.14280-1-jacopo@jmondi.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 1/2] libcamera: Drop argument from\n\tLIBCAMERA_DECLARE_PRIVATE","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The LIBCAMERA_DECLARE_PRIVATE() macro, used by the library classes\nthat inherits from libcamera::Extensible in order to implement the\nPIMPL pattern, expands to:\n\npublic:\t\t\t\t\t\t\t\t\t\\\n\tclass Private;\t\t\t\t\t\t\t\\\n\tfriend class Private;\n\nThe 'klass' argument is not used and it might confuse developers as\nit might hint that the class that defines the pattern's implementation\ncan be freely named, while it is actually hardcoded to 'Private'.\n\nDrop the argument from the macro definition.\n\nReviewed-by: Hanlin Chen <hanlinchen@google.com>\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n include/libcamera/camera.h         | 2 +-\n include/libcamera/camera_manager.h | 2 +-\n include/libcamera/class.h          | 4 ++--\n src/android/camera_buffer.h        | 2 +-\n src/libcamera/class.cpp            | 4 +---\n 5 files changed, 6 insertions(+), 8 deletions(-)\n\n--\n2.31.1","diff":"diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 326b14d0ca01..d71641805c0a 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -74,7 +74,7 @@ protected:\n class Camera final : public Object, public std::enable_shared_from_this<Camera>,\n \t\t     public Extensible\n {\n-\tLIBCAMERA_DECLARE_PRIVATE(Camera)\n+\tLIBCAMERA_DECLARE_PRIVATE()\n\n public:\n \tstatic std::shared_ptr<Camera> create(PipelineHandler *pipe,\ndiff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h\nindex 35a59f0df4ca..c2f0b786da8e 100644\n--- a/include/libcamera/camera_manager.h\n+++ b/include/libcamera/camera_manager.h\n@@ -22,7 +22,7 @@ class Camera;\n\n class CameraManager : public Object, public Extensible\n {\n-\tLIBCAMERA_DECLARE_PRIVATE(CameraManager)\n+\tLIBCAMERA_DECLARE_PRIVATE()\n public:\n \tCameraManager();\n \t~CameraManager();\ndiff --git a/include/libcamera/class.h b/include/libcamera/class.h\nindex 920624d8e726..466114ecfaf4 100644\n--- a/include/libcamera/class.h\n+++ b/include/libcamera/class.h\n@@ -30,7 +30,7 @@ namespace libcamera {\n #endif\n\n #ifndef __DOXYGEN__\n-#define LIBCAMERA_DECLARE_PRIVATE(klass)\t\t\t\t\\\n+#define LIBCAMERA_DECLARE_PRIVATE()\t\t\t\t\t\\\n public:\t\t\t\t\t\t\t\t\t\\\n \tclass Private;\t\t\t\t\t\t\t\\\n \tfriend class Private;\n@@ -46,7 +46,7 @@ public:\t\t\t\t\t\t\t\t\t\\\n \t_o<Public>();\n\n #else\n-#define LIBCAMERA_DECLARE_PRIVATE(klass)\n+#define LIBCAMERA_DECLARE_PRIVATE()\n #define LIBCAMERA_DECLARE_PUBLIC(klass)\n #define LIBCAMERA_D_PTR(klass)\n #define LIBCAMERA_O_PTR(klass)\ndiff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h\nindex 7e8970b49f49..c88124b2b3f3 100644\n--- a/src/android/camera_buffer.h\n+++ b/src/android/camera_buffer.h\n@@ -14,7 +14,7 @@\n\n class CameraBuffer final : public libcamera::Extensible\n {\n-\tLIBCAMERA_DECLARE_PRIVATE(CameraBuffer)\n+\tLIBCAMERA_DECLARE_PRIVATE()\n\n public:\n \tCameraBuffer(buffer_handle_t camera3Buffer, int flags);\ndiff --git a/src/libcamera/class.cpp b/src/libcamera/class.cpp\nindex 340b7de7911c..171f7c0a927b 100644\n--- a/src/libcamera/class.cpp\n+++ b/src/libcamera/class.cpp\n@@ -77,12 +77,10 @@ namespace libcamera {\n /**\n  * \\def LIBCAMERA_DECLARE_PRIVATE\n  * \\brief Declare private data for a public class\n- * \\param klass The public class name\n  *\n  * The LIBCAMERA_DECLARE_PRIVATE() macro plumbs the infrastructure necessary to\n  * make a class manage its private data through a d-pointer. It shall be used at\n- * the very top of the class definition, with the public class name passed as\n- * the \\a klass parameter.\n+ * the very top of the class definition.\n  */\n\n /**\n","prefixes":["libcamera-devel","v2","1/2"]}