Code

screen: don't pass mpdclient pointer to method paint()
authorMax Kellermann <max@duempel.org>
Fri, 3 Oct 2008 12:30:59 +0000 (14:30 +0200)
committerMax Kellermann <max@duempel.org>
Fri, 3 Oct 2008 12:30:59 +0000 (14:30 +0200)
None of the paint() implementations acutally uses the mpdclient
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 90788b0868496a5a6a3b9f6cb422d64e24e42bbb..5345f49ef8665bca530a20689d533742797d1a64 100644 (file)
@@ -546,7 +546,7 @@ screen_paint(mpdclient_t *c)
        /* paint the main window */
        wclear(screen.main_window.w);
        if (mode_fn->paint != NULL)
-               mode_fn->paint(c);
+               mode_fn->paint();
 
        paint_progress_window(c);
        paint_status_window(c);
index 4ad376ba8e9d09ddb9d3d86c8fc6e658acdfd5df..976c75c9012dc0bce8b1fdfce39f0767f0da2715 100644 (file)
@@ -62,7 +62,7 @@ typedef struct screen_functions {
        void (*open)(struct screen *screen, mpdclient_t *c);
        void (*close)(void);
        void (*resize)(int cols, int rows);
-       void (*paint)(mpdclient_t *c);
+       void (*paint)(void);
        void (*update)(mpdclient_t *c);
        int (*cmd)(struct screen *scr, mpdclient_t *c, command_t cmd);
        const char *(*get_title)(char *s, size_t size);
index 86291d87de633712542f7459a5a329d682ba919b..52b7eeee8727753ec4ffd92d9edf3d998f8e4dff 100644 (file)
@@ -94,12 +94,12 @@ artist_lw_callback(unsigned idx, mpd_unused int *highlight, mpd_unused void *dat
 }
 
 static void
-paint(mpdclient_t *c);
+paint(void);
 
 static void
 artist_repaint(void)
 {
-       paint(NULL);
+       paint();
        wrefresh(browser.lw->w);
 }
 
@@ -352,7 +352,7 @@ resize(int cols, int rows)
 }
 
 static void
-paint(mpd_unused mpdclient_t *c)
+paint(void)
 {
        if (browser.filelist) {
                list_window_paint(browser.lw, browser_lw_callback,
index 3029165f2ade045a82c932805b570452f1befa0d..9dfe4ac6892d8822c7b4e0aded8326237384b353 100644 (file)
 static struct screen_browser browser;
 
 static void
-browse_paint(mpdclient_t *c);
+browse_paint(void);
 
 static void
 file_repaint(void)
 {
-       browse_paint(NULL);
+       browse_paint();
        wrefresh(browser.lw->w);
 }
 
@@ -190,7 +190,7 @@ browse_title(char *str, size_t size)
 }
 
 static void
-browse_paint(mpd_unused mpdclient_t *c)
+browse_paint(void)
 {
        list_window_paint(browser.lw, browser_lw_callback, browser.filelist);
 }
@@ -266,4 +266,3 @@ const struct screen_functions screen_browse = {
        .cmd = browse_cmd,
        .get_title = browse_title,
 };
-
index adf9a03102fe805c194b2cc1e418f399b444aa57..fbcbf2b820f4fc40200415c93708fb2f292fea3d 100644 (file)
@@ -207,7 +207,7 @@ help_title(mpd_unused char *str, mpd_unused size_t size)
 }
 
 static void
-help_paint(mpd_unused mpdclient_t *c)
+help_paint(void)
 {
        list_window_paint(lw, list_callback, NULL);
 }
index 268bc48d9ab3cd8f72a4cdaa637d7e91f4e87308..b84289d5bb1e8bdcee6767125685e7d4db9c54fb 100644 (file)
@@ -121,12 +121,12 @@ check_subcmd_length(void)
 }
 
 static void
-keydef_paint(mpdclient_t *c);
+keydef_paint(void);
 
 static void
 keydef_repaint(void)
 {
-       keydef_paint(NULL);
+       keydef_paint();
        wrefresh(lw->w);
 }
 
@@ -288,7 +288,7 @@ keydef_title(char *str, size_t size)
 }
 
 static void
-keydef_paint(mpd_unused mpdclient_t *c)
+keydef_paint(void)
 {
        list_window_paint(lw, list_callback, NULL);
 }
index b1812de31154764efee7db1925bef9296f7d4f2f..be99e6b750847a511484f37be22053f164ce4d30 100644 (file)
@@ -84,7 +84,7 @@ screen_lyrics_clear(void)
 }
 
 static void
-lyrics_paint(mpdclient_t *c);
+lyrics_paint(void);
 
 /**
  * Repaint and update the screen.
@@ -92,7 +92,7 @@ lyrics_paint(mpdclient_t *c);
 static void
 lyrics_repaint(void)
 {
-       lyrics_paint(NULL);
+       lyrics_paint();
        wrefresh(lw->w);
 }
 
@@ -291,7 +291,7 @@ lyrics_title(char *str, size_t size)
 }
 
 static void
-lyrics_paint(mpd_unused mpdclient_t *c)
+lyrics_paint(void)
 {
        list_window_paint(lw, list_callback, NULL);
 }
index 0fdf36746f439ae322e6a236ade4653501e90da4..4b285c533c52b9add633fc33900e49841d24517d 100644 (file)
@@ -54,20 +54,20 @@ static list_window_t *lw = NULL;
 static guint timer_hide_cursor_id;
 
 static void
-play_paint(struct mpdclient *c);
+play_paint(void);
 
 static void
-playlist_repaint(struct mpdclient *c)
+playlist_repaint(void)
 {
-       play_paint(c);
+       play_paint();
        wrefresh(lw->w);
 }
 
 static void
-playlist_repaint_if_active(struct mpdclient *c)
+playlist_repaint_if_active(void)
 {
        if (screen_is_visible(&screen_playlist))
-               playlist_repaint(c);
+               playlist_repaint();
 }
 
 static void
@@ -86,7 +86,7 @@ playlist_changed_callback(mpdclient_t *c, int event, gpointer data)
        }
 
        list_window_check_selected(lw, c->playlist.list->len);
-       playlist_repaint_if_active(c);
+       playlist_repaint_if_active();
 }
 
 static const char *
@@ -344,7 +344,7 @@ timer_hide_cursor(gpointer data)
 
        if (c->status != NULL && c->status->state == MPD_STATUS_STATE_PLAY) {
                lw->flags |= LW_HIDE_CURSOR;
-               playlist_repaint(c);
+               playlist_repaint();
        } else
                timer_hide_cursor_id = g_timeout_add(options.hide_cursor * 1000,
                                                     timer_hide_cursor, c);
@@ -406,7 +406,7 @@ play_title(char *str, size_t size)
 }
 
 static void
-play_paint(mpd_unused mpdclient_t *c)
+play_paint(void)
 {
        list_window_paint(lw, list_callback, NULL);
 }
@@ -426,7 +426,7 @@ play_update(mpdclient_t *c)
                if (options.auto_center && current_song_id != -1)
                        center_playing_item(c);
 
-               playlist_repaint(c);
+               playlist_repaint();
        }
 }
 
@@ -440,7 +440,7 @@ handle_mouse_event(struct mpdclient *c)
 
        if (screen_get_mouse_event(c, &bstate, &row) ||
            list_window_mouse(lw, playlist_length(playlist), bstate, row)) {
-               playlist_repaint(c);
+               playlist_repaint();
                return 1;
        }
 
@@ -464,7 +464,7 @@ handle_mouse_event(struct mpdclient *c)
 
        lw->selected = selected;
        list_window_check_selected(lw, playlist_length(playlist));
-       playlist_repaint(c);
+       playlist_repaint();
 
        return 1;
 }
@@ -483,7 +483,7 @@ play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
        }
 
        if (list_window_cmd(lw, playlist_length(&c->playlist), cmd)) {
-               playlist_repaint(c);
+               playlist_repaint();
                return 1;
        }
 
@@ -502,7 +502,7 @@ play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
                return 1;
        case CMD_SCREEN_UPDATE:
                center_playing_item(c);
-               playlist_repaint(c);
+               playlist_repaint();
                return 0;
 
        case CMD_LIST_MOVE_UP:
@@ -518,7 +518,7 @@ play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
                screen_find(screen,
                            lw, playlist_length(&c->playlist),
                            cmd, list_callback, NULL);
-               playlist_repaint(c);
+               playlist_repaint();
                return 1;
 
 #ifdef HAVE_GETMOUSE
index 989ac7eaabfc170c3cb37847a3eb92947507831c..bf9278b53fa4c6280c946c486fad02ed8f042660 100644 (file)
@@ -122,12 +122,12 @@ lw_search_help_callback(unsigned idx, mpd_unused int *highlight,
 }
 
 static void
-paint(mpdclient_t *c);
+paint(void);
 
 static void
 search_repaint(void)
 {
-       paint(NULL);
+       paint();
        wrefresh(browser.lw->w);
 }
 
@@ -378,7 +378,7 @@ resize(int cols, int rows)
 }
 
 static void
-paint(mpd_unused mpdclient_t *c)
+paint(void)
 {
        if (browser.filelist) {
                browser.lw->flags = 0;