From f38742810dfda7d8a10eab1bb199258ece2e8d25 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 10 Aug 2023 14:43:37 +0200 Subject: [PATCH] Replace manual #include guards with "#pragma once". --- src/107-Arduino-Cyphal.h | 5 +---- src/CanRxQueueItem.hpp | 5 +---- src/CircularBuffer.hpp | 5 +---- src/DSDL_Types.h | 5 +---- src/Node.hpp | 5 +---- src/Publisher.hpp | 5 +---- src/PublisherBase.hpp | 5 +---- src/ServiceClient.hpp | 5 +---- src/ServiceClientBase.hpp | 5 +---- src/ServiceServer.hpp | 5 +---- src/ServiceServerBase.hpp | 5 +---- src/Subscription.hpp | 5 +---- src/SubscriptionBase.h | 5 +---- src/cyphal++/cyphal++.h | 5 +---- src/util/nodeinfo/NodeInfo.hpp | 5 +---- src/util/nodeinfo/NodeInfoBase.hpp | 5 +---- src/util/port/PortListPublisher.hpp | 5 +---- src/util/port/PortListPublisherBase.hpp | 5 +---- src/util/registry/Registry.hpp | 5 +---- src/util/transfer_metadata.hpp | 5 +---- 20 files changed, 20 insertions(+), 80 deletions(-) diff --git a/src/107-Arduino-Cyphal.h b/src/107-Arduino-Cyphal.h index baa19e2b..ec992fa2 100644 --- a/src/107-Arduino-Cyphal.h +++ b/src/107-Arduino-Cyphal.h @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef _107_ARDUINO_CYPHAL_H_ -#define _107_ARDUINO_CYPHAL_H_ +#pragma once /************************************************************************************** * INCLUDE @@ -19,5 +18,3 @@ #include "ServiceClient.hpp" #include "ServiceServer.hpp" #include "util/storage/register_storage.hpp" - -#endif /* _107_ARDUINO_CYPHAL_H_ */ diff --git a/src/CanRxQueueItem.hpp b/src/CanRxQueueItem.hpp index 200f912a..011caee5 100644 --- a/src/CanRxQueueItem.hpp +++ b/src/CanRxQueueItem.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_CANARDRXQUEUEITEM_HPP -#define INC_107_ARDUINO_CYPHAL_CANARDRXQUEUEITEM_HPP +#pragma once /************************************************************************************** * INCLUDE @@ -80,5 +79,3 @@ class CanRxQueueItem **************************************************************************************/ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_CANARDRXQUEUEITEM_HPP */ diff --git a/src/CircularBuffer.hpp b/src/CircularBuffer.hpp index ffd03d5c..403459fb 100644 --- a/src/CircularBuffer.hpp +++ b/src/CircularBuffer.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef ARDUINO_CYPHAL_UTILITY_RINGBUFFER_H_ -#define ARDUINO_CYPHAL_UTILITY_RINGBUFFER_H_ +#pragma once /************************************************************************************** * INCLUDE @@ -73,5 +72,3 @@ class CircularBuffer : public CircularBufferBase **************************************************************************************/ #include "CircularBuffer.ipp" - -#endif /* ARDUINO_CYPHAL_UTILITY_RINGBUFFER_H_ */ diff --git a/src/DSDL_Types.h b/src/DSDL_Types.h index d822d206..3fe52d0b 100644 --- a/src/DSDL_Types.h +++ b/src/DSDL_Types.h @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef ARDUINO_UAVCAN_WRAPPERS_H_ -#define ARDUINO_UAVCAN_WRAPPERS_H_ +#pragma once /************************************************************************************** * INCLUDE @@ -19,5 +18,3 @@ #pragma GCC diagnostic ignored "-Wdeprecated-declarations" #include "DSDL_Types.h.impl" #pragma GCC diagnostic pop - -#endif /* ARDUINO_UAVCAN_WRAPPERS_H_ */ diff --git a/src/Node.hpp b/src/Node.hpp index 86d0f179..26489347 100644 --- a/src/Node.hpp +++ b/src/Node.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef ARDUINO_CYPHAL_NODE_HPP_ -#define ARDUINO_CYPHAL_NODE_HPP_ +#pragma once /************************************************************************************** * INCLUDE @@ -166,5 +165,3 @@ class Node **************************************************************************************/ #include "Node.ipp" - -#endif /* ARDUINO_CYPHAL_NODE_HPP_ */ diff --git a/src/Publisher.hpp b/src/Publisher.hpp index 26443800..b88f3f74 100644 --- a/src/Publisher.hpp +++ b/src/Publisher.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_PUBLISHER_H -#define INC_107_ARDUINO_CYPHAL_PUBLISHER_H +#pragma once /************************************************************************************** * INCLUDE @@ -63,5 +62,3 @@ class Publisher final : public PublisherBase **************************************************************************************/ #include "Publisher.ipp" - -#endif /* INC_107_ARDUINO_CYPHAL_PUBLISHER_H */ diff --git a/src/PublisherBase.hpp b/src/PublisherBase.hpp index eb1d2ac9..beeaa4d9 100644 --- a/src/PublisherBase.hpp +++ b/src/PublisherBase.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_PUBLISHER_BASE_H -#define INC_107_ARDUINO_CYPHAL_PUBLISHER_BASE_H +#pragma once /************************************************************************************** * INCLUDE @@ -60,5 +59,3 @@ using Publisher = std::shared_ptr>; **************************************************************************************/ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_PUBLISHER_BASE_H */ diff --git a/src/ServiceClient.hpp b/src/ServiceClient.hpp index b5009e1f..f19fec68 100644 --- a/src/ServiceClient.hpp +++ b/src/ServiceClient.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_HPP -#define INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_HPP +#pragma once /************************************************************************************** * INCLUDE @@ -68,5 +67,3 @@ class ServiceClient final : public ServiceClientBase **************************************************************************************/ #include "ServiceClient.ipp" - -#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_HPP */ diff --git a/src/ServiceClientBase.hpp b/src/ServiceClientBase.hpp index d339153f..744904f8 100644 --- a/src/ServiceClientBase.hpp +++ b/src/ServiceClientBase.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_BASE_HPP -#define INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_BASE_HPP +#pragma once /************************************************************************************** * INCLUDE @@ -57,5 +56,3 @@ using ServiceClient = std::shared_ptr>; **************************************************************************************/ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_BASE_HPP */ diff --git a/src/ServiceServer.hpp b/src/ServiceServer.hpp index 09a1c879..9bda1c60 100644 --- a/src/ServiceServer.hpp +++ b/src/ServiceServer.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_SERVICE_HPP -#define INC_107_ARDUINO_CYPHAL_SERVICE_HPP +#pragma once /************************************************************************************** * INCLUDE @@ -65,5 +64,3 @@ class ServiceServer final : public ServiceServerBase **************************************************************************************/ #include "ServiceServer.ipp" - -#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_HPP */ diff --git a/src/ServiceServerBase.hpp b/src/ServiceServerBase.hpp index 1f091de9..05f56e4e 100644 --- a/src/ServiceServerBase.hpp +++ b/src/ServiceServerBase.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_SERVICE_SERVER_BASE_HPP -#define INC_107_ARDUINO_CYPHAL_SERVICE_SERVER_BASE_HPP +#pragma once /************************************************************************************** * INCLUDE @@ -53,5 +52,3 @@ using ServiceServer = std::shared_ptr; **************************************************************************************/ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_SERVER_BASE_HPP */ diff --git a/src/Subscription.hpp b/src/Subscription.hpp index 02777dc0..63260817 100644 --- a/src/Subscription.hpp +++ b/src/Subscription.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_SUBSCRIPTION_HPP -#define INC_107_ARDUINO_CYPHAL_SUBSCRIPTION_HPP +#pragma once /************************************************************************************** * INCLUDE @@ -64,5 +63,3 @@ class Subscription final : public SubscriptionBase **************************************************************************************/ #include "Subscription.ipp" - -#endif /* INC_107_ARDUINO_CYPHAL_SUBSCRIPTION_HPP */ diff --git a/src/SubscriptionBase.h b/src/SubscriptionBase.h index 70cae8b0..994734f4 100644 --- a/src/SubscriptionBase.h +++ b/src/SubscriptionBase.h @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_CANARDSUBSCRIPTION_H -#define INC_107_ARDUINO_CYPHAL_CANARDSUBSCRIPTION_H +#pragma once /************************************************************************************** * INCLUDE @@ -86,5 +85,3 @@ using Subscription = std::shared_ptr; **************************************************************************************/ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_CANARDSUBSCRIPTION_H */ diff --git a/src/cyphal++/cyphal++.h b/src/cyphal++/cyphal++.h index 4eff6c32..af2443e5 100644 --- a/src/cyphal++/cyphal++.h +++ b/src/cyphal++/cyphal++.h @@ -5,13 +5,10 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_CYPHALCAN_H -#define INC_107_ARDUINO_CYPHAL_CYPHALCAN_H +#pragma once /************************************************************************************** * INCLUDE **************************************************************************************/ #include "107-Arduino-Cyphal.h" - -#endif /* INC_107_ARDUINO_CYPHAL_CYPHALCAN_H */ diff --git a/src/util/nodeinfo/NodeInfo.hpp b/src/util/nodeinfo/NodeInfo.hpp index 74acacc2..6157737e 100644 --- a/src/util/nodeinfo/NodeInfo.hpp +++ b/src/util/nodeinfo/NodeInfo.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef ARDUINO_OPENCYPHAL_NODE_INFO_H_ -#define ARDUINO_OPENCYPHAL_NODE_INFO_H_ +#pragma once /************************************************************************************** * INCLUDES @@ -80,5 +79,3 @@ class NodeInfo : public NodeInfoBase } /* impl */ } /* cyphal */ - -#endif /* ARDUINO_OPENCYPHAL_NODE_INFO_H_ */ diff --git a/src/util/nodeinfo/NodeInfoBase.hpp b/src/util/nodeinfo/NodeInfoBase.hpp index 9163b050..f69123e8 100644 --- a/src/util/nodeinfo/NodeInfoBase.hpp +++ b/src/util/nodeinfo/NodeInfoBase.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef ARDUINO_OPENCYPHAL_NODE_INFO_BASE_H_ -#define ARDUINO_OPENCYPHAL_NODE_INFO_BASE_H_ +#pragma once /************************************************************************************** * INCLUDES @@ -58,5 +57,3 @@ using NodeInfo = std::shared_ptr; **************************************************************************************/ } /* cyphal */ - -#endif /* ARDUINO_OPENCYPHAL_NODE_INFO_BASE_H_ */ diff --git a/src/util/port/PortListPublisher.hpp b/src/util/port/PortListPublisher.hpp index c1a99caf..99ff912e 100644 --- a/src/util/port/PortListPublisher.hpp +++ b/src/util/port/PortListPublisher.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_LIST_HPP -#define INC_107_ARDUINO_CYPHAL_LIST_HPP +#pragma once /************************************************************************************** * INCLUDES @@ -99,5 +98,3 @@ class PortListPublisher final : public PortListPublisherBase } /* impl */ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_LIST_HPP */ diff --git a/src/util/port/PortListPublisherBase.hpp b/src/util/port/PortListPublisherBase.hpp index d0ab6718..f43118ff 100644 --- a/src/util/port/PortListPublisherBase.hpp +++ b/src/util/port/PortListPublisherBase.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef INC_107_ARDUINO_CYPHAL_LIST_BASE_HPP -#define INC_107_ARDUINO_CYPHAL_LIST_BASE_HPP +#pragma once /************************************************************************************** * INCLUDES @@ -64,5 +63,3 @@ using PortListPublisher = std::shared_ptr; **************************************************************************************/ } /* cyphal */ - -#endif /* INC_107_ARDUINO_CYPHAL_LIST_BASE_HPP */ diff --git a/src/util/registry/Registry.hpp b/src/util/registry/Registry.hpp index 3c92e89a..439067c7 100644 --- a/src/util/registry/Registry.hpp +++ b/src/util/registry/Registry.hpp @@ -5,8 +5,7 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef REGISTER_LIST_H_ -#define REGISTER_LIST_H_ +#pragma once /************************************************************************************** * INCLUDES @@ -119,5 +118,3 @@ class Registry final : public cyphal::registry::Registry } /* cyphal */ #endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */ - -#endif /* REGISTER_LIST_H_ */ diff --git a/src/util/transfer_metadata.hpp b/src/util/transfer_metadata.hpp index 8d9aca4f..f508d4c7 100644 --- a/src/util/transfer_metadata.hpp +++ b/src/util/transfer_metadata.hpp @@ -5,13 +5,10 @@ * Contributors: https://github.com/107-systems/107-Arduino-Cyphal/graphs/contributors. */ -#ifndef ARDUINO_CYPHAL_TRANSFER_METADATA_HPP_ -#define ARDUINO_CYPHAL_TRANSFER_METADATA_HPP_ +#pragma once struct TransferMetadata final { uint16_t remote_node_id; // More stuff may appear here in the future! }; - -#endif // ARDUINO_CYPHAL_TRANSFER_METADATA_HPP_