From 505f63d85ccf1549f8cee7559ed977e427ec9f9b Mon Sep 17 00:00:00 2001 From: Pierre Dejoue Date: Sun, 8 May 2022 19:26:22 +0200 Subject: [PATCH] Pragma once and for all --- poly2tri/common/dll_symbol.h | 5 +---- poly2tri/common/shapes.h | 6 +----- poly2tri/common/utils.h | 5 +---- poly2tri/poly2tri.h | 5 +---- poly2tri/sweep/advancing_front.h | 5 +---- poly2tri/sweep/cdt.h | 5 +---- poly2tri/sweep/sweep.h | 5 +---- poly2tri/sweep/sweep_context.h | 5 +---- 8 files changed, 8 insertions(+), 33 deletions(-) diff --git a/poly2tri/common/dll_symbol.h b/poly2tri/common/dll_symbol.h index 92c50cb..bf5d202 100644 --- a/poly2tri/common/dll_symbol.h +++ b/poly2tri/common/dll_symbol.h @@ -29,8 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DLL_SYMBOL_H -#define DLL_SYMBOL_H +#pragma once #if defined(_WIN32) # define P2T_COMPILER_DLLEXPORT __declspec(dllexport) @@ -52,5 +51,3 @@ # define P2T_DLL_SYMBOL P2T_COMPILER_DLLIMPORT # endif #endif - -#endif diff --git a/poly2tri/common/shapes.h b/poly2tri/common/shapes.h index 489558d..d78aa87 100644 --- a/poly2tri/common/shapes.h +++ b/poly2tri/common/shapes.h @@ -29,9 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -// Include guard -#ifndef SHAPES_H -#define SHAPES_H +#pragma once #include "dll_symbol.h" @@ -329,5 +327,3 @@ inline void Triangle::IsInterior(bool b) P2T_DLL_SYMBOL bool IsDelaunay(const std::vector&); } - -#endif diff --git a/poly2tri/common/utils.h b/poly2tri/common/utils.h index 6a20a00..c9f1c23 100644 --- a/poly2tri/common/utils.h +++ b/poly2tri/common/utils.h @@ -29,8 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef UTILS_H -#define UTILS_H +#pragma once // Otherwise #defines like M_PI are undeclared under Visual Studio #define _USE_MATH_DEFINES @@ -129,5 +128,3 @@ bool InScanArea(const Point& pa, const Point& pb, const Point& pc, const Point& } } - -#endif diff --git a/poly2tri/poly2tri.h b/poly2tri/poly2tri.h index c959d13..3d40373 100644 --- a/poly2tri/poly2tri.h +++ b/poly2tri/poly2tri.h @@ -29,10 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef POLY2TRI_H -#define POLY2TRI_H +#pragma once #include "common/shapes.h" #include "sweep/cdt.h" - -#endif diff --git a/poly2tri/sweep/advancing_front.h b/poly2tri/sweep/advancing_front.h index 3de0708..ffd3fe7 100644 --- a/poly2tri/sweep/advancing_front.h +++ b/poly2tri/sweep/advancing_front.h @@ -29,8 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef ADVANCED_FRONT_H -#define ADVANCED_FRONT_H +#pragma once #include "../common/shapes.h" @@ -114,5 +113,3 @@ inline void AdvancingFront::set_search(Node* node) } } - -#endif diff --git a/poly2tri/sweep/cdt.h b/poly2tri/sweep/cdt.h index 7e3a45a..7c54ea9 100644 --- a/poly2tri/sweep/cdt.h +++ b/poly2tri/sweep/cdt.h @@ -29,8 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef CDT_H -#define CDT_H +#pragma once #include "advancing_front.h" #include "sweep_context.h" @@ -103,5 +102,3 @@ public: }; } - -#endif diff --git a/poly2tri/sweep/sweep.h b/poly2tri/sweep/sweep.h index 895b0e8..ec3b4b8 100644 --- a/poly2tri/sweep/sweep.h +++ b/poly2tri/sweep/sweep.h @@ -36,8 +36,7 @@ * "FlipScan" Constrained Edge Algorithm invented by Thomas Åhlén, thahlen@gmail.com */ -#ifndef SWEEP_H -#define SWEEP_H +#pragma once #include @@ -281,5 +280,3 @@ private: }; } - -#endif diff --git a/poly2tri/sweep/sweep_context.h b/poly2tri/sweep/sweep_context.h index da62181..11d5739 100644 --- a/poly2tri/sweep/sweep_context.h +++ b/poly2tri/sweep/sweep_context.h @@ -29,8 +29,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SWEEP_CONTEXT_H -#define SWEEP_CONTEXT_H +#pragma once #include #include @@ -183,5 +182,3 @@ inline Point* SweepContext::tail() const } } - -#endif