Run clang-format

Fix some small style inconsistencies
This commit is contained in:
ISSOtm
2024-03-28 01:41:25 +01:00
parent d327138cd8
commit 20b7b591d4
9 changed files with 18 additions and 18 deletions

View File

@@ -31,7 +31,7 @@
#define ssize_t int
#define SSIZE_MAX INT_MAX
#else
#include <fcntl.h> // IWYU pragma: export
#include <fcntl.h> // IWYU pragma: export
#include <limits.h> // IWYU pragma: export
#include <unistd.h> // IWYU pragma: export
#endif

View File

@@ -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 <windows.h> // target architecture
@@ -2175,18 +2175,19 @@ static Capture startCapture() {
view && lexerState->expansions.empty()) {
return {
.lineNo = lineNo,
.span = {
.ptr = std::shared_ptr<char[]>(view->span.ptr, &view->span.ptr[view->offset]),
.size = 0,
}
};
.span =
{
.ptr = std::shared_ptr<char[]>(view->span.ptr, &view->span.ptr[view->offset]),
.size = 0,
}
};
} else {
assert(lexerState->captureBuf == nullptr);
lexerState->captureBuf = std::make_shared<std::vector<char>>();
// `.span.ptr == nullptr`; indicates to retrieve the capture buffer when done capturing
return {
.lineNo = lineNo, .span = {.ptr = nullptr, .size = 0}
};
};
}
}

View File

@@ -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

View File

@@ -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 */

View File

@@ -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,

View File

@@ -156,7 +156,7 @@ void reverse() {
std::vector<std::array<std::optional<Rgba>, 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;

View File

@@ -246,8 +246,8 @@ static void placeSection(Section &section) {
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!

View File

@@ -52,7 +52,7 @@ static SectionType typeMap[SECTTYPE_INVALID] = {
};
void out_AddSection(Section const &section) {
static const uint32_t maxNbBanks[SECTTYPE_INVALID] = {
static uint32_t const maxNbBanks[SECTTYPE_INVALID] = {
1, // SECTTYPE_WRAM0
2, // SECTTYPE_VRAM
UINT32_MAX, // SECTTYPE_ROMX

View File

@@ -9,9 +9,8 @@
#include <variant>
#include <vector>
#include "opmath.hpp"
#include "linkdefs.hpp"
#include "opmath.hpp"
#include "link/main.hpp"
#include "link/section.hpp"