From patchwork Tue Nov 23 22:40:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14732 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 19C22BF415 for ; Tue, 23 Nov 2021 22:40:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4BD44603EE; Tue, 23 Nov 2021 23:40:24 +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="Wy7lIL0f"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB7CB60228 for ; Tue, 23 Nov 2021 23:40:20 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7D914F95; Tue, 23 Nov 2021 23:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707220; bh=74m8OXe9H9PaYz/jipGEMDd4dO7DHvs9q427ZDBib68=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wy7lIL0fz7o7GzlJsGwP9iCWgyjWwUHkVY4mAQk5f/2hnWDb+aJnNTSF9AppvS2UV LrtA45UfTmb6azPZRTeQrxdZILv1P4STnVqGIaFMcGWJKN9hWaFc9oj0gKJ/KWZUBv q/Q77AwBJZfsA2bcrOHNXl1lMyOG2tFC6QXInhvg= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:01 +0000 Message-Id: <20211123224015.3619282-2-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 01/15] libcamera: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- include/libcamera/camera.h | 6 ++---- include/libcamera/camera_manager.h | 6 ++---- include/libcamera/compiler.h | 6 ++---- include/libcamera/control_ids.h.in | 5 +---- include/libcamera/controls.h | 5 +---- include/libcamera/file_descriptor.h | 6 ++---- include/libcamera/formats.h.in | 6 ++---- include/libcamera/framebuffer.h | 6 ++---- include/libcamera/framebuffer_allocator.h | 6 ++---- include/libcamera/geometry.h | 5 +---- include/libcamera/logging.h | 6 ++---- include/libcamera/pixel_format.h | 6 ++---- include/libcamera/property_ids.h.in | 5 +---- include/libcamera/request.h | 6 ++---- include/libcamera/stream.h | 6 ++---- include/libcamera/transform.h | 5 +---- include/libcamera/version.h.in | 6 ++---- 17 files changed, 29 insertions(+), 68 deletions(-) diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index 601ee46e415b..a7759ccb957e 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -4,8 +4,8 @@ * * camera.h - Camera object interface */ -#ifndef __LIBCAMERA_CAMERA_H__ -#define __LIBCAMERA_CAMERA_H__ + +#pragma once #include #include @@ -121,5 +121,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_CAMERA_H__ */ diff --git a/include/libcamera/camera_manager.h b/include/libcamera/camera_manager.h index 744e5a06c78c..7647c2a1c43c 100644 --- a/include/libcamera/camera_manager.h +++ b/include/libcamera/camera_manager.h @@ -4,8 +4,8 @@ * * camera_manager.h - Camera management */ -#ifndef __LIBCAMERA_CAMERA_MANAGER_H__ -#define __LIBCAMERA_CAMERA_MANAGER_H__ + +#pragma once #include #include @@ -51,5 +51,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_CAMERA_MANAGER_H__ */ diff --git a/include/libcamera/compiler.h b/include/libcamera/compiler.h index dc56dbb8b792..02564f2f8b5c 100644 --- a/include/libcamera/compiler.h +++ b/include/libcamera/compiler.h @@ -4,13 +4,11 @@ * * compiler.h - Compiler support */ -#ifndef __LIBCAMERA_COMPILER_H__ -#define __LIBCAMERA_COMPILER_H__ + +#pragma once #if __cplusplus >= 201703L #define __nodiscard [[nodiscard]] #else #define __nodiscard #endif - -#endif /* __LIBCAMERA_COMPILER_H__ */ diff --git a/include/libcamera/control_ids.h.in b/include/libcamera/control_ids.h.in index 7edeb6b65e32..0718a8886f6c 100644 --- a/include/libcamera/control_ids.h.in +++ b/include/libcamera/control_ids.h.in @@ -7,8 +7,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_CONTROL_IDS_H__ -#define __LIBCAMERA_CONTROL_IDS_H__ +#pragma once #include #include @@ -36,5 +35,3 @@ ${draft_controls} } /* namespace controls */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_CONTROL_IDS_H__ */ diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index af851b4661c8..665bcac1d9aa 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -5,8 +5,7 @@ * controls.h - Control handling */ -#ifndef __LIBCAMERA_CONTROLS_H__ -#define __LIBCAMERA_CONTROLS_H__ +#pragma once #include #include @@ -421,5 +420,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_CONTROLS_H__ */ diff --git a/include/libcamera/file_descriptor.h b/include/libcamera/file_descriptor.h index 988f9b7a3d25..8d764f8b4a26 100644 --- a/include/libcamera/file_descriptor.h +++ b/include/libcamera/file_descriptor.h @@ -4,8 +4,8 @@ * * file_descriptor.h - File descriptor wrapper */ -#ifndef __LIBCAMERA_FILE_DESCRIPTOR_H__ -#define __LIBCAMERA_FILE_DESCRIPTOR_H__ + +#pragma once #include #include @@ -47,5 +47,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_FILE_DESCRIPTOR_H__ */ diff --git a/include/libcamera/formats.h.in b/include/libcamera/formats.h.in index 8e7b95812afa..ead5287d8299 100644 --- a/include/libcamera/formats.h.in +++ b/include/libcamera/formats.h.in @@ -6,8 +6,8 @@ * * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_FORMATS_H__ -#define __LIBCAMERA_FORMATS_H__ + +#pragma once #include @@ -40,5 +40,3 @@ ${formats} } /* namespace formats */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_FORMATS_H__ */ diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h index 7f2f176af691..4e710e332370 100644 --- a/include/libcamera/framebuffer.h +++ b/include/libcamera/framebuffer.h @@ -4,8 +4,8 @@ * * framebuffer.h - Frame buffer handling */ -#ifndef __LIBCAMERA_FRAMEBUFFER_H__ -#define __LIBCAMERA_FRAMEBUFFER_H__ + +#pragma once #include #include @@ -81,5 +81,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_FRAMEBUFFER_H__ */ diff --git a/include/libcamera/framebuffer_allocator.h b/include/libcamera/framebuffer_allocator.h index cbc9ce101889..45ff232b3d04 100644 --- a/include/libcamera/framebuffer_allocator.h +++ b/include/libcamera/framebuffer_allocator.h @@ -4,8 +4,8 @@ * * framebuffer_allocator.h - FrameBuffer allocator */ -#ifndef __LIBCAMERA_FRAMEBUFFER_ALLOCATOR_H__ -#define __LIBCAMERA_FRAMEBUFFER_ALLOCATOR_H__ + +#pragma once #include #include @@ -39,5 +39,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_FRAMEBUFFER_ALLOCATOR_H__ */ diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h index fa7ae7bce8db..713f71c180c6 100644 --- a/include/libcamera/geometry.h +++ b/include/libcamera/geometry.h @@ -5,8 +5,7 @@ * geometry.h - Geometry-related classes */ -#ifndef __LIBCAMERA_GEOMETRY_H__ -#define __LIBCAMERA_GEOMETRY_H__ +#pragma once #include #include @@ -293,5 +292,3 @@ static inline bool operator!=(const Rectangle &lhs, const Rectangle &rhs) } } /* namespace libcamera */ - -#endif /* __LIBCAMERA_GEOMETRY_H__ */ diff --git a/include/libcamera/logging.h b/include/libcamera/logging.h index 2b6dd3f4cff2..c36882b91974 100644 --- a/include/libcamera/logging.h +++ b/include/libcamera/logging.h @@ -4,8 +4,8 @@ * * logging.h - Logging infrastructure */ -#ifndef __LIBCAMERA_LOGGING_H__ -#define __LIBCAMERA_LOGGING_H__ + +#pragma once namespace libcamera { @@ -22,5 +22,3 @@ int logSetTarget(LoggingTarget target); void logSetLevel(const char *category, const char *level); } /* namespace libcamera */ - -#endif /* __LIBCAMERA_LOGGING_H__ */ diff --git a/include/libcamera/pixel_format.h b/include/libcamera/pixel_format.h index c4ae088397cb..a9d7c03de851 100644 --- a/include/libcamera/pixel_format.h +++ b/include/libcamera/pixel_format.h @@ -4,8 +4,8 @@ * * pixel_format.h - libcamera Pixel Format */ -#ifndef __LIBCAMERA_PIXEL_FORMAT_H__ -#define __LIBCAMERA_PIXEL_FORMAT_H__ + +#pragma once #include #include @@ -46,5 +46,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIXEL_FORMAT_H__ */ diff --git a/include/libcamera/property_ids.h.in b/include/libcamera/property_ids.h.in index 52646c1f78ae..ff0194083af0 100644 --- a/include/libcamera/property_ids.h.in +++ b/include/libcamera/property_ids.h.in @@ -7,8 +7,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_PROPERTY_IDS_H__ -#define __LIBCAMERA_PROPERTY_IDS_H__ +#pragma once #include @@ -35,5 +34,3 @@ extern const ControlIdMap properties; } /* namespace properties */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PROPERTY_IDS_H__ */ diff --git a/include/libcamera/request.h b/include/libcamera/request.h index d16904e6b679..f434335b243a 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -4,8 +4,8 @@ * * request.h - Capture request handling */ -#ifndef __LIBCAMERA_REQUEST_H__ -#define __LIBCAMERA_REQUEST_H__ + +#pragma once #include #include @@ -83,5 +83,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_REQUEST_H__ */ diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index 0c55e7164592..41ec02b17b91 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -4,8 +4,8 @@ * * stream.h - Video stream for a Camera */ -#ifndef __LIBCAMERA_STREAM_H__ -#define __LIBCAMERA_STREAM_H__ + +#pragma once #include #include @@ -81,5 +81,3 @@ protected: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_STREAM_H__ */ diff --git a/include/libcamera/transform.h b/include/libcamera/transform.h index 71b43da7c89f..2e76b9405b2e 100644 --- a/include/libcamera/transform.h +++ b/include/libcamera/transform.h @@ -5,8 +5,7 @@ * transform.h - 2D plane transforms */ -#ifndef __LIBCAMERA_TRANSFORM_H__ -#define __LIBCAMERA_TRANSFORM_H__ +#pragma once #include @@ -74,5 +73,3 @@ Transform transformFromRotation(int angle, bool *success = nullptr); const char *transformToString(Transform t); } /* namespace libcamera */ - -#endif /* __LIBCAMERA_TRANSFORM_H__ */ diff --git a/include/libcamera/version.h.in b/include/libcamera/version.h.in index 5e9a30911d12..6e24d0a89fcb 100644 --- a/include/libcamera/version.h.in +++ b/include/libcamera/version.h.in @@ -6,11 +6,9 @@ * * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_VERSION_H__ -#define __LIBCAMERA_VERSION_H__ + +#pragma once #define LIBCAMERA_VERSION_MAJOR @LIBCAMERA_VERSION_MAJOR@ #define LIBCAMERA_VERSION_MINOR @LIBCAMERA_VERSION_MINOR@ #define LIBCAMERA_VERSION_PATCH @LIBCAMERA_VERSION_PATCH@ - -#endif /* __LIBCAMERA_VERSION_H__ */ From patchwork Tue Nov 23 22:40:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14733 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 DAC84BF415 for ; Tue, 23 Nov 2021 22:40:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5376A6044F; Tue, 23 Nov 2021 23:40:25 +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="I7VWa2FV"; 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 118E16022F for ; Tue, 23 Nov 2021 23:40:21 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B5AED11BB; Tue, 23 Nov 2021 23:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707220; bh=fNdOA1N28Kg6wXlD0ZGWmUQVsd6EhqpWsmYvScBncYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I7VWa2FV8fOpRUGjHb+zyqXBzCXtfhpMKpt4P9ZtIavRmuy3/h8A4yyAfDesbhoq+ Or9su/mUzGPKqSpk0Mpzu8j/xyp/U6AlljDw6JMDd6pfmVF8DnlTcxdLLMXFBTxB6j oNHSIqn6oIBHiF6yQp4218xUOyGSfQvUuzEcP2Uo= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:02 +0000 Message-Id: <20211123224015.3619282-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 02/15] libcamera: base: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- include/libcamera/base/backtrace.h | 6 ++---- include/libcamera/base/bound_method.h | 6 ++---- include/libcamera/base/class.h | 6 ++---- include/libcamera/base/event_dispatcher.h | 6 ++---- include/libcamera/base/event_dispatcher_poll.h | 6 ++---- include/libcamera/base/event_notifier.h | 6 ++---- include/libcamera/base/file.h | 6 ++---- include/libcamera/base/flags.h | 6 ++---- include/libcamera/base/log.h | 6 ++---- include/libcamera/base/message.h | 6 ++---- include/libcamera/base/object.h | 6 ++---- include/libcamera/base/semaphore.h | 6 ++---- include/libcamera/base/signal.h | 6 ++---- include/libcamera/base/span.h | 5 +---- include/libcamera/base/thread.h | 6 ++---- include/libcamera/base/timer.h | 6 ++---- include/libcamera/base/utils.h | 6 ++---- 17 files changed, 33 insertions(+), 68 deletions(-) diff --git a/include/libcamera/base/backtrace.h b/include/libcamera/base/backtrace.h index bb77c73b67e3..752034d140e8 100644 --- a/include/libcamera/base/backtrace.h +++ b/include/libcamera/base/backtrace.h @@ -4,8 +4,8 @@ * * backtrace.h - Call stack backtraces */ -#ifndef __LIBCAMERA_BASE_BACKTRACE_H__ -#define __LIBCAMERA_BASE_BACKTRACE_H__ + +#pragma once #include #include @@ -34,5 +34,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_BACKTRACE_H__ */ diff --git a/include/libcamera/base/bound_method.h b/include/libcamera/base/bound_method.h index ebd297ab8209..e73a4d98ddae 100644 --- a/include/libcamera/base/bound_method.h +++ b/include/libcamera/base/bound_method.h @@ -4,8 +4,8 @@ * * bound_method.h - Method bind and invocation */ -#ifndef __LIBCAMERA_BASE_BOUND_METHOD_H__ -#define __LIBCAMERA_BASE_BOUND_METHOD_H__ + +#pragma once #include #include @@ -222,5 +222,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_BOUND_METHOD_H__ */ diff --git a/include/libcamera/base/class.h b/include/libcamera/base/class.h index 09806cd723c0..571eecf4da50 100644 --- a/include/libcamera/base/class.h +++ b/include/libcamera/base/class.h @@ -4,8 +4,8 @@ * * class.h - Utilities and helpers for classes */ -#ifndef __LIBCAMERA_BASE_CLASS_H__ -#define __LIBCAMERA_BASE_CLASS_H__ + +#pragma once #include @@ -107,5 +107,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_CLASS_H__ */ diff --git a/include/libcamera/base/event_dispatcher.h b/include/libcamera/base/event_dispatcher.h index 825af7a33919..184f1b12c966 100644 --- a/include/libcamera/base/event_dispatcher.h +++ b/include/libcamera/base/event_dispatcher.h @@ -4,8 +4,8 @@ * * event_dispatcher.h - Event dispatcher */ -#ifndef __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ -#define __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ + +#pragma once #include @@ -33,5 +33,3 @@ public: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_EVENT_DISPATCHER_H__ */ diff --git a/include/libcamera/base/event_dispatcher_poll.h b/include/libcamera/base/event_dispatcher_poll.h index 683934bfc7f7..3d2fc7bbc4c3 100644 --- a/include/libcamera/base/event_dispatcher_poll.h +++ b/include/libcamera/base/event_dispatcher_poll.h @@ -4,8 +4,8 @@ * * event_dispatcher_poll.h - Poll-based event dispatcher */ -#ifndef __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ -#define __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ + +#pragma once #include #include @@ -56,5 +56,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_EVENT_DISPATCHER_POLL_H__ */ diff --git a/include/libcamera/base/event_notifier.h b/include/libcamera/base/event_notifier.h index f7722a32ef55..e5c0594d3ebd 100644 --- a/include/libcamera/base/event_notifier.h +++ b/include/libcamera/base/event_notifier.h @@ -4,8 +4,8 @@ * * event_notifier.h - File descriptor event notifier */ -#ifndef __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ -#define __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ + +#pragma once #include @@ -46,5 +46,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_EVENT_NOTIFIER_H__ */ diff --git a/include/libcamera/base/file.h b/include/libcamera/base/file.h index 60851d385587..55e8edd934d4 100644 --- a/include/libcamera/base/file.h +++ b/include/libcamera/base/file.h @@ -4,8 +4,8 @@ * * file.h - File I/O operations */ -#ifndef __LIBCAMERA_BASE_FILE_H__ -#define __LIBCAMERA_BASE_FILE_H__ + +#pragma once #include @@ -84,5 +84,3 @@ LIBCAMERA_FLAGS_ENABLE_OPERATORS(File::MapFlag) LIBCAMERA_FLAGS_ENABLE_OPERATORS(File::OpenModeFlag) } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_FILE_H__ */ diff --git a/include/libcamera/base/flags.h b/include/libcamera/base/flags.h index adec549dccc9..bff3b93c85a1 100644 --- a/include/libcamera/base/flags.h +++ b/include/libcamera/base/flags.h @@ -4,8 +4,8 @@ * * flags.h - Type-safe enum-based bitfields */ -#ifndef __LIBCAMERA_BASE_FLAGS_H__ -#define __LIBCAMERA_BASE_FLAGS_H__ + +#pragma once #include @@ -191,5 +191,3 @@ struct flags_enable_operators<_enum> { \ #endif /* __DOXYGEN__ */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_FLAGS_H__ */ diff --git a/include/libcamera/base/log.h b/include/libcamera/base/log.h index 866a2133523b..3f065267c914 100644 --- a/include/libcamera/base/log.h +++ b/include/libcamera/base/log.h @@ -4,8 +4,8 @@ * * log.h - Logging infrastructure */ -#ifndef __LIBCAMERA_BASE_LOG_H__ -#define __LIBCAMERA_BASE_LOG_H__ + +#pragma once #include #include @@ -128,5 +128,3 @@ LogMessage _log(const LogCategory *category, LogSeverity severity, #endif } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_LOG_H__ */ diff --git a/include/libcamera/base/message.h b/include/libcamera/base/message.h index 5d2a9f04f0a7..65572c7470e9 100644 --- a/include/libcamera/base/message.h +++ b/include/libcamera/base/message.h @@ -4,8 +4,8 @@ * * message.h - Message queue support */ -#ifndef __LIBCAMERA_BASE_MESSAGE_H__ -#define __LIBCAMERA_BASE_MESSAGE_H__ + +#pragma once #include @@ -67,5 +67,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_MESSAGE_H__ */ diff --git a/include/libcamera/base/object.h b/include/libcamera/base/object.h index 5c385ab4b140..25dcbc0483d0 100644 --- a/include/libcamera/base/object.h +++ b/include/libcamera/base/object.h @@ -4,8 +4,8 @@ * * object.h - Base object */ -#ifndef __LIBCAMERA_BASE_OBJECT_H__ -#define __LIBCAMERA_BASE_OBJECT_H__ + +#pragma once #include #include @@ -67,5 +67,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_OBJECT_H__ */ diff --git a/include/libcamera/base/semaphore.h b/include/libcamera/base/semaphore.h index d8146eb8060b..ae87d31916dc 100644 --- a/include/libcamera/base/semaphore.h +++ b/include/libcamera/base/semaphore.h @@ -4,8 +4,8 @@ * * semaphore.h - General-purpose counting semaphore */ -#ifndef __LIBCAMERA_BASE_SEMAPHORE_H__ -#define __LIBCAMERA_BASE_SEMAPHORE_H__ + +#pragma once #include @@ -31,5 +31,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_SEMAPHORE_H__ */ diff --git a/include/libcamera/base/signal.h b/include/libcamera/base/signal.h index 8d9f82f62d0d..91000d0d6349 100644 --- a/include/libcamera/base/signal.h +++ b/include/libcamera/base/signal.h @@ -4,8 +4,8 @@ * * signal.h - Signal & slot implementation */ -#ifndef __LIBCAMERA_BASE_SIGNAL_H__ -#define __LIBCAMERA_BASE_SIGNAL_H__ + +#pragma once #include #include @@ -147,5 +147,3 @@ public: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_SIGNAL_H__ */ diff --git a/include/libcamera/base/span.h b/include/libcamera/base/span.h index 21099d5611b8..88d2e3de3a6b 100644 --- a/include/libcamera/base/span.h +++ b/include/libcamera/base/span.h @@ -5,8 +5,7 @@ * span.h - C++20 std::span<> implementation for C++11 */ -#ifndef __LIBCAMERA_BASE_SPAN_H__ -#define __LIBCAMERA_BASE_SPAN_H__ +#pragma once #include #include @@ -420,5 +419,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_SPAN_H__ */ diff --git a/include/libcamera/base/thread.h b/include/libcamera/base/thread.h index e0ca0aeaa761..32ebc80a0eb9 100644 --- a/include/libcamera/base/thread.h +++ b/include/libcamera/base/thread.h @@ -4,8 +4,8 @@ * * thread.h - Thread support */ -#ifndef __LIBCAMERA_BASE_THREAD_H__ -#define __LIBCAMERA_BASE_THREAD_H__ + +#pragma once #include #include @@ -74,5 +74,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_THREAD_H__ */ diff --git a/include/libcamera/base/timer.h b/include/libcamera/base/timer.h index 44876a85dc0a..09f1d3229bd5 100644 --- a/include/libcamera/base/timer.h +++ b/include/libcamera/base/timer.h @@ -4,8 +4,8 @@ * * timer.h - Generic timer */ -#ifndef __LIBCAMERA_BASE_TIMER_H__ -#define __LIBCAMERA_BASE_TIMER_H__ + +#pragma once #include #include @@ -47,5 +47,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_TIMER_H__ */ diff --git a/include/libcamera/base/utils.h b/include/libcamera/base/utils.h index 2b761436a99f..3a803176693d 100644 --- a/include/libcamera/base/utils.h +++ b/include/libcamera/base/utils.h @@ -4,8 +4,8 @@ * * utils.h - Miscellaneous utility functions */ -#ifndef __LIBCAMERA_BASE_UTILS_H__ -#define __LIBCAMERA_BASE_UTILS_H__ + +#pragma once #include #include @@ -355,5 +355,3 @@ std::basic_ostream &operator<<(std::basic_ostream #endif } /* namespace libcamera */ - -#endif /* __LIBCAMERA_BASE_UTILS_H__ */ From patchwork Tue Nov 23 22:40:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14734 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 7FB35BF415 for ; Tue, 23 Nov 2021 22:40:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C02B86022F; Tue, 23 Nov 2021 23:40:27 +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="Fy/1Hpg2"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4A71260230 for ; Tue, 23 Nov 2021 23:40:21 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EC0C7A1B; Tue, 23 Nov 2021 23:40:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707221; bh=eHjnGg3U+bEWEKvbvs9EydPTRXUfuF/JLUrTtnqPsaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fy/1Hpg2lY6RGEH0hdyAjtCzThxkOCIFMs0BxsrT3kFA3IhHbPXTNxvJ0oz06ptKu 90OIhbaE+BQUDpKRnx64yKHw7YTT2nV9OlaX9Qh7Y9VlraS4KG76+qLdSCH74/gNrN At7AiBBjWfDKqyYUMTFf0BBKx47g33OWFD9GEke8= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:03 +0000 Message-Id: <20211123224015.3619282-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 03/15] libcamera: internal: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Laurent Pinchart --- include/libcamera/internal/bayer_format.h | 6 ++---- include/libcamera/internal/byte_stream_buffer.h | 6 ++---- include/libcamera/internal/camera.h | 6 ++---- include/libcamera/internal/camera_controls.h | 6 ++---- include/libcamera/internal/camera_sensor.h | 6 ++---- include/libcamera/internal/camera_sensor_properties.h | 6 ++---- include/libcamera/internal/control_serializer.h | 6 ++---- include/libcamera/internal/control_validator.h | 6 ++---- include/libcamera/internal/delayed_controls.h | 6 ++---- include/libcamera/internal/device_enumerator.h | 6 ++---- include/libcamera/internal/device_enumerator_sysfs.h | 6 ++---- include/libcamera/internal/device_enumerator_udev.h | 6 ++---- include/libcamera/internal/formats.h | 5 +---- include/libcamera/internal/framebuffer.h | 6 ++---- include/libcamera/internal/ipa_data_serializer.h | 6 ++---- include/libcamera/internal/ipa_manager.h | 6 ++---- include/libcamera/internal/ipa_module.h | 6 ++---- include/libcamera/internal/ipa_proxy.h | 6 ++---- include/libcamera/internal/ipc_pipe.h | 6 ++---- include/libcamera/internal/ipc_pipe_unixsocket.h | 6 ++---- include/libcamera/internal/ipc_unixsocket.h | 5 +---- include/libcamera/internal/mapped_framebuffer.h | 6 ++---- include/libcamera/internal/media_device.h | 6 ++---- include/libcamera/internal/media_object.h | 6 ++---- include/libcamera/internal/pipeline_handler.h | 6 ++---- include/libcamera/internal/process.h | 6 ++---- include/libcamera/internal/pub_key.h | 6 ++---- include/libcamera/internal/source_paths.h | 6 ++---- include/libcamera/internal/sysfs.h | 6 ++---- include/libcamera/internal/tracepoints.h.in | 6 ++---- include/libcamera/internal/v4l2_device.h | 6 ++---- include/libcamera/internal/v4l2_pixelformat.h | 6 ++---- include/libcamera/internal/v4l2_subdevice.h | 6 ++---- include/libcamera/internal/v4l2_videodevice.h | 6 ++---- 34 files changed, 66 insertions(+), 136 deletions(-) diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h index 79a25b52582d..cb20bf9bea84 100644 --- a/include/libcamera/internal/bayer_format.h +++ b/include/libcamera/internal/bayer_format.h @@ -4,8 +4,8 @@ * * bayer_format.h - Bayer Pixel Format */ -#ifndef __LIBCAMERA_INTERNAL_BAYER_FORMAT_H__ -#define __LIBCAMERA_INTERNAL_BAYER_FORMAT_H__ + +#pragma once #include #include @@ -69,5 +69,3 @@ static inline bool operator!=(const BayerFormat &lhs, const BayerFormat &rhs) } } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_BAYER_FORMAT_H__ */ diff --git a/include/libcamera/internal/byte_stream_buffer.h b/include/libcamera/internal/byte_stream_buffer.h index d0f0df5ee87b..0f4fce6f4dc0 100644 --- a/include/libcamera/internal/byte_stream_buffer.h +++ b/include/libcamera/internal/byte_stream_buffer.h @@ -4,8 +4,8 @@ * * byte_stream_buffer.h - Byte stream buffer */ -#ifndef __LIBCAMERA_INTERNAL_BYTE_STREAM_BUFFER_H__ -#define __LIBCAMERA_INTERNAL_BYTE_STREAM_BUFFER_H__ + +#pragma once #include #include @@ -85,5 +85,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_BYTE_STREAM_BUFFER_H__ */ diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h index 9f5adac12a77..597426a6f9d2 100644 --- a/include/libcamera/internal/camera.h +++ b/include/libcamera/internal/camera.h @@ -4,8 +4,8 @@ * * camera.h - Camera private data */ -#ifndef __LIBCAMERA_INTERNAL_CAMERA_H__ -#define __LIBCAMERA_INTERNAL_CAMERA_H__ + +#pragma once #include #include @@ -72,5 +72,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_CAMERA_H__ */ diff --git a/include/libcamera/internal/camera_controls.h b/include/libcamera/internal/camera_controls.h index 6e40f4436cad..ee6d382f8989 100644 --- a/include/libcamera/internal/camera_controls.h +++ b/include/libcamera/internal/camera_controls.h @@ -4,8 +4,8 @@ * * camera_controls.h - Camera controls */ -#ifndef __LIBCAMERA_INTERNAL_CAMERA_CONTROLS_H__ -#define __LIBCAMERA_INTERNAL_CAMERA_CONTROLS_H__ + +#pragma once #include "libcamera/internal/control_validator.h" @@ -26,5 +26,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_CAMERA_CONTROLS_H__ */ diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index d25a1165a06c..2facbf3c8dc0 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -4,8 +4,8 @@ * * camera_sensor.h - A camera sensor */ -#ifndef __LIBCAMERA_INTERNAL_CAMERA_SENSOR_H__ -#define __LIBCAMERA_INTERNAL_CAMERA_SENSOR_H__ + +#pragma once #include #include @@ -94,5 +94,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_CAMERA_SENSOR_H__ */ diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h index 67c77920eb38..af381a121bfc 100644 --- a/include/libcamera/internal/camera_sensor_properties.h +++ b/include/libcamera/internal/camera_sensor_properties.h @@ -4,8 +4,8 @@ * * camera_sensor_properties.h - Database of camera sensor properties */ -#ifndef __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ -#define __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ + +#pragma once #include #include @@ -22,5 +22,3 @@ struct CameraSensorProperties { }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ */ diff --git a/include/libcamera/internal/control_serializer.h b/include/libcamera/internal/control_serializer.h index caeafa11bc54..99e57feed608 100644 --- a/include/libcamera/internal/control_serializer.h +++ b/include/libcamera/internal/control_serializer.h @@ -4,8 +4,8 @@ * * control_serializer.h - Control (de)serializer */ -#ifndef __LIBCAMERA_INTERNAL_CONTROL_SERIALIZER_H__ -#define __LIBCAMERA_INTERNAL_CONTROL_SERIALIZER_H__ + +#pragma once #include #include @@ -60,5 +60,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_CONTROL_SERIALIZER_H__ */ diff --git a/include/libcamera/internal/control_validator.h b/include/libcamera/internal/control_validator.h index 206006954cd9..26412d8bac9a 100644 --- a/include/libcamera/internal/control_validator.h +++ b/include/libcamera/internal/control_validator.h @@ -4,8 +4,8 @@ * * control_validator.h - Control validator */ -#ifndef __LIBCAMERA_INTERNAL_CONTROL_VALIDATOR_H__ -#define __LIBCAMERA_INTERNAL_CONTROL_VALIDATOR_H__ + +#pragma once #include @@ -23,5 +23,3 @@ public: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_CONTROL_VALIDATOR_H__ */ diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h index 2a6a912bde10..703fdb66bc27 100644 --- a/include/libcamera/internal/delayed_controls.h +++ b/include/libcamera/internal/delayed_controls.h @@ -4,8 +4,8 @@ * * delayed_controls.h - Helper to deal with controls that take effect with a delay */ -#ifndef __LIBCAMERA_INTERNAL_DELAYED_CONTROLS_H__ -#define __LIBCAMERA_INTERNAL_DELAYED_CONTROLS_H__ + +#pragma once #include #include @@ -82,5 +82,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_DELAYED_CONTROLS_H__ */ diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h index baccfc000d87..72ec9a60b19a 100644 --- a/include/libcamera/internal/device_enumerator.h +++ b/include/libcamera/internal/device_enumerator.h @@ -4,8 +4,8 @@ * * device_enumerator.h - API to enumerate and find media devices */ -#ifndef __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_H__ -#define __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_H__ + +#pragma once #include #include @@ -55,5 +55,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_H__ */ diff --git a/include/libcamera/internal/device_enumerator_sysfs.h b/include/libcamera/internal/device_enumerator_sysfs.h index 2112bc543054..3e84b83f3200 100644 --- a/include/libcamera/internal/device_enumerator_sysfs.h +++ b/include/libcamera/internal/device_enumerator_sysfs.h @@ -4,8 +4,8 @@ * * device_enumerator_sysfs.h - sysfs-based device enumerator */ -#ifndef __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_SYSFS_H__ -#define __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_SYSFS_H__ + +#pragma once #include #include @@ -28,5 +28,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_SYSFS_H__ */ diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h index c035298081b4..1b3360df31ba 100644 --- a/include/libcamera/internal/device_enumerator_udev.h +++ b/include/libcamera/internal/device_enumerator_udev.h @@ -4,8 +4,8 @@ * * device_enumerator_udev.h - udev-based device enumerator */ -#ifndef __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_UDEV_H__ -#define __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_UDEV_H__ + +#pragma once #include #include @@ -71,5 +71,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_DEVICE_ENUMERATOR_UDEV_H__ */ diff --git a/include/libcamera/internal/formats.h b/include/libcamera/internal/formats.h index 5ebc68f91cda..ee599765be47 100644 --- a/include/libcamera/internal/formats.h +++ b/include/libcamera/internal/formats.h @@ -5,8 +5,7 @@ * formats.h - libcamera image formats */ -#ifndef __LIBCAMERA_INTERNAL_FORMATS_H__ -#define __LIBCAMERA_INTERNAL_FORMATS_H__ +#pragma once #include #include @@ -68,5 +67,3 @@ public: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_FORMATS_H__ */ diff --git a/include/libcamera/internal/framebuffer.h b/include/libcamera/internal/framebuffer.h index cd33c295466e..908b478985e7 100644 --- a/include/libcamera/internal/framebuffer.h +++ b/include/libcamera/internal/framebuffer.h @@ -4,8 +4,8 @@ * * framebuffer.h - Internal frame buffer handling */ -#ifndef __LIBCAMERA_INTERNAL_FRAMEBUFFER_H__ -#define __LIBCAMERA_INTERNAL_FRAMEBUFFER_H__ + +#pragma once #include @@ -29,5 +29,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_FRAMEBUFFER_H__ */ diff --git a/include/libcamera/internal/ipa_data_serializer.h b/include/libcamera/internal/ipa_data_serializer.h index 4353e07b572d..c2f602d5b7de 100644 --- a/include/libcamera/internal/ipa_data_serializer.h +++ b/include/libcamera/internal/ipa_data_serializer.h @@ -4,8 +4,8 @@ * * ipa_data_serializer.h - Image Processing Algorithm data serializer */ -#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_H__ -#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_H__ + +#pragma once #include #include @@ -304,5 +304,3 @@ public: #endif /* __DOXYGEN__ */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_H__ */ diff --git a/include/libcamera/internal/ipa_manager.h b/include/libcamera/internal/ipa_manager.h index 0687842e5c06..7f36e58e8bfa 100644 --- a/include/libcamera/internal/ipa_manager.h +++ b/include/libcamera/internal/ipa_manager.h @@ -4,8 +4,8 @@ * * ipa_manager.h - Image Processing Algorithm module manager */ -#ifndef __LIBCAMERA_INTERNAL_IPA_MANAGER_H__ -#define __LIBCAMERA_INTERNAL_IPA_MANAGER_H__ + +#pragma once #include #include @@ -68,5 +68,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_MANAGER_H__ */ diff --git a/include/libcamera/internal/ipa_module.h b/include/libcamera/internal/ipa_module.h index a87f56502b9a..8038bdee6b3c 100644 --- a/include/libcamera/internal/ipa_module.h +++ b/include/libcamera/internal/ipa_module.h @@ -4,8 +4,8 @@ * * ipa_module.h - Image Processing Algorithm module */ -#ifndef __LIBCAMERA_INTERNAL_IPA_MODULE_H__ -#define __LIBCAMERA_INTERNAL_IPA_MODULE_H__ + +#pragma once #include #include @@ -58,5 +58,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_MODULE_H__ */ diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h index ea9f0760c2fc..781c8b623605 100644 --- a/include/libcamera/internal/ipa_proxy.h +++ b/include/libcamera/internal/ipa_proxy.h @@ -4,8 +4,8 @@ * * ipa_proxy.h - Image Processing Algorithm proxy */ -#ifndef __LIBCAMERA_INTERNAL_IPA_PROXY_H__ -#define __LIBCAMERA_INTERNAL_IPA_PROXY_H__ + +#pragma once #include #include @@ -44,5 +44,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_H__ */ diff --git a/include/libcamera/internal/ipc_pipe.h b/include/libcamera/internal/ipc_pipe.h index 52cc8fa30838..bd8824f255c2 100644 --- a/include/libcamera/internal/ipc_pipe.h +++ b/include/libcamera/internal/ipc_pipe.h @@ -4,8 +4,8 @@ * * ipc_pipe.h - Image Processing Algorithm IPC module for IPA proxies */ -#ifndef __LIBCAMERA_INTERNAL_IPA_IPC_H__ -#define __LIBCAMERA_INTERNAL_IPA_IPC_H__ + +#pragma once #include @@ -67,5 +67,3 @@ protected: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_IPC_H__ */ diff --git a/include/libcamera/internal/ipc_pipe_unixsocket.h b/include/libcamera/internal/ipc_pipe_unixsocket.h index ad2927fed7f0..004d953989c6 100644 --- a/include/libcamera/internal/ipc_pipe_unixsocket.h +++ b/include/libcamera/internal/ipc_pipe_unixsocket.h @@ -4,8 +4,8 @@ * * ipc_pipe_unixsocket.h - Image Processing Algorithm IPC module using unix socket */ -#ifndef __LIBCAMERA_INTERNAL_IPA_IPC_UNIXSOCKET_H__ -#define __LIBCAMERA_INTERNAL_IPA_IPC_UNIXSOCKET_H__ + +#pragma once #include #include @@ -45,5 +45,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_IPC_UNIXSOCKET_H__ */ diff --git a/include/libcamera/internal/ipc_unixsocket.h b/include/libcamera/internal/ipc_unixsocket.h index 2b87196c4851..5010b66a2bda 100644 --- a/include/libcamera/internal/ipc_unixsocket.h +++ b/include/libcamera/internal/ipc_unixsocket.h @@ -5,8 +5,7 @@ * ipc_unixsocket.h - IPC mechanism based on Unix sockets */ -#ifndef __LIBCAMERA_INTERNAL_IPC_UNIXSOCKET_H__ -#define __LIBCAMERA_INTERNAL_IPC_UNIXSOCKET_H__ +#pragma once #include #include @@ -57,5 +56,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPC_UNIXSOCKET_H__ */ diff --git a/include/libcamera/internal/mapped_framebuffer.h b/include/libcamera/internal/mapped_framebuffer.h index 70ffbcbea078..fb39adbf5796 100644 --- a/include/libcamera/internal/mapped_framebuffer.h +++ b/include/libcamera/internal/mapped_framebuffer.h @@ -4,8 +4,8 @@ * * mapped_framebuffer.h - Frame buffer memory mapping support */ -#ifndef __LIBCAMERA_INTERNAL_MAPPED_FRAMEBUFFER_H__ -#define __LIBCAMERA_INTERNAL_MAPPED_FRAMEBUFFER_H__ + +#pragma once #include #include @@ -60,5 +60,3 @@ public: LIBCAMERA_FLAGS_ENABLE_OPERATORS(MappedFrameBuffer::MapFlag) } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_MAPPED_FRAMEBUFFER_H__ */ diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h index 1f2304c19281..d636e34a8573 100644 --- a/include/libcamera/internal/media_device.h +++ b/include/libcamera/internal/media_device.h @@ -4,8 +4,8 @@ * * media_device.h - Media device handler */ -#ifndef __LIBCAMERA_INTERNAL_MEDIA_DEVICE_H__ -#define __LIBCAMERA_INTERNAL_MEDIA_DEVICE_H__ + +#pragma once #include #include @@ -92,5 +92,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_MEDIA_DEVICE_H__ */ diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index 6ae22c679cc5..90c635983ba7 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -4,8 +4,8 @@ * * media_object.h - Media Device objects: entities, pads and links. */ -#ifndef __LIBCAMERA_INTERNAL_MEDIA_OBJECT_H__ -#define __LIBCAMERA_INTERNAL_MEDIA_OBJECT_H__ + +#pragma once #include #include @@ -132,5 +132,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_MEDIA_OBJECT_H__ */ diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 41cba44d990f..3de27ae93645 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -4,8 +4,8 @@ * * pipeline_handler.h - Pipeline handler infrastructure */ -#ifndef __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__ -#define __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__ + +#pragma once #include #include @@ -118,5 +118,3 @@ private: \ static handler##Factory global_##handler##Factory; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_PIPELINE_HANDLER_H__ */ diff --git a/include/libcamera/internal/process.h b/include/libcamera/internal/process.h index 300e0521eb03..96748a3676e4 100644 --- a/include/libcamera/internal/process.h +++ b/include/libcamera/internal/process.h @@ -4,8 +4,8 @@ * * process.h - Process object */ -#ifndef __LIBCAMERA_INTERNAL_PROCESS_H__ -#define __LIBCAMERA_INTERNAL_PROCESS_H__ + +#pragma once #include #include @@ -80,5 +80,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_PROCESS_H__ */ diff --git a/include/libcamera/internal/pub_key.h b/include/libcamera/internal/pub_key.h index 9261c9c2a0ee..a22ba037cff6 100644 --- a/include/libcamera/internal/pub_key.h +++ b/include/libcamera/internal/pub_key.h @@ -4,8 +4,8 @@ * * pub_key.h - Public key signature verification */ -#ifndef __LIBCAMERA_INTERNAL_PUB_KEY_H__ -#define __LIBCAMERA_INTERNAL_PUB_KEY_H__ + +#pragma once #include @@ -34,5 +34,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_PUB_KEY_H__ */ diff --git a/include/libcamera/internal/source_paths.h b/include/libcamera/internal/source_paths.h index 111c25b00b43..be6f153b49db 100644 --- a/include/libcamera/internal/source_paths.h +++ b/include/libcamera/internal/source_paths.h @@ -4,8 +4,8 @@ * * source_paths.h - Identify libcamera source and build paths */ -#ifndef __LIBCAMERA_INTERNAL_SOURCE_PATHS_H__ -#define __LIBCAMERA_INTERNAL_SOURCE_PATHS_H__ + +#pragma once #include @@ -15,5 +15,3 @@ std::string libcameraBuildPath(); std::string libcameraSourcePath(); } /* namespace libcamera::utils */ - -#endif /* __LIBCAMERA_INTERNAL_SOURCE_PATHS_H__ */ diff --git a/include/libcamera/internal/sysfs.h b/include/libcamera/internal/sysfs.h index bc6c1620b55d..917457bef6e2 100644 --- a/include/libcamera/internal/sysfs.h +++ b/include/libcamera/internal/sysfs.h @@ -4,8 +4,8 @@ * * sysfs.h - Miscellaneous utility functions to access sysfs */ -#ifndef __LIBCAMERA_INTERNAL_SYSFS_H__ -#define __LIBCAMERA_INTERNAL_SYSFS_H__ + +#pragma once #include @@ -20,5 +20,3 @@ std::string firmwareNodePath(const std::string &device); } /* namespace sysfs */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_SYSFS_H__ */ diff --git a/include/libcamera/internal/tracepoints.h.in b/include/libcamera/internal/tracepoints.h.in index d0fc136598b6..b093bc6b5eda 100644 --- a/include/libcamera/internal/tracepoints.h.in +++ b/include/libcamera/internal/tracepoints.h.in @@ -6,8 +6,8 @@ * * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ -#define __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ + +#pragma once #if HAVE_TRACING #define LIBCAMERA_TRACEPOINT(...) tracepoint(libcamera, __VA_ARGS__) @@ -36,8 +36,6 @@ inline void unused([[maybe_unused]] Args&& ...args) #endif /* HAVE_TRACING */ -#endif /* __LIBCAMERA_INTERNAL_TRACEPOINTS_H__ */ - #if HAVE_TRACING diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index f21bc3701ca0..7816a290141d 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -4,8 +4,8 @@ * * v4l2_device.h - Common base for V4L2 video devices and subdevices */ -#ifndef __LIBCAMERA_INTERNAL_V4L2_DEVICE_H__ -#define __LIBCAMERA_INTERNAL_V4L2_DEVICE_H__ + +#pragma once #include #include @@ -79,5 +79,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_V4L2_DEVICE_H__ */ diff --git a/include/libcamera/internal/v4l2_pixelformat.h b/include/libcamera/internal/v4l2_pixelformat.h index e3cda6997c32..886d534d8c91 100644 --- a/include/libcamera/internal/v4l2_pixelformat.h +++ b/include/libcamera/internal/v4l2_pixelformat.h @@ -5,8 +5,8 @@ * * v4l2_pixelformat.h - V4L2 Pixel Format */ -#ifndef __LIBCAMERA_INTERNAL_V4L2_PIXELFORMAT_H__ -#define __LIBCAMERA_INTERNAL_V4L2_PIXELFORMAT_H__ + +#pragma once #include #include @@ -51,5 +51,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_V4L2_PIXELFORMAT_H__ */ diff --git a/include/libcamera/internal/v4l2_subdevice.h b/include/libcamera/internal/v4l2_subdevice.h index 97b89fb95087..484fcfdda9b1 100644 --- a/include/libcamera/internal/v4l2_subdevice.h +++ b/include/libcamera/internal/v4l2_subdevice.h @@ -4,8 +4,8 @@ * * v4l2_subdevice.h - V4L2 Subdevice */ -#ifndef __LIBCAMERA_INTERNAL_V4L2_SUBDEVICE_H__ -#define __LIBCAMERA_INTERNAL_V4L2_SUBDEVICE_H__ + +#pragma once #include #include @@ -78,5 +78,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_V4L2_SUBDEVICE_H__ */ diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h index a1c458e45088..4a44b7fd53b1 100644 --- a/include/libcamera/internal/v4l2_videodevice.h +++ b/include/libcamera/internal/v4l2_videodevice.h @@ -4,8 +4,8 @@ * * v4l2_videodevice.h - V4L2 Video Device */ -#ifndef __LIBCAMERA_INTERNAL_V4L2_VIDEODEVICE_H__ -#define __LIBCAMERA_INTERNAL_V4L2_VIDEODEVICE_H__ + +#pragma once #include #include @@ -278,5 +278,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_V4L2_VIDEODEVICE_H__ */ From patchwork Tue Nov 23 22:40:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14735 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 A7511BF415 for ; Tue, 23 Nov 2021 22:40:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2A91B604F9; Tue, 23 Nov 2021 23:40:28 +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="NGuImxCu"; 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 7E24A60121 for ; Tue, 23 Nov 2021 23:40:21 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 36AD0F95; Tue, 23 Nov 2021 23:40:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707221; bh=PVSnTH2xPr8zG61fjaqufX7gEYVrpN/7MVkm/wrAtTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NGuImxCuOc7WDUtMcqd8fOBHXSA6ReHWUIgzSfArTop71GeEKhkBGPD6GoQ10z48g nN5NmyZfr890vfnWdpcadJwLwOkGxAh61yn6QZOP2auzU1GRtBoDilF7HhzIgEDwpI 2fNR8qYd0SLEU8Ja2UEewT/lKMIEStPd8HCaAR1w= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:04 +0000 Message-Id: <20211123224015.3619282-5-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 04/15] libcamera: ipa: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- include/libcamera/ipa/ipa_controls.h | 6 ++---- include/libcamera/ipa/ipa_interface.h | 6 ++---- include/libcamera/ipa/ipa_module_info.h | 6 ++---- include/libcamera/ipa/raspberrypi.h | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/include/libcamera/ipa/ipa_controls.h b/include/libcamera/ipa/ipa_controls.h index eec34d9267af..da1a759618e0 100644 --- a/include/libcamera/ipa/ipa_controls.h +++ b/include/libcamera/ipa/ipa_controls.h @@ -4,8 +4,8 @@ * * ipa_controls.h - IPA Control handling */ -#ifndef __LIBCAMERA_IPA_CONTROLS_H__ -#define __LIBCAMERA_IPA_CONTROLS_H__ + +#pragma once #include @@ -50,5 +50,3 @@ struct ipa_control_info_entry { #ifdef __cplusplus } #endif - -#endif /* __LIBCAMERA_IPA_CONTROLS_H__ */ diff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h index 1590584c1fb4..50ca0e7b0359 100644 --- a/include/libcamera/ipa/ipa_interface.h +++ b/include/libcamera/ipa/ipa_interface.h @@ -4,8 +4,8 @@ * * ipa_interface.h - Image Processing Algorithm interface */ -#ifndef __LIBCAMERA_IPA_INTERFACE_H__ -#define __LIBCAMERA_IPA_INTERFACE_H__ + +#pragma once #include #include @@ -37,5 +37,3 @@ public: extern "C" { libcamera::IPAInterface *ipaCreate(); } - -#endif /* __LIBCAMERA_IPA_INTERFACE_H__ */ diff --git a/include/libcamera/ipa/ipa_module_info.h b/include/libcamera/ipa/ipa_module_info.h index 3b1c37d2a7f1..b19b00f71a9b 100644 --- a/include/libcamera/ipa/ipa_module_info.h +++ b/include/libcamera/ipa/ipa_module_info.h @@ -4,8 +4,8 @@ * * ipa_module_info.h - Image Processing Algorithm module information */ -#ifndef __LIBCAMERA_IPA_MODULE_INFO_H__ -#define __LIBCAMERA_IPA_MODULE_INFO_H__ + +#pragma once #include @@ -25,5 +25,3 @@ extern const struct IPAModuleInfo ipaModuleInfo; } } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_MODULE_INFO_H__ */ diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h index 521eaecd19b2..7f705e49411d 100644 --- a/include/libcamera/ipa/raspberrypi.h +++ b/include/libcamera/ipa/raspberrypi.h @@ -4,8 +4,8 @@ * * raspberrypi.h - Image Processing Algorithm interface for Raspberry Pi */ -#ifndef __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__ -#define __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__ + +#pragma once #include @@ -53,5 +53,3 @@ static const ControlInfoMap Controls({ } /* namespace libcamera */ #endif /* __DOXYGEN__ */ - -#endif /* __LIBCAMERA_IPA_INTERFACE_RASPBERRYPI_H__ */ From patchwork Tue Nov 23 22:40:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14736 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 6A4C5C324F for ; Tue, 23 Nov 2021 22:40:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DB37860228; Tue, 23 Nov 2021 23:40:28 +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="IfDO2htM"; 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 B72DA6038A for ; Tue, 23 Nov 2021 23:40:21 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 6FD13A1B; Tue, 23 Nov 2021 23:40:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707221; bh=pgZdaC2G2P1FufhZ9UkcnPJoaNTQ+viy0oVrkhq5eHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfDO2htMTh6WKlExjB/0Zo2vZaDxBI5bcdq5JM4EcyDYK2zjyYMQf0vvVBuKiBdYb 6TDbtuysgKtpAoAUzHdBlpphriz25G7un1XjM1Te8aUrHRxtiRHYKwuNZnq/QzvDLI IpwhlcFbHv6aNgcQ+lM8zxx9B8d2YNnIOd5I/eMQ= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:05 +0000 Message-Id: <20211123224015.3619282-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/15] libcamera: pipeline: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/libcamera/pipeline/ipu3/cio2.h | 6 ++---- src/libcamera/pipeline/ipu3/frames.h | 6 ++---- src/libcamera/pipeline/ipu3/imgu.h | 6 ++---- src/libcamera/pipeline/raspberrypi/dma_heaps.h | 6 ++---- src/libcamera/pipeline/raspberrypi/rpi_stream.h | 6 ++---- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 6 ++---- src/libcamera/pipeline/simple/converter.h | 5 +---- 7 files changed, 13 insertions(+), 28 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h index ba8f0052c5b3..68504a2da89d 100644 --- a/src/libcamera/pipeline/ipu3/cio2.h +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -4,8 +4,8 @@ * * cio2.h - Intel IPU3 CIO2 */ -#ifndef __LIBCAMERA_PIPELINE_IPU3_CIO2_H__ -#define __LIBCAMERA_PIPELINE_IPU3_CIO2_H__ + +#pragma once #include #include @@ -75,5 +75,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_IPU3_CIO2_H__ */ diff --git a/src/libcamera/pipeline/ipu3/frames.h b/src/libcamera/pipeline/ipu3/frames.h index 614701e2da2d..6e3cb915c7b8 100644 --- a/src/libcamera/pipeline/ipu3/frames.h +++ b/src/libcamera/pipeline/ipu3/frames.h @@ -4,8 +4,8 @@ * * frames.h - Intel IPU3 Frames helper */ -#ifndef __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__ -#define __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__ + +#pragma once #include #include @@ -65,5 +65,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_IPU3_FRAMES_H__ */ diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h index 2b28d912676a..0af4dd8ae86e 100644 --- a/src/libcamera/pipeline/ipu3/imgu.h +++ b/src/libcamera/pipeline/ipu3/imgu.h @@ -4,8 +4,8 @@ * * imgu.h - Intel IPU3 ImgU */ -#ifndef __LIBCAMERA_PIPELINE_IPU3_IMGU_H__ -#define __LIBCAMERA_PIPELINE_IPU3_IMGU_H__ + +#pragma once #include #include @@ -122,5 +122,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_IPU3_IMGU_H__ */ diff --git a/src/libcamera/pipeline/raspberrypi/dma_heaps.h b/src/libcamera/pipeline/raspberrypi/dma_heaps.h index 79f39c5153d3..38dfc242c0b9 100644 --- a/src/libcamera/pipeline/raspberrypi/dma_heaps.h +++ b/src/libcamera/pipeline/raspberrypi/dma_heaps.h @@ -4,8 +4,8 @@ * * dma_heaps.h - Helper class for dma-heap allocations. */ -#ifndef __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__ -#define __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__ + +#pragma once #include @@ -28,5 +28,3 @@ private: } /* namespace RPi */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_RASPBERRYPI_DMA_HEAPS_H__ */ diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.h b/src/libcamera/pipeline/raspberrypi/rpi_stream.h index f1ac715f4221..d6f49d34f8c8 100644 --- a/src/libcamera/pipeline/raspberrypi/rpi_stream.h +++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.h @@ -4,8 +4,8 @@ * * rpi_stream.h - Raspberry Pi device stream abstraction class. */ -#ifndef __LIBCAMERA_PIPELINE_RPI_STREAM_H__ -#define __LIBCAMERA_PIPELINE_RPI_STREAM_H__ + +#pragma once #include #include @@ -177,5 +177,3 @@ public: } /* namespace RPi */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_RPI_STREAM_H__ */ diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index 91757600ccdc..f3f1ae391d65 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -4,8 +4,8 @@ * * rkisp1path.h - Rockchip ISP1 path helper */ -#ifndef __LIBCAMERA_PIPELINE_RKISP1_PATH_H__ -#define __LIBCAMERA_PIPELINE_RKISP1_PATH_H__ + +#pragma once #include #include @@ -84,5 +84,3 @@ public: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_RKISP1_PATH_H__ */ diff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h index 276a2a291c21..f0ebe2e0123d 100644 --- a/src/libcamera/pipeline/simple/converter.h +++ b/src/libcamera/pipeline/simple/converter.h @@ -5,8 +5,7 @@ * converter.h - Format converter for simple pipeline handler */ -#ifndef __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ -#define __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ +#pragma once #include #include @@ -97,5 +96,3 @@ private: }; } /* namespace libcamera */ - -#endif /* __LIBCAMERA_PIPELINE_SIMPLE_CONVERTER_H__ */ From patchwork Tue Nov 23 22:40:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14737 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 E6E6BBF415 for ; Tue, 23 Nov 2021 22:40:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E303D6048E; Tue, 23 Nov 2021 23:40:29 +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="Ardpms/Q"; 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 E92B660228 for ; Tue, 23 Nov 2021 23:40:21 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A6BFAF95; Tue, 23 Nov 2021 23:40:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707221; bh=PfJPRRTvz3lFXnA9I2TlTN/N7fj1lAka5Kwf4Lbn2Ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ardpms/QzwDaEwPxKLBL6a4ClV1cT6hxhIJcABMK2Ov5sR5gVFO0cYakWOgctv9v+ r7LDBXZ8yg56xqu6/SRmvTxm8fO9k5sayHPCxW+AcinKOfelaP6TPOYSa4MI2F4Ht7 eTokKyGg7pFH35OcEvWf5vjwI4cPD1Q+LQMZhkEA= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:06 +0000 Message-Id: <20211123224015.3619282-7-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 06/15] android: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/android/camera_buffer.h | 5 ++--- src/android/camera_capabilities.h | 6 ++---- src/android/camera_device.h | 6 ++---- src/android/camera_hal_config.h | 5 ++--- src/android/camera_hal_manager.h | 6 ++---- src/android/camera_metadata.h | 6 ++---- src/android/camera_ops.h | 6 ++---- src/android/camera_request.h | 6 ++---- src/android/camera_stream.h | 6 ++---- src/android/camera_worker.h | 6 ++---- src/android/jpeg/encoder.h | 6 ++---- src/android/jpeg/encoder_libjpeg.h | 6 ++---- src/android/jpeg/exif.h | 6 ++---- src/android/jpeg/post_processor_jpeg.h | 6 ++---- src/android/jpeg/thumbnailer.h | 6 ++---- src/android/post_processor.h | 6 ++---- src/android/yuv/post_processor_yuv.h | 6 ++---- 17 files changed, 34 insertions(+), 66 deletions(-) diff --git a/src/android/camera_buffer.h b/src/android/camera_buffer.h index 226a8f5c153b..b4531c800fdb 100644 --- a/src/android/camera_buffer.h +++ b/src/android/camera_buffer.h @@ -4,8 +4,8 @@ * * camera_buffer.h - Frame buffer handling interface definition */ -#ifndef __ANDROID_CAMERA_BUFFER_H__ -#define __ANDROID_CAMERA_BUFFER_H__ + +#pragma once #include @@ -82,4 +82,3 @@ size_t CameraBuffer::jpegBufferSize(size_t maxJpegBufferSize) const \ { \ return _d()->jpegBufferSize(maxJpegBufferSize); \ } -#endif /* __ANDROID_CAMERA_BUFFER_H__ */ diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h index 2cf97ae80095..6f66f221d33f 100644 --- a/src/android/camera_capabilities.h +++ b/src/android/camera_capabilities.h @@ -4,8 +4,8 @@ * * camera_capabilities.h - Camera static properties manager */ -#ifndef __ANDROID_CAMERA_CAPABILITIES_H__ -#define __ANDROID_CAMERA_CAPABILITIES_H__ + +#pragma once #include #include @@ -84,5 +84,3 @@ private: std::set availableRequestKeys_; std::set availableResultKeys_; }; - -#endif /* __ANDROID_CAMERA_CAPABILITIES_H__ */ diff --git a/src/android/camera_device.h b/src/android/camera_device.h index 2a414020f1ad..51fe7da2cb47 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -4,8 +4,8 @@ * * camera_device.h - libcamera Android Camera Device */ -#ifndef __ANDROID_CAMERA_DEVICE_H__ -#define __ANDROID_CAMERA_DEVICE_H__ + +#pragma once #include #include @@ -130,5 +130,3 @@ private: CameraMetadata lastSettings_; }; - -#endif /* __ANDROID_CAMERA_DEVICE_H__ */ diff --git a/src/android/camera_hal_config.h b/src/android/camera_hal_config.h index a79d5d6c42dc..9df554f9929b 100644 --- a/src/android/camera_hal_config.h +++ b/src/android/camera_hal_config.h @@ -4,8 +4,8 @@ * * camera_hal_config.h - Camera HAL configuration file manager */ -#ifndef __ANDROID_CAMERA_HAL_CONFIG_H__ -#define __ANDROID_CAMERA_HAL_CONFIG_H__ + +#pragma once #include #include @@ -36,4 +36,3 @@ private: int parseConfigurationFile(); }; -#endif /* __ANDROID_CAMERA_HAL_CONFIG_H__ */ diff --git a/src/android/camera_hal_manager.h b/src/android/camera_hal_manager.h index 3f6d302ad615..192f2fc56540 100644 --- a/src/android/camera_hal_manager.h +++ b/src/android/camera_hal_manager.h @@ -4,8 +4,8 @@ * * camera_hal_manager.h - libcamera Android Camera Manager */ -#ifndef __ANDROID_CAMERA_MANAGER_H__ -#define __ANDROID_CAMERA_MANAGER_H__ + +#pragma once #include #include @@ -69,5 +69,3 @@ private: unsigned int numInternalCameras_; unsigned int nextExternalCameraId_; }; - -#endif /* __ANDROID_CAMERA_MANAGER_H__ */ diff --git a/src/android/camera_metadata.h b/src/android/camera_metadata.h index 8555c7c3aaff..e70f60afdc01 100644 --- a/src/android/camera_metadata.h +++ b/src/android/camera_metadata.h @@ -4,8 +4,8 @@ * * camera_metadata.h - libcamera Android Camera Metadata Helper */ -#ifndef __ANDROID_CAMERA_METADATA_H__ -#define __ANDROID_CAMERA_METADATA_H__ + +#pragma once #include #include @@ -99,5 +99,3 @@ private: bool valid_; bool resized_; }; - -#endif /* __ANDROID_CAMERA_METADATA_H__ */ diff --git a/src/android/camera_ops.h b/src/android/camera_ops.h index 304e7b856e81..b501bb7ef639 100644 --- a/src/android/camera_ops.h +++ b/src/android/camera_ops.h @@ -4,12 +4,10 @@ * * camera_ops.h - Android Camera HAL Operations */ -#ifndef __ANDROID_CAMERA_OPS_H__ -#define __ANDROID_CAMERA_OPS_H__ + +#pragma once #include int hal_dev_close(hw_device_t *hw_device); extern camera3_device_ops hal_dev_ops; - -#endif /* __ANDROID_CAMERA_OPS_H__ */ diff --git a/src/android/camera_request.h b/src/android/camera_request.h index 8d1204e5590b..f3cb6d643961 100644 --- a/src/android/camera_request.h +++ b/src/android/camera_request.h @@ -4,8 +4,8 @@ * * camera_request.h - libcamera Android Camera Request Descriptor */ -#ifndef __ANDROID_CAMERA_REQUEST_H__ -#define __ANDROID_CAMERA_REQUEST_H__ + +#pragma once #include #include @@ -80,5 +80,3 @@ public: private: LIBCAMERA_DISABLE_COPY(Camera3RequestDescriptor) }; - -#endif /* __ANDROID_CAMERA_REQUEST_H__ */ diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h index 0c402deb4e8d..e9da75f0fed8 100644 --- a/src/android/camera_stream.h +++ b/src/android/camera_stream.h @@ -4,8 +4,8 @@ * * camera_stream.h - Camera HAL stream */ -#ifndef __ANDROID_CAMERA_STREAM_H__ -#define __ANDROID_CAMERA_STREAM_H__ + +#pragma once #include #include @@ -179,5 +179,3 @@ private: std::unique_ptr worker_; }; - -#endif /* __ANDROID_CAMERA_STREAM__ */ diff --git a/src/android/camera_worker.h b/src/android/camera_worker.h index c94f16325925..26ecc2732046 100644 --- a/src/android/camera_worker.h +++ b/src/android/camera_worker.h @@ -4,8 +4,8 @@ * * camera_worker.h - Process capture requests on behalf of the Camera HAL */ -#ifndef __ANDROID_CAMERA_WORKER_H__ -#define __ANDROID_CAMERA_WORKER_H__ + +#pragma once #include #include @@ -68,5 +68,3 @@ private: Worker worker_; }; - -#endif /* __ANDROID_CAMERA_WORKER_H__ */ diff --git a/src/android/jpeg/encoder.h b/src/android/jpeg/encoder.h index a28522f41714..b974d367d8fa 100644 --- a/src/android/jpeg/encoder.h +++ b/src/android/jpeg/encoder.h @@ -4,8 +4,8 @@ * * encoder.h - Image encoding interface */ -#ifndef __ANDROID_JPEG_ENCODER_H__ -#define __ANDROID_JPEG_ENCODER_H__ + +#pragma once #include @@ -23,5 +23,3 @@ public: libcamera::Span exifData, unsigned int quality) = 0; }; - -#endif /* __ANDROID_JPEG_ENCODER_H__ */ diff --git a/src/android/jpeg/encoder_libjpeg.h b/src/android/jpeg/encoder_libjpeg.h index 45ffbd7fae5d..1b3ac067a1c0 100644 --- a/src/android/jpeg/encoder_libjpeg.h +++ b/src/android/jpeg/encoder_libjpeg.h @@ -4,8 +4,8 @@ * * encoder_libjpeg.h - JPEG encoding using libjpeg */ -#ifndef __ANDROID_JPEG_ENCODER_LIBJPEG_H__ -#define __ANDROID_JPEG_ENCODER_LIBJPEG_H__ + +#pragma once #include "encoder.h" @@ -43,5 +43,3 @@ private: bool nv_; bool nvSwap_; }; - -#endif /* __ANDROID_JPEG_ENCODER_LIBJPEG_H__ */ diff --git a/src/android/jpeg/exif.h b/src/android/jpeg/exif.h index 23b0e0974459..2ff8fb78abce 100644 --- a/src/android/jpeg/exif.h +++ b/src/android/jpeg/exif.h @@ -4,8 +4,8 @@ * * exif.h - EXIF tag creator using libexif */ -#ifndef __ANDROID_JPEG_EXIF_H__ -#define __ANDROID_JPEG_EXIF_H__ + +#pragma once #include #include @@ -107,5 +107,3 @@ private: unsigned char *exifData_; unsigned int size_; }; - -#endif /* __ANDROID_JPEG_EXIF_H__ */ diff --git a/src/android/jpeg/post_processor_jpeg.h b/src/android/jpeg/post_processor_jpeg.h index 43fcbe60bb26..98309b012a3b 100644 --- a/src/android/jpeg/post_processor_jpeg.h +++ b/src/android/jpeg/post_processor_jpeg.h @@ -4,8 +4,8 @@ * * post_processor_jpeg.h - JPEG Post Processor */ -#ifndef __ANDROID_POST_PROCESSOR_JPEG_H__ -#define __ANDROID_POST_PROCESSOR_JPEG_H__ + +#pragma once #include "../post_processor.h" #include "encoder_libjpeg.h" @@ -36,5 +36,3 @@ private: EncoderLibJpeg thumbnailEncoder_; Thumbnailer thumbnailer_; }; - -#endif /* __ANDROID_POST_PROCESSOR_JPEG_H__ */ diff --git a/src/android/jpeg/thumbnailer.h b/src/android/jpeg/thumbnailer.h index 4d086c4943b0..d933cf0e31f1 100644 --- a/src/android/jpeg/thumbnailer.h +++ b/src/android/jpeg/thumbnailer.h @@ -4,8 +4,8 @@ * * thumbnailer.h - Simple image thumbnailer */ -#ifndef __ANDROID_JPEG_THUMBNAILER_H__ -#define __ANDROID_JPEG_THUMBNAILER_H__ + +#pragma once #include #include @@ -30,5 +30,3 @@ private: bool valid_; }; - -#endif /* __ANDROID_JPEG_THUMBNAILER_H__ */ diff --git a/src/android/post_processor.h b/src/android/post_processor.h index 5ec71c93f40a..1a205b05e842 100644 --- a/src/android/post_processor.h +++ b/src/android/post_processor.h @@ -4,8 +4,8 @@ * * post_processor.h - CameraStream Post Processing Interface */ -#ifndef __ANDROID_POST_PROCESSOR_H__ -#define __ANDROID_POST_PROCESSOR_H__ + +#pragma once #include @@ -31,5 +31,3 @@ public: libcamera::Signal processComplete; }; - -#endif /* __ANDROID_POST_PROCESSOR_H__ */ diff --git a/src/android/yuv/post_processor_yuv.h b/src/android/yuv/post_processor_yuv.h index 39ec7994c0c0..a7ac17c564b6 100644 --- a/src/android/yuv/post_processor_yuv.h +++ b/src/android/yuv/post_processor_yuv.h @@ -4,8 +4,8 @@ * * post_processor_yuv.h - Post Processor using libyuv */ -#ifndef __ANDROID_POST_PROCESSOR_YUV_H__ -#define __ANDROID_POST_PROCESSOR_YUV_H__ + +#pragma once #include "../post_processor.h" @@ -33,5 +33,3 @@ private: unsigned int sourceStride_[2] = {}; unsigned int destinationStride_[2] = {}; }; - -#endif /* __ANDROID_POST_PROCESSOR_YUV_H__ */ From patchwork Tue Nov 23 22:40:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14738 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 71AB1C3250 for ; Tue, 23 Nov 2021 22:40:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E00BC604FD; Tue, 23 Nov 2021 23:40:30 +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="VvZn2hrr"; 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 3448D6022F for ; Tue, 23 Nov 2021 23:40:22 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DE109A1B; Tue, 23 Nov 2021 23:40:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707222; bh=6q3mUWZZVUcQAe99GQHwPuATVYTMqKu9oqegzWLA470=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VvZn2hrrZ1xzo2NHmRuCUaOEwmonME0NN3Xb1uNOLmOVjSGdOgtNS14KnwOM8Oiab cqG043hXCMBSlNmDgPVc4P3g1yxvPvjNn7VNX/r8WJXfU+rLaUkhVNYasRW3d01xMN e0f1Wz840K4FoZ2w4H0Gx2wqMchVCran2fGf8Vq4= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:07 +0000 Message-Id: <20211123224015.3619282-8-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 07/15] cam: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/cam/camera_session.h | 6 ++---- src/cam/drm.h | 6 ++---- src/cam/event_loop.h | 6 ++---- src/cam/file_sink.h | 6 ++---- src/cam/frame_sink.h | 6 ++---- src/cam/image.h | 6 ++---- src/cam/kms_sink.h | 6 ++---- src/cam/main.h | 6 ++---- src/cam/options.h | 6 ++---- src/cam/stream_options.h | 6 ++---- 10 files changed, 20 insertions(+), 40 deletions(-) diff --git a/src/cam/camera_session.h b/src/cam/camera_session.h index a7f92d61307e..bf966bd15ab0 100644 --- a/src/cam/camera_session.h +++ b/src/cam/camera_session.h @@ -4,8 +4,8 @@ * * camera_session.h - Camera capture session */ -#ifndef __CAM_CAMERA_SESSION_H__ -#define __CAM_CAMERA_SESSION_H__ + +#pragma once #include #include @@ -74,5 +74,3 @@ private: std::unique_ptr allocator_; std::vector> requests_; }; - -#endif /* __CAM_CAMERA_SESSION_H__ */ diff --git a/src/cam/drm.h b/src/cam/drm.h index 0b88f9a33912..de57e4457951 100644 --- a/src/cam/drm.h +++ b/src/cam/drm.h @@ -4,8 +4,8 @@ * * drm.h - DRM/KMS Helpers */ -#ifndef __CAM_DRM_H__ -#define __CAM_DRM_H__ + +#pragma once #include #include @@ -330,5 +330,3 @@ private: }; } /* namespace DRM */ - -#endif /* __CAM_DRM_H__ */ diff --git a/src/cam/event_loop.h b/src/cam/event_loop.h index 57bb6fb34aa7..a4613eb29b30 100644 --- a/src/cam/event_loop.h +++ b/src/cam/event_loop.h @@ -4,8 +4,8 @@ * * event_loop.h - cam - Event loop */ -#ifndef __CAM_EVENT_LOOP_H__ -#define __CAM_EVENT_LOOP_H__ + +#pragma once #include #include @@ -61,5 +61,3 @@ private: void *param); void dispatchCall(); }; - -#endif /* __CAM_EVENT_LOOP_H__ */ diff --git a/src/cam/file_sink.h b/src/cam/file_sink.h index 8de93a01a1e8..067736f5b8db 100644 --- a/src/cam/file_sink.h +++ b/src/cam/file_sink.h @@ -4,8 +4,8 @@ * * file_sink.h - File Sink */ -#ifndef __CAM_FILE_SINK_H__ -#define __CAM_FILE_SINK_H__ + +#pragma once #include #include @@ -38,5 +38,3 @@ private: std::string pattern_; std::map> mappedBuffers_; }; - -#endif /* __CAM_FILE_SINK_H__ */ diff --git a/src/cam/frame_sink.h b/src/cam/frame_sink.h index 76e1fc30a905..ca4347cb2650 100644 --- a/src/cam/frame_sink.h +++ b/src/cam/frame_sink.h @@ -4,8 +4,8 @@ * * frame_sink.h - Base Frame Sink Class */ -#ifndef __CAM_FRAME_SINK_H__ -#define __CAM_FRAME_SINK_H__ + +#pragma once #include @@ -30,5 +30,3 @@ public: virtual bool processRequest(libcamera::Request *request) = 0; libcamera::Signal requestProcessed; }; - -#endif /* __CAM_FRAME_SINK_H__ */ diff --git a/src/cam/image.h b/src/cam/image.h index f7fc5b271de8..7953b1776782 100644 --- a/src/cam/image.h +++ b/src/cam/image.h @@ -4,8 +4,8 @@ * * image.h - Multi-planar image with access to pixel data */ -#ifndef __CAM_IMAGE_H__ -#define __CAM_IMAGE_H__ + +#pragma once #include #include @@ -48,5 +48,3 @@ private: namespace libcamera { LIBCAMERA_FLAGS_ENABLE_OPERATORS(Image::MapMode) } - -#endif /* __CAM_IMAGE_H__ */ diff --git a/src/cam/kms_sink.h b/src/cam/kms_sink.h index 072ef1c90793..1e4290adba21 100644 --- a/src/cam/kms_sink.h +++ b/src/cam/kms_sink.h @@ -4,8 +4,8 @@ * * kms_sink.h - KMS Sink */ -#ifndef __CAM_KMS_SINK_H__ -#define __CAM_KMS_SINK_H__ + +#pragma once #include #include @@ -68,5 +68,3 @@ private: std::unique_ptr queued_; std::unique_ptr active_; }; - -#endif /* __CAM_KMS_SINK_H__ */ diff --git a/src/cam/main.h b/src/cam/main.h index 1c2fab763698..62f7bbc9d181 100644 --- a/src/cam/main.h +++ b/src/cam/main.h @@ -4,8 +4,8 @@ * * main.h - Cam application */ -#ifndef __CAM_MAIN_H__ -#define __CAM_MAIN_H__ + +#pragma once enum { OptCamera = 'c', @@ -22,5 +22,3 @@ enum { OptStrictFormats = 257, OptMetadata = 258, }; - -#endif /* __CAM_MAIN_H__ */ diff --git a/src/cam/options.h b/src/cam/options.h index 0047b4f220ed..4ddd49874b83 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -4,8 +4,8 @@ * * options.h - cam - Options parsing */ -#ifndef __CAM_OPTIONS_H__ -#define __CAM_OPTIONS_H__ + +#pragma once #include #include @@ -155,5 +155,3 @@ private: std::vector array_; OptionsParser::Options children_; }; - -#endif /* __CAM_OPTIONS_H__ */ diff --git a/src/cam/stream_options.h b/src/cam/stream_options.h index fbbc13a3cc97..d235b77fb38f 100644 --- a/src/cam/stream_options.h +++ b/src/cam/stream_options.h @@ -4,8 +4,8 @@ * * stream_options.h - Helper to parse options for streams */ -#ifndef __CAM_STREAM_OPTIONS_H__ -#define __CAM_STREAM_OPTIONS_H__ + +#pragma once #include @@ -26,5 +26,3 @@ private: static bool parseRole(libcamera::StreamRole *role, const KeyValueParser::Options &options); }; - -#endif /* __CAM_STREAM_OPTIONS_H__ */ From patchwork Tue Nov 23 22:40:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14739 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 55C3EBF415 for ; Tue, 23 Nov 2021 22:40:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0E53760490; Tue, 23 Nov 2021 23:40:37 +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="soNRU1FH"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 70825603C4 for ; Tue, 23 Nov 2021 23:40:22 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 24BD1F95; Tue, 23 Nov 2021 23:40:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707222; bh=bKExQQelqOacY2dtx5kgKCHOjiTJN0hvCEns6b2dnPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=soNRU1FHlsQ045gqkHAhnJsWXTB5bIMuDwWAKI6UhZg4wL2GzOZKVDVg64HribRHu 72KpqPjbZ5ixfT12d/a9KHa1MgH5Z4TzGjgWnis1ibrBB/6LsDYzkWugUyCYQ2FaOD M6///4GwuABv/518coCfSCqcaov5EOmbsag0rnsw= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:08 +0000 Message-Id: <20211123224015.3619282-9-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 08/15] gstreamer: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/gstreamer/gstlibcamera-utils.h | 5 +---- src/gstreamer/gstlibcameraallocator.h | 5 +---- src/gstreamer/gstlibcamerapad.h | 5 +---- src/gstreamer/gstlibcamerapool.h | 6 +----- src/gstreamer/gstlibcameraprovider.h | 6 +----- src/gstreamer/gstlibcamerasrc.h | 5 +---- 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/gstreamer/gstlibcamera-utils.h b/src/gstreamer/gstlibcamera-utils.h index 7087fef0a94d..d54f15885d0c 100644 --- a/src/gstreamer/gstlibcamera-utils.h +++ b/src/gstreamer/gstlibcamera-utils.h @@ -6,8 +6,7 @@ * gstlibcamera-utils.h - GStreamer libcamera Utility Functions */ -#ifndef __GST_LIBCAMERA_UTILS_H__ -#define __GST_LIBCAMERA_UTILS_H__ +#pragma once #include #include @@ -71,5 +70,3 @@ public: private: GRecMutex *mutex_; }; - -#endif /* __GST_LIBCAMERA_UTILS_H__ */ diff --git a/src/gstreamer/gstlibcameraallocator.h b/src/gstreamer/gstlibcameraallocator.h index 0dbd00d00a20..0a08c3bb3bbe 100644 --- a/src/gstreamer/gstlibcameraallocator.h +++ b/src/gstreamer/gstlibcameraallocator.h @@ -6,8 +6,7 @@ * gstlibcameraallocator.h - GStreamer Custom Allocator */ -#ifndef __GST_LIBCAMERA_ALLOCATOR_H__ -#define __GST_LIBCAMERA_ALLOCATOR_H__ +#pragma once #include #include @@ -30,5 +29,3 @@ gsize gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *allocator, libcamera::Stream *stream); libcamera::FrameBuffer *gst_libcamera_memory_get_frame_buffer(GstMemory *mem); - -#endif /* __GST_LIBCAMERA_ALLOCATOR_H__ */ diff --git a/src/gstreamer/gstlibcamerapad.h b/src/gstreamer/gstlibcamerapad.h index 779f2d13887a..207695173313 100644 --- a/src/gstreamer/gstlibcamerapad.h +++ b/src/gstreamer/gstlibcamerapad.h @@ -6,8 +6,7 @@ * gstlibcamerapad.h - GStreamer Capture Element */ -#ifndef __GST_LIBCAMERA_PAD_H__ -#define __GST_LIBCAMERA_PAD_H__ +#pragma once #include "gstlibcamerapool.h" @@ -33,5 +32,3 @@ GstFlowReturn gst_libcamera_pad_push_pending(GstPad *pad); bool gst_libcamera_pad_has_pending(GstPad *pad); void gst_libcamera_pad_set_latency(GstPad *pad, GstClockTime latency); - -#endif /* __GST_LIBCAMERA_PAD_H__ */ diff --git a/src/gstreamer/gstlibcamerapool.h b/src/gstreamer/gstlibcamerapool.h index a3f1b685e22e..05795d21223e 100644 --- a/src/gstreamer/gstlibcamerapool.h +++ b/src/gstreamer/gstlibcamerapool.h @@ -9,8 +9,7 @@ * only. This pool cannot be configured or activated. */ -#ifndef __GST_LIBCAMERA_POOL_H__ -#define __GST_LIBCAMERA_POOL_H__ +#pragma once #include "gstlibcameraallocator.h" @@ -29,6 +28,3 @@ libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self); libcamera::Stream *gst_libcamera_buffer_get_stream(GstBuffer *buffer); libcamera::FrameBuffer *gst_libcamera_buffer_get_frame_buffer(GstBuffer *buffer); - - -#endif /* __GST_LIBCAMERA_POOL_H__ */ diff --git a/src/gstreamer/gstlibcameraprovider.h b/src/gstreamer/gstlibcameraprovider.h index bdd19db80df1..aaceabf5eff2 100644 --- a/src/gstreamer/gstlibcameraprovider.h +++ b/src/gstreamer/gstlibcameraprovider.h @@ -6,8 +6,7 @@ * gstlibcameraprovider.h - GStreamer Device Provider */ -#ifndef __GST_LIBCAMERA_PROVIDER_H__ -#define __GST_LIBCAMERA_PROVIDER_H__ +#pragma once #include @@ -18,6 +17,3 @@ G_DECLARE_FINAL_TYPE(GstLibcameraProvider, gst_libcamera_provider, GST_LIBCAMERA, PROVIDER, GstDeviceProvider) G_END_DECLS - -#endif /* __GST_LIBCAMERA_PROVIDER_H__ */ - diff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h index 0144cbc42fa6..fdea2f10d95d 100644 --- a/src/gstreamer/gstlibcamerasrc.h +++ b/src/gstreamer/gstlibcamerasrc.h @@ -6,8 +6,7 @@ * gstlibcamerasrc.h - GStreamer Capture Element */ -#ifndef __GST_LIBCAMERA_SRC_H__ -#define __GST_LIBCAMERA_SRC_H__ +#pragma once #include @@ -18,5 +17,3 @@ G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src, GST_LIBCAMERA, SRC, GstElement) G_END_DECLS - -#endif /* __GST_LIBCAMERA_SRC_H__ */ From patchwork Tue Nov 23 22:40:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14740 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 04716C324F for ; Tue, 23 Nov 2021 22:40:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 951056033C; Tue, 23 Nov 2021 23:40:37 +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="LfHFP0Ah"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A81F060398 for ; Tue, 23 Nov 2021 23:40:22 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5DEFCA1B; Tue, 23 Nov 2021 23:40:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707222; bh=mQKAYdHDiBYDJwPawVQKjRTAdeoTD0GV4aMZBH93E3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LfHFP0AhtCoSCV+No9B753FqM0pni450yh5/8//7q7hDmNowcS8ph8sRQQWfhpcyw cv8hX+ne8P6p/nrkLHjfo/Tmp26141md2hiaonS5b27fLXlVtobTnjTugox23tM6fm t5ItxKDsGKH2GfWmOgjeZIBqWEtFEN+UpmbxNlY0= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:09 +0000 Message-Id: <20211123224015.3619282-10-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 09/15] ipa: ipu3: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/ipa/ipu3/algorithms/agc.h | 6 ++---- src/ipa/ipu3/algorithms/algorithm.h | 6 ++---- src/ipa/ipu3/algorithms/awb.h | 5 ++--- src/ipa/ipu3/algorithms/blc.h | 6 ++---- src/ipa/ipu3/algorithms/tone_mapping.h | 6 ++---- src/ipa/ipu3/ipa_context.h | 6 ++---- 6 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h index a04a81fb8eae..96ec7005acb6 100644 --- a/src/ipa/ipu3/algorithms/agc.h +++ b/src/ipa/ipu3/algorithms/agc.h @@ -4,8 +4,8 @@ * * agc.h - IPU3 AGC/AEC mean-based control algorithm */ -#ifndef __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__ -#define __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__ + +#pragma once #include @@ -59,5 +59,3 @@ private: } /* namespace ipa::ipu3::algorithms */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPU3_ALGORITHMS_AGC_H__ */ diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h index 43f5d8b058b5..16310ab16985 100644 --- a/src/ipa/ipu3/algorithms/algorithm.h +++ b/src/ipa/ipu3/algorithms/algorithm.h @@ -4,8 +4,8 @@ * * algorithm.h - IPU3 control algorithm interface */ -#ifndef __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ -#define __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ + +#pragma once #include @@ -28,5 +28,3 @@ public: } /* namespace ipa::ipu3 */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_IPU3_ALGORITHM_H__ */ diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h index b90782c1cb5c..ab4b0a338369 100644 --- a/src/ipa/ipu3/algorithms/awb.h +++ b/src/ipa/ipu3/algorithms/awb.h @@ -4,8 +4,8 @@ * * awb.h - IPU3 AWB control algorithm */ -#ifndef __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__ -#define __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__ + +#pragma once #include @@ -86,4 +86,3 @@ private: } /* namespace ipa::ipu3::algorithms */ } /* namespace libcamera*/ -#endif /* __LIBCAMERA_IPU3_ALGORITHMS_AWB_H__ */ diff --git a/src/ipa/ipu3/algorithms/blc.h b/src/ipa/ipu3/algorithms/blc.h index 4b7cb483fae6..d8da1748baba 100644 --- a/src/ipa/ipu3/algorithms/blc.h +++ b/src/ipa/ipu3/algorithms/blc.h @@ -4,8 +4,8 @@ * * black_correction.h - IPU3 Black Level Correction control */ -#ifndef __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ -#define __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ + +#pragma once #include "algorithm.h" @@ -24,5 +24,3 @@ public: } /* namespace ipa::ipu3::algorithms */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPU3_ALGORITHMS_BLC_H__ */ diff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h index 46dd6171b1d5..b727ab1e25a6 100644 --- a/src/ipa/ipu3/algorithms/tone_mapping.h +++ b/src/ipa/ipu3/algorithms/tone_mapping.h @@ -4,8 +4,8 @@ * * tone_mapping.h - IPU3 ToneMapping and Gamma control */ -#ifndef __LIBCAMERA_IPU3_ALGORITHMS_TONE_MAPPING_H__ -#define __LIBCAMERA_IPU3_ALGORITHMS_TONE_MAPPING_H__ + +#pragma once #include "algorithm.h" @@ -29,5 +29,3 @@ private: } /* namespace ipa::ipu3::algorithms */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPU3_ALGORITHMS_TONE_MAPPING_H__ */ diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index fd97e240f3fa..c6dc08147321 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -5,8 +5,8 @@ * ipa_context.h - IPU3 IPA Context * */ -#ifndef __LIBCAMERA_IPU3_IPA_CONTEXT_H__ -#define __LIBCAMERA_IPU3_IPA_CONTEXT_H__ + +#pragma once #include @@ -68,5 +68,3 @@ struct IPAContext { } /* namespace ipa::ipu3 */ } /* namespace libcamera*/ - -#endif /* __LIBCAMERA_IPU3_IPA_CONTEXT_H__ */ From patchwork Tue Nov 23 22:40:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14743 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 0F180C324F for ; Tue, 23 Nov 2021 22:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A6B1B60490; Tue, 23 Nov 2021 23:40:39 +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="kZWmxSj+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E4972603CB for ; Tue, 23 Nov 2021 23:40:22 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 98E0FF95; Tue, 23 Nov 2021 23:40:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707222; bh=60gufxY7DkGItsfTltIp3x7DFWUCjtNaXeRIMh430cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kZWmxSj+M80thpXqLm4bJMhaXLQHEsQ1uUx+ALHsOXkeqcblonyjpcHCMAVRlguVd sX/tMLV10dlkq/t0zwxtl839GZa0DHTDGWvo28t6aOU80ZaX5OcL5HGc20QjXyAh30 LK9885fwOcAKMQjy4usD7jgD3GfZ2aCcoL4cd8Pg= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:10 +0000 Message-Id: <20211123224015.3619282-11-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/15] ipa: libipa: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/ipa/libipa/camera_sensor_helper.h | 6 ++---- src/ipa/libipa/histogram.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h index a7e4ab3b2af6..26adfcb5955f 100644 --- a/src/ipa/libipa/camera_sensor_helper.h +++ b/src/ipa/libipa/camera_sensor_helper.h @@ -4,8 +4,8 @@ * * camera_sensor_helper.h - Helper class that performs sensor-specific parameter computations */ -#ifndef __LIBCAMERA_IPA_LIBIPA_CAMERA_SENSOR_HELPER_H__ -#define __LIBCAMERA_IPA_LIBIPA_CAMERA_SENSOR_HELPER_H__ + +#pragma once #include @@ -85,5 +85,3 @@ static helper##Factory global_##helper##Factory; } /* namespace ipa */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_LIBIPA_CAMERA_SENSOR_HELPER_H__ */ diff --git a/src/ipa/libipa/histogram.h b/src/ipa/libipa/histogram.h index c2761cb29e7a..c40a366bb38c 100644 --- a/src/ipa/libipa/histogram.h +++ b/src/ipa/libipa/histogram.h @@ -4,8 +4,8 @@ * * histogram.h - histogram calculation interface */ -#ifndef __LIBCAMERA_IPA_LIBIPA_HISTOGRAM_H__ -#define __LIBCAMERA_IPA_LIBIPA_HISTOGRAM_H__ + +#pragma once #include #include @@ -36,5 +36,3 @@ private: } /* namespace ipa */ } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_LIBIPA_HISTOGRAM_H__ */ From patchwork Tue Nov 23 22:40:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14742 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 6204DC3250 for ; Tue, 23 Nov 2021 22:40:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 144EF6039C; Tue, 23 Nov 2021 23:40:39 +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="aHcLWJgy"; 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 3FECC603FC for ; Tue, 23 Nov 2021 23:40:23 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CFE36A1B; Tue, 23 Nov 2021 23:40:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707222; bh=MTitkI/27Pj5UnW8Vgx+DW2Y2pw2fF6eTJy3KbMUnKg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aHcLWJgyQK7DodOtOtjR8u9n6a13GKHWy96yFxqDvg7pJYCsxMRrkRfqsgTwZT+rZ DxY/yHuodNAUToFdjVJ2m6uo3T71DuDT9wR09fzCiEZMDPme6N+J/wXNOd66QTHRxb eWAFF+4xRjKNdPk5LvYd0iANXqIAq/h/2TfQ2bd4= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:11 +0000 Message-Id: <20211123224015.3619282-12-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 11/15] lc-compliance: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/lc-compliance/environment.h | 6 ++---- src/lc-compliance/simple_capture.h | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lc-compliance/environment.h b/src/lc-compliance/environment.h index ba308732396e..0debbcce7150 100644 --- a/src/lc-compliance/environment.h +++ b/src/lc-compliance/environment.h @@ -4,8 +4,8 @@ * * environment.h - Common environment for tests */ -#ifndef __LC_COMPLIANCE_ENVIRONMENT_H__ -#define __LC_COMPLIANCE_ENVIRONMENT_H__ + +#pragma once #include @@ -25,5 +25,3 @@ private: std::string cameraId_; libcamera::CameraManager *cm_; }; - -#endif /* __LC_COMPLIANCE_ENVIRONMENT_H__ */ diff --git a/src/lc-compliance/simple_capture.h b/src/lc-compliance/simple_capture.h index 100ffd6637ad..9d31f7cb2e53 100644 --- a/src/lc-compliance/simple_capture.h +++ b/src/lc-compliance/simple_capture.h @@ -4,8 +4,8 @@ * * simple_capture.h - Simple capture helper */ -#ifndef __LC_COMPLIANCE_SIMPLE_CAPTURE_H__ -#define __LC_COMPLIANCE_SIMPLE_CAPTURE_H__ + +#pragma once #include @@ -63,5 +63,3 @@ private: unsigned int captureCount_; unsigned int captureLimit_; }; - -#endif /* __LC_COMPLIANCE_SIMPLE_CAPTURE_H__ */ From patchwork Tue Nov 23 22:40:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14741 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 AF87CBF415 for ; Tue, 23 Nov 2021 22:40:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 56FB56038A; Tue, 23 Nov 2021 23:40:38 +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="mGoxogvE"; 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 764B16042A for ; Tue, 23 Nov 2021 23:40:23 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 243BAF95; Tue, 23 Nov 2021 23:40:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707223; bh=15g54kN9lxh84FsgjeP2E37dVZITLhUofjNkYenL8L8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mGoxogvEp4HV6MC5eQAlwmSu2oiEcgmtsecFNcOxYlRuBTwKkbVunNadQO6Vs2FTq fRbYXFrdZ0VUMhe+zB6ABrPH0Qv+q8l6ipxKYNtP+ZohhghLegI+e8JZwwfagpXrW0 pXlLe7mRa2ld3Ik7taoHQynv6txS4sv6UY86P8rQ= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:12 +0000 Message-Id: <20211123224015.3619282-13-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 12/15] qcam: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/qcam/dng_writer.h | 6 ++---- src/qcam/format_converter.h | 6 ++---- src/qcam/main_window.h | 6 ++---- src/qcam/message_handler.h | 6 ++---- src/qcam/viewfinder.h | 6 ++---- src/qcam/viewfinder_gl.h | 6 ++---- src/qcam/viewfinder_qt.h | 6 ++---- 7 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/qcam/dng_writer.h b/src/qcam/dng_writer.h index e4486288e629..c044bf8b8162 100644 --- a/src/qcam/dng_writer.h +++ b/src/qcam/dng_writer.h @@ -4,8 +4,8 @@ * * dng_writer.h - DNG writer */ -#ifndef __QCAM_DNG_WRITER_H__ -#define __QCAM_DNG_WRITER_H__ + +#pragma once #ifdef HAVE_TIFF #define HAVE_DNG @@ -25,5 +25,3 @@ public: }; #endif /* HAVE_TIFF */ - -#endif /* __QCAM_DNG_WRITER_H__ */ diff --git a/src/qcam/format_converter.h b/src/qcam/format_converter.h index 9da2df5d294b..37dbfae2d344 100644 --- a/src/qcam/format_converter.h +++ b/src/qcam/format_converter.h @@ -4,8 +4,8 @@ * * format_convert.h - qcam - Convert buffer to RGB */ -#ifndef __QCAM_FORMAT_CONVERTER_H__ -#define __QCAM_FORMAT_CONVERTER_H__ + +#pragma once #include @@ -60,5 +60,3 @@ private: unsigned int y_pos_; unsigned int cb_pos_; }; - -#endif /* __QCAM_FORMAT_CONVERTER_H__ */ diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index 4d8e806b2bf4..3fbe872c0b5b 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -4,8 +4,8 @@ * * main_window.h - qcam - Main application window */ -#ifndef __QCAM_MAIN_WINDOW_H__ -#define __QCAM_MAIN_WINDOW_H__ + +#pragma once #include #include @@ -126,5 +126,3 @@ private: std::vector> requests_; }; - -#endif /* __QCAM_MAIN_WINDOW__ */ diff --git a/src/qcam/message_handler.h b/src/qcam/message_handler.h index 4534db9d93f7..56294d37ce2f 100644 --- a/src/qcam/message_handler.h +++ b/src/qcam/message_handler.h @@ -4,8 +4,8 @@ * * message_handler.cpp - qcam - Log message handling */ -#ifndef __QCAM_MESSAGE_HANDLER_H__ -#define __QCAM_MESSAGE_HANDLER_H__ + +#pragma once #include @@ -22,5 +22,3 @@ private: static QtMessageHandler handler_; static bool verbose_; }; - -#endif /* __QCAM_MESSAGE_HANDLER_H__ */ diff --git a/src/qcam/viewfinder.h b/src/qcam/viewfinder.h index 4c2102a6ed04..260074aed440 100644 --- a/src/qcam/viewfinder.h +++ b/src/qcam/viewfinder.h @@ -4,8 +4,8 @@ * * viewfinder.h - qcam - Viewfinder base class */ -#ifndef __QCAM_VIEWFINDER_H__ -#define __QCAM_VIEWFINDER_H__ + +#pragma once #include #include @@ -30,5 +30,3 @@ public: virtual QImage getCurrentImage() = 0; }; - -#endif /* __QCAM_VIEWFINDER_H__ */ diff --git a/src/qcam/viewfinder_gl.h b/src/qcam/viewfinder_gl.h index 37b1ddd04b1d..0a9275baf9b9 100644 --- a/src/qcam/viewfinder_gl.h +++ b/src/qcam/viewfinder_gl.h @@ -5,8 +5,8 @@ * viewfinder_GL.h - OpenGL Viewfinder for rendering by OpenGL shader * */ -#ifndef __VIEWFINDER_GL_H__ -#define __VIEWFINDER_GL_H__ + +#pragma once #include #include @@ -103,5 +103,3 @@ private: QMutex mutex_; /* Prevent concurrent access to image_ */ }; - -#endif /* __VIEWFINDER_GL_H__ */ diff --git a/src/qcam/viewfinder_qt.h b/src/qcam/viewfinder_qt.h index 756f3fa33055..8c62145211d1 100644 --- a/src/qcam/viewfinder_qt.h +++ b/src/qcam/viewfinder_qt.h @@ -4,8 +4,8 @@ * * viewfinder_qt.h - qcam - QPainter-based ViewFinder */ -#ifndef __QCAM_VIEWFINDER_QT_H__ -#define __QCAM_VIEWFINDER_QT_H__ + +#pragma once #include #include @@ -61,5 +61,3 @@ private: QImage image_; QMutex mutex_; /* Prevent concurrent access to image_ */ }; - -#endif /* __QCAM_VIEWFINDER_QT_H__ */ From patchwork Tue Nov 23 22:40:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14744 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 BC111C3251 for ; Tue, 23 Nov 2021 22:40:40 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6803C6033C; Tue, 23 Nov 2021 23:40:40 +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="M5z15Odp"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AE4C260121 for ; Tue, 23 Nov 2021 23:40:23 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5D827A1B; Tue, 23 Nov 2021 23:40:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707223; bh=UWRZlXn7Dzj3SpF2i1Lkwew7y5FpgcYwkUGWAlvd/jU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5z15OdpNhh+X1GvvMQvI7UWHclgkgUWHtsJKUBrr1d5Jd4KWxR5cDlvFQTho2Qhp bdWdWfovywiExC5ZYYs2b1kkIcQ0yYA3uDylZtai6CEeYXkP/hq5P75Ra97J+UG6LK QnF1meI3Oc/z68YfIyZ2HTLEZsZMhNkjHYgpwuvw= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:13 +0000 Message-Id: <20211123224015.3619282-14-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 13/15] test: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- test/gstreamer/gstreamer_test.h | 5 +---- test/libtest/buffer_source.h | 6 ++---- test/libtest/camera_test.h | 6 ++---- test/libtest/test.h | 6 ++---- test/media_device/media_device_test.h | 6 ++---- test/serialization/serialization_test.h | 6 ++---- test/v4l2_subdevice/v4l2_subdevice_test.h | 5 +---- test/v4l2_videodevice/v4l2_videodevice_test.h | 6 ++---- 8 files changed, 14 insertions(+), 32 deletions(-) diff --git a/test/gstreamer/gstreamer_test.h b/test/gstreamer/gstreamer_test.h index ccfe0b92e1bb..9869d252c7ba 100644 --- a/test/gstreamer/gstreamer_test.h +++ b/test/gstreamer/gstreamer_test.h @@ -5,8 +5,7 @@ * gstreamer_test.cpp - GStreamer test base class */ -#ifndef __LIBCAMERA_GSTREAMER_TEST_H__ -#define __LIBCAMERA_GSTREAMER_TEST_H__ +#pragma once #include #include @@ -33,5 +32,3 @@ protected: GstElement *libcameraSrc_; int status_; }; - -#endif /* __LIBCAMERA_GSTREAMER_TEST_H__ */ diff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h index 84e2fa8f41a0..0cc71aa59478 100644 --- a/test/libtest/buffer_source.h +++ b/test/libtest/buffer_source.h @@ -4,8 +4,8 @@ * * buffer_source.h - libcamera camera test helper to create FrameBuffers */ -#ifndef __LIBCAMERA_BUFFER_SOURCE_TEST_H__ -#define __LIBCAMERA_BUFFER_SOURCE_TEST_H__ + +#pragma once #include @@ -25,5 +25,3 @@ private: std::shared_ptr media_; std::vector> buffers_; }; - -#endif /* __LIBCAMERA_BUFFER_SOURCE_TEST_H__ */ diff --git a/test/libtest/camera_test.h b/test/libtest/camera_test.h index 23122245faf9..0b178bc21a96 100644 --- a/test/libtest/camera_test.h +++ b/test/libtest/camera_test.h @@ -4,8 +4,8 @@ * * camera_test.h - libcamera camera test base class */ -#ifndef __LIBCAMERA_CAMERA_TEST_H__ -#define __LIBCAMERA_CAMERA_TEST_H__ + +#pragma once #include @@ -23,5 +23,3 @@ protected: std::shared_ptr camera_; int status_; }; - -#endif /* __LIBCAMERA_CAMERA_TEST_H__ */ diff --git a/test/libtest/test.h b/test/libtest/test.h index 8ecf2bda950f..ee01a22591f8 100644 --- a/test/libtest/test.h +++ b/test/libtest/test.h @@ -4,8 +4,8 @@ * * test.h - libcamera test base class */ -#ifndef __TEST_TEST_H__ -#define __TEST_TEST_H__ + +#pragma once #include @@ -34,5 +34,3 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) \ { \ return klass().execute(); \ } - -#endif /* __TEST_TEST_H__ */ diff --git a/test/media_device/media_device_test.h b/test/media_device/media_device_test.h index a88de56c5023..9b226f1a726d 100644 --- a/test/media_device/media_device_test.h +++ b/test/media_device/media_device_test.h @@ -4,8 +4,8 @@ * * media_device_test.h - libcamera media device test base class */ -#ifndef __LIBCAMERA_MEDIADEVICE_TEST_H__ -#define __LIBCAMERA_MEDIADEVICE_TEST_H__ + +#pragma once #include @@ -28,5 +28,3 @@ protected: private: std::unique_ptr enumerator_; }; - -#endif /* __LIBCAMERA_MEDIADEVICE_TEST_H__ */ diff --git a/test/serialization/serialization_test.h b/test/serialization/serialization_test.h index d654c7bfbdfd..609f9fdfc29e 100644 --- a/test/serialization/serialization_test.h +++ b/test/serialization/serialization_test.h @@ -4,8 +4,8 @@ * * serialization_test.h - Base class for serialization tests */ -#ifndef __LIBCAMERA_SERIALIZATION_TEST_H__ -#define __LIBCAMERA_SERIALIZATION_TEST_H__ + +#pragma once #include #include @@ -27,5 +27,3 @@ public: static bool equals(const libcamera::ControlList &lhs, const libcamera::ControlList &rhs); }; - -#endif /* __LIBCAMERA_SERIALIZATION_TEST_H__ */ diff --git a/test/v4l2_subdevice/v4l2_subdevice_test.h b/test/v4l2_subdevice/v4l2_subdevice_test.h index 83beb6a27eac..e73c583b50ae 100644 --- a/test/v4l2_subdevice/v4l2_subdevice_test.h +++ b/test/v4l2_subdevice/v4l2_subdevice_test.h @@ -5,8 +5,7 @@ * v4l2_subdevice_test.h - VIMC-based V4L2 subdevice test */ -#ifndef __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ -#define __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ +#pragma once #include @@ -32,5 +31,3 @@ protected: std::shared_ptr media_; libcamera::V4L2Subdevice *scaler_; }; - -#endif /* __LIBCAMERA_V4L2_SUBDEVICE_TEST_H__ */ diff --git a/test/v4l2_videodevice/v4l2_videodevice_test.h b/test/v4l2_videodevice/v4l2_videodevice_test.h index e7762294cb3e..d2de1a6de29f 100644 --- a/test/v4l2_videodevice/v4l2_videodevice_test.h +++ b/test/v4l2_videodevice/v4l2_videodevice_test.h @@ -4,8 +4,8 @@ * * vl42device_test.h - libcamera v4l2device test base class */ -#ifndef __LIBCAMERA_V4L2_DEVICE_TEST_H_ -#define __LIBCAMERA_V4L2_DEVICE_TEST_H_ + +#pragma once #include @@ -41,5 +41,3 @@ protected: libcamera::V4L2VideoDevice *capture_; std::vector> buffers_; }; - -#endif /* __LIBCAMERA_V4L2_DEVICE_TEST_H_ */ From patchwork Tue Nov 23 22:40:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14745 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 4E8EDBF415 for ; Tue, 23 Nov 2021 22:40:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EF34860441; Tue, 23 Nov 2021 23:40:40 +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="CaQXkDCY"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB1DE6042B for ; Tue, 23 Nov 2021 23:40:23 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 96F24F95; Tue, 23 Nov 2021 23:40:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707223; bh=NZeS09z7rFlurG5pa7zDfpw/1BwH2lWZtakDmVEQkvk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaQXkDCY6pnMZKFGDTIeIkRMDNAD/jXgcHczKsiR00Io8tHo7T26Iyx8T66UVGstu l/+BZovziS/YXcxGHd+akUW/ds9LKVZ1QIjBwJOJI5BqICImK+gyumwDV1d6wrUlEp NFeD5YfkGdhUyPGqdwWF6hbDcZppAqXCkWiX6pGw= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:14 +0000 Message-Id: <20211123224015.3619282-15-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 14/15] utils: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- utils/gen-header.sh | 9 ++------- .../libcamera_templates/core_ipa_interface.h.tmpl | 5 +---- .../libcamera_templates/core_ipa_serializer.h.tmpl | 5 +---- .../libcamera_templates/module_ipa_interface.h.tmpl | 5 +---- .../libcamera_templates/module_ipa_proxy.h.tmpl | 5 +---- .../libcamera_templates/module_ipa_serializer.h.tmpl | 5 +---- 6 files changed, 7 insertions(+), 27 deletions(-) diff --git a/utils/gen-header.sh b/utils/gen-header.sh index fcb9c5e16d07..8b66c5dd0f47 100755 --- a/utils/gen-header.sh +++ b/utils/gen-header.sh @@ -11,8 +11,8 @@ cat < "$dst_file" * * libcamera.h - libcamera public API */ -#ifndef __LIBCAMERA_LIBCAMERA_H__ -#define __LIBCAMERA_LIBCAMERA_H__ + +#pragma once EOF @@ -25,8 +25,3 @@ done | sort) for header in $headers ; do echo "#include " >> "$dst_file" done - -cat <> "$dst_file" - -#endif /* __LIBCAMERA_LIBCAMERA_H__ */ -EOF diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl index 6bf6094b9456..a565b59ada25 100644 --- a/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/core_ipa_interface.h.tmpl @@ -12,8 +12,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ -#define __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ +#pragma once {% if has_map %}#include {% endif %} {% if has_array %}#include {% endif %} @@ -36,5 +35,3 @@ static const {{const.kind|name}} {{const.mojom_name}} = {{const.value}}; {% endfor %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_INTERFACE_CORE_GENERATED_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl index 37a784f1f940..5738a1aa3405 100644 --- a/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/core_ipa_serializer.h.tmpl @@ -13,8 +13,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ -#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ +#pragma once #include #include @@ -43,5 +42,3 @@ public: {% endfor %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_CORE_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl index ebe811fa1028..415ec283895c 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_interface.h.tmpl @@ -12,8 +12,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ -#define __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ +#pragma once #include #include @@ -83,5 +82,3 @@ public: {% endfor %} {%- endif %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_IPA_INTERFACE_{{module_name|upper}}_GENERATED_H__ */ 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 1979e68ff74d..ce396c183d0c 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.h.tmpl @@ -13,8 +13,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ -#define __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ +#pragma once #include #include @@ -130,5 +129,3 @@ private: {% endfor %} {%- endif %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_PROXY_{{module_name|upper}}_H__ */ diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl index 779d2114f9f3..8b709705aa32 100644 --- a/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl +++ b/utils/ipc/generators/libcamera_templates/module_ipa_serializer.h.tmpl @@ -13,8 +13,7 @@ * This file is auto-generated. Do not edit. */ -#ifndef __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ -#define __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ +#pragma once #include #include @@ -44,5 +43,3 @@ public: {% endfor %} } /* namespace libcamera */ - -#endif /* __LIBCAMERA_INTERNAL_IPA_DATA_SERIALIZER_{{module_name|upper}}_H__ */ From patchwork Tue Nov 23 22:40:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 14746 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 D8AFDC3250 for ; Tue, 23 Nov 2021 22:40:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8EAE0603C2; Tue, 23 Nov 2021 23:40:41 +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="hxe83UBz"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2CAB56039C for ; Tue, 23 Nov 2021 23:40:24 +0100 (CET) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CE977A1B; Tue, 23 Nov 2021 23:40:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1637707223; bh=yYvUufQThQXROZnjJQKHggiNEQAwdpCWMiKXWcXqZAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hxe83UBzUS0O1vQV3CLWNWovPrYULxLd+cDt9bY0YBYyOnQXXXztQDCMeC3oEqIJ1 ur/verOhSoNrdfz7TKgoe3gm/qyx3HpkZWhJStP1fe4HeaqhBFilxP6g/Ee/UKNhCc q+lKrEkMTPey3eXiPaQ30GNkCojYUrMtYlJE+W/g= From: Kieran Bingham To: libcamera devel Date: Tue, 23 Nov 2021 22:40:15 +0000 Message-Id: <20211123224015.3619282-16-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> References: <20211123224015.3619282-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 15/15] v4l2: Convert to pragma once 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" Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham --- src/v4l2/v4l2_camera.h | 5 +---- src/v4l2/v4l2_camera_file.h | 5 +---- src/v4l2/v4l2_camera_proxy.h | 5 +---- src/v4l2/v4l2_compat_manager.h | 5 +---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/v4l2/v4l2_camera.h b/src/v4l2/v4l2_camera.h index e81996f21168..94263b2f5db6 100644 --- a/src/v4l2/v4l2_camera.h +++ b/src/v4l2/v4l2_camera.h @@ -5,8 +5,7 @@ * v4l2_camera.h - V4L2 compatibility camera */ -#ifndef __V4L2_CAMERA_H__ -#define __V4L2_CAMERA_H__ +#pragma once #include #include @@ -86,5 +85,3 @@ private: std::condition_variable bufferCV_; unsigned int bufferAvailableCount_; }; - -#endif /* __V4L2_CAMERA_H__ */ diff --git a/src/v4l2/v4l2_camera_file.h b/src/v4l2/v4l2_camera_file.h index 8f4670a0fa49..6c4cb5d89dbf 100644 --- a/src/v4l2/v4l2_camera_file.h +++ b/src/v4l2/v4l2_camera_file.h @@ -5,8 +5,7 @@ * v4l2_camera_file.h - V4L2 compatibility camera file information */ -#ifndef __V4L2_CAMERA_FILE_H__ -#define __V4L2_CAMERA_FILE_H__ +#pragma once #include @@ -33,5 +32,3 @@ private: int efd_; enum v4l2_priority priority_; }; - -#endif /* __V4L2_CAMERA_FILE_H__ */ diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index 56a45bb76650..fccec241879d 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -5,8 +5,7 @@ * v4l2_camera_proxy.h - Proxy to V4L2 compatibility camera */ -#ifndef __V4L2_CAMERA_PROXY_H__ -#define __V4L2_CAMERA_PROXY_H__ +#pragma once #include #include @@ -100,5 +99,3 @@ private: /* This mutex is to serialize access to the proxy. */ libcamera::Mutex proxyMutex_; }; - -#endif /* __V4L2_CAMERA_PROXY_H__ */ diff --git a/src/v4l2/v4l2_compat_manager.h b/src/v4l2/v4l2_compat_manager.h index b11698cc165f..f52069f7b62d 100644 --- a/src/v4l2/v4l2_compat_manager.h +++ b/src/v4l2/v4l2_compat_manager.h @@ -5,8 +5,7 @@ * v4l2_compat_manager.h - V4L2 compatibility manager */ -#ifndef __V4L2_COMPAT_MANAGER_H__ -#define __V4L2_COMPAT_MANAGER_H__ +#pragma once #include #include @@ -68,5 +67,3 @@ private: std::map> files_; std::map mmaps_; }; - -#endif /* __V4L2_COMPAT_MANAGER_H__ */