diff --git a/contrib/checkformat.bash b/contrib/checkformat.bash index f2f357ca..bcf11b1a 100755 --- a/contrib/checkformat.bash +++ b/contrib/checkformat.bash @@ -11,5 +11,5 @@ if ! git diff-index --quiet HEAD --; then git diff-index --name-only HEAD -- echo git diff HEAD -- - return 1 + exit 1 fi diff --git a/src/asm/main.cpp b/src/asm/main.cpp index 7d9014fd..b9b5db4b 100644 --- a/src/asm/main.cpp +++ b/src/asm/main.cpp @@ -67,14 +67,13 @@ static option const longopts[] = { {"define", required_argument, nullptr, 'D'}, {"export-all", no_argument, nullptr, 'E'}, {"gfx-chars", required_argument, nullptr, 'g'}, + {"help", no_argument, nullptr, 'h'}, {"include", required_argument, nullptr, 'I'}, {"dependfile", required_argument, nullptr, 'M'}, {"MG", no_argument, &depType, 'G'}, - {"help", no_argument, nullptr, 'h'}, {"MP", no_argument, &depType, 'P'}, - {"MT", required_argument, &depType, 'T'}, - {"warning", required_argument, nullptr, 'W'}, {"MQ", required_argument, &depType, 'Q'}, + {"MT", required_argument, &depType, 'T'}, {"output", required_argument, nullptr, 'o'}, {"preinclude", required_argument, nullptr, 'P'}, {"pad-value", required_argument, nullptr, 'p'}, diff --git a/src/gfx/process.cpp b/src/gfx/process.cpp index 427c30ff..81219312 100644 --- a/src/gfx/process.cpp +++ b/src/gfx/process.cpp @@ -1296,10 +1296,11 @@ continue_visiting_tiles:; uint32_t const nbTilesH = png.getHeight() / 8, nbTilesW = png.getWidth() / 8; // Check the tile count - if (nbTilesW * nbTilesH > options.maxNbTiles[0] + options.maxNbTiles[1]) { + if (uint32_t nbTiles = nbTilesW * nbTilesH; + nbTiles > options.maxNbTiles[0] + options.maxNbTiles[1]) { fatal( "Image contains %" PRIu32 " tiles, exceeding the limit of %" PRIu16 " + %" PRIu16, - nbTilesW * nbTilesH, + nbTiles, options.maxNbTiles[0], options.maxNbTiles[1] ); @@ -1328,10 +1329,11 @@ continue_visiting_tiles:; options.verbosePrint(Options::VERB_LOG_ACT, "Deduplicating tiles...\n"); UniqueTiles tiles = dedupTiles(png, attrmap, palettes, mappings); - if (tiles.size() > options.maxNbTiles[0] + options.maxNbTiles[1]) { + if (size_t nbTiles = tiles.size(); + nbTiles > options.maxNbTiles[0] + options.maxNbTiles[1]) { fatal( "Image contains %zu tiles, exceeding the limit of %" PRIu16 " + %" PRIu16, - tiles.size(), + nbTiles, options.maxNbTiles[0], options.maxNbTiles[1] );