From f48c282dff15cc5916567025f9b5f6bf2f42006b Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 27 Sep 2018 22:01:40 -0700 Subject: [PATCH] SCP: Silence potential compiler warnings on Windows using GCC --- sim_fio.c | 6 +++--- sim_timer.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sim_fio.c b/sim_fio.c index fcbdc5b0..6d10a8eb 100644 --- a/sim_fio.c +++ b/sim_fio.c @@ -446,7 +446,7 @@ if ((*shmem)->hMapping == INVALID_HANDLE_VALUE) { sim_shmem_close (*shmem); *shmem = NULL; - return sim_messagef (SCPE_OPENERR, "Can't CreateFileMapping of a %u byte shared memory segment '%s' - LastError=0x%X\n", size, name, LastError); + return sim_messagef (SCPE_OPENERR, "Can't CreateFileMapping of a %u byte shared memory segment '%s' - LastError=0x%X\n", (unsigned int)size, name, (unsigned int)LastError); } AlreadyExists = (GetLastError () == ERROR_ALREADY_EXISTS); (*shmem)->shm_base = MapViewOfFile ((*shmem)->hMapping, FILE_MAP_ALL_ACCESS, 0, 0, 0); @@ -455,7 +455,7 @@ if ((*shmem)->shm_base == NULL) { sim_shmem_close (*shmem); *shmem = NULL; - return sim_messagef (SCPE_OPENERR, "Can't MapViewOfFile() of a %u byte shared memory segment '%s' - LastError=0x%X\n", size, name, LastError); + return sim_messagef (SCPE_OPENERR, "Can't MapViewOfFile() of a %u byte shared memory segment '%s' - LastError=0x%X\n", (unsigned int)size, name, (unsigned int)LastError); } if (AlreadyExists) { if (*((DWORD *)((*shmem)->shm_base)) == 0) @@ -464,7 +464,7 @@ if (AlreadyExists) { DWORD SizeFound = *((DWORD *)((*shmem)->shm_base)); sim_shmem_close (*shmem); *shmem = NULL; - return sim_messagef (SCPE_OPENERR, "Shared Memory segment '%s' is %u bytes instead of %d\n", name, SizeFound, (int)size); + return sim_messagef (SCPE_OPENERR, "Shared Memory segment '%s' is %u bytes instead of %d\n", name, (unsigned int)SizeFound, (int)size); } } else diff --git a/sim_timer.c b/sim_timer.c index d31979bf..f857d63d 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -443,7 +443,7 @@ MMRESULT mm_status; mm_status = timeGetDevCaps (&timers, sizeof (timers)); if (mm_status != TIMERR_NOERROR) { - fprintf (stderr, "timeGetDevCaps() returned: 0x%X, Last Error: 0x%X\n", mm_status, GetLastError()); + fprintf (stderr, "timeGetDevCaps() returned: 0x%X, Last Error: 0x%X\n", mm_status, (unsigned int)GetLastError()); return 0; } if (timers.wPeriodMin == 0) { @@ -452,7 +452,7 @@ if (timers.wPeriodMin == 0) { } mm_status = timeBeginPeriod (timers.wPeriodMin); if (mm_status != TIMERR_NOERROR) { - fprintf (stderr, "timeBeginPeriod() returned: 0x%X, Last Error: 0x%X\n", mm_status, GetLastError()); + fprintf (stderr, "timeBeginPeriod() returned: 0x%X, Last Error: 0x%X\n", mm_status, (unsigned int)GetLastError()); return 0; } atexit (sim_timer_exit);