From 94c3546e7120ceb0425eca5c17288d5a1e973677 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Sep 2015 22:03:05 +0200 Subject: [PATCH] More static code analysis cleanups --- input/drivers/xenon360_input.c | 2 +- menu/menu_input.c | 5 ++++- menu/menu_iterate.c | 2 +- tasks/task_file_transfer.c | 12 ++++++------ 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/input/drivers/xenon360_input.c b/input/drivers/xenon360_input.c index 165ecca86a..6ed34ead7f 100644 --- a/input/drivers/xenon360_input.c +++ b/input/drivers/xenon360_input.c @@ -98,7 +98,7 @@ static bool xenon360_input_meta_key_pressed(void *data, int key) return (lifecycle_state & (UINT64_C(1) << key)); } -static uint64_t xenon360_get_capabilities(void *data) +static uint64_t xenon360_input_get_capabilities(void *data) { uint64_t caps = 0; diff --git a/menu/menu_input.c b/menu/menu_input.c index 5af02cd6ae..c52a9c6b4a 100644 --- a/menu/menu_input.c +++ b/menu/menu_input.c @@ -676,9 +676,12 @@ int menu_input_set_input_device_bind_mode(void *data, rarch_setting_t *setting = (rarch_setting_t*)data; settings_t *settings = config_get_ptr(); + if (!setting) + return -1; + bind_port = settings->input.joypad_map[setting->index_offset]; - if (!setting || menu_input_set_bind_mode_common(setting, type) == -1) + if (menu_input_set_bind_mode_common(setting, type) == -1) return -1; menu_input_poll_bind_get_rested_axes(&menu_input->binds, bind_port); diff --git a/menu/menu_iterate.c b/menu/menu_iterate.c index 3ae2268bdd..f2ee4e2345 100644 --- a/menu/menu_iterate.c +++ b/menu/menu_iterate.c @@ -47,7 +47,6 @@ enum action_iterate_type static int action_iterate_help(char *s, size_t len, const char *label) { - unsigned i; menu_handle_t *menu = menu_driver_get_ptr(); settings_t *settings = config_get_ptr(); @@ -86,6 +85,7 @@ static int action_iterate_help(char *s, size_t len, const char *label) break; case MENU_HELP_CONTROLS: { + unsigned i; char s2[PATH_MAX_LENGTH]; const unsigned binds[] = { RETRO_DEVICE_ID_JOYPAD_UP, diff --git a/tasks/task_file_transfer.c b/tasks/task_file_transfer.c index 29eabdc913..a872992b27 100644 --- a/tasks/task_file_transfer.c +++ b/tasks/task_file_transfer.c @@ -61,7 +61,6 @@ typedef struct nbio_image_handle unsigned processing_pos_increment; unsigned pos_increment; uint64_t frame_count; - uint64_t processing_frame_count; int processing_final_state; msg_queue_t *msg_queue; unsigned status; @@ -294,8 +293,6 @@ static int rarch_main_data_image_iterate_process_transfer(nbio_handle_t *nbio) break; } - nbio->image.processing_frame_count++; - if (retval == IMAGE_PROCESS_NEXT) return 0; @@ -312,7 +309,6 @@ static int rarch_main_data_image_iterate_parse_free(nbio_handle_t *nbio) nbio->image.handle = NULL; nbio->image.frame_count = 0; - nbio->image.processing_frame_count = 0; msg_queue_clear(nbio->image.msg_queue); @@ -321,18 +317,22 @@ static int rarch_main_data_image_iterate_parse_free(nbio_handle_t *nbio) static int rarch_main_data_image_iterate_process_transfer_parse(nbio_handle_t *nbio) { - size_t len = 0; if (nbio->image.handle && nbio->image.cb) + { + size_t len = 0; nbio->image.cb(nbio, len); + } return 0; } static int rarch_main_data_image_iterate_transfer_parse(nbio_handle_t *nbio) { - size_t len = 0; if (nbio->image.handle && nbio->image.cb) + { + size_t len = 0; nbio->image.cb(nbio, len); + } return 0; }