From 5e6a79c4ac5d024b5a77d3482fe6cbf960512619 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 22 Feb 2017 01:57:05 +0100 Subject: [PATCH] Try to fix Coverity warnings --- tasks/task_content.c | 45 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index 3ed47634dc..7ab033b5e3 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1039,13 +1039,10 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info) content_ctx.subsystem.data = NULL; content_ctx.subsystem.size = 0; - if (settings) - { - content_ctx.history_list_enable = settings->history_list_enable; + content_ctx.history_list_enable = settings->history_list_enable; - if (!string_is_empty(settings->directory.system)) - content_ctx.directory_system = strdup(settings->directory.system); - } + if (!string_is_empty(settings->directory.system)) + content_ctx.directory_system = strdup(settings->directory.system); #ifdef HAVE_MENU if (!content_info->environ_get) @@ -1116,13 +1113,10 @@ bool task_push_load_content_from_playlist_from_menu( content_ctx.subsystem.data = NULL; content_ctx.subsystem.size = 0; - if (settings) - { - content_ctx.history_list_enable = settings->history_list_enable; + content_ctx.history_list_enable = settings->history_list_enable; - if (!string_is_empty(settings->directory.system)) - content_ctx.directory_system = strdup(settings->directory.system); - } + if (!string_is_empty(settings->directory.system)) + content_ctx.directory_system = strdup(settings->directory.system); /* Set libretro core path */ runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)core_path); @@ -1195,13 +1189,10 @@ bool task_push_start_current_core(content_ctx_info_t *content_info) content_ctx.subsystem.data = NULL; content_ctx.subsystem.size = 0; - if (settings) - { - content_ctx.history_list_enable = settings->history_list_enable; + content_ctx.history_list_enable = settings->history_list_enable; - if (!string_is_empty(settings->directory.system)) - content_ctx.directory_system = strdup(settings->directory.system); - } + if (!string_is_empty(settings->directory.system)) + content_ctx.directory_system = strdup(settings->directory.system); #ifdef HAVE_MENU if (!content_info->environ_get) @@ -1307,13 +1298,10 @@ bool task_push_load_content_with_new_core_from_menu( content_ctx.subsystem.data = NULL; content_ctx.subsystem.size = 0; - if (settings) - { - content_ctx.history_list_enable = settings->history_list_enable; + content_ctx.history_list_enable = settings->history_list_enable; - if (!string_is_empty(settings->directory.system)) - content_ctx.directory_system = strdup(settings->directory.system); - } + if (!string_is_empty(settings->directory.system)) + content_ctx.directory_system = strdup(settings->directory.system); /* Set content path */ path_set(RARCH_PATH_CONTENT, fullpath); @@ -1390,13 +1378,10 @@ static bool task_load_content_callback(content_ctx_info_t *content_info, content_ctx.subsystem.data = NULL; content_ctx.subsystem.size = 0; - if (settings) - { - content_ctx.history_list_enable = settings->history_list_enable; + content_ctx.history_list_enable = settings->history_list_enable; - if (!string_is_empty(settings->directory.system)) - content_ctx.directory_system = strdup(settings->directory.system); - } + if (!string_is_empty(settings->directory.system)) + content_ctx.directory_system = strdup(settings->directory.system); #ifdef HAVE_MENU if (!content_info->environ_get)