Skip to content

Commit

Permalink
Cleanups/style nits
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Dec 25, 2024
1 parent 1450cc0 commit c477956
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
21 changes: 8 additions & 13 deletions gfx/drivers_shader/glslang_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
14 changes: 7 additions & 7 deletions gfx/gfx_thumbnail.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c477956

Please sign in to comment.