Code

screen: don't pass screen pointer to method paint()
authorMax Kellermann <max@duempel.org>
Thu, 25 Sep 2008 15:40:59 +0000 (17:40 +0200)
committerMax Kellermann <max@duempel.org>
Thu, 25 Sep 2008 15:40:59 +0000 (17:40 +0200)
None of the paint() implementations actually use the screen pointer -
remove it from the method signature.

src/screen.c
src/screen.h
src/screen_artist.c
src/screen_file.c
src/screen_help.c
src/screen_keydef.c
src/screen_lyrics.c
src/screen_play.c
src/screen_search.c

index c7fece70eb83c4b9fd939f0ca6d84c626fb7f459..785807c2b7e6e87bfc759c6efff808df1d66c428 100644 (file)
@@ -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);
index 91ee26447d68709b99b6e35f0b9ee9a8f440eba6..8c0a947a090be8d4a9c8d8ca2b29c7d252431013 100644 (file)
@@ -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);
index 6857b66adb712e2cbe94eaa5fcdde9a614dff59a..b8f5bb018f2f6df82e90ece7afc569f7fefebd8d 100644 (file)
@@ -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);
 }
 
index a3bf192d92fd3a75324e7a17e04966393fe1d8fa..efea4db6000ad8f2bea63de4125a63e5683a7baf 100644 (file)
@@ -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;
        }
index cbdd66c62fbacec3c0a6dbcc6196e212b25b8bf0..3ac4b0543ecdbe79536d9acf3785272fb9de552b 100644 (file)
@@ -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);
 }
index f6ae3d3e950562fc5f645d0067d9ea533e4ea2ef..fbd9905cb4b23ac43762486ea5f5efcf5a7c130d 100644 (file)
@@ -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);
 }
index 50f41b7f6f4c83c0a27d72efbe5bb7d839b0e9dd..931b114fb86eb789d697ef4a5b7e827ac5f3361a 100644 (file)
@@ -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;
index 6eac958b6efc36e015cf8b0f5c991063c33fb1b4..3aaff229dbdaadfbe7f407ef5539679f336bb3da 100644 (file)
@@ -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);
index 723409028565cde135932103b93b55f3c44d0d3f..d29c7bf9594045288602093e1a697601722802d2 100644 (file)
@@ -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: