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