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_search.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 '')
-rw-r--r-- | src/screen_search.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/src/screen_search.c b/src/screen_search.c index 6e2a0d68c..659070804 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -537,25 +537,17 @@ search_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) return 0; } -screen_functions_t * -get_screen_search(void) -{ - static screen_functions_t functions; - - memset(&functions, 0, sizeof(screen_functions_t)); - functions.init = init; - functions.exit = quit; - functions.open = open; - functions.close = close; - functions.resize = resize; - functions.paint = paint; - functions.update = update; - functions.cmd = search_cmd; - functions.get_lw = get_filelist_window; - functions.get_title = get_title; - - return &functions; -} - +const struct screen_functions screen_search = { + .init = init, + .exit = quit, + .open = open, + .close = close, + .resize = resize, + .paint = paint, + .update = update, + .cmd = search_cmd, + .get_lw = get_filelist_window, + .get_title = get_title, +}; #endif /* ENABLE_SEARCH_SCREEN */ |