Fixes for -Wformat compiler warnings when using custom printf style functions.

This commit is contained in:
harry 2023-01-30 09:24:49 -05:00
parent 3266a20970
commit d061ba2bfa
7 changed files with 14 additions and 14 deletions

View File

@ -122,7 +122,7 @@ static void UNL43272Sync(void) {
if ((latche & 0x81) == 0x81) { if ((latche & 0x81) == 0x81) {
setprg32(0x8000, (latche & 0x38) >> 3); setprg32(0x8000, (latche & 0x38) >> 3);
} else } else
FCEU_printf("unrecognized command %04!\n", latche); FCEU_printf("unrecognized command %04x!\n", latche);
setchr8(0); setchr8(0);
setmirror(0); setmirror(0);
} }

View File

@ -120,7 +120,7 @@ FCEUD_NetworkConnect(void)
if(TSocket < 0) { if(TSocket < 0) {
const char* s = "Error creating stream socket."; const char* s = "Error creating stream socket.";
puts(s); puts(s);
FCEU_DispMessage(s,0); FCEU_DispMessage("%s",0,s);
FCEUD_NetworkClose(); FCEUD_NetworkClose();
return 0; return 0;
} }

View File

@ -899,7 +899,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) {
GameInfo->type = GIT_VSUNI; GameInfo->type = GIT_VSUNI;
break; break;
default: default:
FCEU_PrintError("Game type is not supported at all.", MapperNo); FCEU_PrintError("Game type is not supported at all.");
goto init_error; goto init_error;
} }
} }
@ -969,7 +969,7 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) {
FCEU_printf(" PRG ROM: %d x 16KiB = %d KiB\n", round ? ROM_size : not_round_size, (round ? ROM_size : not_round_size) * 16); FCEU_printf(" PRG ROM: %d x 16KiB = %d KiB\n", round ? ROM_size : not_round_size, (round ? ROM_size : not_round_size) * 16);
FCEU_printf(" CHR ROM: %d x 8KiB = %d KiB\n", VROM_size, VROM_size * 8); FCEU_printf(" CHR ROM: %d x 8KiB = %d KiB\n", VROM_size, VROM_size * 8);
FCEU_printf(" ROM CRC32: 0x%08lx\n", iNESGameCRC32); FCEU_printf(" ROM CRC32: 0x%08x\n", iNESGameCRC32);
{ {
int x; int x;
FCEU_printf(" ROM MD5: 0x"); FCEU_printf(" ROM MD5: 0x");

View File

@ -1583,10 +1583,10 @@ bool FCEUMOV_ReadState(EMUFILE* is, uint32 size)
//TODO: turn frame counter to red to get attention //TODO: turn frame counter to red to get attention
if (!backupSavestates) //If backups are disabled we can just resume normally since we can't restore so stop movie and inform user if (!backupSavestates) //If backups are disabled we can just resume normally since we can't restore so stop movie and inform user
{ {
FCEU_PrintError("Error: Savestate taken from a frame (%d) after the final frame in the savestated movie (%d) cannot be verified against current movie (%d). This is not permitted.\nUnable to restore backup, movie playback stopped.", currFrameCounter, tempMovieData.records.size() - 1, currMovieData.records.size() - 1); FCEU_PrintError("Error: Savestate taken from a frame (%d) after the final frame in the savestated movie (%zi) cannot be verified against current movie (%zi). This is not permitted.\nUnable to restore backup, movie playback stopped.", currFrameCounter, tempMovieData.records.size() - 1, currMovieData.records.size() - 1);
FCEUI_StopMovie(); FCEUI_StopMovie();
} else } else
FCEU_PrintError("Savestate taken from a frame (%d) after the final frame in the savestated movie (%d) cannot be verified against current movie (%d). This is not permitted.", currFrameCounter, tempMovieData.records.size() - 1, currMovieData.records.size() - 1); FCEU_PrintError("Savestate taken from a frame (%d) after the final frame in the savestated movie (%zi) cannot be verified against current movie (%zi). This is not permitted.", currFrameCounter, tempMovieData.records.size() - 1, currMovieData.records.size() - 1);
return false; return false;
} }
} }
@ -1742,7 +1742,7 @@ void FCEUI_MovieToggleReadOnly()
strcpy(message, "Movie is now Read+Write"); strcpy(message, "Movie is now Read+Write");
strcat(message, GetMovieModeStr()); strcat(message, GetMovieModeStr());
FCEU_DispMessage(message,0); FCEU_DispMessage("%s",0,message);
} }
void FCEUI_MovieToggleRecording() void FCEUI_MovieToggleRecording()
@ -1786,7 +1786,7 @@ void FCEUI_MovieToggleRecording()
strcat(message, GetMovieModeStr()); strcat(message, GetMovieModeStr());
FCEU_DispMessage(message, 0); FCEU_DispMessage("%s",0,message);
} }
void FCEUI_MovieInsertFrame() void FCEUI_MovieInsertFrame()
@ -1813,7 +1813,7 @@ void FCEUI_MovieInsertFrame()
strcat(message, GetMovieModeStr()); strcat(message, GetMovieModeStr());
} }
FCEU_DispMessage(message, 0); FCEU_DispMessage("%s",0,message);
} }
void FCEUI_MovieDeleteFrame() void FCEUI_MovieDeleteFrame()
@ -1851,7 +1851,7 @@ void FCEUI_MovieDeleteFrame()
strcat(message, GetMovieModeStr()); strcat(message, GetMovieModeStr());
} }
FCEU_DispMessage(message, 0); FCEU_DispMessage("%s",0,message);
} }
void FCEUI_MovieTruncate() void FCEUI_MovieTruncate()
@ -1889,7 +1889,7 @@ void FCEUI_MovieTruncate()
strcat(message, GetMovieModeStr()); strcat(message, GetMovieModeStr());
} }
FCEU_DispMessage(message, 0); FCEU_DispMessage("%s",0,message);
} }
void FCEUI_MovieNextRecordMode() void FCEUI_MovieNextRecordMode()

View File

@ -140,7 +140,7 @@ static int DoMirroring(FCEUFILE *fp) {
return(0); return(0);
FCEU_printf(" %02x", t); FCEU_printf(" %02x", t);
} }
FCEU_printf("\n Default Name/Attribute Table Mirroring: Horizontal\n", uchead.info); FCEU_printf("\n Default Name/Attribute Table Mirroring: Horizontal\n");
mirrortodo = 0; mirrortodo = 0;
} }
return(1); return(1);

View File

@ -112,6 +112,6 @@ void* FCEU_realloc(void* ptr, size_t size)
void FCEU_abort(const char* message) void FCEU_abort(const char* message)
{ {
if(message) FCEU_PrintError(message); if(message) FCEU_PrintError("%s", message);
abort(); abort();
} }

View File

@ -422,7 +422,7 @@ void FCEU_DispMessage( __FCEU_PRINTF_FORMAT const char *format, int disppos=0, .
vsnprintf(temp,sizeof(temp),format,ap); vsnprintf(temp,sizeof(temp),format,ap);
va_end(ap); va_end(ap);
strcat(temp, "\n"); strcat(temp, "\n");
FCEU_printf(temp); FCEU_printf("%s",temp);
if ( vidGuiMsgEna ) if ( vidGuiMsgEna )
{ {