Mes recomanacions de cppcheck aplicades
Abans de tocar unes cosetes de strings buits
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
Options options;
|
||||
|
||||
// Declaraciones
|
||||
bool setOptions(std::string var, std::string value);
|
||||
bool setOptions(std::string var, const std::string &value);
|
||||
|
||||
// Inicializa las opciones del programa
|
||||
void initOptions()
|
||||
@@ -86,7 +86,9 @@ bool loadOptionsFile(std::string file_path)
|
||||
bool success = true;
|
||||
|
||||
// Variables para manejar el fichero
|
||||
#ifdef VERBOSE
|
||||
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1);
|
||||
#endif
|
||||
std::ifstream file(file_path);
|
||||
|
||||
// Si el fichero se puede abrir
|
||||
@@ -150,7 +152,9 @@ bool loadOptionsFile(std::string file_path)
|
||||
// Guarda el fichero de configuración
|
||||
bool saveOptionsFile(std::string file_path)
|
||||
{
|
||||
#ifdef VERBOSE
|
||||
const std::string file_name = file_path.substr(file_path.find_last_of("\\/") + 1);
|
||||
#endif
|
||||
std::ofstream file(file_path);
|
||||
|
||||
if (!file.good())
|
||||
@@ -240,10 +244,10 @@ bool saveOptionsFile(std::string file_path)
|
||||
}
|
||||
|
||||
// Asigna variables a partir de dos cadenas
|
||||
bool setOptions(std::string var, std::string value)
|
||||
bool setOptions(std::string var, const std::string &value)
|
||||
{
|
||||
// Indicador de éxito en la asignación
|
||||
bool success = true;
|
||||
auto success = true;
|
||||
|
||||
// Opciones de video
|
||||
if (var == "video.mode")
|
||||
|
||||
Reference in New Issue
Block a user