diff --git a/include/platform.hpp b/include/platform.hpp index 2e20a8db..248ddec6 100644 --- a/include/platform.hpp +++ b/include/platform.hpp @@ -31,7 +31,7 @@ #define ssize_t int #define SSIZE_MAX INT_MAX #else - #include // IWYU pragma: export + #include // IWYU pragma: export #include // IWYU pragma: export #include // IWYU pragma: export #endif diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index 973f3627..ca108989 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -36,7 +36,7 @@ // Neither MSVC nor MinGW provide `mmap` #if defined(_MSC_VER) || defined(__MINGW32__) - // clang-format off +// clang-format off // (we need these `include`s in this order) #define WIN32_LEAN_AND_MEAN // include less from windows.h #include // target architecture @@ -2175,18 +2175,19 @@ static Capture startCapture() { view && lexerState->expansions.empty()) { return { .lineNo = lineNo, - .span = { - .ptr = std::shared_ptr(view->span.ptr, &view->span.ptr[view->offset]), - .size = 0, - } - }; + .span = + { + .ptr = std::shared_ptr(view->span.ptr, &view->span.ptr[view->offset]), + .size = 0, + } + }; } else { assert(lexerState->captureBuf == nullptr); lexerState->captureBuf = std::make_shared>(); // `.span.ptr == nullptr`; indicates to retrieve the capture buffer when done capturing return { .lineNo = lineNo, .span = {.ptr = nullptr, .size = 0} - }; + }; } } diff --git a/src/asm/warning.cpp b/src/asm/warning.cpp index 1707d69b..f396f9a8 100644 --- a/src/asm/warning.cpp +++ b/src/asm/warning.cpp @@ -20,7 +20,7 @@ unsigned int nbErrors = 0; unsigned int maxErrors = 0; -static const WarningState defaultWarnings[ARRAY_SIZE(warningStates)] = { +static WarningState const defaultWarnings[ARRAY_SIZE(warningStates)] = { WARNING_ENABLED, // WARNING_ASSERT WARNING_DISABLED, // WARNING_BACKWARDS_FOR WARNING_DISABLED, // WARNING_BUILTIN_ARG diff --git a/src/extern/utf8decoder.cpp b/src/extern/utf8decoder.cpp index 3b780c93..c20511c5 100644 --- a/src/extern/utf8decoder.cpp +++ b/src/extern/utf8decoder.cpp @@ -4,7 +4,7 @@ #include "extern/utf8decoder.hpp" -static const uint8_t utf8d[] = { +static uint8_t const utf8d[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00..0f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10..1f */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20..2f */ diff --git a/src/fix/main.cpp b/src/fix/main.cpp index 440643a8..e2bb3174 100644 --- a/src/fix/main.cpp +++ b/src/fix/main.cpp @@ -729,13 +729,13 @@ static bool hasRAM(MbcType type) { unreachable_(); } -static const uint8_t ninLogo[] = { +static uint8_t const ninLogo[] = { 0xCE, 0xED, 0x66, 0x66, 0xCC, 0x0D, 0x00, 0x0B, 0x03, 0x73, 0x00, 0x83, 0x00, 0x0C, 0x00, 0x0D, 0x00, 0x08, 0x11, 0x1F, 0x88, 0x89, 0x00, 0x0E, 0xDC, 0xCC, 0x6E, 0xE6, 0xDD, 0xDD, 0xD9, 0x99, 0xBB, 0xBB, 0x67, 0x63, 0x6E, 0x0E, 0xEC, 0xCC, 0xDD, 0xDC, 0x99, 0x9F, 0xBB, 0xB9, 0x33, 0x3E, }; -static const uint8_t trashLogo[] = { +static uint8_t const trashLogo[] = { 0xFF ^ 0xCE, 0xFF ^ 0xED, 0xFF ^ 0x66, 0xFF ^ 0x66, 0xFF ^ 0xCC, 0xFF ^ 0x0D, 0xFF ^ 0x00, 0xFF ^ 0x0B, 0xFF ^ 0x03, 0xFF ^ 0x73, 0xFF ^ 0x00, 0xFF ^ 0x83, 0xFF ^ 0x00, 0xFF ^ 0x0C, 0xFF ^ 0x00, 0xFF ^ 0x0D, 0xFF ^ 0x00, 0xFF ^ 0x08, 0xFF ^ 0x11, 0xFF ^ 0x1F, 0xFF ^ 0x88, diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index 0413f253..4e347165 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -156,7 +156,7 @@ void reverse() { std::vector, 4>> palettes{ {Rgba(0xFFFFFFFF), Rgba(0xAAAAAAFF), Rgba(0x555555FF), Rgba(0x000000FF)} - }; + }; // If a palette file is used as input, it overrides the default colors. if (!options.palettes.empty()) { File file; diff --git a/src/link/assign.cpp b/src/link/assign.cpp index a8b706d7..d02b3e3d 100644 --- a/src/link/assign.cpp +++ b/src/link/assign.cpp @@ -246,8 +246,8 @@ static void placeSection(Section §ion) { bankMem.insert( bankMem.begin() + spaceIdx + 1, {.address = (uint16_t)(section.org + section.size), - .size = - (uint16_t)(freeSpace.address + freeSpace.size - section.org - section.size)} + .size = (uint16_t)(freeSpace.address + freeSpace.size - section.org - section.size) + } ); // **`freeSpace` cannot be reused from this point on**, because `bankMem.insert` // invalidates all references to itself! diff --git a/src/link/output.cpp b/src/link/output.cpp index 82c0c229..47cc7f88 100644 --- a/src/link/output.cpp +++ b/src/link/output.cpp @@ -52,7 +52,7 @@ static SectionType typeMap[SECTTYPE_INVALID] = { }; void out_AddSection(Section const §ion) { - static const uint32_t maxNbBanks[SECTTYPE_INVALID] = { + static uint32_t const maxNbBanks[SECTTYPE_INVALID] = { 1, // SECTTYPE_WRAM0 2, // SECTTYPE_VRAM UINT32_MAX, // SECTTYPE_ROMX diff --git a/src/link/patch.cpp b/src/link/patch.cpp index 84d50a6c..db7921d1 100644 --- a/src/link/patch.cpp +++ b/src/link/patch.cpp @@ -9,9 +9,8 @@ #include #include -#include "opmath.hpp" - #include "linkdefs.hpp" +#include "opmath.hpp" #include "link/main.hpp" #include "link/section.hpp"