From 70364013b04aa5fafd3f12fb77772239d010677c Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Sat, 16 Jul 2022 11:24:44 +0100 Subject: [PATCH] Fix fmt v9 deprecation warnings Version 9 of libfmt deprecates printing `enum` without casting it to an integral type explicitly (consistent with `enum class`). --- Source/engine/render/scrollrt.cpp | 8 ++++---- Source/miniwin/misc_msg.cpp | 2 +- Source/objects.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/engine/render/scrollrt.cpp b/Source/engine/render/scrollrt.cpp index b11ba0eb4..e08623915 100644 --- a/Source/engine/render/scrollrt.cpp +++ b/Source/engine/render/scrollrt.cpp @@ -322,13 +322,13 @@ void DrawMissilePrivate(const Surface &out, const Missile &missile, Point target return; if (missile._miAnimData == nullptr) { - Log("Draw Missile 2 type {}: NULL Cel Buffer", missile._mitype); + Log("Draw Missile 2 type {}: NULL Cel Buffer", static_cast(missile._mitype)); return; } int nCel = missile._miAnimFrame - 1; const uint32_t frames = LoadLE32(missile._miAnimData); if (nCel < 0 || frames > 50 || nCel >= static_cast(frames)) { - Log("Draw Missile 2: frame {} of {}, missile type=={}", nCel, frames, missile._mitype); + Log("Draw Missile 2: frame {} of {}, missile type {}", nCel, frames, static_cast(missile._mitype)); return; } @@ -623,14 +623,14 @@ void DrawObject(const Surface &out, Point tilePosition, Point targetBufferPositi byte *pCelBuff = objectToDraw._oAnimData; if (pCelBuff == nullptr) { - Log("Draw Object type {}: NULL Cel Buffer", objectToDraw._otype); + Log("Draw Object type {}: NULL Cel Buffer", static_cast(objectToDraw._otype)); return; } const uint32_t nCel = objectToDraw._oAnimFrame - 1; const uint32_t frames = LoadLE32(pCelBuff); if (nCel == static_cast(-1) || frames > 50 || nCel >= frames) { - Log("Draw Object: frame {} of {}, object type=={}", nCel, frames, objectToDraw._otype); + Log("Draw Object: frame {} of {}, object type {}", nCel, frames, static_cast(objectToDraw._otype)); return; } diff --git a/Source/miniwin/misc_msg.cpp b/Source/miniwin/misc_msg.cpp index d2560e07e..ac79dd959 100644 --- a/Source/miniwin/misc_msg.cpp +++ b/Source/miniwin/misc_msg.cpp @@ -260,7 +260,7 @@ int TranslateSdlKey(SDL_Keysym key) } else if (sym >= SDLK_F1 && sym <= SDLK_F12) { return DVL_VK_F1 + (sym - SDLK_F1); } - Log("unknown key: name={} sym=0x{:X} scan={} mod=0x{:X}", SDL_GetKeyName(sym), sym, key.scancode, key.mod); + Log("unknown key: name={} sym=0x{:X} scan={} mod=0x{:X}", SDL_GetKeyName(sym), static_cast(sym), static_cast(key.scancode), static_cast(key.mod)); return -1; } } diff --git a/Source/objects.cpp b/Source/objects.cpp index 93f4ffbc8..f64053ac4 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -769,7 +769,7 @@ void SetupObject(Object &object, Point position, _object_id ot) if (!HeadlessMode) { const auto &found = std::find(std::begin(ObjFileList), std::end(ObjFileList), ofi); if (found == std::end(ObjFileList)) { - LogCritical("Unable to find object_graphic_id {} in list of objects to load, level generation error.", ofi); + LogCritical("Unable to find object_graphic_id {} in list of objects to load, level generation error.", static_cast(ofi)); return; } @@ -5181,7 +5181,7 @@ void SyncObjectAnim(Object &object) if (!HeadlessMode) { const auto &found = std::find(std::begin(ObjFileList), std::end(ObjFileList), index); if (found == std::end(ObjFileList)) { - LogCritical("Unable to find object_graphic_id {} in list of objects to load, level generation error.", index); + LogCritical("Unable to find object_graphic_id {} in list of objects to load, level generation error.", static_cast(index)); return; }