aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_lyrics.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_lyrics.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 '')
-rw-r--r--src/screen_lyrics.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 2f63fb0ae..885a35a76 100644
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
@@ -376,23 +376,17 @@ lyrics_lw(void)
return lw;
}
-screen_functions_t *
-get_screen_lyrics(void)
-{
- static screen_functions_t functions;
-
- memset(&functions, 0, sizeof(screen_functions_t));
- functions.init = lyrics_screen_init;
- functions.exit = lyrics_exit;
- functions.open = lyrics_open;
- functions.close = NULL;
- functions.resize = lyrics_resize;
- functions.paint = lyrics_paint;
- functions.update = lyrics_update;
- functions.cmd = lyrics_cmd;
- functions.get_lw = lyrics_lw;
- functions.get_title = lyrics_title;
-
- return &functions;
-}
+const struct screen_functions screen_lyrics = {
+ .init = lyrics_screen_init,
+ .exit = lyrics_exit,
+ .open = lyrics_open,
+ .close = NULL,
+ .resize = lyrics_resize,
+ .paint = lyrics_paint,
+ .update = lyrics_update,
+ .cmd = lyrics_cmd,
+ .get_lw = lyrics_lw,
+ .get_title = lyrics_title,
+};
+
#endif /* ENABLE_LYRICS_SCREEN */