summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2022-01-12 22:26:04 -0800
committerPokechu22 <Pokechu022@gmail.com>2022-01-13 11:11:08 -0800
commit29d6dd609c4e77a6d2a6bcac9f48e44cc0ab8814 (patch)
tree698cf605b91805cf01f0f5a3f9a305017fb58d65 /Source/Core
parent18cf8ac7670a9ed53cf3d78d55dbcdffcf0d9605 (diff)
Fix non-constexpr format strings
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp11
-rw-r--r--Source/Core/DiscIO/DiscUtils.cpp2
-rw-r--r--Source/Core/VideoCommon/BPMemory.h8
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp3
-rw-r--r--Source/Core/VideoCommon/XFStructs.cpp2
5 files changed, 12 insertions, 14 deletions
diff --git a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp
index e5a65ffb93..13b77eb1ad 100644
--- a/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp
+++ b/Source/Core/Core/IOS/USB/Bluetooth/WiimoteDevice.cpp
@@ -212,13 +212,12 @@ bool WiimoteDevice::IsConnected() const
void WiimoteDevice::Activate(bool connect)
{
- const char* message = nullptr;
-
if (connect && m_baseband_state == BasebandState::Inactive)
{
SetBasebandState(BasebandState::RequestConnection);
- message = "Wii Remote {} connected";
+ Core::DisplayMessage(fmt::format("Wii Remote {} connected", GetNumber() + 1),
+ CONNECTION_MESSAGE_TIME);
}
else if (!connect && IsConnected())
{
@@ -228,11 +227,9 @@ void WiimoteDevice::Activate(bool connect)
// Not doing that doesn't seem to break anything.
m_host->RemoteDisconnect(GetBD());
- message = "Wii Remote {} disconnected";
+ Core::DisplayMessage(fmt::format("Wii Remote {} disconnected", GetNumber() + 1),
+ CONNECTION_MESSAGE_TIME);
}
-
- if (message)
- Core::DisplayMessage(fmt::format(message, GetNumber() + 1), CONNECTION_MESSAGE_TIME);
}
bool WiimoteDevice::EventConnectionRequest()
diff --git a/Source/Core/DiscIO/DiscUtils.cpp b/Source/Core/DiscIO/DiscUtils.cpp
index 002ce066db..cdfcb015c4 100644
--- a/Source/Core/DiscIO/DiscUtils.cpp
+++ b/Source/Core/DiscIO/DiscUtils.cpp
@@ -45,7 +45,7 @@ std::string NameForPartitionType(u32 partition_type, bool include_prefix)
return include_prefix ? "P-" + type_as_game_id : type_as_game_id;
}
- return fmt::format(include_prefix ? "P{}" : "{}", partition_type);
+ return fmt::format("{}{}", include_prefix ? "P" : "", partition_type);
}
}
diff --git a/Source/Core/VideoCommon/BPMemory.h b/Source/Core/VideoCommon/BPMemory.h
index 14a6935cbe..0d21166094 100644
--- a/Source/Core/VideoCommon/BPMemory.h
+++ b/Source/Core/VideoCommon/BPMemory.h
@@ -565,9 +565,9 @@ struct fmt::formatter<TevStageCombiner::ColorCombiner>
if (has_bias)
{
if (has_ac || has_bc || has_d)
- out = fmt::format_to(out, cc.bias == TevBias::AddHalf ? " + .5" : " - .5");
+ out = fmt::format_to(out, "{}", cc.bias == TevBias::AddHalf ? " + .5" : " - .5");
else
- out = fmt::format_to(out, cc.bias == TevBias::AddHalf ? ".5" : "-.5");
+ out = fmt::format_to(out, "{}", cc.bias == TevBias::AddHalf ? ".5" : "-.5");
}
else
{
@@ -659,9 +659,9 @@ struct fmt::formatter<TevStageCombiner::AlphaCombiner>
if (has_bias)
{
if (has_ac || has_bc || has_d)
- out = fmt::format_to(out, ac.bias == TevBias::AddHalf ? " + .5" : " - .5");
+ out = fmt::format_to(out, "{}", ac.bias == TevBias::AddHalf ? " + .5" : " - .5");
else
- out = fmt::format_to(out, ac.bias == TevBias::AddHalf ? ".5" : "-.5");
+ out = fmt::format_to(out, "{}", ac.bias == TevBias::AddHalf ? ".5" : "-.5");
}
else
{
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 8aaba2e4e0..673c97ec9b 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -5,6 +5,7 @@
#include <cmath>
#include <cstdio>
+#include <fmt/format.h>
#include "Common/Assert.h"
#include "Common/CommonTypes.h"
@@ -1819,7 +1820,7 @@ static void WriteAlphaTest(ShaderCode& out, const pixel_shader_uid_data* uid_dat
if (has_no_arguments)
out.Write("{}", tev_alpha_funcs_table[mode]);
else
- out.Write(tev_alpha_funcs_table[mode], ref);
+ out.Write(fmt::runtime(tev_alpha_funcs_table[mode]), ref);
};
out.SetConstantsUsed(C_ALPHA, C_ALPHA);
diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp
index be565c6de0..33e148d043 100644
--- a/Source/Core/VideoCommon/XFStructs.cpp
+++ b/Source/Core/VideoCommon/XFStructs.cpp
@@ -594,7 +594,7 @@ std::pair<std::string, std::string> GetXFTransferInfo(u16 base_address, u8 trans
for (u32 i = 0; i < xf_mem_transfer_size; i++)
{
const auto mem_desc = GetXFMemDescription(xf_mem_base + i, Common::swap32(data));
- fmt::format_to(std::back_inserter(desc), i == 0 ? "{}" : "\n{}", mem_desc);
+ fmt::format_to(std::back_inserter(desc), "{}{}", i != 0 ? "\n" : "", mem_desc);
data += 4;
}