diff --git a/src/gfx/main.cpp b/src/gfx/main.cpp index 2db56f8f..385b08f2 100644 --- a/src/gfx/main.cpp +++ b/src/gfx/main.cpp @@ -835,7 +835,8 @@ int main(int argc, char *argv[]) { } else { process(); } - } else if (!options.palettes.empty() && options.palSpecType == Options::EXPLICIT && !options.reverse()) { + } else if (!options.palettes.empty() && options.palSpecType == Options::EXPLICIT + && !options.reverse()) { processPalettes(); } else { fputs("FATAL: No input image specified\n", stderr); diff --git a/src/gfx/pal_spec.cpp b/src/gfx/pal_spec.cpp index b6ff8783..cfeefd7f 100644 --- a/src/gfx/pal_spec.cpp +++ b/src/gfx/pal_spec.cpp @@ -177,7 +177,8 @@ void parseInlinePalSpec(char const * const rawArg) { */ template [[gnu::warn_unused_result]] // Ignoring failure to match is a bad idea. -static bool readMagic(std::filebuf &file, char const *magic) { +static bool + readMagic(std::filebuf &file, char const *magic) { assume(strlen(magic) == n); char magicBuf[n]; @@ -208,7 +209,8 @@ static T readLE(U const *bytes) { * @return true if a line was read. */ [[gnu::warn_unused_result]] // Ignoring EOF is a bad idea. -static bool readLine(std::filebuf &file, std::string &buffer) { +static bool + readLine(std::filebuf &file, std::string &buffer) { // TODO: maybe this can be optimized to bulk reads? for (;;) { auto c = file.sbumpc(); @@ -227,12 +229,13 @@ static bool readLine(std::filebuf &file, std::string &buffer) { } } -#define requireLine(kind, file, buffer) do { \ - if (!readLine(file, buffer)) { \ - error(kind " palette file is shorter than expected"); \ - return; \ - } \ -} while (0) +#define requireLine(kind, file, buffer) \ + do { \ + if (!readLine(file, buffer)) { \ + error(kind " palette file is shorter than expected"); \ + return; \ + } \ + } while (0) /* * Parses the initial part of a string_view, advancing the "read index" as it does @@ -375,7 +378,8 @@ static void parseGPLFile(std::filebuf &file) { return; } // Ignore anything following the three components - // (sometimes it's a comment, sometimes it's the color in CSS hex format, sometimes there's nothing...). + // (sometimes it's a comment, sometimes it's the color in CSS hex format, sometimes there's + // nothing...). if (nbColors < maxNbColors) { if (nbColors % options.nbColorsPerPal == 0) { diff --git a/src/gfx/reverse.cpp b/src/gfx/reverse.cpp index 42f15a95..398f0d83 100644 --- a/src/gfx/reverse.cpp +++ b/src/gfx/reverse.cpp @@ -176,7 +176,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;