summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26e2f21)
raw | patch | inline | side by side (parent: 26e2f21)
author | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:06:11 +0000 (12:06 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Wed, 17 Sep 2008 10:06:11 +0000 (12:06 +0200) |
At startup, mode_fn is initialized with &screen_playlist, and it will
never be reset to NULL. Remove all checks.
never be reset to NULL. Remove all checks.
src/screen.c | patch | blob | history |
diff --git a/src/screen.c b/src/screen.c
index 5adf31c93c15e66d5599c467369485470524d7a5..797eae2ac9a2d69fbb8801b7f25152cd5b827730 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
static gboolean welcome = TRUE;
static screen_t *screen = NULL;
-static const struct screen_functions *mode_fn = NULL;
+static const struct screen_functions *mode_fn = &screen_playlist;
static int seek_id = -1;
static int seek_target_time = 0;
return;
/* close the old mode */
- if( mode_fn && mode_fn->close )
+ if (mode_fn->close != NULL)
mode_fn->close();
/* get functions for the new mode */
screen->painted = 0;
/* open the new mode */
- if (mode_fn && mode_fn->open)
+ if (mode_fn->open != NULL)
mode_fn->open(screen, c);
}
i++;
}
-#if 0
- /* broken */
- mode_fn = NULL;
- switch_screen_mode(screen_get_id(options.screen_list[0]), c);
-#else
- mode_fn = &screen_playlist;
-#endif
-
- if( mode_fn && mode_fn->open )
+ if (mode_fn->open != NULL)
mode_fn->open(screen, c);
/* initialize wreadln */
{
const char *title = NULL;
- if (mode_fn && mode_fn->get_title)
+ if (mode_fn->get_title != NULL)
title = mode_fn->get_title(screen->buf, screen->buf_size);
D("screen_paint(%s)\n", title);
/* paint the main window */
wclear(screen->main_window.w);
- if( mode_fn && mode_fn->paint )
+ if (mode_fn->paint != NULL)
mode_fn->paint(screen, c);
paint_progress_window(c);
if (welcome && screen->last_cmd==CMD_NONE &&
time(NULL)-screen->start_timestamp <= SCREEN_WELCOME_TIME)
paint_top_window("", c, 0);
- else if (mode_fn && mode_fn->get_title) {
+ else if (mode_fn->get_title != NULL) {
paint_top_window(mode_fn->get_title(screen->buf,screen->buf_size), c, 0);
welcome = FALSE;
} else
paint_top_window("", c, 0);
/* update the main window */
- if (mode_fn && mode_fn->update != NULL)
+ if (mode_fn->update != NULL)
mode_fn->update(screen, c);
/* update progress window */
screen->last_cmd = cmd;
welcome = FALSE;
- if( mode_fn && mode_fn->cmd && mode_fn->cmd(screen, c, cmd) )
+ if (mode_fn->cmd != NULL && mode_fn->cmd(screen, c, cmd))
return;
switch(cmd) {