From 6c52fa139c5ad8f78ed4fdb306a6074228dbf4c9 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 30 Nov 2022 15:17:54 +0000 Subject: Remove browse_context_init() Prefer to use designated initializers to avoid having to specify unneeded parameters. Non-initialized members are zero-initialized by the compiler. Change-Id: Ia6a03c45cb3ef0b30f458d7d0ae1604a350c737c --- apps/plugins/speedread.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'apps/plugins/speedread.c') diff --git a/apps/plugins/speedread.c b/apps/plugins/speedread.c index 55d8fd58e5..7a9ab61e7c 100644 --- a/apps/plugins/speedread.c +++ b/apps/plugins/speedread.c @@ -482,16 +482,19 @@ static void load_font(void) static void font_menu(void) { /* taken from text_viewer */ - struct browse_context browse; char font[MAX_PATH], name[MAX_FILENAME+10]; - rb->snprintf(name, sizeof(name), "%s.fnt", rb->global_settings->font_file); - rb->browse_context_init(&browse, SHOW_FONT, - BROWSE_SELECTONLY|BROWSE_NO_CONTEXT_MENU, - "Font", Icon_Menu_setting, FONT_DIR, name); - browse.buf = font; - browse.bufsize = sizeof(font); + struct browse_context browse = { + .dirfilter = SHOW_FONT, + .flags = BROWSE_SELECTONLY | BROWSE_NO_CONTEXT_MENU, + .title = rb->str(LANG_CUSTOM_FONT), + .icon = Icon_Menu_setting, + .root = FONT_DIR, + .selected = name, + .buf = font, + .bufsize = sizeof(font), + }; rb->rockbox_browse(&browse); -- cgit v1.2.3