Code

screen_interface: make cols/rows unsigned
[ncmpc.git] / src / screen_song.c
index 6814dcddbaa7e38aa489068396a540d2a73b4513..086768cec6b058f353604cf1b3df2bfd35156846 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
@@ -112,19 +112,6 @@ screen_song_clear(void)
        }
 }
 
-static void
-screen_song_paint(void);
-
-/**
- * Repaint and update the screen.
- */
-static void
-screen_song_repaint(void)
-{
-       screen_song_paint();
-       wrefresh(lw->w);
-}
-
 static const char *
 screen_song_list_callback(unsigned idx, gcc_unused void *data)
 {
@@ -135,7 +122,7 @@ screen_song_list_callback(unsigned idx, gcc_unused void *data)
 
 
 static void
-screen_song_init(WINDOW *w, int cols, int rows)
+screen_song_init(WINDOW *w, unsigned cols, unsigned rows)
 {
        for (unsigned i = 0; i < G_N_ELEMENTS(tag_labels); ++i) {
                if (tag_labels[i] != NULL) {
@@ -173,7 +160,7 @@ screen_song_exit(void)
 }
 
 static void
-screen_song_resize(int cols, int rows)
+screen_song_resize(unsigned cols, unsigned rows)
 {
        list_window_resize(lw, cols, rows);
 }
@@ -371,7 +358,7 @@ audio_format_to_string(char *buffer, size_t size,
 {
 #if LIBMPDCLIENT_CHECK_VERSION(2,10,0)
        if (format->bits == MPD_SAMPLE_FORMAT_FLOAT) {
-               g_snprintf(buffer, size, _("%u:f:%u"),
+               g_snprintf(buffer, size, "%u:f:%u",
                           format->sample_rate,
                           format->channels);
                return;
@@ -382,20 +369,20 @@ audio_format_to_string(char *buffer, size_t size,
                    format->sample_rate % 44100 == 0) {
                        /* use shortcuts such as "dsd64" which implies the
                           sample rate */
-                       g_snprintf(buffer, size, _("dsd%u:%u"),
+                       g_snprintf(buffer, size, "dsd%u:%u",
                                   format->sample_rate * 8 / 44100,
                                   format->channels);
                        return;
                }
 
-               g_snprintf(buffer, size, _("%u:dsd:%u"),
+               g_snprintf(buffer, size, "%u:dsd:%u",
                           format->sample_rate,
                           format->channels);
                return;
        }
 #endif
 
-       g_snprintf(buffer, size, _("%u:%u:%u"),
+       g_snprintf(buffer, size, "%u:%u:%u",
                   format->sample_rate, format->bits,
                   format->channels);
 }
@@ -459,14 +446,14 @@ screen_song_update(struct mpdclient *c)
                mpdclient_handle_error(c);
 
        list_window_set_length(lw, current.lines->len);
-       screen_song_repaint();
+       screen_song_paint();
 }
 
 static bool
 screen_song_cmd(struct mpdclient *c, command_t cmd)
 {
        if (list_window_scroll_cmd(lw, cmd)) {
-               screen_song_repaint();
+               screen_song_paint();
                return true;
        }
 
@@ -512,7 +499,7 @@ screen_song_cmd(struct mpdclient *c, command_t cmd)
        if (screen_find(lw, cmd, screen_song_list_callback, NULL)) {
                /* center the row */
                list_window_center(lw, lw->selected);
-               screen_song_repaint();
+               screen_song_paint();
                return true;
        }