From e56fd03cb2a1851bfedb66afb1b7cd420804bb09 Mon Sep 17 00:00:00 2001 From: Jarod42 Date: Sat, 25 Nov 2023 15:31:54 +0100 Subject: [PATCH] Fixes warning reported by gcc. --- src/ui/mouse.cpp | 2 +- src/ui/script_ui.cpp | 2 +- src/unit/unit_save.cpp | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp index bf964c39f1..b2e30c2c6e 100644 --- a/src/ui/mouse.cpp +++ b/src/ui/mouse.cpp @@ -1492,7 +1492,7 @@ static void SendCommand(const Vec2i &tilePos) ret = SendSpellCast(tilePos); break; default: - ErrorPrint("Unsupported send action %d\n", CursorAction); + ErrorPrint("Unsupported send action %d\n", static_cast(CursorAction)); break; } if (ret) { diff --git a/src/ui/script_ui.cpp b/src/ui/script_ui.cpp index 1001d3497d..a870c92c48 100644 --- a/src/ui/script_ui.cpp +++ b/src/ui/script_ui.cpp @@ -1229,7 +1229,7 @@ static int CclSetSelectionStyle(lua_State *l) static int CclAddMessage(lua_State *l) { LuaCheckArgs(l, 1); - SetMessage("%s", LuaToString(l, 1)); + SetMessage("%s", LuaToString(l, 1).data()); return 0; } diff --git a/src/unit/unit_save.cpp b/src/unit/unit_save.cpp index e28054e58c..4e74bfeadf 100644 --- a/src/unit/unit_save.cpp +++ b/src/unit/unit_save.cpp @@ -331,9 +331,8 @@ void SaveUnit(const CUnit &unit, CFile &file) file.printf(",\n \"spell-cooldown\", {"); const char *sep = ""; for (int timer : unit.SpellCoolDownTimers) { - file.printf(sep); - sep = " ,"; - file.printf("%d", timer); + file.printf("%s%d", sep, timer); + sep = ", "; } file.printf("}"); }