diff --git a/configuration.c b/configuration.c index 8cc3afce25..67b4e5d65e 100644 --- a/configuration.c +++ b/configuration.c @@ -2405,7 +2405,7 @@ static config_file_t *open_default_config_file(void) fill_pathname_resolve_relative(conf_path, app_path, file_path_str(FILE_PATH_MAIN_CONFIG), path_size); - conf = config_file_new(conf_path); + conf = config_file_new_from_path_to_string(conf_path); if (!conf) { @@ -2414,7 +2414,7 @@ static config_file_t *open_default_config_file(void) { fill_pathname_join(conf_path, application_data, file_path_str(FILE_PATH_MAIN_CONFIG), path_size); - conf = config_file_new(conf_path); + conf = config_file_new_from_path_to_string(conf_path); } } @@ -2457,7 +2457,7 @@ static config_file_t *open_default_config_file(void) fill_pathname_join(conf_path, application_data, file_path_str(FILE_PATH_MAIN_CONFIG), path_size); - conf = config_file_new(conf_path); + conf = config_file_new_from_path_to_string(conf_path); if (!conf) { @@ -2490,7 +2490,7 @@ static config_file_t *open_default_config_file(void) fill_pathname_join(conf_path, application_data, file_path_str(FILE_PATH_MAIN_CONFIG), path_size); RARCH_LOG("Looking for config in: \"%s\".\n", conf_path); - conf = config_file_new(conf_path); + conf = config_file_new_from_path_to_string(conf_path); } /* Fallback to $HOME/.retroarch.cfg. */ @@ -2499,7 +2499,7 @@ static config_file_t *open_default_config_file(void) fill_pathname_join(conf_path, getenv("HOME"), ".retroarch.cfg", path_size); RARCH_LOG("Looking for config in: \"%s\".\n", conf_path); - conf = config_file_new(conf_path); + conf = config_file_new_from_path_to_string(conf_path); } if (!conf && has_application_data) @@ -2533,7 +2533,7 @@ static config_file_t *open_default_config_file(void) fill_pathname_join(skeleton_conf, GLOBAL_CONFIG_DIR, file_path_str(FILE_PATH_MAIN_CONFIG), path_size); - conf = config_file_new(skeleton_conf); + conf = config_file_new_from_path_to_string(skeleton_conf); if (conf) RARCH_WARN("Config: using skeleton config \"%s\" as base for a new config file.\n", skeleton_conf); else @@ -2652,7 +2652,7 @@ static bool config_load_file(const char *path, settings_t *settings) struct config_size_setting *size_settings = populate_settings_size (settings, &size_settings_size); struct config_array_setting *array_settings = populate_settings_array (settings, &array_settings_size); struct config_path_setting *path_settings = populate_settings_path (settings, &path_settings_size); - config_file_t *conf = path ? config_file_new(path) : open_default_config_file(); + config_file_t *conf = path ? config_file_new_from_path_to_string(path) : open_default_config_file(); tmp_str[0] = '\0'; @@ -3452,7 +3452,7 @@ bool config_load_remap(void) path_size); /* Create a new config file from game_path */ - new_conf = config_file_new(game_path); + new_conf = config_file_new_from_path_to_string(game_path); /* If a game remap file exists, load it. */ if (new_conf) @@ -3474,7 +3474,7 @@ bool config_load_remap(void) } /* Create a new config file from content_path */ - new_conf = config_file_new(content_path); + new_conf = config_file_new_from_path_to_string(content_path); /* If a content-dir remap file exists, load it. */ if (new_conf) @@ -3496,7 +3496,7 @@ bool config_load_remap(void) } /* Create a new config file from core_path */ - new_conf = config_file_new(core_path); + new_conf = config_file_new_from_path_to_string(core_path); /* If a core remap file exists, load it. */ if (new_conf) @@ -3634,7 +3634,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user) free(buf); free(path_new); - conf = config_file_new(autoconf_file); + conf = config_file_new_from_path_to_string(autoconf_file); if (!conf) { @@ -3698,7 +3698,7 @@ bool config_save_file(const char *path) struct config_float_setting *float_settings = NULL; struct config_array_setting *array_settings = NULL; struct config_path_setting *path_settings = NULL; - config_file_t *conf = config_file_new(path); + config_file_t *conf = config_file_new_from_path_to_string(path); settings_t *settings = config_get_ptr(); int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder); int float_settings_size = sizeof(settings->floats)/ sizeof(settings->floats.placeholder); diff --git a/gfx/video_filter.c b/gfx/video_filter.c index e1c80728bf..1d9a4ec27f 100644 --- a/gfx/video_filter.c +++ b/gfx/video_filter.c @@ -406,8 +406,7 @@ rarch_softfilter_t *rarch_softfilter_new(const char *filter_config, if (!filt) return NULL; - filt->conf = config_file_new(filter_config); - if (!filt->conf) + if (!(filt->conf = config_file_new_from_path_to_string(filter_config))) { RARCH_ERR("[SoftFilter]: Did not find config: %s\n", filter_config); goto error; diff --git a/input/input_remapping.c b/input/input_remapping.c index 25857ba935..78ecc1daee 100644 --- a/input/input_remapping.c +++ b/input/input_remapping.c @@ -166,9 +166,7 @@ bool input_remapping_save_file(const char *path) free(buf); - conf = config_file_new(remap_file); - - if (!conf) + if (!(conf = config_file_new_from_path_to_string(remap_file))) { if (!(conf = config_file_new_alloc())) { diff --git a/libretro-common/audio/dsp_filter.c b/libretro-common/audio/dsp_filter.c index e28eaa9f64..14f15f4f05 100644 --- a/libretro-common/audio/dsp_filter.c +++ b/libretro-common/audio/dsp_filter.c @@ -244,8 +244,7 @@ retro_dsp_filter_t *retro_dsp_filter_new( if (!dsp) return NULL; - conf = config_file_new(filter_config); - if (!conf) /* Did not find config. */ + if (!(conf = config_file_new_from_path_to_string(filter_config))) goto error; dsp->conf = conf; diff --git a/libretro-common/file/config_file.c b/libretro-common/file/config_file.c index ebeb652eb3..eb2b9abbed 100644 --- a/libretro-common/file/config_file.c +++ b/libretro-common/file/config_file.c @@ -515,7 +515,7 @@ void config_file_free(config_file_t *conf) bool config_append_file(config_file_t *conf, const char *path) { - config_file_t *new_conf = config_file_new(path); + config_file_t *new_conf = config_file_new_from_path_to_string(path); if (!new_conf) return false; diff --git a/managers/cheat_manager.c b/managers/cheat_manager.c index df66bd382d..1985e71310 100644 --- a/managers/cheat_manager.c +++ b/managers/cheat_manager.c @@ -165,7 +165,7 @@ bool cheat_manager_save(const char *path, const char *cheat_database, bool overw } if (!overwrite) - conf = config_file_new(cheats_file); + conf = config_file_new_from_path_to_string(cheats_file); if (!conf) if (!(conf = config_file_new_alloc())) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index c91d35b939..b95bc75d64 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1551,7 +1551,7 @@ static int generic_action_ok(const char *path, break; case ACTION_OK_LOAD_REMAPPING_FILE: { - config_file_t *conf = config_file_new(action_path); + config_file_t *conf = config_file_new_from_path_to_string(action_path); flush_char = msg_hash_to_str(flush_id); if (conf) diff --git a/menu/drivers/rgui.c b/menu/drivers/rgui.c index 5118c70a87..280038f399 100644 --- a/menu/drivers/rgui.c +++ b/menu/drivers/rgui.c @@ -2158,8 +2158,7 @@ static void load_custom_theme(rgui_t *rgui, rgui_theme_t *theme_colors, const ch goto end; /* Open config file */ - conf = config_file_new(theme_path); - if (!conf) + if (!(conf = config_file_new_from_path_to_string(theme_path))) goto end; /* Parse config file */ diff --git a/record/drivers/record_ffmpeg.c b/record/drivers/record_ffmpeg.c index d4048a9095..da3f17fdd2 100644 --- a/record/drivers/record_ffmpeg.c +++ b/record/drivers/record_ffmpeg.c @@ -800,9 +800,9 @@ static bool ffmpeg_init_config(struct ff_config_param *params, if (!config) return true; - params->conf = config_file_new(config); RARCH_LOG("[FFmpeg] Loading FFmpeg config \"%s\".\n", config); - if (!params->conf) + + if (!(params->conf = config_file_new_from_path_to_string(config))) { RARCH_ERR("[FFmpeg] Failed to load FFmpeg config \"%s\".\n", config); return false; diff --git a/ui/drivers/qt/coreoptionsdialog.cpp b/ui/drivers/qt/coreoptionsdialog.cpp index e7dce9e8eb..d0e118d3ab 100644 --- a/ui/drivers/qt/coreoptionsdialog.cpp +++ b/ui/drivers/qt/coreoptionsdialog.cpp @@ -133,9 +133,7 @@ void CoreOptionsDialog::onSaveGameSpecificOptions() return; } - conf = config_file_new(game_path); - - if (!conf) + if (!(conf = config_file_new_from_path_to_string(game_path))) { if (!(conf = config_file_new_alloc())) {