Silence warnings/errors

This commit is contained in:
twinaphex 2018-01-02 06:40:19 +01:00
parent 0c741e6f61
commit 472a792d88
3 changed files with 41 additions and 43 deletions

View File

@ -124,8 +124,10 @@ struct command
#endif
};
#ifdef HAVE_CHEEVOS
static bool command_read_ram(const char *arg);
static bool command_write_ram(const char *arg);
#endif
static const struct cmd_action_map action_map[] = {
{ "SET_SHADER", command_set_shader, "<shader path>" },
@ -247,9 +249,9 @@ bool command_set_shader(const char *arg)
return video_driver_set_shader(type, arg);
}
#if defined(HAVE_COMMAND) && defined(HAVE_CHEEVOS)
static bool command_read_ram(const char *arg)
{
#if defined(HAVE_COMMAND) && defined(HAVE_CHEEVOS)
cheevos_var_t var;
unsigned i;
unsigned nbytes;
@ -283,14 +285,10 @@ static bool command_read_ram(const char *arg)
}
return true;
#else
return false;
#endif
}
static bool command_write_ram(const char *arg)
{
#if defined(HAVE_COMMAND) && defined(HAVE_CHEEVOS)
int i;
cheevos_var_t var;
unsigned nbytes = 0;
@ -311,10 +309,9 @@ static bool command_write_ram(const char *arg)
return true;
}
#endif
return false;
}
#endif
static bool command_get_arg(const char *tok,
const char **arg, unsigned *index)
@ -357,28 +354,6 @@ static bool command_get_arg(const char *tok,
return false;
}
static void command_parse_sub_msg(command_t *handle, const char *tok)
{
const char *arg = NULL;
unsigned index = 0;
if (command_get_arg(tok, &arg, &index))
{
if (arg)
{
if (!action_map[index].action(arg))
RARCH_ERR("Command \"%s\" failed.\n", arg);
}
else
handle->state[map[index].id] = true;
}
else
RARCH_WARN("%s \"%s\" %s.\n",
msg_hash_to_str(MSG_UNRECOGNIZED_COMMAND),
tok,
msg_hash_to_str(MSG_RECEIVED));
}
#if defined(HAVE_NETWORKING) && defined(HAVE_NETWORK_CMD) && defined(HAVE_COMMAND)
static bool command_network_init(command_t *handle, uint16_t port)
{
@ -434,6 +409,28 @@ static bool command_verify(const char *cmd)
}
#ifdef HAVE_COMMAND
static void command_parse_sub_msg(command_t *handle, const char *tok)
{
const char *arg = NULL;
unsigned index = 0;
if (command_get_arg(tok, &arg, &index))
{
if (arg)
{
if (!action_map[index].action(arg))
RARCH_ERR("Command \"%s\" failed.\n", arg);
}
else
handle->state[map[index].id] = true;
}
else
RARCH_WARN("%s \"%s\" %s.\n",
msg_hash_to_str(MSG_UNRECOGNIZED_COMMAND),
tok,
msg_hash_to_str(MSG_RECEIVED));
}
static void command_parse_msg(command_t *handle, char *buf, enum cmd_source_t source)
{
char *save = NULL;

View File

@ -149,17 +149,19 @@ static int action_select_input_desc(const char *path, const char *label, unsigne
}
#ifdef HAVE_KEYMAPPER
static int action_select_input_desc_kbd(const char *path, const char *label, unsigned type,
static int action_select_input_desc_kbd(const char *path,
const char *label, unsigned type,
size_t idx)
{
return action_right_input_desc_kbd(type, label, true);
}
#endif
static int action_select_netplay_connect_room(const char *path, const char *label, unsigned type,
size_t idx)
{
#ifdef HAVE_NETWORKING
static int action_select_netplay_connect_room(const char *path,
const char *label, unsigned type,
size_t idx)
{
char tmp_hostname[4115];
tmp_hostname[0] = '\0';
@ -173,16 +175,16 @@ static int action_select_netplay_connect_room(const char *path, const char *labe
snprintf(tmp_hostname,
sizeof(tmp_hostname),
"%s|%d",
netplay_room_list[idx - 3].mitm_address,
netplay_room_list[idx - 3].mitm_port);
netplay_room_list[idx - 3].mitm_address,
netplay_room_list[idx - 3].mitm_port);
}
else
{
snprintf(tmp_hostname,
sizeof(tmp_hostname),
"%s|%d",
netplay_room_list[idx - 3].address,
netplay_room_list[idx - 3].port);
netplay_room_list[idx - 3].address,
netplay_room_list[idx - 3].port);
}
#if 0
@ -193,15 +195,12 @@ static int action_select_netplay_connect_room(const char *path, const char *labe
#endif
task_push_netplay_crc_scan(netplay_room_list[idx - 3].gamecrc,
netplay_room_list[idx - 3].gamename,
tmp_hostname, netplay_room_list[idx - 3].corename);
netplay_room_list[idx - 3].gamename,
tmp_hostname, netplay_room_list[idx - 3].corename);
#else
return -1;
#endif
return 0;
}
#endif
static int menu_cbs_init_bind_select_compare_type(
menu_file_list_cbs_t *cbs, unsigned type)

View File

@ -2587,6 +2587,7 @@ static int menu_displaylist_parse_load_content_settings(
MENU_SETTING_ACTION_SCREENSHOT, 0, 0);
}
#ifdef HAVE_CHEEVOS
if (settings->bools.quick_menu_show_save_load_state &&
!(settings->bools.cheevos_hardcore_mode_enable && cheevos_loaded))
{
@ -2622,6 +2623,7 @@ static int menu_displaylist_parse_load_content_settings(
MENU_ENUM_LABEL_UNDO_SAVE_STATE,
MENU_SETTING_ACTION_LOADSTATE, 0, 0);
}
#endif
if (settings->bools.quick_menu_show_add_to_favorites)
{