From patchwork Tue Jan 23 01:12:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19450 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 4F750C32BC for ; Tue, 23 Jan 2024 01:12:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7CF2C6294F; Tue, 23 Jan 2024 02:12:52 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Um+tJSxE"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 28D936294A for ; Tue, 23 Jan 2024 02:12:49 +0100 (CET) Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 666C61593; Tue, 23 Jan 2024 02:11:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1705972295; bh=WizYAfAkOLHPMkVocllD4Y1dKtYd2x2CsN/2zqXAyHA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Um+tJSxENxapXw1uh0zwVxHCwEXoUeFEZATdAUFlCIYO450jXnGri8HoCAMYe0hXm XfFC7JDGgBjEsqpeVuTbOSSZLBX+eMEJLvfn7mq6GaZB7cyMqP9//kBFjoD1GZBsjE GssTrFqQXAfHlA0eIK6ct0kaZuK97BFLfpRyT8sc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 02/12] libcamera: signal: Replace object.h inclusion with forward declatation Date: Tue, 23 Jan 2024 03:12:39 +0200 Message-ID: <20240123011249.22716-3-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240123011249.22716-1-laurent.pinchart@ideasonboard.com> References: <20240123011249.22716-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The signal.h header doesn't need to include object.h. Replace it with a forward declaration, and instead include object.h in source files that require it. It can speed up compilation a little bit, but more importantly avoids unintended dependencies from the Signal class to the Object class to be added later as the compiler will catch them. Signed-off-by: Laurent Pinchart Reviewed-by: Milan Zamazal --- Changes since v1: - Fix typo in commit message --- include/libcamera/base/signal.h | 3 ++- src/libcamera/base/bound_method.cpp | 1 + src/libcamera/base/signal.cpp | 1 + src/libcamera/base/thread.cpp | 1 + test/event-thread.cpp | 1 + test/ipa/ipa_interface_test.cpp | 1 + test/message.cpp | 1 + test/signal-threads.cpp | 1 + test/timer-thread.cpp | 1 + .../ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl | 1 + 10 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h index 841e4b4ca15c..444997b4525d 100644 --- a/include/libcamera/base/signal.h +++ b/include/libcamera/base/signal.h @@ -13,10 +13,11 @@ #include #include -#include namespace libcamera { +class Object; + class SignalBase { public: diff --git a/src/libcamera/base/bound_method.cpp b/src/libcamera/base/bound_method.cpp index 3ecec51c4b75..c83d623f107d 100644 --- a/src/libcamera/base/bound_method.cpp +++ b/src/libcamera/base/bound_method.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include diff --git a/src/libcamera/base/signal.cpp b/src/libcamera/base/signal.cpp index 02290ad779ee..f1018b37038c 100644 --- a/src/libcamera/base/signal.cpp +++ b/src/libcamera/base/signal.cpp @@ -8,6 +8,7 @@ #include #include +#include /** * \file base/signal.h diff --git a/src/libcamera/base/thread.cpp b/src/libcamera/base/thread.cpp index b96951ac19ba..75693c92a0b1 100644 --- a/src/libcamera/base/thread.cpp +++ b/src/libcamera/base/thread.cpp @@ -18,6 +18,7 @@ #include #include #include +#include /** * \page thread Thread Support diff --git a/test/event-thread.cpp b/test/event-thread.cpp index ef8a52c3de55..88a8c07ef9f0 100644 --- a/test/event-thread.cpp +++ b/test/event-thread.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index 051ef96e7ed2..56f3cd6d57ba 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -16,6 +16,7 @@ #include #include +#include #include #include diff --git a/test/message.cpp b/test/message.cpp index d148a13d6c7a..0e76f323e3b9 100644 --- a/test/message.cpp +++ b/test/message.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include "test.h" diff --git a/test/signal-threads.cpp b/test/signal-threads.cpp index d5e2eb662df2..8c550eb014d8 100644 --- a/test/signal-threads.cpp +++ b/test/signal-threads.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp index 618217538779..0bcd0d8ce194 100644 --- a/test/timer-thread.cpp +++ b/test/timer-thread.cpp @@ -9,6 +9,7 @@ #include #include +#include #include #include diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl index ed270f5cd49c..6e823598930e 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl @@ -18,6 +18,7 @@ #include #include +#include #include #include "libcamera/internal/control_serializer.h"