Misc: Fix incorrect printf of std::string_view

This commit is contained in:
Connor McLaughlin 2022-03-20 13:40:47 +10:00 committed by refractionpcsx2
parent 678bb1218b
commit 44728be719
6 changed files with 9 additions and 9 deletions

View File

@ -313,13 +313,13 @@ void Host::ReportErrorAsync(const std::string_view& title, const std::string_vie
{ {
if (!title.empty() && !message.empty()) if (!title.empty() && !message.empty())
{ {
Console.Error("ReportErrorAsync: %*s: %*s", Console.Error("ReportErrorAsync: %.*s: %.*s",
static_cast<int>(title.size()), title.data(), static_cast<int>(title.size()), title.data(),
static_cast<int>(message.size()), message.data()); static_cast<int>(message.size()), message.data());
} }
else if (!message.empty()) else if (!message.empty())
{ {
Console.Error("ReportErrorAsync: %*s", Console.Error("ReportErrorAsync: %.*s",
static_cast<int>(message.size()), message.data()); static_cast<int>(message.size()), message.data());
} }

View File

@ -102,7 +102,7 @@ void ControllerBindingWidget_Base::initBindingWidgets()
InputBindingWidget* widget = findChild<InputBindingWidget*>(QString::fromStdString(binding)); InputBindingWidget* widget = findChild<InputBindingWidget*>(QString::fromStdString(binding));
if (!widget) if (!widget)
{ {
Console.Error("(ControllerBindingWidget_Base) No widget found for '%s' (%*s)", Console.Error("(ControllerBindingWidget_Base) No widget found for '%s' (%.*s)",
binding.c_str(), static_cast<int>(type.size()), type.data()); binding.c_str(), static_cast<int>(type.size()), type.data());
continue; continue;
} }
@ -155,4 +155,4 @@ ControllerBindingWidget_Base* ControllerBindingWidget_DualShock2::createInstance
return new ControllerBindingWidget_DualShock2(parent); return new ControllerBindingWidget_DualShock2(parent);
} }
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////

View File

@ -264,7 +264,7 @@ bool InputManager::SplitBinding(
const std::string_view::size_type slash_pos = binding.find('/'); const std::string_view::size_type slash_pos = binding.find('/');
if (slash_pos == std::string_view::npos) if (slash_pos == std::string_view::npos)
{ {
Console.Warning("Malformed binding: '%*s'", static_cast<int>(binding.size()), binding.data()); Console.Warning("Malformed binding: '%.*s'", static_cast<int>(binding.size()), binding.data());
return false; return false;
} }

View File

@ -319,7 +319,7 @@ void GSTextureReplacements::ReloadReplacementMap()
if (!name.has_value()) if (!name.has_value())
continue; continue;
DevCon.WriteLn("Found %ux%u replacement '%*s'", name->Width(), name->Height(), static_cast<int>(filename.size()), filename.data()); DevCon.WriteLn("Found %ux%u replacement '%.*s'", name->Width(), name->Height(), static_cast<int>(filename.size()), filename.data());
s_replacement_texture_filenames.emplace(std::move(name.value()), std::move(fd.FileName)); s_replacement_texture_filenames.emplace(std::move(name.value()), std::move(fd.FileName));
} }
@ -564,7 +564,7 @@ void GSTextureReplacements::DumpTexture(const GSTextureCache::HashCacheKey& hash
return; return;
const std::string_view title(FileSystem::GetFileTitleFromPath(filename)); const std::string_view title(FileSystem::GetFileTitleFromPath(filename));
DevCon.WriteLn("Dumping %ux%u texture '%*s'.", name.Width(), name.Height(), static_cast<int>(title.size()), title.data()); DevCon.WriteLn("Dumping %ux%u texture '%.*s'.", name.Width(), name.Height(), static_cast<int>(title.size()), title.data());
// compute width/height // compute width/height
const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM]; const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM];

View File

@ -218,7 +218,7 @@ void GameDatabase::parseAndInsert(const std::string_view& serial, const c4::yml:
std::optional<s32> value = n.has_val() ? StringUtil::FromChars<s32>(std::string_view(n.val().data(), n.val().size())) : 1; std::optional<s32> value = n.has_val() ? StringUtil::FromChars<s32>(std::string_view(n.val().data(), n.val().size())) : 1;
if (!id.has_value() || !value.has_value()) if (!id.has_value() || !value.has_value())
{ {
Console.Error("[GameDB] Invalid GS HW Fix: '%*s' specified for serial '%*s'. Dropping!", Console.Error("[GameDB] Invalid GS HW Fix: '%.*s' specified for serial '%.*s'. Dropping!",
static_cast<int>(id_name.size()), id_name.data(), static_cast<int>(id_name.size()), id_name.data(),
static_cast<int>(serial.size()), serial.data()); static_cast<int>(serial.size()), serial.data());
continue; continue;

View File

@ -929,7 +929,7 @@ bool FileMcd_CreateNewCard(const std::string_view& name, MemoryCardType type, Me
if (type == MemoryCardType::Folder) if (type == MemoryCardType::Folder)
{ {
Console.WriteLn("(FileMcd) Creating new PS2 folder memory card: '%*s'", static_cast<int>(name.size()), name.data()); Console.WriteLn("(FileMcd) Creating new PS2 folder memory card: '%.*s'", static_cast<int>(name.size()), name.data());
if (!FileSystem::CreateDirectoryPath(full_path.c_str(), false)) if (!FileSystem::CreateDirectoryPath(full_path.c_str(), false))
{ {