Prevent more warnings

This commit is contained in:
twinaphex 2016-06-01 05:18:59 +02:00
parent 5eb43846da
commit da7f6a2a3b
4 changed files with 31 additions and 20 deletions

View File

@ -996,9 +996,12 @@ static void command_event_init_controllers(void)
const struct retro_controller_description *desc = NULL;
unsigned device = settings->input.libretro_device[i];
if (info)
{
if (i < info->ports.size)
desc = libretro_find_controller_description(
&info->ports.data[i], device);
}
if (desc)
ident = desc->desc;

View File

@ -867,7 +867,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
if (string_is_empty(settings->directory.system))
{
char *fullpath = NULL;
if (runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath))
if (runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath) &&
fullpath)
{
RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR %s\n",
fullpath);

View File

@ -689,12 +689,15 @@ static int mui_get_core_title(char *s, size_t len)
return -1;
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info))
{
if (info)
{
if (string_is_empty(core_name))
core_name = info->info.library_name;
if (!core_version)
core_version = info->info.library_version;
}
}
if (string_is_empty(core_name))
core_name = menu_hash_to_str(MENU_VALUE_NO_CORE);

View File

@ -1074,7 +1074,8 @@ static void setting_get_string_representation_uint_libretro_device(void *data,
index_offset = menu_setting_get_index_offset(setting);
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system))
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system)
&& system)
{
if (index_offset < system->ports.size)
desc = libretro_find_controller_description(
@ -2360,15 +2361,16 @@ static int setting_action_start_libretro_device_type(void *data)
devices[types++] = RETRO_DEVICE_NONE;
devices[types++] = RETRO_DEVICE_JOYPAD;
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system))
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system)
&& system)
{
/* Only push RETRO_DEVICE_ANALOG as default if we use an
* older core which doesn't use SET_CONTROLLER_INFO. */
if (!system->ports.size)
devices[types++] = RETRO_DEVICE_ANALOG;
desc = port < system->ports.size ?
&system->ports.data[port] : NULL;
if (port < system->ports.size)
desc = &system->ports.data[port];
}
if (desc)
@ -2567,8 +2569,6 @@ static int setting_action_right_libretro_device_type(
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = NULL;
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
if (!setting)
return -1;
@ -2577,6 +2577,9 @@ static int setting_action_right_libretro_device_type(
devices[types++] = RETRO_DEVICE_NONE;
devices[types++] = RETRO_DEVICE_JOYPAD;
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system)
&& system)
{
/* Only push RETRO_DEVICE_ANALOG as default if we use an
* older core which doesn't use SET_CONTROLLER_INFO. */
if (!system->ports.size)
@ -2584,6 +2587,7 @@ static int setting_action_right_libretro_device_type(
if (port < system->ports.size)
desc = &system->ports.data[port];
}
if (desc)
{