(gfx/video_shader_parse) Readability

This commit is contained in:
libretroadmin 2024-12-18 15:54:42 +01:00
parent d682917e44
commit f047c247f9
1 changed files with 9 additions and 10 deletions

View File

@ -126,7 +126,7 @@ static path_change_data_t *file_change_data = NULL;
* out_path is filled with the absolute path * out_path is filled with the absolute path
**/ **/
static void fill_pathname_expanded_and_absolute( static void fill_pathname_expanded_and_absolute(
char *out_path, size_t out_size, char *out_path, size_t out_len,
const char *in_refpath, const char *in_refpath,
const char *in_path) const char *in_path)
{ {
@ -140,10 +140,10 @@ static void fill_pathname_expanded_and_absolute(
/* Resolve the reference path relative to the config */ /* Resolve the reference path relative to the config */
if (path_is_absolute(expanded_path)) if (path_is_absolute(expanded_path))
strlcpy(out_path, expanded_path, out_size); strlcpy(out_path, expanded_path, out_len);
else else
fill_pathname_resolve_relative(out_path, in_refpath, fill_pathname_resolve_relative(out_path, in_refpath,
in_path, out_size); in_path, out_len);
pathname_conform_slashes_to_os(out_path); pathname_conform_slashes_to_os(out_path);
} }
@ -151,7 +151,7 @@ static void fill_pathname_expanded_and_absolute(
/** /**
* video_shader_replace_wildcards: * video_shader_replace_wildcards:
* *
* @param inout_absolute_path * @param s
* Absolute path to replace wildcards in * Absolute path to replace wildcards in
* *
* @param in_preset_path * @param in_preset_path
@ -230,16 +230,15 @@ static void fill_pathname_expanded_and_absolute(
* after replacing the wildcards does not exist on disk, * after replacing the wildcards does not exist on disk,
* the path returned will be uneffected. * the path returned will be uneffected.
**/ **/
static void video_shader_replace_wildcards(char *inout_absolute_path, static void video_shader_replace_wildcards(char *s, size_t len, char *in_preset_path)
const unsigned in_absolute_path_length, char *in_preset_path)
{ {
int i = 0; int i = 0;
char replaced_path[PATH_MAX_LENGTH]; char replaced_path[PATH_MAX_LENGTH];
if (!strstr(inout_absolute_path, RARCH_WILDCARD_DELIMITER)) if (!strstr(s, RARCH_WILDCARD_DELIMITER))
return; return;
strlcpy(replaced_path, inout_absolute_path, sizeof(replaced_path)); strlcpy(replaced_path, s, sizeof(replaced_path));
/* Step through the wildcards while we can still find the /* Step through the wildcards while we can still find the
* delimiter in the replaced path * delimiter in the replaced path
@ -440,7 +439,7 @@ static void video_shader_replace_wildcards(char *inout_absolute_path,
} }
if (path_is_valid(replaced_path)) if (path_is_valid(replaced_path))
strlcpy(inout_absolute_path, replaced_path, in_absolute_path_length); strlcpy(s, replaced_path, len);
else else
{ {
/* If a file does not exist at the location of the replaced path /* If a file does not exist at the location of the replaced path
@ -448,7 +447,7 @@ static void video_shader_replace_wildcards(char *inout_absolute_path,
RARCH_DBG("\n[Shaders]: Filepath after wildcard replacement can't be found:\n"); RARCH_DBG("\n[Shaders]: Filepath after wildcard replacement can't be found:\n");
RARCH_DBG(" \"%s\" \n", replaced_path); RARCH_DBG(" \"%s\" \n", replaced_path);
RARCH_DBG(" Falling back to original Filepath\n"); RARCH_DBG(" Falling back to original Filepath\n");
RARCH_DBG(" \"%s\" \n\n", inout_absolute_path); RARCH_DBG(" \"%s\" \n\n", s);
} }
} }