From 51cb2863dd7def8505ba37bdbcb8221416c26f55 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Sep 2008 12:05:02 +0200 Subject: 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. --- src/screen_help.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'src/screen_help.c') 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, +}; -- cgit v1.2.3