diff --git a/netplay.c b/netplay.c index 4b718432ed..e6be379492 100644 --- a/netplay.c +++ b/netplay.c @@ -1361,7 +1361,7 @@ static int16_t netplay_get_spectate_input(netplay_t *netplay, bool port, int16_t input_state_spectate_client(unsigned port, unsigned device, unsigned index, unsigned id) { - return netplay_get_spectate_input(driver.netplay_data, port, + return netplay_get_spectate_input((netplay_t*)driver.netplay_data, port, device, index, id); } diff --git a/retroarch.c b/retroarch.c index 7e08b3927f..f1b714c6c2 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2147,8 +2147,9 @@ static void check_volume(bool pressed_up, bool pressed_down) #ifdef HAVE_NETPLAY static void check_netplay_flip(bool pressed, bool fullscreen_toggle_pressed) { - if (pressed) - netplay_flip_players(driver.netplay_data); + netplay_t *netplay = (netplay_t*)driver.netplay_data; + if (pressed && netplay) + netplay_flip_players(netplay); rarch_check_fullscreen(fullscreen_toggle_pressed); } @@ -3107,9 +3108,12 @@ void rarch_main_command(unsigned cmd) break; case RARCH_CMD_NETPLAY_DEINIT: #ifdef HAVE_NETPLAY - if (driver.netplay_data) - netplay_free(driver.netplay_data); + { + netplay_t *netplay = (netplay_t*)driver.netplay_data; + if (netplay) + netplay_free(netplay); driver.netplay_data = NULL; + } #endif break; case RARCH_CMD_NETPLAY_INIT: @@ -3269,7 +3273,7 @@ bool rarch_main_iterate(void) #ifdef HAVE_NETPLAY if (driver.netplay_data) - netplay_pre_frame(driver.netplay_data); + netplay_pre_frame((netplay_t*)driver.netplay_data); #endif if (g_extern.bsv.movie) @@ -3311,7 +3315,7 @@ bool rarch_main_iterate(void) #ifdef HAVE_NETPLAY if (driver.netplay_data) - netplay_post_frame(driver.netplay_data); + netplay_post_frame((netplay_t*)driver.netplay_data); #endif #if defined(HAVE_THREADS)