mirror of
https://github.com/libretro/RetroArch.git
synced 2025-01-26 11:36:01 +00:00
(runloop_data.c) Cleanups
This commit is contained in:
parent
4f69881592
commit
f967c88ff0
@ -131,28 +131,27 @@ static void data_runloop_iterate(bool is_thread)
|
||||
|
||||
bool rarch_main_data_active(void)
|
||||
{
|
||||
bool active = false;
|
||||
#ifdef HAVE_LIBRETRODB
|
||||
if (rarch_main_data_db_is_active())
|
||||
active = true;
|
||||
return true;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (input_overlay_data_is_active())
|
||||
active = true;
|
||||
return true;
|
||||
#endif
|
||||
if (rarch_main_data_nbio_image_get_handle())
|
||||
active = true;
|
||||
return true;
|
||||
if (rarch_main_data_nbio_get_handle())
|
||||
active = true;
|
||||
return true;
|
||||
#ifdef HAVE_NETWORKING
|
||||
if (rarch_main_data_http_get_handle())
|
||||
active = true;
|
||||
return true;
|
||||
if (rarch_main_data_http_conn_get_handle())
|
||||
active = true;
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return active;
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
|
@ -362,8 +362,8 @@ static int database_info_iterate(database_state_handle_t *state, database_info_h
|
||||
|
||||
static int database_info_poll(db_handle_t *db)
|
||||
{
|
||||
char elem0[PATH_MAX_LENGTH];
|
||||
uint32_t cb_type_hash = 0;
|
||||
char elem0[PATH_MAX_LENGTH] = {0};
|
||||
struct string_list *str_list = NULL;
|
||||
const char *path = msg_queue_pull(db->msg_queue);
|
||||
|
||||
@ -374,9 +374,10 @@ static int database_info_poll(db_handle_t *db)
|
||||
|
||||
if (!str_list)
|
||||
goto error;
|
||||
if (str_list->size < 1)
|
||||
goto error;
|
||||
|
||||
if (str_list->size > 0)
|
||||
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
||||
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
||||
if (str_list->size > 1)
|
||||
cb_type_hash = msg_hash_calculate(str_list->elems[1].data);
|
||||
|
||||
|
@ -375,10 +375,11 @@ static int rarch_main_data_http_iterate_poll(http_handle_t *http)
|
||||
str_list = string_split(url, "|");
|
||||
|
||||
if (!str_list)
|
||||
return -1;
|
||||
goto error;
|
||||
if (str_list->size < 1)
|
||||
goto error;
|
||||
|
||||
if (str_list->size > 0)
|
||||
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
||||
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
||||
|
||||
http->connection.handle = net_http_connection_new(elem0);
|
||||
|
||||
@ -398,6 +399,11 @@ static int rarch_main_data_http_iterate_poll(http_handle_t *http)
|
||||
string_list_free(str_list);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
if (str_list)
|
||||
string_list_free(str_list);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user