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