Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace manual #include guards with "#pragma once". #245

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/107-Arduino-Cyphal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,5 +18,3 @@
#include "ServiceClient.hpp"
#include "ServiceServer.hpp"
#include "util/storage/register_storage.hpp"

#endif /* _107_ARDUINO_CYPHAL_H_ */
5 changes: 1 addition & 4 deletions src/CanRxQueueItem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,5 +79,3 @@ class CanRxQueueItem
**************************************************************************************/

} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_CANARDRXQUEUEITEM_HPP */
5 changes: 1 addition & 4 deletions src/CircularBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -73,5 +72,3 @@ class CircularBuffer : public CircularBufferBase
**************************************************************************************/

#include "CircularBuffer.ipp"

#endif /* ARDUINO_CYPHAL_UTILITY_RINGBUFFER_H_ */
5 changes: 1 addition & 4 deletions src/DSDL_Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,5 +18,3 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#include "DSDL_Types.h.impl"
#pragma GCC diagnostic pop

#endif /* ARDUINO_UAVCAN_WRAPPERS_H_ */
5 changes: 1 addition & 4 deletions src/Node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -166,5 +165,3 @@ class Node
**************************************************************************************/

#include "Node.ipp"

#endif /* ARDUINO_CYPHAL_NODE_HPP_ */
5 changes: 1 addition & 4 deletions src/Publisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -63,5 +62,3 @@ class Publisher final : public PublisherBase<T>
**************************************************************************************/

#include "Publisher.ipp"

#endif /* INC_107_ARDUINO_CYPHAL_PUBLISHER_H */
5 changes: 1 addition & 4 deletions src/PublisherBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -60,5 +59,3 @@ using Publisher = std::shared_ptr<impl::PublisherBase<T>>;
**************************************************************************************/

} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_PUBLISHER_BASE_H */
5 changes: 1 addition & 4 deletions src/ServiceClient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -68,5 +67,3 @@ class ServiceClient final : public ServiceClientBase<T_REQ>
**************************************************************************************/

#include "ServiceClient.ipp"

#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_HPP */
5 changes: 1 addition & 4 deletions src/ServiceClientBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,5 +56,3 @@ using ServiceClient = std::shared_ptr<impl::ServiceClientBase<T_REQ>>;
**************************************************************************************/

} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_CLIENT_BASE_HPP */
5 changes: 1 addition & 4 deletions src/ServiceServer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -65,5 +64,3 @@ class ServiceServer final : public ServiceServerBase
**************************************************************************************/

#include "ServiceServer.ipp"

#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_HPP */
5 changes: 1 addition & 4 deletions src/ServiceServerBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -53,5 +52,3 @@ using ServiceServer = std::shared_ptr<impl::ServiceServerBase>;
**************************************************************************************/

} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_SERVICE_SERVER_BASE_HPP */
5 changes: 1 addition & 4 deletions src/Subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,5 +63,3 @@ class Subscription final : public SubscriptionBase
**************************************************************************************/

#include "Subscription.ipp"

#endif /* INC_107_ARDUINO_CYPHAL_SUBSCRIPTION_HPP */
5 changes: 1 addition & 4 deletions src/SubscriptionBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -86,5 +85,3 @@ using Subscription = std::shared_ptr<impl::SubscriptionBase>;
**************************************************************************************/

} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_CANARDSUBSCRIPTION_H */
5 changes: 1 addition & 4 deletions src/cyphal++/cyphal++.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
5 changes: 1 addition & 4 deletions src/util/nodeinfo/NodeInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -80,5 +79,3 @@ class NodeInfo : public NodeInfoBase

} /* impl */
} /* cyphal */

#endif /* ARDUINO_OPENCYPHAL_NODE_INFO_H_ */
5 changes: 1 addition & 4 deletions src/util/nodeinfo/NodeInfoBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -58,5 +57,3 @@ using NodeInfo = std::shared_ptr<impl::NodeInfoBase>;
**************************************************************************************/

} /* cyphal */

#endif /* ARDUINO_OPENCYPHAL_NODE_INFO_BASE_H_ */
5 changes: 1 addition & 4 deletions src/util/port/PortListPublisher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -99,5 +98,3 @@ class PortListPublisher final : public PortListPublisherBase

} /* impl */
} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_LIST_HPP */
5 changes: 1 addition & 4 deletions src/util/port/PortListPublisherBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -64,5 +63,3 @@ using PortListPublisher = std::shared_ptr<impl::PortListPublisherBase>;
**************************************************************************************/

} /* cyphal */

#endif /* INC_107_ARDUINO_CYPHAL_LIST_BASE_HPP */
5 changes: 1 addition & 4 deletions src/util/registry/Registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -119,5 +118,3 @@ class Registry final : public cyphal::registry::Registry
} /* cyphal */

#endif /* !defined(__GNUC__) || (__GNUC__ >= 11) */

#endif /* REGISTER_LIST_H_ */
5 changes: 1 addition & 4 deletions src/util/transfer_metadata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Loading