clang-tidy modernize
This commit is contained in:
@@ -28,7 +28,7 @@ std::vector<Difficulty> difficulties = {
|
||||
{DifficultyCode::HARD, "Hard"}};
|
||||
|
||||
// Declaraciones
|
||||
bool set(const std::string &var, const std::string &value);
|
||||
auto set(const std::string &var, const std::string &value) -> bool;
|
||||
|
||||
// Inicializa las opciones del programa
|
||||
void init() {
|
||||
@@ -49,7 +49,7 @@ void init() {
|
||||
}
|
||||
|
||||
// Carga el fichero de configuración
|
||||
bool loadFromFile() {
|
||||
auto loadFromFile() -> bool {
|
||||
// Inicializa las opciones del programa
|
||||
init();
|
||||
|
||||
@@ -94,7 +94,7 @@ bool loadFromFile() {
|
||||
}
|
||||
|
||||
// Guarda el fichero de configuración
|
||||
bool saveToFile() {
|
||||
auto saveToFile() -> bool {
|
||||
std::ofstream file(settings.config_file);
|
||||
|
||||
if (!file.good()) {
|
||||
@@ -167,7 +167,7 @@ bool saveToFile() {
|
||||
}
|
||||
|
||||
// Asigna variables a partir de dos cadenas
|
||||
bool set(const std::string &var, const std::string &value) {
|
||||
auto set(const std::string &var, const std::string &value) -> bool {
|
||||
// Indicador de éxito en la asignación
|
||||
auto success = true;
|
||||
|
||||
@@ -281,7 +281,7 @@ void swapControllers() {
|
||||
}
|
||||
|
||||
// Averigua quien está usando el teclado
|
||||
int getPlayerWhoUsesKeyboard() {
|
||||
auto getPlayerWhoUsesKeyboard() -> int {
|
||||
for (const auto &controller : controllers) {
|
||||
if (controller.type == InputDevice::ANY) {
|
||||
return controller.player_id;
|
||||
@@ -308,7 +308,7 @@ void checkPendingChanges() {
|
||||
}
|
||||
}
|
||||
|
||||
DifficultyCode getDifficultyCodeFromName(const std::string &name) {
|
||||
auto getDifficultyCodeFromName(const std::string &name) -> DifficultyCode {
|
||||
for (const auto &difficulty : difficulties) {
|
||||
if (difficulty.name == name)
|
||||
return difficulty.code;
|
||||
@@ -317,7 +317,7 @@ DifficultyCode getDifficultyCodeFromName(const std::string &name) {
|
||||
return difficulties[0].code;
|
||||
}
|
||||
|
||||
std::string getDifficultyNameFromCode(DifficultyCode code) {
|
||||
auto getDifficultyNameFromCode(DifficultyCode code) -> std::string {
|
||||
for (const auto &difficulty : difficulties) {
|
||||
if (difficulty.code == code)
|
||||
return difficulty.name;
|
||||
|
||||
Reference in New Issue
Block a user