aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_file.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-09-17 12:05:02 +0200
committerMax Kellermann <max@duempel.org>2008-09-17 12:05:02 +0200
commit51cb2863dd7def8505ba37bdbcb8221416c26f55 (patch)
tree3672d81258baf9ecbb06398cd30c9e84128eff4c /src/screen_file.c
parentb126dbbfecd92850528b37b7f580e48601023748 (diff)
downloadmpd-51cb2863dd7def8505ba37bdbcb8221416c26f55.tar.gz
mpd-51cb2863dd7def8505ba37bdbcb8221416c26f55.tar.xz
mpd-51cb2863dd7def8505ba37bdbcb8221416c26f55.zip
replaced get_screen_X() with static screen_functions variable
Compile time initialization saves resources, compared to run-time initialization. Declare all screen_function structs as global variables, and remove all get functions.
Diffstat (limited to 'src/screen_file.c')
-rw-r--r--src/screen_file.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/screen_file.c b/src/screen_file.c
index c480961c4..e996aba09 100644
--- a/src/screen_file.c
+++ b/src/screen_file.c
@@ -751,23 +751,16 @@ get_filelist_window(void)
return lw;
}
-screen_functions_t *
-get_screen_browse(void)
-{
- static screen_functions_t functions;
-
- memset(&functions, 0, sizeof(screen_functions_t));
- functions.init = browse_init;
- functions.exit = browse_exit;
- functions.open = browse_open;
- functions.close = browse_close;
- functions.resize = browse_resize;
- functions.paint = browse_paint;
- functions.update = browse_update;
- functions.cmd = browse_cmd;
- functions.get_lw = get_filelist_window;
- functions.get_title = browse_title;
-
- return &functions;
-}
+const struct screen_functions screen_browse = {
+ .init = browse_init,
+ .exit = browse_exit,
+ .open = browse_open,
+ .close = browse_close,
+ .resize = browse_resize,
+ .paint = browse_paint,
+ .update = browse_update,
+ .cmd = browse_cmd,
+ .get_lw = get_filelist_window,
+ .get_title = browse_title,
+};