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