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/open_plugin.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'apps/open_plugin.c') diff --git a/apps/open_plugin.c b/apps/open_plugin.c index 49d727b4c9..c36a72f30e 100644 --- a/apps/open_plugin.c +++ b/apps/open_plugin.c @@ -352,7 +352,7 @@ retnhash: void open_plugin_browse(const char *key) { logf("%s", __func__); - struct browse_context browse; + char tmp_buf[OPEN_PLUGIN_BUFSZ+1]; open_plugin_load_entry(key); struct open_plugin_entry_t *op_entry = open_plugin_get_entry(); @@ -364,11 +364,15 @@ void open_plugin_browse(const char *key) if (op_entry->path[0] == '\0') strcpy(op_entry->path, PLUGIN_DIR"/"); - browse_context_init(&browse, SHOW_ALL, BROWSE_SELECTONLY, "", - Icon_Plugin, op_entry->path, NULL); - - browse.buf = tmp_buf; - browse.bufsize = OPEN_PLUGIN_BUFSZ; + struct browse_context browse = { + .dirfilter = SHOW_ALL, + .flags = BROWSE_SELECTONLY, + .title = str(LANG_OPEN_PLUGIN), + .icon = Icon_Plugin, + .root = op_entry->path, + .buf = tmp_buf, + .bufsize = sizeof(tmp_buf), + }; if (rockbox_browse(&browse) == GO_TO_PREVIOUS) open_plugin_add_path(key, tmp_buf, NULL); -- cgit v1.2.3