mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Cleanups
This commit is contained in:
parent
47709fe0d5
commit
4521f6bcb2
@ -2328,7 +2328,9 @@ bool video_shader_load_preset_into_shader(const char *path,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Gather all the paths of all of the presets in all reference chains */
|
/* Gather all the paths of all of the presets in all reference chains */
|
||||||
override_paths_list = path_linked_list_new();
|
override_paths_list = (struct path_linked_list*)malloc(sizeof(*override_paths_list));
|
||||||
|
override_paths_list->next = NULL;
|
||||||
|
override_paths_list->path = NULL;
|
||||||
video_shader_gather_reference_path_list(override_paths_list, conf->path, 0);
|
video_shader_gather_reference_path_list(override_paths_list, conf->path, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -413,7 +413,11 @@ size_t config_file_add_reference(config_file_t *conf, char *path)
|
|||||||
/* It is expected that the conf has it's path already set */
|
/* It is expected that the conf has it's path already set */
|
||||||
char short_path[NAME_MAX_LENGTH];
|
char short_path[NAME_MAX_LENGTH];
|
||||||
if (!conf->references)
|
if (!conf->references)
|
||||||
conf->references = path_linked_list_new();
|
{
|
||||||
|
conf->references = (struct path_linked_list*)malloc(sizeof(*conf->references));
|
||||||
|
conf->references->next = NULL;
|
||||||
|
conf->references->path = NULL;
|
||||||
|
}
|
||||||
len = fill_pathname_abbreviated_or_relative(short_path, conf->path, path, sizeof(short_path));
|
len = fill_pathname_abbreviated_or_relative(short_path, conf->path, path, sizeof(short_path));
|
||||||
path_linked_list_add_path(conf->references, short_path);
|
path_linked_list_add_path(conf->references, short_path);
|
||||||
return len;
|
return len;
|
||||||
|
@ -358,7 +358,8 @@ char *find_last_slash(const char *str)
|
|||||||
{
|
{
|
||||||
const char *slash = strrchr(str, '/');
|
const char *slash = strrchr(str, '/');
|
||||||
const char *backslash = strrchr(str, '\\');
|
const char *backslash = strrchr(str, '\\');
|
||||||
return (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
|
char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
|
||||||
|
return last_slash;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -374,7 +375,7 @@ size_t fill_pathname_slash(char *path, size_t size)
|
|||||||
size_t path_len;
|
size_t path_len;
|
||||||
const char *slash = strrchr(path, '/');
|
const char *slash = strrchr(path, '/');
|
||||||
const char *backslash = strrchr(path, '\\');
|
const char *backslash = strrchr(path, '\\');
|
||||||
const char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
|
char *last_slash = (!slash || (backslash > slash)) ? (char*)backslash : (char*)slash;
|
||||||
if (!last_slash)
|
if (!last_slash)
|
||||||
return strlcat(path, PATH_DEFAULT_SLASH(), size);
|
return strlcat(path, PATH_DEFAULT_SLASH(), size);
|
||||||
path_len = strlen(path);
|
path_len = strlen(path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user