Cleanups - cleanup unused variable warnings

This commit is contained in:
libretroadmin 2023-06-01 01:06:56 +02:00
parent e51d1a3d2a
commit 21ffa14fea
3 changed files with 24 additions and 34 deletions

View File

@ -136,7 +136,7 @@ static bool create_softfilter_graph(rarch_softfilter_t *filt,
softfilter_simd_mask_t cpu_features, softfilter_simd_mask_t cpu_features,
unsigned threads) unsigned threads)
{ {
unsigned input_fmts, input_fmt, output_fmts, i = 0; unsigned input_fmts, input_fmt, output_fmts;
struct config_file_userdata userdata; struct config_file_userdata userdata;
char key[64], name[64]; char key[64], name[64];
name[0] = '\0'; name[0] = '\0';
@ -236,9 +236,9 @@ static bool create_softfilter_graph(rarch_softfilter_t *filt,
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
if (filt->threads > 1) if (filt->threads > 1)
{ {
filt->thread_data = (struct filter_thread_data*) unsigned i;
calloc(threads, sizeof(*filt->thread_data)); if (!(filt->thread_data = (struct filter_thread_data*)
if (!filt->thread_data) calloc(threads, sizeof(*filt->thread_data))))
return false; return false;
for (i = 0; i < threads; i++) for (i = 0; i < threads; i++)

View File

@ -252,27 +252,14 @@ static int action_left_scroll(unsigned type, const char *label,
return 0; return 0;
} }
static int action_left_goto_tab(void)
{
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
file_list_t *selection_buf = menu_list ? MENU_LIST_GET_SELECTION(menu_list, 0) : NULL;
if (menu_st->driver_ctx && menu_st->driver_ctx->list_cache)
menu_st->driver_ctx->list_cache(menu_st->userdata,
MENU_LIST_HORIZONTAL, MENU_ACTION_LEFT);
return menu_driver_deferred_push_content_list(selection_buf);
}
static int action_left_mainmenu(unsigned type, const char *label, static int action_left_mainmenu(unsigned type, const char *label,
bool wraparound) bool wraparound)
{ {
#ifdef HAVE_XMB
struct menu_state *menu_st = menu_state_get_ptr(); struct menu_state *menu_st = menu_state_get_ptr();
const menu_ctx_driver_t *driver_ctx = menu_st->driver_ctx; const menu_ctx_driver_t *driver_ctx = menu_st->driver_ctx;
const char *menu_ident = (driver_ctx && driver_ctx->ident) ? driver_ctx->ident : NULL;
size_t size = (driver_ctx && driver_ctx->list_get_size) ? driver_ctx->list_get_size(menu_st->userdata, MENU_LIST_PLAIN) : 0; size_t size = (driver_ctx && driver_ctx->list_get_size) ? driver_ctx->list_get_size(menu_st->userdata, MENU_LIST_PLAIN) : 0;
const char *menu_ident = (driver_ctx && driver_ctx->ident) ? driver_ctx->ident : NULL;
#ifdef HAVE_XMB
/* Tab switching functionality only applies /* Tab switching functionality only applies
* to XMB */ * to XMB */
if ( (size == 1) if ( (size == 1)
@ -282,7 +269,15 @@ static int action_left_mainmenu(unsigned type, const char *label,
bool menu_nav_wraparound_enable = settings->bools.menu_navigation_wraparound_enable; bool menu_nav_wraparound_enable = settings->bools.menu_navigation_wraparound_enable;
size_t selection = (driver_ctx && driver_ctx->list_get_selection) ? driver_ctx->list_get_selection(menu_st->userdata) : 0; size_t selection = (driver_ctx && driver_ctx->list_get_selection) ? driver_ctx->list_get_selection(menu_st->userdata) : 0;
if ((selection != 0) || menu_nav_wraparound_enable) if ((selection != 0) || menu_nav_wraparound_enable)
return action_left_goto_tab(); {
menu_list_t *menu_list = menu_st->entries.list;
file_list_t *selection_buf = menu_list ? MENU_LIST_GET_SELECTION(menu_list, 0) : NULL;
if (menu_st->driver_ctx && menu_st->driver_ctx->list_cache)
menu_st->driver_ctx->list_cache(menu_st->userdata,
MENU_LIST_HORIZONTAL, MENU_ACTION_LEFT);
return menu_driver_deferred_push_content_list(selection_buf);
}
} }
else else
#endif #endif

View File

@ -281,26 +281,14 @@ static int audio_mixer_stream_volume_right(unsigned type, const char *label,
} }
#endif #endif
static int action_right_goto_tab(void)
{
struct menu_state *menu_st = menu_state_get_ptr();
menu_list_t *menu_list = menu_st->entries.list;
file_list_t *selection_buf = menu_list ? MENU_LIST_GET_SELECTION(menu_list, 0) : NULL;
if (menu_st->driver_ctx && menu_st->driver_ctx->list_cache)
menu_st->driver_ctx->list_cache(menu_st->userdata,
MENU_LIST_HORIZONTAL, MENU_ACTION_RIGHT);
return menu_driver_deferred_push_content_list(selection_buf);
}
static int action_right_mainmenu(unsigned type, const char *label, static int action_right_mainmenu(unsigned type, const char *label,
bool wraparound) bool wraparound)
{ {
#ifdef HAVE_XMB
struct menu_state *menu_st = menu_state_get_ptr(); struct menu_state *menu_st = menu_state_get_ptr();
const menu_ctx_driver_t *driver_ctx = menu_st->driver_ctx; const menu_ctx_driver_t *driver_ctx = menu_st->driver_ctx;
const char *menu_ident = (driver_ctx && driver_ctx->ident) ? driver_ctx->ident : NULL; const char *menu_ident = (driver_ctx && driver_ctx->ident) ? driver_ctx->ident : NULL;
size_t size = (driver_ctx && driver_ctx->list_get_size) ? driver_ctx->list_get_size(menu_st->userdata, MENU_LIST_PLAIN) : 0; size_t size = (driver_ctx && driver_ctx->list_get_size) ? driver_ctx->list_get_size(menu_st->userdata, MENU_LIST_PLAIN) : 0;
#ifdef HAVE_XMB
/* Tab switching functionality only applies /* Tab switching functionality only applies
* to XMB */ * to XMB */
if ( (size == 1) if ( (size == 1)
@ -321,7 +309,14 @@ static int action_right_mainmenu(unsigned type, const char *label,
if ( (selection != (horiz_size + tabs_size)) if ( (selection != (horiz_size + tabs_size))
|| menu_nav_wraparound_enable) || menu_nav_wraparound_enable)
return action_right_goto_tab(); {
menu_list_t *menu_list = menu_st->entries.list;
file_list_t *selection_buf = menu_list ? MENU_LIST_GET_SELECTION(menu_list, 0) : NULL;
if (menu_st->driver_ctx && menu_st->driver_ctx->list_cache)
menu_st->driver_ctx->list_cache(menu_st->userdata,
MENU_LIST_HORIZONTAL, MENU_ACTION_RIGHT);
return menu_driver_deferred_push_content_list(selection_buf);
}
} }
else else
#endif #endif