Cleanups/style nits

This commit is contained in:
libretroadmin 2024-12-25 22:52:12 +01:00
parent 1450cc04de
commit c477956f23
2 changed files with 15 additions and 20 deletions

View File

@ -28,23 +28,17 @@
#include "glslang_util.h"
#include "../../verbosity.h"
static void get_include_file(
const char *line, char *include_file, size_t len)
static void get_include_file(const char *line, char *s, size_t len)
{
char *end = NULL;
char *start = (char*)strchr(line, '\"');
if (!start)
return;
start++;
end = (char*)strchr(start, '\"');
if (!end)
if (!(end = (char*)strchr(start, '\"')))
return;
*end = '\0';
strlcpy(include_file, start, len);
strlcpy(s, start, len);
}
bool slang_texture_semantic_is_array(enum slang_texture_semantic sem)
@ -116,7 +110,7 @@ bool glslang_read_shader_file(const char *path,
if (string_is_empty(path) || !output)
return false;
basename = path_basename_nocompression(path);
basename = path_basename_nocompression(path);
if (string_is_empty(basename))
return false;
@ -219,7 +213,8 @@ bool glslang_read_shader_file(const char *path,
include_path, path, include_file, sizeof(include_path));
/* Parse include file */
if (!glslang_read_shader_file(include_path, output, false, include_optional)) {
if (!glslang_read_shader_file(include_path, output, false, include_optional))
{
if (include_optional)
RARCH_LOG("[slang]: Optional include not found \"%s\".\n", include_path);
else
@ -233,8 +228,8 @@ bool glslang_read_shader_file(const char *path,
if (!string_list_append(output, tmp, attr))
goto error;
}
else if (!strncmp("#endif", line, STRLEN_CONST("#endif")) ||
!strncmp("#pragma", line, STRLEN_CONST("#pragma")))
else if ( !strncmp("#endif", line, STRLEN_CONST("#endif"))
|| !strncmp("#pragma", line, STRLEN_CONST("#pragma")))
{
/* #line seems to be ignored if preprocessor tests fail,
* so we should reapply #line after each #endif.

View File

@ -325,20 +325,20 @@ void gfx_thumbnail_request(
/* Since task_push_pl_entry_download will shift the flag, do not attempt if it is already
* at second to last option. */
curr_flag = playlist_get_curr_thumbnail_name_flag(playlist,idx);
if (curr_flag & PLAYLIST_THUMBNAIL_FLAG_NONE || curr_flag & PLAYLIST_THUMBNAIL_FLAG_SHORT_NAME)
if ( curr_flag & PLAYLIST_THUMBNAIL_FLAG_NONE
|| curr_flag & PLAYLIST_THUMBNAIL_FLAG_SHORT_NAME)
goto end;
/* Do not try to fetch full names here, if it is not explicitly wanted */
if (!settings->bools.playlist_use_filename &&
!playlist_thumbnail_match_with_filename(playlist) &&
curr_flag == PLAYLIST_THUMBNAIL_FLAG_INVALID)
if ( !settings->bools.playlist_use_filename
&& !playlist_thumbnail_match_with_filename(playlist)
&& curr_flag == PLAYLIST_THUMBNAIL_FLAG_INVALID)
playlist_update_thumbnail_name_flag(playlist, idx, PLAYLIST_THUMBNAIL_FLAG_FULL_NAME);
/* Trigger thumbnail download *
* Note: download will grab all 3 possible thumbnails, no matter
* what left/right thumbnails are set at the moment */
task_push_pl_entry_thumbnail_download(
system, playlist, (unsigned)idx,
false, true);
task_push_pl_entry_thumbnail_download(system, playlist,
(unsigned)idx, false, true);
}
#endif
}