Codechange: replace error/usererror printf variant with fmt variant and rename

This commit is contained in:
Rubidium
2023-04-19 22:47:36 +02:00
committed by rubidium42
parent 43c65a3fec
commit f74e26ca7e
39 changed files with 176 additions and 131 deletions

View File

@@ -10,6 +10,7 @@
#include "stdafx.h"
#include "debug.h"
#include "error.h"
#include "error_func.h"
#include "sound/sound_driver.hpp"
#include "music/music_driver.hpp"
#include "video/video_driver.hpp"
@@ -86,8 +87,8 @@ void DriverFactoryBase::SelectDriver(const std::string &name, Driver::Type type)
{
if (!DriverFactoryBase::SelectDriverImpl(name, type)) {
name.empty() ?
usererror("Failed to autoprobe %s driver", GetDriverTypeName(type)) :
usererror("Failed to select requested %s driver '%s'", GetDriverTypeName(type), name.c_str());
UserError("Failed to autoprobe {} driver", GetDriverTypeName(type)) :
UserError("Failed to select requested {} driver '{}'", GetDriverTypeName(type), name.c_str());
}
}
@@ -137,7 +138,7 @@ bool DriverFactoryBase::SelectDriverImpl(const std::string &name, Driver::Type t
}
}
}
usererror("Couldn't find any suitable %s driver", GetDriverTypeName(type));
UserError("Couldn't find any suitable {} driver", GetDriverTypeName(type));
} else {
/* Extract the driver name and put parameter list in parm */
std::istringstream buffer(name);
@@ -167,7 +168,7 @@ bool DriverFactoryBase::SelectDriverImpl(const std::string &name, Driver::Type t
const char *err = newd->Start(parms);
if (err != nullptr) {
delete newd;
usererror("Unable to load driver '%s'. The error was: %s", d->name, err);
UserError("Unable to load driver '{}'. The error was: {}", d->name, err);
}
Debug(driver, 1, "Successfully loaded {} driver '{}'", GetDriverTypeName(type), d->name);
@@ -175,7 +176,7 @@ bool DriverFactoryBase::SelectDriverImpl(const std::string &name, Driver::Type t
*GetActiveDriver(type) = newd;
return true;
}
usererror("No such %s driver: %s\n", GetDriverTypeName(type), dname.c_str());
UserError("No such {} driver: {}\n", GetDriverTypeName(type), dname);
}
}