diff options
author | Max Kellermann <max@duempel.org> | 2008-09-17 12:05:02 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-17 12:05:02 +0200 |
commit | 51cb2863dd7def8505ba37bdbcb8221416c26f55 (patch) | |
tree | 3672d81258baf9ecbb06398cd30c9e84128eff4c /src/screen_play.c | |
parent | b126dbbfecd92850528b37b7f580e48601023748 (diff) | |
download | mpd-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_play.c')
-rw-r--r-- | src/screen_play.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/src/screen_play.c b/src/screen_play.c index 32c08ea73..22d7198aa 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -503,22 +503,15 @@ play_lw(void) return lw; } -screen_functions_t * -get_screen_playlist(void) -{ - static screen_functions_t functions; - - memset(&functions, 0, sizeof(screen_functions_t)); - functions.init = play_init; - functions.exit = play_exit; - functions.open = play_open; - functions.close = NULL; - functions.resize = play_resize; - functions.paint = play_paint; - functions.update = play_update; - functions.cmd = play_cmd; - functions.get_lw = play_lw; - functions.get_title = play_title; - - return &functions; -} +const struct screen_functions screen_playlist = { + .init = play_init, + .exit = play_exit, + .open = play_open, + .close = NULL, + .resize = play_resize, + .paint = play_paint, + .update = play_update, + .cmd = play_cmd, + .get_lw = play_lw, + .get_title = play_title, +}; |