From 0667f2ec553a08a4f3edc6d85c55e58adb92494a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 26 Nov 2017 09:59:28 +0200 Subject: [PATCH] Fixed string format issues reported by GCC/Clang d_net.cpp:2874:25: warning: format specifies type 'int' but the argument has type 'unsigned long long' [-Wformat] gl/utility/gl_clock.cpp:240:38: warning: format specifies type 'int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] v_video.cpp:883:71: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] v_video.cpp:883:80: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat] --- src/d_net.cpp | 3 ++- src/gl/utility/gl_clock.cpp | 4 +++- src/v_video.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index e8711bda5..57dbb93b7 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -26,6 +26,7 @@ //----------------------------------------------------------------------------- #include +#include #include "version.h" #include "menu/menu.h" @@ -2871,7 +2872,7 @@ CCMD (pings) int i; for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) - Printf ("% 4d %s\n", currrecvtime[i] - lastrecvtime[i], + Printf ("% 4" PRId64 " %s\n", currrecvtime[i] - lastrecvtime[i], players[i].userinfo.GetName()); } diff --git a/src/gl/utility/gl_clock.cpp b/src/gl/utility/gl_clock.cpp index df96fb6b8..1003fae86 100644 --- a/src/gl/utility/gl_clock.cpp +++ b/src/gl/utility/gl_clock.cpp @@ -43,6 +43,8 @@ #include #endif +#include + #include "i_system.h" #include "g_level.h" #include "c_console.h" @@ -237,7 +239,7 @@ void CheckBench() AppendRenderTimes(compose); AppendLightStats(compose); AppendMissingTextureStats(compose); - compose.AppendFormat("%d fps\n\n", screen->GetLastFPS()); + compose.AppendFormat("%" PRIu64 " fps\n\n", screen->GetLastFPS()); FILE *f = fopen("benchmarks.txt", "at"); if (f != NULL) diff --git a/src/v_video.cpp b/src/v_video.cpp index 01ae8b428..814dc4615 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -880,7 +880,7 @@ void DFrameBuffer::DrawRateStuff () int textScale = active_con_scale(); - chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2u ms (%3u fps)", howlong, LastCount); + chars = mysnprintf (fpsbuff, countof(fpsbuff), "%2" PRIu64 " ms (%3" PRIu64 " fps)", howlong, LastCount); rate_x = Width / textScale - ConFont->StringWidth(&fpsbuff[0]); Clear (rate_x * textScale, 0, Width, ConFont->GetHeight() * textScale, GPalette.BlackIndex, 0); DrawText (ConFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0],