From c4d1f2c49d9c394711aa9b8ea19d5c4e4c726ee6 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 6 Dec 2015 14:46:50 +0100 Subject: [PATCH] Get rid of some implicit memsets for font_params local variables --- menu/drivers/materialui.c | 7 +++++-- menu/drivers/rmenu.c | 13 ++++++++----- menu/drivers/xmb.c | 11 +++++------ menu/drivers/zarch.c | 7 +++++-- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index e12314e528..3a4ef097f4 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -231,8 +231,8 @@ static void mui_blit_line(float x, float y, unsigned width, unsigned height, const char *message, uint32_t color, enum text_alignment text_align) { int font_size; + struct font_params params; void *fb_buf = NULL; - struct font_params params = {0}; menu_handle_t *menu = menu_driver_get_ptr(); if (!menu) @@ -242,7 +242,10 @@ static void mui_blit_line(float x, float y, unsigned width, unsigned height, params.x = x / width; params.y = 1.0f - (y + font_size / 3) / height; - params.scale = 1.0; + params.scale = 1.0f; + params.drop_mod = 0.0f; + params.drop_x = 0.0f; + params.drop_y = 0.0f; params.color = color; params.full_screen = true; params.text_align = text_align; diff --git a/menu/drivers/rmenu.c b/menu/drivers/rmenu.c index 9aec9db60d..dbcc54e1dc 100644 --- a/menu/drivers/rmenu.c +++ b/menu/drivers/rmenu.c @@ -124,7 +124,7 @@ static void rmenu_render(void) bool msg_force; uint64_t *frame_count; size_t begin, end, i, j, selection; - struct font_params font_parms = {0}; + struct font_params font_parms; char title[256] = {0}; char title_buf[256] = {0}; char title_msg[64] = {0}; @@ -171,11 +171,14 @@ static void rmenu_render(void) menu_animation_ticker_str(title_buf, RMENU_TERM_WIDTH, *frame_count / 15, title, true); - font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET; - font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET + font_parms.x = POSITION_EDGE_MIN + POSITION_OFFSET; + font_parms.y = POSITION_EDGE_MIN + POSITION_RENDER_OFFSET - (POSITION_OFFSET*2); - font_parms.scale = FONT_SIZE_NORMAL; - font_parms.color = WHITE; + font_parms.scale = FONT_SIZE_NORMAL; + font_parms.color = WHITE; + font_parms.drop_mod = 0.0f; + font_parms.drop_x = 0.0f; + font_parms.drop_y = 0.0f; video_driver_set_osd_msg(title_buf, &font_parms, NULL); diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 09b91302c5..33b2ea909a 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -429,8 +429,8 @@ static void xmb_draw_text(menu_handle_t *menu, enum text_alignment text_align, unsigned width, unsigned height) { + struct font_params params; uint8_t a8 = 0; - struct font_params params = {0}; void *disp_buf = NULL; if (alpha > xmb->alpha) @@ -447,8 +447,10 @@ static void xmb_draw_text(menu_handle_t *menu, params.x = x / width; params.y = 1.0f - y / height; - params.scale = scale_factor; + params.drop_mod = 0.0f; + params.drop_x = 0.0f; + params.drop_y = 0.0f; params.color = FONT_COLOR_RGBA(255, 255, 255, a8); params.full_screen = true; params.text_align = text_align; @@ -1346,12 +1348,12 @@ static void xmb_draw_items(xmb_handle_t *xmb, for (; i < end; i++) { + menu_entry_t entry; char name[PATH_MAX_LENGTH]; char value[PATH_MAX_LENGTH]; float icon_x, icon_y; const float half_size = xmb->icon.size / 2.0f; - menu_entry_t entry = {{0}}; uintptr_t texture_switch = 0; uintptr_t icon = 0; xmb_node_t * node = (xmb_node_t*)menu_entries_get_userdata_at_offset(list, i); @@ -1359,9 +1361,6 @@ static void xmb_draw_items(xmb_handle_t *xmb, uint32_t hash_value = 0; bool do_draw_text = false; - *entry.path = *entry.label = *entry.value = 0; - entry.idx = entry.spacing = entry.type = 0; - if (!node) continue; diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index bd172af348..730d15e99a 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -312,13 +312,16 @@ static unsigned zarch_zui_hash(zui_t *zui, const char *s) static void zarch_zui_draw_text(zui_t *zui, uint32_t color, int x, int y, const char *text) { - struct font_params params = {0}; + struct font_params params; /* need to use height-y because the font renderer * uses a different model-view-projection (MVP). */ params.x = x / (float)zui->width; params.y = (zui->height - y) / (float)zui->height; - params.scale = 1.0; + params.scale = 1.0f; + params.drop_mod = 0.0f; + params.drop_x = 0.0f; + params.drop_y = 0.0f; params.color = color; params.full_screen = true; params.text_align = TEXT_ALIGN_LEFT;