Code

screen_interface: make cols/rows unsigned
[ncmpc.git] / src / screen_outputs.c
index e80d7bae50962af4320fcc6dc8182b4fdd342933..67cc4b86fbc0073e0d986f19e95b8f0d71d373cf 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2010 The Music Player Daemon Project
+ * (c) 2004-2017 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -34,16 +34,6 @@ static struct list_window *lw;
 
 static GPtrArray *mpd_outputs = NULL;
 
-static void
-outputs_paint(void);
-
-static void
-outputs_repaint(void)
-{
-       outputs_paint();
-       wrefresh(lw->w);
-}
-
 static bool
 toggle_output(struct mpdclient *c, unsigned int output_index)
 {
@@ -132,7 +122,7 @@ fill_outputs_list(struct mpdclient *c)
 }
 
 static void
-outputs_init(WINDOW *w, int cols, int rows)
+outputs_init(WINDOW *w, unsigned cols, unsigned rows)
 {
        lw = list_window_init(w, cols, rows);
 
@@ -140,7 +130,7 @@ outputs_init(WINDOW *w, int cols, int rows)
 }
 
 static void
-outputs_resize(int cols, int rows)
+outputs_resize(unsigned cols, unsigned rows)
 {
        list_window_resize(lw, cols, rows);
 }
@@ -174,7 +164,7 @@ outputs_title(gcc_unused char *str, gcc_unused size_t size)
 static void
 screen_outputs_paint_callback(WINDOW *w, unsigned i,
                              gcc_unused unsigned y, unsigned width,
-                             bool selected, gcc_unused void *data)
+                             bool selected, gcc_unused const void *data)
 {
        const struct mpd_output *output;
 
@@ -201,7 +191,7 @@ screen_outputs_update(struct mpdclient *c)
        if (c->events & MPD_IDLE_OUTPUT) {
                clear_outputs_list();
                fill_outputs_list(c);
-               outputs_repaint();
+               outputs_paint();
        }
 }
 
@@ -211,7 +201,7 @@ outputs_cmd(struct mpdclient *c, command_t cmd)
        assert(mpd_outputs != NULL);
 
        if (list_window_cmd(lw, cmd)) {
-               outputs_repaint();
+               outputs_paint();
                return true;
        }
 
@@ -223,7 +213,7 @@ outputs_cmd(struct mpdclient *c, command_t cmd)
        case CMD_SCREEN_UPDATE:
                clear_outputs_list();
                fill_outputs_list(c);
-               outputs_repaint();
+               outputs_paint();
                return true;
 
        default: