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/Bindings/BlockTypeRegistry.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/Bindings/BlockTypeRegistry.cpp') diff --git a/src/Bindings/BlockTypeRegistry.cpp b/src/Bindings/BlockTypeRegistry.cpp index 491e03593..62c3c580b 100644 --- a/src/Bindings/BlockTypeRegistry.cpp +++ b/src/Bindings/BlockTypeRegistry.cpp @@ -211,10 +211,11 @@ AString BlockTypeRegistry::AlreadyRegisteredException::message( const std::shared_ptr & aNewRegistration ) { - return Printf("Attempting to register BlockTypeName %s from plugin %s, while it is already registered in plugin %s", - aNewRegistration->blockTypeName().c_str(), - aNewRegistration->pluginName().c_str(), - aPreviousRegistration->pluginName().c_str() + return fmt::format( + FMT_STRING("Attempting to register BlockTypeName {} from plugin {}, while it is already registered in plugin {}"), + aNewRegistration->blockTypeName(), + aNewRegistration->pluginName(), + aPreviousRegistration->pluginName() ); } @@ -230,11 +231,11 @@ BlockTypeRegistry::NotRegisteredException::NotRegisteredException( const AString & aHintKey, const AString & aHintValue ): - Super(Printf( - "Attempting to set a hint of nonexistent BlockTypeName.\n\tBlockTypeName = %s\n\tHintKey = %s\n\tHintValue = %s", - aBlockTypeName.c_str(), - aHintKey.c_str(), - aHintValue.c_str() + Super(fmt::format( + FMT_STRING("Attempting to set a hint of nonexistent BlockTypeName.\n\tBlockTypeName = {}\n\tHintKey = {}\n\tHintValue = {}"), + aBlockTypeName, + aHintKey, + aHintValue )) { } -- cgit v1.2.3