From c9522fb740200ccef6230cec452c48efb31e5394 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 11 May 2023 22:05:17 +0200 Subject: Removed all Printf-family functions from StringUtils. Replaced them with fmt::format calls, including changes to the format strings. Also changed the format strings to use FMT_STRING, so that the format is checked compile-time against the arguments. Also fixed code-style violations already present in the code. --- src/Enchantments.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Enchantments.cpp') diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp index 8abf4469d..fbe4c8b95 100644 --- a/src/Enchantments.cpp +++ b/src/Enchantments.cpp @@ -85,7 +85,7 @@ void cEnchantments::AddFromString(const AString & a_StringSpec) -size_t cEnchantments::Count(void) const +size_t cEnchantments::Count() const { return m_Enchantments.size(); } @@ -94,13 +94,13 @@ size_t cEnchantments::Count(void) const -AString cEnchantments::ToString(void) const +AString cEnchantments::ToString() const { // Serialize all the enchantments into a string AString res; for (cEnchantments::cMap::const_iterator itr = m_Enchantments.begin(), end = m_Enchantments.end(); itr != end; ++itr) { - AppendPrintf(res, "%d=%d;", itr->first, itr->second); + res.append(fmt::format(FMT_STRING("{}={};"), itr->first, itr->second)); } // for itr - m_Enchantments[] return res; } -- cgit v1.2.3