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__ */