mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
use string_list_initialize/deinitialize in more places
This commit is contained in:
parent
ea4a74a005
commit
c2a8a0f04e
@ -220,39 +220,39 @@ bool glslang_parse_meta(const struct string_list *lines, glslang_meta *meta)
|
||||
bool glslang_compile_shader(const char *shader_path, glslang_output *output)
|
||||
{
|
||||
#if defined(HAVE_GLSLANG)
|
||||
struct string_list *lines = string_list_new();
|
||||
|
||||
if (!lines)
|
||||
struct string_list lines;
|
||||
|
||||
if (!string_list_initialize(&lines))
|
||||
return false;
|
||||
|
||||
RARCH_LOG("[slang]: Compiling shader \"%s\".\n", shader_path);
|
||||
|
||||
if (!glslang_read_shader_file(shader_path, lines, true))
|
||||
if (!glslang_read_shader_file(shader_path, &lines, true))
|
||||
goto error;
|
||||
output->meta = glslang_meta{};
|
||||
if (!glslang_parse_meta(lines, &output->meta))
|
||||
if (!glslang_parse_meta(&lines, &output->meta))
|
||||
goto error;
|
||||
|
||||
if (!glslang::compile_spirv(build_stage_source(lines, "vertex"),
|
||||
if (!glslang::compile_spirv(build_stage_source(&lines, "vertex"),
|
||||
glslang::StageVertex, &output->vertex))
|
||||
{
|
||||
RARCH_ERR("Failed to compile vertex shader stage.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!glslang::compile_spirv(build_stage_source(lines, "fragment"),
|
||||
if (!glslang::compile_spirv(build_stage_source(&lines, "fragment"),
|
||||
glslang::StageFragment, &output->fragment))
|
||||
{
|
||||
RARCH_ERR("Failed to compile fragment shader stage.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
string_list_free(lines);
|
||||
string_list_deinitialize(&lines);
|
||||
|
||||
return true;
|
||||
|
||||
error:
|
||||
string_list_free(lines);
|
||||
string_list_deinitialize(&lines);
|
||||
#endif
|
||||
|
||||
return false;
|
||||
|
@ -536,14 +536,16 @@ static int general_push(menu_displaylist_info_t *info,
|
||||
case PUSH_ARCHIVE_OPEN_DETECT_CORE:
|
||||
case PUSH_DETECT_CORE_LIST:
|
||||
{
|
||||
struct string_list str_list2;
|
||||
union string_list_elem_attr attr;
|
||||
char newstring[PATH_MAX_LENGTH];
|
||||
struct string_list *str_list2 = string_list_new();
|
||||
struct retro_system_info *system = runloop_get_libretro_system_info();
|
||||
|
||||
newstring[0] = '\0';
|
||||
attr.i = 0;
|
||||
|
||||
string_list_initialize(&str_list2);
|
||||
|
||||
if (system)
|
||||
{
|
||||
if (!string_is_empty(system->valid_extensions))
|
||||
@ -554,7 +556,7 @@ static int general_push(menu_displaylist_info_t *info,
|
||||
for (x = 0; x < str_list->size; x++)
|
||||
{
|
||||
const char *elem = str_list->elems[x].data;
|
||||
string_list_append(str_list2, elem, attr);
|
||||
string_list_append(&str_list2, elem, attr);
|
||||
}
|
||||
|
||||
string_list_free(str_list);
|
||||
@ -571,11 +573,11 @@ static int general_push(menu_displaylist_info_t *info,
|
||||
|
||||
for (x = 0; x < str_list->size; x++)
|
||||
{
|
||||
if (!string_list_find_elem(str_list2,
|
||||
if (!string_list_find_elem(&str_list2,
|
||||
str_list->elems[x].data))
|
||||
{
|
||||
const char *elem = str_list->elems[x].data;
|
||||
string_list_append(str_list2, elem, attr);
|
||||
string_list_append(&str_list2, elem, attr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -584,7 +586,7 @@ static int general_push(menu_displaylist_info_t *info,
|
||||
}
|
||||
|
||||
string_list_join_concat(newstring, sizeof(newstring),
|
||||
str_list2, "|");
|
||||
&str_list2, "|");
|
||||
|
||||
{
|
||||
struct string_list *str_list3 = string_split(newstring, "|");
|
||||
@ -602,7 +604,7 @@ static int general_push(menu_displaylist_info_t *info,
|
||||
str_list3, "|");
|
||||
string_list_free(str_list3);
|
||||
}
|
||||
string_list_free(str_list2);
|
||||
string_list_deinitialize(&str_list2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user