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_help.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_help.c')
-rw-r--r-- | src/screen_help.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/screen_help.c b/src/screen_help.c index d225b3d6d..bfefc1e7a 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -306,22 +306,13 @@ help_lw(void) return lw; } -screen_functions_t * -get_screen_help(void) -{ - static screen_functions_t functions; - - memset(&functions, 0, sizeof(screen_functions_t)); - functions.init = help_init; - functions.exit = help_exit; - functions.open = NULL; - functions.close = NULL; - functions.resize = help_resize; - functions.paint = help_paint; - functions.update = help_update; - functions.cmd = help_cmd; - functions.get_lw = help_lw; - functions.get_title = help_title; - - return &functions; -} +const struct screen_functions screen_help = { + .init = help_init, + .exit = help_exit, + .resize = help_resize, + .paint = help_paint, + .update = help_update, + .cmd = help_cmd, + .get_lw = help_lw, + .get_title = help_title, +}; |