Fix C89_BUILD

This commit is contained in:
twinaphex 2017-01-22 21:24:57 +01:00
parent 36b2c48cb5
commit 178d959cad
6 changed files with 30 additions and 25 deletions

View File

@ -2453,12 +2453,14 @@ bool command_event(enum event_command cmd, void *data)
{
/* buf is expected to be address:port, there must be a better way
to do this but for now I'll just use a string list */
char *buf = (char *) data;
char *buf = (char *)data;
static struct string_list *hostname = NULL;
settings_t *settings = config_get_ptr();
hostname = string_split(buf, ":");
settings_t *settings = config_get_ptr();
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
if (!init_netplay_deferred(
hostname->elems[0].data, atoi(hostname->elems[1].data)))
{

View File

@ -3350,6 +3350,7 @@ finish:
{
int i, j = 0;
char tmp[PATH_MAX_LENGTH];
char s[PATH_MAX_LENGTH];
static struct string_list *room_data = NULL;
file_list_t *file_list = menu_entries_get_selection_buf_ptr(0);
@ -3419,10 +3420,12 @@ finish:
netplay_room_list[i].gamename,
netplay_room_list[i].gamecrc,
netplay_room_list[i].timestamp);
j+=8;
char s[PATH_MAX_LENGTH];
snprintf(s, sizeof(s), "Nickname: %s",
netplay_room_list[i].nickname);
menu_entries_append_enum(file_list,
s,
msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM),

View File

@ -156,7 +156,9 @@ static int action_bind_sublabel_netplay_room(
snprintf(s,len, "%s (%s)\n%s (%08x)",
netplay_room_list[i - 1].corename, netplay_room_list[i - 1].coreversion,
netplay_room_list[i - 1].gamename, netplay_room_list[i - 1].gamecrc);
//strlcpy(s, netplay_room_list[i - 1].corename, len);
#if 0
strlcpy(s, netplay_room_list[i - 1].corename, len);
#endif
return 0;
}

View File

@ -2961,10 +2961,13 @@ static int menu_displaylist_parse_netplay_room_list(
for (i = 0; i < netplay_room_count; i++)
{
char s[PATH_MAX_LENGTH];
snprintf(s, sizeof(s), "Nickname: %s", netplay_room_list[i].nickname);
const char *label = s;
s[0] = '\0';
snprintf(s, sizeof(s),
"Nickname: %s", netplay_room_list[i].nickname);
menu_entries_append_enum(info->list,
label,
s,
msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM),
MENU_ENUM_LABEL_CONNECT_NETPLAY_ROOM,
MENU_WIFI, 0, 0);

View File

@ -425,14 +425,16 @@ static void netplay_announce_cb(void *task_data, void *user_data, const char *er
static void netplay_announce()
{
char buf [2048];
char url [2048] = "http://lobby.libretro.com/raw/?";
rarch_system_info_t *system = NULL;
settings_t *settings = config_get_ptr();
uint32_t *content_crc_ptr = NULL;
uint32_t *content_crc_ptr = NULL;
content_get_crc(&content_crc_ptr);
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
char url [2048] = "http://lobby.libretro.com/raw/?";
char buf [2048];
buf[0] = '\0';
snprintf(buf, sizeof(buf), "%susername=%s&corename=%s&coreversion=%s&"

View File

@ -47,11 +47,11 @@ typedef struct
static void netplay_crc_scan_callback(void *task_data,
void *user_data, const char *error)
{
netplay_crc_handle_t *state = (netplay_crc_handle_t*)task_data;
core_info_list_t *info = NULL;
int i;
netplay_crc_handle_t *state = (netplay_crc_handle_t*)task_data;
core_info_list_t *info = NULL;
content_ctx_info_t content_info = {0};
int i;
core_info_get_list(&info);
if (!state)
@ -63,11 +63,6 @@ static void netplay_crc_scan_callback(void *task_data,
break;
}
printf("Hostname: %s\n", state->hostname);
printf("Content: %s\n", state->path);
printf("Corename: %s\n", state->corename);
printf("Corepath: %s\n", info->list[i].path);
command_event(CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED, state->hostname);
task_push_content_load_default(
info->list[i].path, state->path,
@ -81,8 +76,8 @@ static void netplay_crc_scan_callback(void *task_data,
static void task_netplay_crc_scan_handler(retro_task_t *task)
{
netplay_crc_handle_t *state = (netplay_crc_handle_t*)task->state;
size_t i, j;
netplay_crc_handle_t *state = (netplay_crc_handle_t*)task->state;
task_set_progress(task, 0);
task_set_title(task, strdup("Checking for ROM presence."));
@ -102,18 +97,16 @@ static void task_netplay_crc_scan_handler(retro_task_t *task)
for (i = 0; i < state->lpl_list->size; i++)
{
playlist_t *playlist = NULL;
const char *lpl_path = state->lpl_list->elems[i].data;
if (!strstr(lpl_path, file_path_str(FILE_PATH_LPL_EXTENSION)))
continue;
printf("%s\n", lpl_path);
playlist_t *playlist = playlist_init(lpl_path, 99999);
playlist = playlist_init(lpl_path, 99999);
for (j = 0; j < playlist->size; j++)
{
printf("%s\n", playlist->entries[j].crc32);
if (string_is_equal(playlist->entries[j].crc32, state->crc))
{
strlcpy(state->path, playlist->entries[j].path, sizeof(state->path));
@ -141,8 +134,8 @@ no_playlists:
bool task_push_netplay_crc_scan(uint32_t crc,
const char *hostname, const char *corename)
{
settings_t *settings = config_get_ptr();
retro_task_t *task = (retro_task_t *)calloc(1, sizeof(*task));
settings_t *settings = config_get_ptr();
retro_task_t *task = (retro_task_t *)calloc(1, sizeof(*task));
netplay_crc_handle_t *state = (netplay_crc_handle_t*)calloc(1, sizeof(*state));
if (!task || !state)