From cbc83065c0ecbb3fa14c862dc69afe8458a365fc Mon Sep 17 00:00:00 2001 From: aryanrawlani28 Date: Mon, 15 Jun 2020 21:05:14 +0530 Subject: [PATCH] GUI: U32: Fix warnings with printf statements Command line printfs used some functions which returned u32 strings. Correctly encode them and then turn into c_str --- base/commandLine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/commandLine.cpp b/base/commandLine.cpp index c45f860cbf2..8e264f148e6 100644 --- a/base/commandLine.cpp +++ b/base/commandLine.cpp @@ -917,7 +917,7 @@ static Common::Error listSaves(const Common::String &singleTarget) { " ---- ------------------------------------------------------\n"); for (SaveStateList::const_iterator x = saveList.begin(); x != saveList.end(); ++x) { - printf(" %-4d %s\n", x->getSaveSlot(), x->getDescription().c_str()); + printf(" %-4d %s\n", x->getSaveSlot(), x->getDescription().encode().c_str()); // TODO: Could also iterate over the full hashmap, printing all key-value pairs } atLeastOneFound = true; @@ -961,7 +961,7 @@ static void listAudioDevices() { const MusicPluginObject &musicObject = (*i)->get(); MusicDevices deviceList = musicObject.getDevices(); for (MusicDevices::iterator j = deviceList.begin(), jend = deviceList.end(); j != jend; ++j) { - printf("%-30s %s\n", Common::String::format("\"%s\"", j->getCompleteId().c_str()).c_str(), j->getCompleteName().c_str()); + printf("%-30s %s\n", Common::String::format("\"%s\"", j->getCompleteId().encode().c_str()).c_str(), j->getCompleteName().encode().c_str()); } } }