Use config_file_new_from_path_to_string

This commit is contained in:
twinaphex 2019-07-18 12:13:09 +02:00
parent 41a2fabb4e
commit c0787accc3
10 changed files with 21 additions and 27 deletions

View File

@ -1137,7 +1137,7 @@ typedef struct MTLALIGN(16)
[self _freeVideoShader:_shader];
_shader = nil;
config_file_t *conf = config_file_new(path.UTF8String);
config_file_t *conf = config_file_new_from_path_to_string(path.UTF8String);
struct video_shader *shader = (struct video_shader *)calloc(1, sizeof(*shader));
@try

View File

@ -360,9 +360,7 @@ static bool d3d10_gfx_set_shader(void* data, enum rarch_shader_type type, const
return false;
}
conf = config_file_new(path);
if (!conf)
if (!(conf = config_file_new_from_path_to_string(path)))
return false;
d3d10->shader_preset = (struct video_shader*)calloc(1, sizeof(*d3d10->shader_preset));

View File

@ -378,9 +378,7 @@ static bool d3d11_gfx_set_shader(void* data, enum rarch_shader_type type, const
return false;
}
conf = config_file_new(path);
if (!conf)
if (!(conf = config_file_new_from_path_to_string(path)))
return false;
d3d11->shader_preset = (struct video_shader*)calloc(1, sizeof(*d3d11->shader_preset));

View File

@ -359,9 +359,7 @@ static bool d3d12_gfx_set_shader(void* data, enum rarch_shader_type type, const
return false;
}
conf = config_file_new(path);
if (!conf)
if (!(conf = config_file_new_from_path_to_string(path)))
return false;
d3d12->shader_preset = (struct video_shader*)calloc(1, sizeof(*d3d12->shader_preset));

View File

@ -325,7 +325,7 @@ static bool d3d9_init_multipass(d3d9_video_t *d3d, const char *shader_path)
unsigned i;
bool use_extra_pass = false;
struct video_shader_pass *pass = NULL;
config_file_t *conf = config_file_new(shader_path);
config_file_t *conf = config_file_new_from_path_to_string(shader_path);
if (!conf)
{

View File

@ -1453,7 +1453,7 @@ static bool wiiu_gfx_set_shader(void *data,
return false;
}
if (!(conf = config_file_new(path)))
if (!(conf = config_file_new_from_path_to_string(path)))
return false;
wiiu->shader_preset = calloc(1, sizeof(*wiiu->shader_preset));

View File

@ -678,7 +678,7 @@ static bool gl_cg_load_preset(void *data, const char *path)
return false;
RARCH_LOG("[CG]: Loading Cg meta-shader: %s\n", path);
conf = config_file_new(path);
conf = config_file_new_from_path_to_string(path);
if (!conf)
{
RARCH_ERR("Failed to load preset.\n");

View File

@ -899,7 +899,7 @@ static void *gl_glsl_init(void *data, const char *path)
if (is_preset)
{
conf = config_file_new(path);
conf = config_file_new_from_path_to_string(path);
if (conf)
{
ret = video_shader_read_conf_preset(conf, glsl->shader);

View File

@ -219,12 +219,11 @@ static int deferred_push_cursor_manager_list_deferred(
int ret = -1;
char *query = NULL;
char *rdb = NULL;
settings_t *settings = config_get_ptr();
const char *path = info->path;
config_file_t *conf = path ? config_file_new(path) : NULL;
if (!conf || !settings)
goto end;
config_file_t *conf = NULL;
if (!(conf = config_file_new_from_path_to_string(path)))
return -1;
if (!config_get_string(conf, "query", &query))
goto end;
@ -234,9 +233,13 @@ static int deferred_push_cursor_manager_list_deferred(
rdb_path[0] = '\0';
fill_pathname_join(rdb_path,
settings->paths.path_content_database,
rdb, sizeof(rdb_path));
{
settings_t *settings = config_get_ptr();
if (settings)
fill_pathname_join(rdb_path,
settings->paths.path_content_database,
rdb, sizeof(rdb_path));
}
if (!string_is_empty(info->path_b))
free(info->path_b);
@ -255,8 +258,7 @@ static int deferred_push_cursor_manager_list_deferred(
ret = deferred_push_dlist(info, DISPLAYLIST_DATABASE_QUERY);
end:
if (conf)
config_file_free(conf);
config_file_free(conf);
free(rdb);
free(query);
return ret;

View File

@ -4034,9 +4034,7 @@ static int action_ok_option_create(const char *path,
return 0;
}
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()))
return false;