Code

screen_song: draw bit rate in screen_song_update()
[ncmpc.git] / src / screen_outputs.c
index 888aa34f1f9edcbb970564e173f746443e5809db..2aa60e1ab44c4fddabf2bb3d13dd0cc67f94e843 100644 (file)
@@ -47,20 +47,17 @@ outputs_repaint(void)
 static bool
 toggle_output(struct mpdclient *c, unsigned int output_index)
 {
-       struct mpd_connection *connection;
-       struct mpd_output *output;
-
        assert(mpd_outputs != NULL);
 
        if (output_index >= mpd_outputs->len)
                return false;
 
-       connection = mpdclient_get_connection(c);
+       struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL)
                return false;
 
-       output = g_ptr_array_index(mpd_outputs, output_index);
-
+       struct mpd_output *output =
+               g_ptr_array_index(mpd_outputs, output_index);
        if (!mpd_output_get_enabled(output)) {
                if (!mpd_run_enable_output(connection,
                                           mpd_output_get_id(output))) {
@@ -89,7 +86,7 @@ toggle_output(struct mpdclient *c, unsigned int output_index)
 }
 
 static void
-clear_output_element(gpointer data, G_GNUC_UNUSED gpointer user_data)
+clear_output_element(gpointer data, gcc_unused gpointer user_data)
 {
        mpd_output_free(data);
 }
@@ -114,18 +111,17 @@ clear_outputs_list(void)
 static void
 fill_outputs_list(struct mpdclient *c)
 {
-       struct mpd_connection *connection;
-       struct mpd_output *output;
-
        assert(mpd_outputs != NULL);
 
-       connection = mpdclient_get_connection(c);
+       struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL) {
                list_window_set_length(lw, 0);
                return;
        }
 
        mpd_send_outputs(connection);
+
+       struct mpd_output *output;
        while ((output = mpd_recv_output(connection)) != NULL) {
                g_ptr_array_add(mpd_outputs, output);
        }
@@ -170,15 +166,15 @@ outputs_close(void)
 }
 
 static const char *
-outputs_title(G_GNUC_UNUSED char *str, G_GNUC_UNUSED size_t size)
+outputs_title(gcc_unused char *str, gcc_unused size_t size)
 {
        return _("Outputs");
 }
 
 static void
 screen_outputs_paint_callback(WINDOW *w, unsigned i,
-                             G_GNUC_UNUSED unsigned y, unsigned width,
-                             bool selected, G_GNUC_UNUSED void *data)
+                             gcc_unused unsigned y, unsigned width,
+                             bool selected, gcc_unused const void *data)
 {
        const struct mpd_output *output;