mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Prevent more warnings
This commit is contained in:
parent
5eb43846da
commit
da7f6a2a3b
@ -996,9 +996,12 @@ static void command_event_init_controllers(void)
|
|||||||
const struct retro_controller_description *desc = NULL;
|
const struct retro_controller_description *desc = NULL;
|
||||||
unsigned device = settings->input.libretro_device[i];
|
unsigned device = settings->input.libretro_device[i];
|
||||||
|
|
||||||
if (i < info->ports.size)
|
if (info)
|
||||||
desc = libretro_find_controller_description(
|
{
|
||||||
&info->ports.data[i], device);
|
if (i < info->ports.size)
|
||||||
|
desc = libretro_find_controller_description(
|
||||||
|
&info->ports.data[i], device);
|
||||||
|
}
|
||||||
|
|
||||||
if (desc)
|
if (desc)
|
||||||
ident = desc->desc;
|
ident = desc->desc;
|
||||||
|
@ -867,7 +867,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||||||
if (string_is_empty(settings->directory.system))
|
if (string_is_empty(settings->directory.system))
|
||||||
{
|
{
|
||||||
char *fullpath = NULL;
|
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",
|
RARCH_WARN("SYSTEM DIR is empty, assume CONTENT DIR %s\n",
|
||||||
fullpath);
|
fullpath);
|
||||||
|
@ -690,10 +690,13 @@ static int mui_get_core_title(char *s, size_t len)
|
|||||||
|
|
||||||
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info))
|
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info))
|
||||||
{
|
{
|
||||||
if (string_is_empty(core_name))
|
if (info)
|
||||||
core_name = info->info.library_name;
|
{
|
||||||
if (!core_version)
|
if (string_is_empty(core_name))
|
||||||
core_version = info->info.library_version;
|
core_name = info->info.library_name;
|
||||||
|
if (!core_version)
|
||||||
|
core_version = info->info.library_version;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string_is_empty(core_name))
|
if (string_is_empty(core_name))
|
||||||
|
@ -1074,7 +1074,8 @@ static void setting_get_string_representation_uint_libretro_device(void *data,
|
|||||||
|
|
||||||
index_offset = menu_setting_get_index_offset(setting);
|
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)
|
if (index_offset < system->ports.size)
|
||||||
desc = libretro_find_controller_description(
|
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_NONE;
|
||||||
devices[types++] = RETRO_DEVICE_JOYPAD;
|
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
|
/* Only push RETRO_DEVICE_ANALOG as default if we use an
|
||||||
* older core which doesn't use SET_CONTROLLER_INFO. */
|
* older core which doesn't use SET_CONTROLLER_INFO. */
|
||||||
if (!system->ports.size)
|
if (!system->ports.size)
|
||||||
devices[types++] = RETRO_DEVICE_ANALOG;
|
devices[types++] = RETRO_DEVICE_ANALOG;
|
||||||
|
|
||||||
desc = port < system->ports.size ?
|
if (port < system->ports.size)
|
||||||
&system->ports.data[port] : NULL;
|
desc = &system->ports.data[port];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desc)
|
if (desc)
|
||||||
@ -2567,8 +2569,6 @@ static int setting_action_right_libretro_device_type(
|
|||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
rarch_system_info_t *system = NULL;
|
rarch_system_info_t *system = NULL;
|
||||||
|
|
||||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
|
||||||
|
|
||||||
if (!setting)
|
if (!setting)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -2577,13 +2577,17 @@ static int setting_action_right_libretro_device_type(
|
|||||||
devices[types++] = RETRO_DEVICE_NONE;
|
devices[types++] = RETRO_DEVICE_NONE;
|
||||||
devices[types++] = RETRO_DEVICE_JOYPAD;
|
devices[types++] = RETRO_DEVICE_JOYPAD;
|
||||||
|
|
||||||
/* Only push RETRO_DEVICE_ANALOG as default if we use an
|
if (runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system)
|
||||||
* older core which doesn't use SET_CONTROLLER_INFO. */
|
&& system)
|
||||||
if (!system->ports.size)
|
{
|
||||||
devices[types++] = RETRO_DEVICE_ANALOG;
|
/* 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;
|
||||||
|
|
||||||
if (port < system->ports.size)
|
if (port < system->ports.size)
|
||||||
desc = &system->ports.data[port];
|
desc = &system->ports.data[port];
|
||||||
|
}
|
||||||
|
|
||||||
if (desc)
|
if (desc)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user