From 17c85814bf19b6f4ec4ef4152bd84ead7bf0e527 Mon Sep 17 00:00:00 2001 From: Jmgr Date: Mon, 26 Apr 2021 21:29:22 +0100 Subject: [PATCH] Fix a few remaining C-style format in Log calls --- Source/init.cpp | 8 ++++---- Source/miniwin/misc_msg.cpp | 2 +- Source/mpqapi.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/init.cpp b/Source/init.cpp index 9a7418d64..816e796b8 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -60,16 +60,16 @@ HANDLE init_test_access(const std::vector &paths, const char *mpq_n for (const auto &path : paths) { mpq_abspath = path + mpq_name; if (SFileOpenArchive(mpq_abspath.c_str(), 0, MPQ_OPEN_READ_ONLY, &archive)) { - LogVerbose(" Found: %s in %s", mpq_name, path.c_str()); + LogVerbose(" Found: {} in {}", mpq_name, path); SFileSetBasePath(path.c_str()); return archive; } if (SErrGetLastError() != STORM_ERROR_FILE_NOT_FOUND) { - LogError("Open error %u: %s", SErrGetLastError(), mpq_abspath.c_str()); + LogError("Open error {}: {}", SErrGetLastError(), mpq_abspath); } } if (SErrGetLastError() == STORM_ERROR_FILE_NOT_FOUND) { - LogVerbose("Missing: %s", mpq_name); + LogVerbose("Missing: {}", mpq_name); } return nullptr; @@ -173,7 +173,7 @@ void init_archives() message.append(paths[i]); message += '\''; } - LogVerbose("MPQ search paths%s", message.c_str()); + LogVerbose("MPQ search paths:{}", message); } diabdat_mpq = init_test_access(paths, "DIABDAT.MPQ"); diff --git a/Source/miniwin/misc_msg.cpp b/Source/miniwin/misc_msg.cpp index d2c08186c..5b1bb3eef 100644 --- a/Source/miniwin/misc_msg.cpp +++ b/Source/miniwin/misc_msg.cpp @@ -266,7 +266,7 @@ WPARAM KeystateForMouse(WPARAM ret) bool FalseAvail(const char *name, int value) { - LogDebug("Unhandled SDL event: %s %d", name, value); + LogDebug("Unhandled SDL event: {} {}", name, value); return true; } diff --git a/Source/mpqapi.cpp b/Source/mpqapi.cpp index 5bd1e1dcb..0cea0073d 100644 --- a/Source/mpqapi.cpp +++ b/Source/mpqapi.cpp @@ -157,7 +157,7 @@ private: { if (s_->fail()) { std::string fmt_with_error = fmt; - fmt_with_error.append(": failed with \"%s\""); + fmt_with_error.append(": failed with \"{}\""); const char *error_message = std::strerror(errno); if (error_message == nullptr) error_message = "";