From: Max Kellermann Date: Thu, 25 Sep 2008 15:40:59 +0000 (+0200) Subject: screen: don't pass screen pointer to method paint() X-Git-Tag: v0.12_alpha1~164 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1230f84524fc1625e0ff9eda67e2840334d7916f;p=ncmpc.git screen: don't pass screen pointer to method paint() None of the paint() implementations actually use the screen pointer - remove it from the method signature. --- diff --git a/src/screen.c b/src/screen.c index c7fece7..785807c 100644 --- a/src/screen.c +++ b/src/screen.c @@ -637,7 +637,7 @@ screen_paint(mpdclient_t *c) /* paint the main window */ wclear(screen.main_window.w); if (mode_fn->paint != NULL) - mode_fn->paint(&screen, c); + mode_fn->paint(c); paint_progress_window(c); paint_status_window(c); diff --git a/src/screen.h b/src/screen.h index 91ee264..8c0a947 100644 --- a/src/screen.h +++ b/src/screen.h @@ -49,7 +49,7 @@ typedef void (*screen_exit_fn_t)(void); typedef void (*screen_open_fn_t)(struct screen *screen, mpdclient_t *c); typedef void (*screen_close_fn_t)(void); typedef void (*screen_resize_fn_t)(int cols, int rows); -typedef void (*screen_paint_fn_t)(struct screen *screen, mpdclient_t *c); +typedef void (*screen_paint_fn_t)(mpdclient_t *c); typedef void (*screen_update_fn_t)(struct screen *screen, mpdclient_t *c); typedef int (*screen_cmd_fn_t)(struct screen *scr, mpdclient_t *c, command_t cmd); typedef const char *(*screen_title_fn_t)(char *s, size_t size); diff --git a/src/screen_artist.c b/src/screen_artist.c index 6857b66..b8f5bb0 100644 --- a/src/screen_artist.c +++ b/src/screen_artist.c @@ -211,7 +211,7 @@ resize(int cols, int rows) } static void -paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c) +paint(mpd_unused mpdclient_t *c) { if (browser.filelist) { list_window_paint(browser.lw, browser_lw_callback, @@ -226,7 +226,7 @@ paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c) } static void -update(screen_t *screen, mpdclient_t *c) +update(mpd_unused screen_t *screen, mpdclient_t *c) { if (browser.filelist && !browser.filelist->updated) list_window_paint(browser.lw, browser_lw_callback, @@ -234,7 +234,7 @@ update(screen_t *screen, mpdclient_t *c) else if (metalist) list_window_paint(browser.lw, artist_lw_callback, metalist); else - paint(screen, c); + paint(c); wnoutrefresh(browser.lw->w); } diff --git a/src/screen_file.c b/src/screen_file.c index a3bf192..efea4db 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -175,16 +175,16 @@ browse_title(char *str, size_t size) } static void -browse_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c) +browse_paint(mpd_unused mpdclient_t *c) { list_window_paint(browser.lw, browser_lw_callback, browser.filelist); } static void -browse_update(screen_t *screen, mpdclient_t *c) +browse_update(mpd_unused screen_t *screen, mpdclient_t *c) { if (browser.filelist->updated) { - browse_paint(screen, c); + browse_paint(c); browser.filelist->updated = FALSE; return; } diff --git a/src/screen_help.c b/src/screen_help.c index cbdd66c..3ac4b05 100644 --- a/src/screen_help.c +++ b/src/screen_help.c @@ -208,7 +208,7 @@ help_title(mpd_unused char *str, mpd_unused size_t size) } static void -help_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c) +help_paint(mpd_unused mpdclient_t *c) { list_window_paint(lw, list_callback, NULL); } diff --git a/src/screen_keydef.c b/src/screen_keydef.c index f6ae3d3..fbd9905 100644 --- a/src/screen_keydef.c +++ b/src/screen_keydef.c @@ -278,7 +278,7 @@ keydef_title(char *str, size_t size) } static void -keydef_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c) +keydef_paint(mpd_unused mpdclient_t *c) { list_window_paint(lw, list_callback, NULL); } diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c index 50f41b7..931b114 100644 --- a/src/screen_lyrics.c +++ b/src/screen_lyrics.c @@ -260,7 +260,7 @@ lyrics_title(char *str, size_t size) } static void -lyrics_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c) +lyrics_paint(mpd_unused mpdclient_t *c) { list_window_paint(lw, list_callback, NULL); } @@ -297,7 +297,7 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) case CMD_LYRICS_UPDATE: if (c->song != NULL) { screen_lyrics_load(c->song); - lyrics_paint(NULL, NULL); + lyrics_paint(NULL); wrefresh(lw->w); } return 1; diff --git a/src/screen_play.c b/src/screen_play.c index 6eac958..3aaff22 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -359,13 +359,13 @@ play_title(char *str, size_t size) } static void -play_paint(mpd_unused screen_t *screen, mpdclient_t *c) +play_paint(mpdclient_t *c) { list_window_paint(lw, list_callback, (void *) c); } static void -play_update(screen_t *screen, mpdclient_t *c) +play_update(mpd_unused screen_t *screen, mpdclient_t *c) { /* hide the cursor when mpd are playing and the user are inactive */ if (options.hide_cursor > 0 && @@ -388,7 +388,7 @@ play_update(screen_t *screen, mpdclient_t *c) if (c->playlist.id != playlist_id) { list_window_check_selected(lw, playlist_length(&c->playlist)); - play_paint(screen, c); + play_paint(c); playlist_id = c->playlist.id; } else { list_window_paint(lw, list_callback, (void *) c); diff --git a/src/screen_search.c b/src/screen_search.c index 7234090..d29c7bf 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -387,7 +387,7 @@ resize(int cols, int rows) } static void -paint(mpd_unused screen_t *screen, mpdclient_t *c) +paint(mpdclient_t *c) { if (browser.filelist) { browser.lw->flags = 0; @@ -404,10 +404,10 @@ paint(mpd_unused screen_t *screen, mpdclient_t *c) } static void -update(screen_t *screen, mpdclient_t *c) +update(mpd_unused screen_t *screen, mpdclient_t *c) { if (browser.filelist == NULL || browser.filelist->updated) { - paint(screen, c); + paint(c); return; } @@ -450,7 +450,7 @@ search_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) case CMD_SELECT_ALL: browser_handle_select_all(&browser, c); - paint (screen, c); + paint(c); return 0; case CMD_SEARCH_MODE: