mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-29 22:37:50 +00:00
Add more rules to .clang-format
This commit is contained in:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user