From 702f1276d669deec7ed06819dbfa9b58890f3064 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 3 Oct 2017 00:53:09 +0200 Subject: [PATCH] Silence warnings --- gfx/video_thread_wrapper.c | 2 +- libretro-common/file/archive_file.c | 4 ++-- menu/drivers_display/menu_display_gdi.c | 7 ++++--- menu/menu_driver.c | 6 +++--- menu/menu_setting.c | 2 +- movie.c | 2 +- retroarch.c | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/gfx/video_thread_wrapper.c b/gfx/video_thread_wrapper.c index 66325e3f2b..3a35893573 100644 --- a/gfx/video_thread_wrapper.c +++ b/gfx/video_thread_wrapper.c @@ -342,7 +342,7 @@ static bool video_thread_handle_packet( case CMD_INIT: thr->driver_data = thr->driver->init(&thr->info, thr->input, thr->input_data); - pkt.data.b = thr->driver_data; + pkt.data.b = (thr->driver_data != NULL); thr->driver->viewport_info(thr->driver_data, &thr->vp); video_thread_reply(thr, &pkt); break; diff --git a/libretro-common/file/archive_file.c b/libretro-common/file/archive_file.c index 4a11045115..c1ad18c809 100644 --- a/libretro-common/file/archive_file.c +++ b/libretro-common/file/archive_file.c @@ -538,7 +538,7 @@ bool file_archive_extract_file( userdata.decomp_state.opt_file = NULL; userdata.decomp_state.needle = NULL; userdata.decomp_state.size = 0; - userdata.decomp_state.found = NULL; + userdata.decomp_state.found = false; if (!list) { @@ -602,7 +602,7 @@ struct string_list *file_archive_get_file_list(const char *path, userdata.decomp_state.opt_file = NULL; userdata.decomp_state.needle = NULL; userdata.decomp_state.size = 0; - userdata.decomp_state.found = NULL; + userdata.decomp_state.found = false; if (!userdata.list) goto error; diff --git a/menu/drivers_display/menu_display_gdi.c b/menu/drivers_display/menu_display_gdi.c index 5ad2db0c45..c67daea64d 100644 --- a/menu/drivers_display/menu_display_gdi.c +++ b/menu/drivers_display/menu_display_gdi.c @@ -86,11 +86,12 @@ static bool menu_display_gdi_font_init_first( bool is_threaded) { font_data_t **handle = (font_data_t**)font_handle; - *handle = font_driver_init_first(video_data, + if (!(*handle = font_driver_init_first(video_data, font_path, font_size, true, is_threaded, - FONT_DRIVER_RENDER_GDI); - return *handle; + FONT_DRIVER_RENDER_GDI))) + return false; + return true; } static const float *menu_display_gdi_get_default_vertices(void) diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 8cc0cdbc4a..5c9e32447a 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -1626,8 +1626,8 @@ bool menu_driver_is_alive(void) * for framebuffer-based menu drivers, like RGUI. */ bool menu_driver_is_texture_set(void) { - if (menu_driver_ctx) - return menu_driver_ctx->set_texture; + if (menu_driver_ctx && menu_driver_ctx->set_texture) + return true; return false; } @@ -2188,7 +2188,7 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) if (pending_push) if (menu_driver_ctx->navigation_clear) menu_driver_ctx->navigation_clear( - menu_userdata, pending_push); + menu_userdata, *pending_push); } break; case MENU_NAVIGATION_CTL_INCREMENT: diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 1edcd82e11..d970384af1 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -7303,7 +7303,7 @@ bool menu_setting_ctl(enum menu_setting_ctl_state state, void *data) if (!setting->change_handler) return false; - cbs_bound = setting->action_right; + cbs_bound = (setting->action_right != NULL); cbs_bound = cbs_bound || setting->action_left; cbs_bound = cbs_bound || setting->action_select; diff --git a/movie.c b/movie.c index dc16efe051..8ca184906e 100644 --- a/movie.c +++ b/movie.c @@ -415,7 +415,7 @@ bool bsv_movie_ctl(enum bsv_ctl_state state, void *data) switch (state) { case BSV_MOVIE_CTL_IS_INITED: - return bsv_movie_state_handle; + return (bsv_movie_state_handle != NULL); case BSV_MOVIE_CTL_SET_START_RECORDING: bsv_movie_state.movie_start_recording = true; break; diff --git a/retroarch.c b/retroarch.c index 08dfa2dd99..6161150be6 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1557,7 +1557,7 @@ bool rarch_ctl(enum rarch_ctl_state state, void *data) } break; case RARCH_CTL_HAS_CORE_OPTIONS: - return runloop_core_options; + return (runloop_core_options != NULL); case RARCH_CTL_CORE_OPTIONS_LIST_GET: { core_option_manager_t **coreopts = (core_option_manager_t**)data;