aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_clock.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_clock.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_clock.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/screen_clock.c b/src/screen_clock.c
index 493150bb0..11d2da1b2 100644
--- a/src/screen_clock.c
+++ b/src/screen_clock.c
@@ -241,24 +241,16 @@ clock_cmd(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c,
return 0;
}
-screen_functions_t *
-get_screen_clock(void)
-{
- static screen_functions_t functions;
-
- memset(&functions, 0, sizeof(screen_functions_t));
- functions.init = clock_init;
- functions.exit = clock_exit;
- functions.open = clock_open;
- functions.close = clock_close;
- functions.resize = clock_resize;
- functions.paint = clock_paint;
- functions.update = clock_update;
- functions.cmd = clock_cmd;
- functions.get_lw = NULL;
- functions.get_title = clock_title;
-
- return &functions;
-}
+const struct screen_functions screen_clock = {
+ .init = clock_init,
+ .exit = clock_exit,
+ .open = clock_open,
+ .close = clock_close,
+ .resize = clock_resize,
+ .paint = clock_paint,
+ .update = clock_update,
+ .cmd = clock_cmd,
+ .get_title = clock_title,
+};
#endif