From 69759f5fd798bac0d3247d52fa06daef2330f9f8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 23 May 2016 21:55:30 +0200 Subject: [PATCH] Remove logically dead code --- database_info.c | 6 ------ input/input_overlay.c | 37 ++++++++----------------------------- 2 files changed, 8 insertions(+), 35 deletions(-) diff --git a/database_info.c b/database_info.c index 17fb06a708..b77b4b3e6e 100644 --- a/database_info.c +++ b/database_info.c @@ -501,9 +501,6 @@ database_info_list_t *database_info_list_new( database_info = new_ptr; db_ptr = &database_info[k]; - if (!db_ptr) - continue; - memcpy(db_ptr, &db_info, sizeof(*db_ptr)); k++; @@ -535,9 +532,6 @@ void database_info_list_free(database_info_list_t *database_info_list) { database_info_t *info = &database_info_list->list[i]; - if (!info) - continue; - if (info->name) free(info->name); if (info->rom_name) diff --git a/input/input_overlay.c b/input/input_overlay.c index 8e3458911a..813d312756 100644 --- a/input/input_overlay.c +++ b/input/input_overlay.c @@ -101,22 +101,16 @@ static void input_overlay_scale(struct overlay *ol, float scale) for (i = 0; i < ol->size; i++) { - float scale_w, scale_h, adj_center_x, adj_center_y; struct overlay_desc *desc = &ol->descs[i]; + float scale_w = ol->mod_w * desc->range_x; + float scale_h = ol->mod_h * desc->range_y; + float adj_center_x = ol->mod_x + desc->x * ol->mod_w; + float adj_center_y = ol->mod_y + desc->y * ol->mod_h; - if (!desc) - continue; - - scale_w = ol->mod_w * desc->range_x; - scale_h = ol->mod_h * desc->range_y; - - desc->mod_w = 2.0f * scale_w; - desc->mod_h = 2.0f * scale_h; - - adj_center_x = ol->mod_x + desc->x * ol->mod_w; - adj_center_y = ol->mod_y + desc->y * ol->mod_h; - desc->mod_x = adj_center_x - scale_w; - desc->mod_y = adj_center_y - scale_h; + desc->mod_w = 2.0f * scale_w; + desc->mod_h = 2.0f * scale_h; + desc->mod_x = adj_center_x - scale_w; + desc->mod_y = adj_center_y - scale_h; } } @@ -136,9 +130,6 @@ static void input_overlay_set_vertex_geom(void) { struct overlay_desc *desc = &ol->active->descs[i]; - if (!desc) - continue; - if (!desc->image.pixels) continue; @@ -313,8 +304,6 @@ static void input_overlay_poll(input_overlay_state_t *out, float x_dist, y_dist; struct overlay_desc *desc = &ol->active->descs[i]; - if (!desc) - continue; if (!inside_hitbox(desc, x, y)) continue; @@ -413,9 +402,6 @@ static void input_overlay_post_poll(float opacity) { struct overlay_desc *desc = &ol->active->descs[i]; - if (!desc) - continue; - desc->range_x_mod = desc->range_x; desc->range_y_mod = desc->range_y; @@ -461,9 +447,6 @@ static void input_overlay_poll_clear(float opacity) { struct overlay_desc *desc = &ol->active->descs[i]; - if (!desc) - continue; - desc->range_x_mod = desc->range_x; desc->range_y_mod = desc->range_y; desc->updated = false; @@ -629,10 +612,6 @@ bool input_overlay_is_alive(void) bool input_overlay_key_pressed(int key) { input_overlay_state_t *ol_state = &overlay_st_ptr; - - if (!ol_state) - return false; - return (ol_state->buttons & (UINT64_C(1) << key)); }