mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 18:52:07 +00:00
Add more rules to .clang-format
This commit is contained in:
@@ -49,7 +49,8 @@ static std::pair<Symbol const *, Symbol const *> currentLoadLabelScopes = {nullp
|
||||
int32_t loadOffset; // Offset into the LOAD section's parent (see sect_GetOutputOffset)
|
||||
|
||||
// A quick check to see if we have an initialized section
|
||||
[[nodiscard]] static bool requireSection() {
|
||||
[[nodiscard]]
|
||||
static bool requireSection() {
|
||||
if (currentSection)
|
||||
return true;
|
||||
|
||||
@@ -59,7 +60,8 @@ int32_t loadOffset; // Offset into the LOAD section's parent (see sect_GetOutput
|
||||
|
||||
// A quick check to see if we have an initialized section that can contain
|
||||
// this much initialized data
|
||||
[[nodiscard]] static bool requireCodeSection() {
|
||||
[[nodiscard]]
|
||||
static bool requireCodeSection() {
|
||||
if (!requireSection())
|
||||
return false;
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ int32_t Symbol::getOutputValue() const {
|
||||
}
|
||||
|
||||
ContentSpan const &Symbol::getMacro() const {
|
||||
assume((std::holds_alternative<ContentSpan>(data)));
|
||||
assume(std::holds_alternative<ContentSpan>(data));
|
||||
return std::get<ContentSpan>(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +308,8 @@ void error(char const *fmt, ...) {
|
||||
);
|
||||
}
|
||||
|
||||
[[noreturn]] void fatalerror(char const *fmt, ...) {
|
||||
[[noreturn]]
|
||||
void fatalerror(char const *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
|
||||
@@ -22,7 +22,8 @@ static void vwarnx(char const *fmt, va_list ap) {
|
||||
putc('\n', stderr);
|
||||
}
|
||||
|
||||
[[noreturn]] static void verr(char const *fmt, va_list ap) {
|
||||
[[noreturn]]
|
||||
static void verr(char const *fmt, va_list ap) {
|
||||
char const *error = strerror(errno);
|
||||
|
||||
fprintf(stderr, "error: ");
|
||||
@@ -32,7 +33,8 @@ static void vwarnx(char const *fmt, va_list ap) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
[[noreturn]] static void verrx(char const *fmt, va_list ap) {
|
||||
[[noreturn]]
|
||||
static void verrx(char const *fmt, va_list ap) {
|
||||
fprintf(stderr, "error: ");
|
||||
vfprintf(stderr, fmt, ap);
|
||||
putc('\n', stderr);
|
||||
@@ -56,14 +58,16 @@ void warnx(char const *fmt, ...) {
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
[[noreturn]] void err(char const *fmt, ...) {
|
||||
[[noreturn]]
|
||||
void err(char const *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
verr(fmt, ap);
|
||||
}
|
||||
|
||||
[[noreturn]] void errx(char const *fmt, ...) {
|
||||
[[noreturn]]
|
||||
void errx(char const *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
||||
@@ -75,7 +75,8 @@ static void printUsage() {
|
||||
|
||||
static uint8_t nbErrors;
|
||||
|
||||
[[gnu::format(printf, 1, 2)]] static void report(char const *fmt, ...) {
|
||||
[[gnu::format(printf, 1, 2)]]
|
||||
static void report(char const *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
|
||||
@@ -41,7 +41,8 @@ static struct LocalOptions {
|
||||
|
||||
static uintmax_t nbErrors;
|
||||
|
||||
[[noreturn]] void giveUp() {
|
||||
[[noreturn]]
|
||||
void giveUp() {
|
||||
fprintf(stderr, "Conversion aborted after %ju error%s\n", nbErrors, nbErrors == 1 ? "" : "s");
|
||||
exit(1);
|
||||
}
|
||||
@@ -82,7 +83,8 @@ void errorMessage(char const *msg) {
|
||||
nbErrors++;
|
||||
}
|
||||
|
||||
[[noreturn]] void fatal(char const *fmt, ...) {
|
||||
[[noreturn]]
|
||||
void fatal(char const *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
fputs("FATAL: ", stderr);
|
||||
|
||||
@@ -191,7 +191,8 @@ static T readLE(U const *bytes) {
|
||||
|
||||
// **Appends** the first line read from `file` to the end of the provided `buffer`.
|
||||
// @return true if a line was read.
|
||||
[[gnu::warn_unused_result]] static bool readLine(std::filebuf &file, std::string &buffer) {
|
||||
[[gnu::warn_unused_result]]
|
||||
static bool readLine(std::filebuf &file, std::string &buffer) {
|
||||
assume(buffer.empty());
|
||||
// TODO: maybe this can be optimized to bulk reads?
|
||||
for (;;) {
|
||||
|
||||
@@ -34,7 +34,8 @@ public:
|
||||
// Registers a color in the palette.
|
||||
// If the newly inserted color "conflicts" with another one (different color, but same CGB
|
||||
// color), then the other color is returned. Otherwise, `nullptr` is returned.
|
||||
[[nodiscard]] Rgba const *registerColor(Rgba const &rgba) {
|
||||
[[nodiscard]]
|
||||
Rgba const *registerColor(Rgba const &rgba) {
|
||||
decltype(_colors)::value_type &slot = _colors[rgba.cgbColor()];
|
||||
|
||||
if (rgba.cgbColor() == Rgba::transparent) {
|
||||
@@ -77,7 +78,8 @@ class Png {
|
||||
int nbTransparentEntries;
|
||||
png_bytep transparencyPal = nullptr;
|
||||
|
||||
[[noreturn]] static void handleError(png_structp png, char const *msg) {
|
||||
[[noreturn]]
|
||||
static void handleError(png_structp png, char const *msg) {
|
||||
Png *self = reinterpret_cast<Png *>(png_get_error_ptr(png));
|
||||
|
||||
fatal("Error reading input image (\"%s\"): %s", self->c_str(), msg);
|
||||
|
||||
@@ -49,7 +49,8 @@ static DefaultInitVec<uint8_t> readInto(std::string const &path) {
|
||||
return data;
|
||||
}
|
||||
|
||||
[[noreturn]] static void pngError(png_structp png, char const *msg) {
|
||||
[[noreturn]]
|
||||
static void pngError(png_structp png, char const *msg) {
|
||||
fatal(
|
||||
"Error writing reversed image (\"%s\"): %s",
|
||||
static_cast<char const *>(png_get_error_ptr(png)),
|
||||
|
||||
@@ -113,7 +113,8 @@ void argErr(char flag, char const *fmt, ...) {
|
||||
nbErrors++;
|
||||
}
|
||||
|
||||
[[noreturn]] void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
||||
[[noreturn]]
|
||||
void fatal(FileStackNode const *where, uint32_t lineNo, char const *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
@@ -308,7 +309,8 @@ next: // Can't `continue` a `for` loop with this nontrivial iteration logic
|
||||
}
|
||||
}
|
||||
|
||||
[[noreturn]] void reportErrors() {
|
||||
[[noreturn]]
|
||||
void reportErrors() {
|
||||
fprintf(
|
||||
stderr, "Linking failed with %" PRIu32 " error%s\n", nbErrors, nbErrors == 1 ? "" : "s"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user