mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 13:14:04 +00:00
Cleanups - move variables to menu_entries_ctl as static local variables
This commit is contained in:
parent
1004537e8d
commit
75c6276ade
@ -35,10 +35,6 @@ struct menu_list
|
|||||||
|
|
||||||
struct menu_entries
|
struct menu_entries
|
||||||
{
|
{
|
||||||
/* Flagged when menu entries need to be refreshed */
|
|
||||||
bool need_refresh;
|
|
||||||
bool nonblocking_refresh;
|
|
||||||
|
|
||||||
size_t begin;
|
size_t begin;
|
||||||
menu_list_t *menu_list;
|
menu_list_t *menu_list;
|
||||||
rarch_setting_t *list_settings;
|
rarch_setting_t *list_settings;
|
||||||
@ -659,6 +655,10 @@ rarch_setting_t *menu_entries_get_setting(uint32_t i)
|
|||||||
|
|
||||||
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
|
/* Flagged when menu entries need to be refreshed */
|
||||||
|
static bool menu_entries_need_refresh = false;
|
||||||
|
static bool menu_entries_nonblocking_refresh = false;
|
||||||
|
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case MENU_ENTRIES_CTL_DEINIT:
|
case MENU_ENTRIES_CTL_DEINIT:
|
||||||
@ -673,12 +673,14 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
|||||||
menu_entries_data->menu_list = NULL;
|
menu_entries_data->menu_list = NULL;
|
||||||
|
|
||||||
free(menu_entries_data);
|
free(menu_entries_data);
|
||||||
menu_entries_data = NULL;
|
menu_entries_need_refresh = NULL;
|
||||||
|
menu_entries_nonblocking_refresh = NULL;
|
||||||
|
menu_entries_data = NULL;
|
||||||
return true;
|
return true;
|
||||||
case MENU_ENTRIES_CTL_NEEDS_REFRESH:
|
case MENU_ENTRIES_CTL_NEEDS_REFRESH:
|
||||||
if (!menu_entries_data || menu_entries_data->nonblocking_refresh)
|
if (!menu_entries_data || menu_entries_nonblocking_refresh)
|
||||||
return false;
|
return false;
|
||||||
if (!menu_entries_data->need_refresh)
|
if (!menu_entries_need_refresh)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
case MENU_ENTRIES_CTL_LIST_GET:
|
case MENU_ENTRIES_CTL_LIST_GET:
|
||||||
@ -703,9 +705,9 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
|||||||
bool *nonblocking = (bool*)data;
|
bool *nonblocking = (bool*)data;
|
||||||
|
|
||||||
if (*nonblocking)
|
if (*nonblocking)
|
||||||
menu_entries_data->nonblocking_refresh = true;
|
menu_entries_nonblocking_refresh = true;
|
||||||
else
|
else
|
||||||
menu_entries_data->need_refresh = true;
|
menu_entries_need_refresh = true;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case MENU_ENTRIES_CTL_UNSET_REFRESH:
|
case MENU_ENTRIES_CTL_UNSET_REFRESH:
|
||||||
@ -714,9 +716,9 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
|
|||||||
bool *nonblocking = (bool*)data;
|
bool *nonblocking = (bool*)data;
|
||||||
|
|
||||||
if (*nonblocking)
|
if (*nonblocking)
|
||||||
menu_entries_data->nonblocking_refresh = false;
|
menu_entries_nonblocking_refresh = false;
|
||||||
else
|
else
|
||||||
menu_entries_data->need_refresh = false;
|
menu_entries_need_refresh = false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case MENU_ENTRIES_CTL_INIT:
|
case MENU_ENTRIES_CTL_INIT:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user