mirror of
https://github.com/libretro/RetroArch
synced 2025-02-22 03:40:43 +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 rarch_main_data_active(void)
|
||||||
{
|
{
|
||||||
bool active = false;
|
|
||||||
#ifdef HAVE_LIBRETRODB
|
#ifdef HAVE_LIBRETRODB
|
||||||
if (rarch_main_data_db_is_active())
|
if (rarch_main_data_db_is_active())
|
||||||
active = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
if (input_overlay_data_is_active())
|
if (input_overlay_data_is_active())
|
||||||
active = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
if (rarch_main_data_nbio_image_get_handle())
|
if (rarch_main_data_nbio_image_get_handle())
|
||||||
active = true;
|
return true;
|
||||||
if (rarch_main_data_nbio_get_handle())
|
if (rarch_main_data_nbio_get_handle())
|
||||||
active = true;
|
return true;
|
||||||
#ifdef HAVE_NETWORKING
|
#ifdef HAVE_NETWORKING
|
||||||
if (rarch_main_data_http_get_handle())
|
if (rarch_main_data_http_get_handle())
|
||||||
active = true;
|
return true;
|
||||||
if (rarch_main_data_http_conn_get_handle())
|
if (rarch_main_data_http_conn_get_handle())
|
||||||
active = true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return active;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#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)
|
static int database_info_poll(db_handle_t *db)
|
||||||
{
|
{
|
||||||
|
char elem0[PATH_MAX_LENGTH];
|
||||||
uint32_t cb_type_hash = 0;
|
uint32_t cb_type_hash = 0;
|
||||||
char elem0[PATH_MAX_LENGTH] = {0};
|
|
||||||
struct string_list *str_list = NULL;
|
struct string_list *str_list = NULL;
|
||||||
const char *path = msg_queue_pull(db->msg_queue);
|
const char *path = msg_queue_pull(db->msg_queue);
|
||||||
|
|
||||||
@ -374,8 +374,9 @@ static int database_info_poll(db_handle_t *db)
|
|||||||
|
|
||||||
if (!str_list)
|
if (!str_list)
|
||||||
goto error;
|
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)
|
if (str_list->size > 1)
|
||||||
cb_type_hash = msg_hash_calculate(str_list->elems[1].data);
|
cb_type_hash = msg_hash_calculate(str_list->elems[1].data);
|
||||||
|
@ -375,9 +375,10 @@ static int rarch_main_data_http_iterate_poll(http_handle_t *http)
|
|||||||
str_list = string_split(url, "|");
|
str_list = string_split(url, "|");
|
||||||
|
|
||||||
if (!str_list)
|
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);
|
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);
|
string_list_free(str_list);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
error:
|
||||||
|
if (str_list)
|
||||||
|
string_list_free(str_list);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user