From dd8f396227fafbfad52002f9eef9e8ff8ae8c4a0 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Fri, 23 Apr 2021 15:12:44 +0200 Subject: [PATCH] Fix compiler warnings As reported in #789 --- src/fix/main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/fix/main.c b/src/fix/main.c index 3a12f173..20477555 100644 --- a/src/fix/main.c +++ b/src/fix/main.c @@ -674,8 +674,8 @@ static void processFile(int input, int output, char const *name, off_t fileSize) report("FATAL: Failed to read \"%s\"'s header: %s\n", name, strerror(errno)); return; } else if (rom0Len < 0x150) { - report("FATAL: \"%s\" too short, expected at least 336 ($150) bytes, got only %ld\n", - name, rom0Len); + report("FATAL: \"%s\" too short, expected at least 336 ($150) bytes, got only %jd\n", + name, (intmax_t)rom0Len); return; } // Accept partial reads if the file contains at least the header @@ -863,8 +863,8 @@ static void processFile(int input, int output, char const *name, off_t fileSize) report("FATAL: Failed to write \"%s\"'s ROM0: %s\n", name, strerror(errno)); goto free_romx; } else if (writeLen < rom0Len) { - report("FATAL: Could only write %ld of \"%s\"'s %ld ROM0 bytes\n", - writeLen, name, rom0Len); + report("FATAL: Could only write %jd of \"%s\"'s %jd ROM0 bytes\n", + (intmax_t)writeLen, name, (intmax_t)rom0Len); goto free_romx; } @@ -877,8 +877,8 @@ static void processFile(int input, int output, char const *name, off_t fileSize) report("FATAL: Failed to write \"%s\"'s ROMX: %s\n", name, strerror(errno)); goto free_romx; } else if ((size_t)writeLen < totalRomxLen) { - report("FATAL: Could only write %ld of \"%s\"'s %ld ROMX bytes\n", - writeLen, name, totalRomxLen); + report("FATAL: Could only write %jd of \"%s\"'s %zu ROMX bytes\n", + (intmax_t)writeLen, name, totalRomxLen); goto free_romx; } } @@ -949,8 +949,8 @@ static bool processFilename(char const *name) } else if (stat.st_size < 0x150) { // This check is in theory redundant with the one in `processFile`, but it // prevents passing a file size of 0, which usually indicates pipes - report("FATAL: \"%s\" too short, expected at least 336 ($150) bytes, got only %ld\n", - name, stat.st_size); + report("FATAL: \"%s\" too short, expected at least 336 ($150) bytes, got only %jd\n", + name, (intmax_t)stat.st_size); } else { processFile(input, input, name, stat.st_size); }