From b002419993529d45fe207a1f04c599112338a0b0 Mon Sep 17 00:00:00 2001 From: Merry Date: Tue, 26 Jul 2022 11:42:15 +0100 Subject: [PATCH] tests/{a32,a64}_unicorn: Avoid use of deprecated fmt API --- tests/unicorn_emu/a32_unicorn.cpp | 14 +++++++------- tests/unicorn_emu/a64_unicorn.cpp | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/unicorn_emu/a32_unicorn.cpp b/tests/unicorn_emu/a32_unicorn.cpp index ed8be3d1..db704c97 100644 --- a/tests/unicorn_emu/a32_unicorn.cpp +++ b/tests/unicorn_emu/a32_unicorn.cpp @@ -12,12 +12,12 @@ #include "../A32/testenv.h" -#define CHECKED(expr) \ - do { \ - if (auto cerr_ = (expr)) { \ - ASSERT_MSG(false, "Call " #expr " failed with error: {} ({})\n", cerr_, \ - uc_strerror(cerr_)); \ - } \ +#define CHECKED(expr) \ + do { \ + if (auto cerr_ = (expr)) { \ + ASSERT_MSG(false, "Call " #expr " failed with error: {} ({})\n", static_cast(cerr_), \ + uc_strerror(cerr_)); \ + } \ } while (0) constexpr u32 BEGIN_ADDRESS = 0; @@ -52,7 +52,7 @@ void A32Unicorn::Run() { return; } if (auto cerr_ = uc_emu_start(uc, pc, END_ADDRESS, 0, 1)) { - fmt::print("uc_emu_start failed @ {:08x} (code = {:08x}) with error {} ({})", pc, *testenv.MemoryReadCode(pc), cerr_, uc_strerror(cerr_)); + fmt::print("uc_emu_start failed @ {:08x} (code = {:08x}) with error {} ({})", pc, *testenv.MemoryReadCode(pc), static_cast(cerr_), uc_strerror(cerr_)); throw "A32Unicorn::Run() failure"; } testenv.ticks_left--; diff --git a/tests/unicorn_emu/a64_unicorn.cpp b/tests/unicorn_emu/a64_unicorn.cpp index f4e14b25..3c202c7c 100644 --- a/tests/unicorn_emu/a64_unicorn.cpp +++ b/tests/unicorn_emu/a64_unicorn.cpp @@ -7,12 +7,12 @@ #include -#define CHECKED(expr) \ - do { \ - if (auto cerr_ = (expr)) { \ - ASSERT_MSG(false, "Call " #expr " failed with error: {} ({})\n", cerr_, \ - uc_strerror(cerr_)); \ - } \ +#define CHECKED(expr) \ + do { \ + if (auto cerr_ = (expr)) { \ + ASSERT_MSG(false, "Call " #expr " failed with error: {} ({})\n", static_cast(cerr_), \ + uc_strerror(cerr_)); \ + } \ } while (0) constexpr u64 BEGIN_ADDRESS = 0;