(runloop data) Don't have to pass around runloop pointer anymore

This commit is contained in:
twinaphex 2015-07-08 23:01:11 +02:00
parent c90072df55
commit 51e2a128c5
6 changed files with 24 additions and 30 deletions

View File

@ -104,20 +104,20 @@ void rarch_main_data_free(void)
runloop = NULL; runloop = NULL;
} }
static void data_runloop_iterate(bool is_thread, data_runloop_t *runloop) static void data_runloop_iterate(bool is_thread)
{ {
rarch_main_data_nbio_iterate (is_thread, runloop); rarch_main_data_nbio_iterate (is_thread);
#ifdef HAVE_RPNG #ifdef HAVE_RPNG
rarch_main_data_nbio_image_iterate (is_thread, runloop); rarch_main_data_nbio_image_iterate (is_thread);
#endif #endif
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
rarch_main_data_overlay_iterate (is_thread, runloop); rarch_main_data_overlay_iterate (is_thread);
#endif #endif
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
rarch_main_data_http_iterate (is_thread, runloop); rarch_main_data_http_iterate (is_thread);
#endif #endif
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB
rarch_main_data_db_iterate (is_thread, runloop); rarch_main_data_db_iterate (is_thread);
#endif #endif
} }
@ -172,7 +172,7 @@ static void data_thread_loop(void *data)
if (!runloop->alive) if (!runloop->alive)
break; break;
data_runloop_iterate(true, runloop); data_runloop_iterate(true);
if (!rarch_main_data_active(runloop)) if (!rarch_main_data_active(runloop))
rarch_sleep(10); rarch_sleep(10);
@ -241,10 +241,10 @@ void rarch_main_data_iterate(void)
#endif #endif
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
rarch_main_data_overlay_image_upload_iterate(false, runloop); rarch_main_data_overlay_image_upload_iterate(false);
#endif #endif
#ifdef HAVE_RPNG #ifdef HAVE_RPNG
rarch_main_data_nbio_image_upload_iterate(false, runloop); rarch_main_data_nbio_image_upload_iterate(false);
#endif #endif
if (data_runloop_msg[0] != '\0') if (data_runloop_msg[0] != '\0')
@ -262,7 +262,7 @@ void rarch_main_data_iterate(void)
return; return;
#endif #endif
data_runloop_iterate(false, runloop); data_runloop_iterate(false);
} }
static data_runloop_t *rarch_main_data_new(void) static data_runloop_t *rarch_main_data_new(void)

View File

@ -396,7 +396,7 @@ static void rarch_main_data_db_cleanup_state(database_state_handle_t *db_state)
db_state->buf = NULL; db_state->buf = NULL;
} }
void rarch_main_data_db_iterate(bool is_thread, void *data) void rarch_main_data_db_iterate(bool is_thread)
{ {
database_info_handle_t *db = (db_ptr) ? db_ptr->handle : NULL; database_info_handle_t *db = (db_ptr) ? db_ptr->handle : NULL;
database_state_handle_t *db_state = (db_ptr) ? &db_ptr->state : NULL; database_state_handle_t *db_state = (db_ptr) ? &db_ptr->state : NULL;

View File

@ -348,7 +348,7 @@ static int rarch_main_data_image_iterate_transfer_parse(nbio_handle_t *nbio)
return 0; return 0;
} }
void rarch_main_data_nbio_image_iterate(bool is_thread, void *data) void rarch_main_data_nbio_image_iterate(bool is_thread)
{ {
nbio_handle_t *nbio = rarch_main_data_nbio_get_ptr(); nbio_handle_t *nbio = rarch_main_data_nbio_get_ptr();
nbio_image_handle_t *image = nbio ? &nbio->image : NULL; nbio_image_handle_t *image = nbio ? &nbio->image : NULL;
@ -382,8 +382,7 @@ void rarch_main_data_nbio_image_iterate(bool is_thread, void *data)
} }
} }
void rarch_main_data_nbio_image_upload_iterate(bool is_thread, void rarch_main_data_nbio_image_upload_iterate(bool is_thread)
void *data)
{ {
nbio_handle_t *nbio = rarch_main_data_nbio_get_ptr(); nbio_handle_t *nbio = rarch_main_data_nbio_get_ptr();
nbio_image_handle_t *image = nbio ? &nbio->image : NULL; nbio_image_handle_t *image = nbio ? &nbio->image : NULL;
@ -623,7 +622,7 @@ static int rarch_main_data_nbio_iterate_parse(nbio_handle_t *nbio)
return 0; return 0;
} }
void rarch_main_data_nbio_iterate(bool is_thread, void *data) void rarch_main_data_nbio_iterate(bool is_thread)
{ {
nbio_handle_t *nbio = rarch_main_data_nbio_get_ptr(); nbio_handle_t *nbio = rarch_main_data_nbio_get_ptr();
if (!nbio) if (!nbio)

View File

@ -435,7 +435,7 @@ static int rarch_main_data_http_iterate_transfer(void *data)
return 0; return 0;
} }
void rarch_main_data_http_iterate(bool is_thread, void *data) void rarch_main_data_http_iterate(bool is_thread)
{ {
http_handle_t *http = rarch_main_data_http_get_ptr(); http_handle_t *http = rarch_main_data_http_get_ptr();
if (!http) if (!http)

View File

@ -26,7 +26,7 @@
static slock_t *overlay_lock; static slock_t *overlay_lock;
#endif #endif
void rarch_main_data_overlay_image_upload_iterate(bool is_thread, void *data) void rarch_main_data_overlay_image_upload_iterate(bool is_thread)
{ {
driver_t *driver = driver_get_ptr(); driver_t *driver = driver_get_ptr();
@ -55,7 +55,7 @@ void rarch_main_data_overlay_image_upload_iterate(bool is_thread, void *data)
#endif #endif
} }
void rarch_main_data_overlay_iterate(bool is_thread, void *data) void rarch_main_data_overlay_iterate(bool is_thread)
{ {
driver_t *driver = NULL; driver_t *driver = NULL;

View File

@ -52,8 +52,7 @@ void *rarch_main_data_nbio_image_get_handle(void);
* Returns: 0 when finished, -1 when we should continue * Returns: 0 when finished, -1 when we should continue
* with the transfer on the next frame. * with the transfer on the next frame.
**/ **/
void rarch_main_data_http_iterate(bool is_thread, void rarch_main_data_http_iterate(bool is_thread);
void *data);
msg_queue_t *rarch_main_data_http_get_msg_queue_ptr(void); msg_queue_t *rarch_main_data_http_get_msg_queue_ptr(void);
@ -71,15 +70,13 @@ void *rarch_main_data_http_get_ptr(void);
#endif #endif
#ifdef HAVE_RPNG #ifdef HAVE_RPNG
void rarch_main_data_nbio_image_iterate(bool is_thread, void rarch_main_data_nbio_image_iterate(bool is_thread);
void *data); void rarch_main_data_nbio_image_upload_iterate(bool is_thread);
void rarch_main_data_nbio_image_upload_iterate(bool is_thread,
void *data);
#endif #endif
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB
#ifdef HAVE_MENU #ifdef HAVE_MENU
void rarch_main_data_db_iterate(bool is_thread, void *data); void rarch_main_data_db_iterate(bool is_thread);
#endif #endif
void rarch_main_data_db_init_msg_queue(void); void rarch_main_data_db_init_msg_queue(void);
@ -96,18 +93,16 @@ bool rarch_main_data_db_is_active(void);
#endif #endif
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
void rarch_main_data_overlay_image_upload_iterate(bool is_thread, void rarch_main_data_overlay_image_upload_iterate(bool is_thread);
void *data);
void rarch_main_data_overlay_iterate(bool is_thread, void *data); void rarch_main_data_overlay_iterate(bool is_thread);
void rarch_main_data_overlay_thread_uninit(void); void rarch_main_data_overlay_thread_uninit(void);
void rarch_main_data_overlay_thread_init(void); void rarch_main_data_overlay_thread_init(void);
#endif #endif
void rarch_main_data_nbio_iterate(bool is_thread, void rarch_main_data_nbio_iterate(bool is_thread);
void *runloop);
void data_runloop_osd_msg(const char *s, size_t len); void data_runloop_osd_msg(const char *s, size_t len);