From 83e0164c9338ac2c402bd726719928cae9741317 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 9 May 2015 16:21:35 +0200 Subject: [PATCH] Get rid of 64-bit formatting warnings --- gfx/video_monitor.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gfx/video_monitor.c b/gfx/video_monitor.c index c88bcc5475..8da2e1596a 100644 --- a/gfx/video_monitor.c +++ b/gfx/video_monitor.c @@ -179,6 +179,13 @@ bool video_monitor_fps_statistics(double *refresh_rate, * otherwise false. * **/ + +#ifdef _WIN32 +#define U64_SIGN "%I64u" +#else +#define U64_SIGN "%llu" +#endif + bool video_monitor_get_fps(char *buf, size_t size, char *buf_fps, size_t size_fps) { @@ -209,14 +216,14 @@ bool video_monitor_get_fps(char *buf, size_t size, last_fps = TIME_TO_FPS(curr_time, new_time, FPS_UPDATE_INTERVAL); curr_time = new_time; - snprintf(buf, size, "%s || FPS: %6.1f || Frames: %lu", - global->title_buf, last_fps, frame_count); + snprintf(buf, size, "%s || FPS: %6.1f || Frames: " U64_SIGN, + global->title_buf, last_fps, (unsigned long long)frame_count); ret = true; } if (buf_fps) - snprintf(buf_fps, size_fps, "FPS: %6.1f || Frames: %lu", - last_fps, frame_count); + snprintf(buf_fps, size_fps, "FPS: %6.1f || Frames: " U64_SIGN, + last_fps, (unsigned long long)frame_count); return ret; }