mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 13:20:43 +00:00
Prevent null pointer dereference / logically dead code / other misc. warnings
This commit is contained in:
parent
baeadb775e
commit
4e3c9987f5
101
configuration.c
101
configuration.c
@ -3126,64 +3126,69 @@ bool config_save_overrides(int override_type)
|
||||
|
||||
RARCH_LOG("[overrides] looking for changed settings... \n");
|
||||
|
||||
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
||||
if (conf)
|
||||
{
|
||||
if ((*bool_settings[i].ptr) != (*bool_overrides[i].ptr))
|
||||
for (i = 0; i < (unsigned)bool_settings_size; i++)
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
bool_settings[i].ident, (*bool_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
bool_overrides[i].ident, (*bool_overrides[i].ptr));
|
||||
config_set_bool(conf, bool_overrides[i].ident,
|
||||
(*bool_overrides[i].ptr));
|
||||
if ((*bool_settings[i].ptr) != (*bool_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
bool_settings[i].ident, (*bool_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
bool_overrides[i].ident, (*bool_overrides[i].ptr));
|
||||
config_set_bool(conf, bool_overrides[i].ident,
|
||||
(*bool_overrides[i].ptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)int_settings_size; i++)
|
||||
{
|
||||
if ((*int_settings[i].ptr) != (*int_overrides[i].ptr))
|
||||
for (i = 0; i < (unsigned)int_settings_size; i++)
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
int_settings[i].ident, (*int_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
int_overrides[i].ident, (*int_overrides[i].ptr));
|
||||
config_set_int(conf, int_overrides[i].ident,
|
||||
(*int_overrides[i].ptr));
|
||||
if ((*int_settings[i].ptr) != (*int_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%d\n",
|
||||
int_settings[i].ident, (*int_settings[i].ptr));
|
||||
RARCH_LOG(" override: %s=%d\n",
|
||||
int_overrides[i].ident, (*int_overrides[i].ptr));
|
||||
config_set_int(conf, int_overrides[i].ident,
|
||||
(*int_overrides[i].ptr));
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)float_settings_size; i++)
|
||||
{
|
||||
if ((*float_settings[i].ptr) != (*float_overrides[i].ptr))
|
||||
for (i = 0; i < (unsigned)float_settings_size; i++)
|
||||
{
|
||||
RARCH_LOG(" original: %s=%f\n",
|
||||
float_settings[i].ident, *float_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%f\n",
|
||||
float_overrides[i].ident, *float_overrides[i].ptr);
|
||||
config_set_float(conf, float_overrides[i].ident,
|
||||
*float_overrides[i].ptr);
|
||||
if ((*float_settings[i].ptr) != (*float_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%f\n",
|
||||
float_settings[i].ident, *float_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%f\n",
|
||||
float_overrides[i].ident, *float_overrides[i].ptr);
|
||||
config_set_float(conf, float_overrides[i].ident,
|
||||
*float_overrides[i].ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)array_settings_size; i++)
|
||||
{
|
||||
if (!string_is_equal(array_settings[i].ptr, array_overrides[i].ptr))
|
||||
|
||||
for (i = 0; i < (unsigned)array_settings_size; i++)
|
||||
{
|
||||
RARCH_LOG(" original: %s=%s\n",
|
||||
array_settings[i].ident, array_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%s\n",
|
||||
array_overrides[i].ident, array_overrides[i].ptr);
|
||||
config_set_string(conf, array_overrides[i].ident,
|
||||
array_overrides[i].ptr);
|
||||
if (!string_is_equal(array_settings[i].ptr, array_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%s\n",
|
||||
array_settings[i].ident, array_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%s\n",
|
||||
array_overrides[i].ident, array_overrides[i].ptr);
|
||||
config_set_string(conf, array_overrides[i].ident,
|
||||
array_overrides[i].ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (i = 0; i < (unsigned)path_settings_size; i++)
|
||||
{
|
||||
if (!string_is_equal(path_settings[i].ptr, path_overrides[i].ptr))
|
||||
|
||||
for (i = 0; i < (unsigned)path_settings_size; i++)
|
||||
{
|
||||
RARCH_LOG(" original: %s=%s\n",
|
||||
path_settings[i].ident, path_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%s\n",
|
||||
path_overrides[i].ident, path_overrides[i].ptr);
|
||||
config_set_path(conf, path_overrides[i].ident,
|
||||
path_overrides[i].ptr);
|
||||
if (!string_is_equal(path_settings[i].ptr, path_overrides[i].ptr))
|
||||
{
|
||||
RARCH_LOG(" original: %s=%s\n",
|
||||
path_settings[i].ident, path_settings[i].ptr);
|
||||
RARCH_LOG(" override: %s=%s\n",
|
||||
path_overrides[i].ident, path_overrides[i].ptr);
|
||||
config_set_path(conf, path_overrides[i].ident,
|
||||
path_overrides[i].ptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
3
dirs.c
3
dirs.c
@ -86,9 +86,6 @@ bool dir_free_shader(void)
|
||||
struct rarch_dir_list *dir_list =
|
||||
(struct rarch_dir_list*)&dir_shader_list;
|
||||
|
||||
if (!dir_list)
|
||||
return false;
|
||||
|
||||
dir_list_free(dir_list->list);
|
||||
dir_list->list = NULL;
|
||||
dir_list->ptr = 0;
|
||||
|
@ -678,8 +678,11 @@ static bool init_content_file_set_attribs(
|
||||
|
||||
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system);
|
||||
|
||||
attr.i = system->info.block_extract;
|
||||
attr.i |= system->info.need_fullpath << 1;
|
||||
if (system)
|
||||
{
|
||||
attr.i = system->info.block_extract;
|
||||
attr.i |= system->info.need_fullpath << 1;
|
||||
}
|
||||
attr.i |= (!content_does_not_need_content()) << 2;
|
||||
|
||||
if (!path_get_content(&fullpath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user