mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Fix C89_BUILD/CXX_BUILD
This commit is contained in:
parent
5bf5388759
commit
05b760d0f8
@ -3415,15 +3415,17 @@ finish:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
int j = 0;
|
|
||||||
int k = 0;
|
|
||||||
char s[PATH_MAX_LENGTH];
|
char s[PATH_MAX_LENGTH];
|
||||||
|
int i = 0;
|
||||||
|
int j = 0;
|
||||||
|
int k = 0;
|
||||||
static struct string_list *room_data = NULL;
|
static struct string_list *room_data = NULL;
|
||||||
|
struct netplay_host_list *lan_hosts = NULL;
|
||||||
file_list_t *file_list = menu_entries_get_selection_buf_ptr(0);
|
file_list_t *file_list = menu_entries_get_selection_buf_ptr(0);
|
||||||
struct netplay_host_list *lan_hosts;
|
|
||||||
|
|
||||||
//netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, &lan_hosts);
|
#if 0
|
||||||
|
netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, &lan_hosts);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (lan_hosts)
|
if (lan_hosts)
|
||||||
lan_room_count = lan_hosts->size;
|
lan_room_count = lan_hosts->size;
|
||||||
@ -3522,10 +3524,14 @@ finish:
|
|||||||
struct netplay_host *host = &lan_hosts->hosts[k];
|
struct netplay_host *host = &lan_hosts->hosts[k];
|
||||||
for (; i < netplay_room_count + lan_room_count; i++)
|
for (; i < netplay_room_count + lan_room_count; i++)
|
||||||
{
|
{
|
||||||
|
struct sockaddr *address = NULL;
|
||||||
|
|
||||||
strlcpy(netplay_room_list[i].nickname,
|
strlcpy(netplay_room_list[i].nickname,
|
||||||
host->nick,
|
host->nick,
|
||||||
sizeof(netplay_room_list[i].nickname));
|
sizeof(netplay_room_list[i].nickname));
|
||||||
struct sockaddr* address = &host->addr;
|
|
||||||
|
address = &host->addr;
|
||||||
|
|
||||||
strlcpy(netplay_room_list[i].address,
|
strlcpy(netplay_room_list[i].address,
|
||||||
inet_ntoa(((struct sockaddr_in*)(address))->sin_addr),
|
inet_ntoa(((struct sockaddr_in*)(address))->sin_addr),
|
||||||
sizeof(netplay_room_list[i].address));
|
sizeof(netplay_room_list[i].address));
|
||||||
@ -3540,10 +3546,11 @@ finish:
|
|||||||
sizeof(netplay_room_list[i].coreversion));
|
sizeof(netplay_room_list[i].coreversion));
|
||||||
|
|
||||||
netplay_room_list[i].port = 55435;
|
netplay_room_list[i].port = 55435;
|
||||||
netplay_room_list[i].gamecrc = host->content_crc;
|
netplay_room_list[i].gamecrc = host->content_crc;
|
||||||
netplay_room_list[i].timestamp = 0;
|
netplay_room_list[i].timestamp = 0;
|
||||||
|
|
||||||
snprintf(s, sizeof(s), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME_LAN),
|
snprintf(s, sizeof(s),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ROOM_NICKNAME_LAN),
|
||||||
netplay_room_list[i].nickname);
|
netplay_room_list[i].nickname);
|
||||||
|
|
||||||
menu_entries_append_enum(file_list,
|
menu_entries_append_enum(file_list,
|
||||||
|
@ -524,6 +524,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_XMB_SHOW_MUSIC:
|
case MENU_ENUM_LABEL_XMB_SHOW_MUSIC:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_music_tab);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_music_tab);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_XMB_SHOW_NETPLAY:
|
||||||
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_netplay_tab);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_XMB_SHOW_VIDEO:
|
case MENU_ENUM_LABEL_XMB_SHOW_VIDEO:
|
||||||
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_video_tab);
|
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_menu_video_tab);
|
||||||
break;
|
break;
|
||||||
|
@ -235,6 +235,9 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
|||||||
sizeof(struct ad_packet), 0, &their_addr, &addr_size) >=
|
sizeof(struct ad_packet), 0, &their_addr, &addr_size) >=
|
||||||
(ssize_t) (2*sizeof(uint32_t)))
|
(ssize_t) (2*sizeof(uint32_t)))
|
||||||
{
|
{
|
||||||
|
char s[NETPLAY_HOST_STR_LEN];
|
||||||
|
uint32_t *content_crc_ptr = NULL;
|
||||||
|
|
||||||
/* Make sure it's a valid query */
|
/* Make sure it's a valid query */
|
||||||
if (memcmp((void *) &ad_packet_buffer, "RANQ", 4))
|
if (memcmp((void *) &ad_packet_buffer, "RANQ", 4))
|
||||||
continue;
|
continue;
|
||||||
@ -247,10 +250,11 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
|||||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);
|
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info);
|
||||||
|
|
||||||
/* Now build our response */
|
/* Now build our response */
|
||||||
uint32_t *content_crc_ptr = NULL;
|
|
||||||
content_get_crc(&content_crc_ptr);
|
content_get_crc(&content_crc_ptr);
|
||||||
|
|
||||||
memset(&ad_packet_buffer, 0, sizeof(struct ad_packet));
|
memset(&ad_packet_buffer, 0, sizeof(struct ad_packet));
|
||||||
memcpy(&ad_packet_buffer, "RANS", 4);
|
memcpy(&ad_packet_buffer, "RANS", 4);
|
||||||
|
|
||||||
ad_packet_buffer.protocol_version =
|
ad_packet_buffer.protocol_version =
|
||||||
htonl(NETPLAY_PROTOCOL_VERSION);
|
htonl(NETPLAY_PROTOCOL_VERSION);
|
||||||
ad_packet_buffer.port = htonl(netplay->tcp_port);
|
ad_packet_buffer.port = htonl(netplay->tcp_port);
|
||||||
@ -268,7 +272,6 @@ bool netplay_lan_ad_server(netplay_t *netplay)
|
|||||||
strlcpy(ad_packet_buffer.core_version, info->info.library_version,
|
strlcpy(ad_packet_buffer.core_version, info->info.library_version,
|
||||||
NETPLAY_HOST_STR_LEN);
|
NETPLAY_HOST_STR_LEN);
|
||||||
}
|
}
|
||||||
char s[NETPLAY_HOST_STR_LEN];
|
|
||||||
snprintf(s, sizeof(s), "%d", *content_crc_ptr);
|
snprintf(s, sizeof(s), "%d", *content_crc_ptr);
|
||||||
strlcpy(ad_packet_buffer.content_crc, s,
|
strlcpy(ad_packet_buffer.content_crc, s,
|
||||||
NETPLAY_HOST_STR_LEN);
|
NETPLAY_HOST_STR_LEN);
|
||||||
@ -301,9 +304,9 @@ static int16_t htons_for_morons(int16_t value)
|
|||||||
static bool netplay_lan_ad_client(void)
|
static bool netplay_lan_ad_client(void)
|
||||||
{
|
{
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
struct timeval tmp_tv = {0};
|
|
||||||
struct sockaddr their_addr;
|
|
||||||
socklen_t addr_size;
|
socklen_t addr_size;
|
||||||
|
struct sockaddr their_addr;
|
||||||
|
struct timeval tmp_tv = {0};
|
||||||
|
|
||||||
if (lan_ad_client_fd < 0)
|
if (lan_ad_client_fd < 0)
|
||||||
return false;
|
return false;
|
||||||
@ -366,7 +369,7 @@ static bool netplay_lan_ad_client(void)
|
|||||||
allocated *= 2;
|
allocated *= 2;
|
||||||
|
|
||||||
if (discovered_hosts.hosts)
|
if (discovered_hosts.hosts)
|
||||||
new_hosts = (struct netplay_host *)
|
new_hosts = (struct netplay_host *)
|
||||||
realloc(discovered_hosts.hosts, allocated * sizeof(struct
|
realloc(discovered_hosts.hosts, allocated * sizeof(struct
|
||||||
netplay_host));
|
netplay_host));
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user