From b5b9c95de160a97701777d37187de194d0b29e61 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 2 Jan 2022 19:55:40 +0000 Subject: Replace include guard macros with pragma once --- lib/cache.h | 5 +---- lib/chronology.hpp | 5 +---- lib/collection.hpp | 5 +---- lib/embed-glsl.h.m4 | 2 ++ lib/glRef.hpp | 5 +---- lib/jsonParse-persistence.h | 5 +---- lib/jsonParse.h | 5 +---- lib/location.hpp | 5 +---- lib/maths.h | 5 +---- lib/persistence.h | 5 +---- lib/ptr.hpp | 5 +---- lib/resource.h | 5 +---- lib/sorting.hpp | 5 +---- lib/special_members.hpp | 5 +---- lib/stream_support.hpp | 5 +---- lib/strings.hpp | 7 +++---- lib/unicode.h | 5 +---- lib/work.h | 5 +---- lib/worker.h | 4 +--- 19 files changed, 22 insertions(+), 71 deletions(-) (limited to 'lib') diff --git a/lib/cache.h b/lib/cache.h index cdc0a2e..5ab9469 100644 --- a/lib/cache.h +++ b/lib/cache.h @@ -1,5 +1,4 @@ -#ifndef CACHE_H -#define CACHE_H +#pragma once #include "special_members.hpp" #include @@ -37,5 +36,3 @@ private: std::map> cached; }; // IWYU pragma: no_forward_declare Cache - -#endif diff --git a/lib/chronology.hpp b/lib/chronology.hpp index 5edf95a..1980116 100644 --- a/lib/chronology.hpp +++ b/lib/chronology.hpp @@ -1,8 +1,5 @@ -#ifndef CHRONOLOGY_H -#define CHRONOLOGY_H +#pragma once #include using TickDuration = std::chrono::duration; - -#endif diff --git a/lib/collection.hpp b/lib/collection.hpp index cf51157..a80faa2 100644 --- a/lib/collection.hpp +++ b/lib/collection.hpp @@ -1,5 +1,4 @@ -#ifndef COLLECTION_H -#define COLLECTION_H +#pragma once #include #include @@ -69,5 +68,3 @@ public: return objects.end(); } }; - -#endif diff --git a/lib/embed-glsl.h.m4 b/lib/embed-glsl.h.m4 index f277c56..57ba0cf 100644 --- a/lib/embed-glsl.h.m4 +++ b/lib/embed-glsl.h.m4 @@ -1,3 +1,5 @@ +#pragma once + // NAME #include diff --git a/lib/glRef.hpp b/lib/glRef.hpp index 3377390..fc0c1c6 100644 --- a/lib/glRef.hpp +++ b/lib/glRef.hpp @@ -1,5 +1,4 @@ -#ifndef GLREF_H -#define GLREF_H +#pragma once #include #include @@ -58,5 +57,3 @@ public: private: IdType id; }; - -#endif diff --git a/lib/jsonParse-persistence.h b/lib/jsonParse-persistence.h index edb5305..fa5e772 100644 --- a/lib/jsonParse-persistence.h +++ b/lib/jsonParse-persistence.h @@ -1,5 +1,4 @@ -#ifndef JSONPARSE_PERSISTANCE -#define JSONPARSE_PERSISTANCE +#pragma once #include "jsonParse.h" // IWYU pragma: export #include "persistence.h" // IWYU pragma: export @@ -68,5 +67,3 @@ namespace Persistence { std::ostream & strm; }; } - -#endif diff --git a/lib/jsonParse.h b/lib/jsonParse.h index 79833eb..4205572 100644 --- a/lib/jsonParse.h +++ b/lib/jsonParse.h @@ -1,5 +1,4 @@ -#ifndef JSONFLEXLEXER_H -#define JSONFLEXLEXER_H +#pragma once #ifndef FLEX_SCANNER # define yyFlexLexer jsonBaseFlexLexer @@ -39,5 +38,3 @@ namespace json { std::string buf; }; } - -#endif diff --git a/lib/location.hpp b/lib/location.hpp index b019b7a..1360c47 100644 --- a/lib/location.hpp +++ b/lib/location.hpp @@ -1,5 +1,4 @@ -#ifndef LOCATION_H -#define LOCATION_H +#pragma once #include @@ -10,5 +9,3 @@ public: glm::vec3 pos; glm::vec3 rot; }; - -#endif diff --git a/lib/maths.h b/lib/maths.h index c7b1c8f..514a5ad 100644 --- a/lib/maths.h +++ b/lib/maths.h @@ -1,5 +1,4 @@ -#ifndef MATH_H -#define MATH_H +#pragma once #include #include @@ -142,5 +141,3 @@ kph_to_ms(T v) // ... literals are handy for now, probably go away when we load stuff externally float operator"" _mph(const long double v); float operator"" _kph(const long double v); - -#endif diff --git a/lib/persistence.h b/lib/persistence.h index 60b40ca..4fbff4c 100644 --- a/lib/persistence.h +++ b/lib/persistence.h @@ -1,5 +1,4 @@ -#ifndef PERSISTANCE_H -#define PERSISTANCE_H +#pragma once #include #include @@ -463,5 +462,3 @@ namespace Persistence { #define STORE_TYPE store.persistType(this, typeid(*this)) #define STORE_MEMBER(mbr) store.persistValue(#mbr, mbr) - -#endif diff --git a/lib/ptr.hpp b/lib/ptr.hpp index f242670..931df39 100644 --- a/lib/ptr.hpp +++ b/lib/ptr.hpp @@ -1,5 +1,4 @@ -#ifndef PTR_H -#define PTR_H +#pragma once #include #include @@ -66,5 +65,3 @@ public: { } }; - -#endif diff --git a/lib/resource.h b/lib/resource.h index 958c49d..37dd657 100644 --- a/lib/resource.h +++ b/lib/resource.h @@ -1,5 +1,4 @@ -#ifndef RESOURCE_H -#define RESOURCE_H +#pragma once #include @@ -19,5 +18,3 @@ public: }; BOOST_GLOBAL_FIXTURE(SetResourcePath); #endif - -#endif diff --git a/lib/sorting.hpp b/lib/sorting.hpp index 0cb0eaf..6b9be6a 100644 --- a/lib/sorting.hpp +++ b/lib/sorting.hpp @@ -1,5 +1,4 @@ -#ifndef SORTING_H -#define SORTING_H +#pragma once template struct PtrSorter { bool @@ -8,5 +7,3 @@ template struct PtrSorter { return *a < *b; } }; - -#endif diff --git a/lib/special_members.hpp b/lib/special_members.hpp index 4b85884..312862b 100644 --- a/lib/special_members.hpp +++ b/lib/special_members.hpp @@ -1,5 +1,4 @@ -#ifndef SPECIAL_MEMBERS_H -#define SPECIAL_MEMBERS_H +#pragma once #define NO_COPY(TYPE) \ TYPE(const TYPE &) = delete; \ @@ -28,5 +27,3 @@ #define CUSTOM_MOVE(TYPE) \ TYPE(TYPE &&) noexcept; \ TYPE & operator=(TYPE &&) noexcept - -#endif diff --git a/lib/stream_support.hpp b/lib/stream_support.hpp index 1ee1661..449708c 100644 --- a/lib/stream_support.hpp +++ b/lib/stream_support.hpp @@ -1,5 +1,4 @@ -#ifndef STREAM_SUPPORT_H -#define STREAM_SUPPORT_H +#pragma once #include #include @@ -38,5 +37,3 @@ namespace std { } #define CLOG(x) std::clog << #x " : " << x << "\n"; - -#endif diff --git a/lib/strings.hpp b/lib/strings.hpp index ee0db95..9dca9ac 100644 --- a/lib/strings.hpp +++ b/lib/strings.hpp @@ -1,5 +1,6 @@ -#ifndef STRINGS_HPP -#define STRINGS_HPP +#pragma once + +#include constexpr auto constexpr_strlen(const GLchar * const s) @@ -10,5 +11,3 @@ constexpr_strlen(const GLchar * const s) } return ch; } - -#endif diff --git a/lib/unicode.h b/lib/unicode.h index 8bd841b..dde1d3d 100644 --- a/lib/unicode.h +++ b/lib/unicode.h @@ -1,5 +1,4 @@ -#ifndef UNICODE_H -#define UNICODE_H +#pragma once // Wrappers of some glib functions (why are we using glib then?) which we want, but glib.h is a bit C like @@ -16,5 +15,3 @@ uint32_t get_codepoint(const char *); #ifdef __cplusplus } #endif - -#endif diff --git a/lib/work.h b/lib/work.h index 2374673..c780e13 100644 --- a/lib/work.h +++ b/lib/work.h @@ -1,5 +1,4 @@ -#ifndef WORK_H -#define WORK_H +#pragma once #include @@ -11,5 +10,3 @@ public: virtual void doWork() = 0; }; - -#endif diff --git a/lib/worker.h b/lib/worker.h index 7df16cd..de7d973 100644 --- a/lib/worker.h +++ b/lib/worker.h @@ -1,5 +1,4 @@ -#ifndef WORKER_H -#define WORKER_H +#pragma once #include class Work; @@ -57,4 +56,3 @@ public: }; #endif -#endif -- cgit v1.2.3