From 7b0e6ad0b6a57ae7841c5ec725583fd61d489224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 12 Dec 2021 17:48:52 +0100 Subject: [PATCH] Reformat with clang-format-12 from updated CI image --- src/openrct2/core/Crypt.CNG.cpp | 3 ++- src/openrct2/core/Http.cURL.cpp | 3 ++- src/openrct2/core/IStream.hpp | 2 +- src/openrct2/drawing/Drawing.Sprite.cpp | 3 ++- src/openrct2/drawing/Drawing.String.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.Banner.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.Entrance.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.LargeScenery.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.Path.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.SmallScenery.cpp | 3 ++- src/openrct2/paint/tile_element/Paint.Wall.cpp | 3 ++- src/openrct2/platform/Platform.Posix.cpp | 3 ++- src/openrct2/util/Util.h | 4 ++-- 13 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/openrct2/core/Crypt.CNG.cpp b/src/openrct2/core/Crypt.CNG.cpp index 9540d73102..d510bb8026 100644 --- a/src/openrct2/core/Crypt.CNG.cpp +++ b/src/openrct2/core/Crypt.CNG.cpp @@ -9,8 +9,9 @@ #if !defined(DISABLE_NETWORK) && defined(_WIN32) && (!defined(_WIN32_WINNT) || _WIN32_WINNT >= 0x0600) -# include "../platform/Platform2.h" # include "Crypt.h" + +# include "../platform/Platform2.h" # include "IStream.hpp" # include diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index 41891a50a4..13d025214b 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -9,9 +9,10 @@ #if !defined(DISABLE_HTTP) && (!defined(_WIN32) || (defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600)) +# include "Http.h" + # include "../Version.h" # include "../core/Console.hpp" -# include "Http.h" # include # include diff --git a/src/openrct2/core/IStream.hpp b/src/openrct2/core/IStream.hpp index 58449729c2..883ae5e9c3 100644 --- a/src/openrct2/core/IStream.hpp +++ b/src/openrct2/core/IStream.hpp @@ -193,7 +193,7 @@ namespace OpenRCT2 Write(&value); } - template[[nodiscard]] std::unique_ptr ReadArray(size_t count) + template [[nodiscard]] std::unique_ptr ReadArray(size_t count) { auto buffer = std::make_unique(count); Read(buffer.get(), sizeof(T) * count); diff --git a/src/openrct2/drawing/Drawing.Sprite.cpp b/src/openrct2/drawing/Drawing.Sprite.cpp index cbd8b0e6cd..7bf52cd054 100644 --- a/src/openrct2/drawing/Drawing.Sprite.cpp +++ b/src/openrct2/drawing/Drawing.Sprite.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "Drawing.h" + #include "../Context.h" #include "../OpenRCT2.h" #include "../PlatformEnvironment.h" @@ -17,7 +19,6 @@ #include "../sprites.h" #include "../ui/UiContext.h" #include "../util/Util.h" -#include "Drawing.h" #include "ScrollingText.h" #include diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 4450706156..fe7d7aa4fe 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -7,11 +7,12 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../drawing/Drawing.h" + #include "../Context.h" #include "../common.h" #include "../config/Config.h" #include "../core/String.hpp" -#include "../drawing/Drawing.h" #include "../drawing/IDrawingContext.h" #include "../drawing/IDrawingEngine.h" #include "../interface/Viewport.h" diff --git a/src/openrct2/paint/tile_element/Paint.Banner.cpp b/src/openrct2/paint/tile_element/Paint.Banner.cpp index f8728a582c..abad962ab6 100644 --- a/src/openrct2/paint/tile_element/Paint.Banner.cpp +++ b/src/openrct2/paint/tile_element/Paint.Banner.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Game.h" #include "../../config/Config.h" #include "../../interface/Viewport.h" @@ -16,7 +18,6 @@ #include "../../world/Banner.h" #include "../../world/Scenery.h" #include "../../world/TileInspector.h" -#include "../Paint.h" #include "Paint.TileElement.h" // BannerBoundBoxes[rotation][0] is for the pole in the back diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index ca99325925..369d5bdcb2 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Context.h" #include "../../Game.h" #include "../../GameState.h" @@ -24,7 +26,6 @@ #include "../../world/Footpath.h" #include "../../world/Park.h" #include "../../world/TileInspector.h" -#include "../Paint.h" #include "../Supports.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index ddc5274ea4..33331b7bb0 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Game.h" #include "../../config/Config.h" #include "../../core/Numerics.hpp" @@ -22,7 +24,6 @@ #include "../../world/Map.h" #include "../../world/Scenery.h" #include "../../world/TileInspector.h" -#include "../Paint.h" #include "../Supports.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index cc0f6b4ade..b2c89cddc3 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Context.h" #include "../../Game.h" #include "../../config/Config.h" @@ -31,7 +33,6 @@ #include "../../world/Scenery.h" #include "../../world/Surface.h" #include "../../world/TileInspector.h" -#include "../Paint.h" #include "../Supports.h" #include "Paint.Surface.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 10717d9216..23503eb635 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Game.h" #include "../../config/Config.h" #include "../../interface/Viewport.h" @@ -17,7 +19,6 @@ #include "../../world/Scenery.h" #include "../../world/SmallScenery.h" #include "../../world/TileInspector.h" -#include "../Paint.h" #include "../Supports.h" #include "Paint.TileElement.h" diff --git a/src/openrct2/paint/tile_element/Paint.Wall.cpp b/src/openrct2/paint/tile_element/Paint.Wall.cpp index 8ce8f9447a..69a064a80e 100644 --- a/src/openrct2/paint/tile_element/Paint.Wall.cpp +++ b/src/openrct2/paint/tile_element/Paint.Wall.cpp @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../Paint.h" + #include "../../Game.h" #include "../../common.h" #include "../../config/Config.h" @@ -21,7 +23,6 @@ #include "../../world/Scenery.h" #include "../../world/TileInspector.h" #include "../../world/Wall.h" -#include "../Paint.h" #include "Paint.TileElement.h" static constexpr const uint8_t DirectionToDoorImageOffset0[] = { diff --git a/src/openrct2/platform/Platform.Posix.cpp b/src/openrct2/platform/Platform.Posix.cpp index 8c3c7753ec..1b1ec5ecd1 100644 --- a/src/openrct2/platform/Platform.Posix.cpp +++ b/src/openrct2/platform/Platform.Posix.cpp @@ -9,11 +9,12 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__) +# include "platform.h" + # include "../core/Memory.hpp" # include "../core/Path.hpp" # include "../core/String.hpp" # include "Platform2.h" -# include "platform.h" # include # include diff --git a/src/openrct2/util/Util.h b/src/openrct2/util/Util.h index 5acfa086fd..3f26c22a21 100644 --- a/src/openrct2/util/Util.h +++ b/src/openrct2/util/Util.h @@ -74,13 +74,13 @@ uint8_t soft_light(uint8_t a, uint8_t b); size_t strcatftime(char* buffer, size_t bufferSize, const char* format, const struct tm* tp); -template[[nodiscard]] constexpr uint64_t EnumToFlag(T v) +template [[nodiscard]] constexpr uint64_t EnumToFlag(T v) { static_assert(std::is_enum_v); return 1ULL << static_cast>(v); } -template[[nodiscard]] constexpr uint64_t EnumsToFlags(T... types) +template [[nodiscard]] constexpr uint64_t EnumsToFlags(T... types) { return (EnumToFlag(types) | ...); }