Code

fix unused parameter warnings
authorMax Kellermann <max@duempel.org>
Mon, 15 Sep 2008 11:27:32 +0000 (13:27 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 15 Sep 2008 11:27:32 +0000 (13:27 +0200)
Add the "unused" attribute to all function parameters which are indeed
going to be ignored.

src/main.c
src/screen_clock.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 7350a50f69b9a8ac1c32bc6ba032f737db1e2c6c..b16cab889bc3e1dd424a33a291bf178aa7c85371 100644 (file)
@@ -29,6 +29,7 @@
 #include "screen.h"
 #include "screen_utils.h"
 #include "strfsong.h"
+#include "gcc.h"
 
 #include <stdlib.h>
 #include <unistd.h>
@@ -55,12 +56,10 @@ error_msg(const gchar *msg)
 }
 
 static void
-error_callback(mpdclient_t *c, gint error, const gchar *msg)
+error_callback(mpd_unused mpdclient_t *c, gint error, const gchar *msg)
 {
-       gint code = GET_ACK_ERROR_CODE(error);
-
        error = error & 0xFF;
-       D("Error [%d:%d]> \"%s\"\n", error, code, msg);
+       D("Error [%d:%d]> \"%s\"\n", error, GET_ACK_ERROR_CODE(error), msg);
        switch (error) {
        case MPD_ERROR_CONNPORT:
        case MPD_ERROR_NORESPONSE:
@@ -126,7 +125,7 @@ exit_and_cleanup(void)
 }
 
 static void
-catch_sigint( int sig )
+catch_sigint(mpd_unused int sig)
 {
        printf("\n%s\n", _("Exiting..."));
        exit(EXIT_SUCCESS);
@@ -134,7 +133,7 @@ catch_sigint( int sig )
 
 
 static void
-catch_sigcont( int sig )
+catch_sigcont(mpd_unused int sig)
 {
        D("catch_sigcont()\n");
 #ifdef ENABLE_RAW_MODE
index a929532622c9184465f8a9b1e1df0a68258f933e..995be67926fcdcf40cc867f107259723a850b875 100644 (file)
@@ -14,6 +14,7 @@
 #include "command.h"
 #include "screen.h"
 #include "screen_utils.h"
+#include "gcc.h"
 
 #include <time.h>
 #include <stdlib.h>
@@ -133,7 +134,7 @@ clock_exit(void)
 }
 
 static void
-clock_open(screen_t *screen, mpdclient_t *c)
+clock_open(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        int j;
 
@@ -148,13 +149,13 @@ clock_close(void)
 }
 
 static const char *
-clock_title(char *str, size_t size)
+clock_title(mpd_unused char *str, mpd_unused size_t size)
 {
        return _("Clock");
 }
 
 static void
-clock_update(screen_t *screen, mpdclient_t *c)
+clock_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        time_t now;
        struct tm *tm;
@@ -234,7 +235,8 @@ clock_paint(screen_t *screen, mpdclient_t *c)
 }
 
 static int
-clock_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
+clock_cmd(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c,
+         mpd_unused command_t cmd)
 {
        return 0;
 }
index c00ccba44bdd5f0b68d89e0737344831f515733a..c480961c4b9ebab4cde59bce4b315d9302a98687 100644 (file)
@@ -29,6 +29,7 @@
 #include "screen_utils.h"
 #include "screen_browse.h"
 #include "screen_play.h"
+#include "gcc.h"
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -114,7 +115,8 @@ sync_highlights(mpdclient_t *c, mpdclient_filelist_t *fl)
 
 /* the db have changed -> update the filelist */
 static void
-file_changed_callback(mpdclient_t *c, int event, gpointer data)
+file_changed_callback(mpdclient_t *c, mpd_unused int event,
+                     mpd_unused gpointer data)
 {
        D("screen_file.c> filelist_callback() [%d]\n", event);
        filelist = mpdclient_filelist_update(c, filelist);
@@ -194,8 +196,8 @@ browse_lw_callback(unsigned idx, int *highlight, void *data)
 
 /* chdir */
 static int
-change_directory(screen_t *screen, mpdclient_t *c, filelist_entry_t *entry,
-                const char *new_path)
+change_directory(mpd_unused screen_t *screen, mpdclient_t *c,
+                filelist_entry_t *entry, const char *new_path)
 {
        mpd_InfoEntity *entity = NULL;
        gchar *path = NULL;
@@ -240,7 +242,8 @@ change_directory(screen_t *screen, mpdclient_t *c, filelist_entry_t *entry,
 }
 
 static int
-load_playlist(screen_t *screen, mpdclient_t *c, filelist_entry_t *entry)
+load_playlist(mpd_unused screen_t *screen, mpdclient_t *c,
+             filelist_entry_t *entry)
 {
        mpd_InfoEntity *entity = entry->entity;
        mpd_PlaylistFile *plf = entity->info.playlistFile;
@@ -313,7 +316,8 @@ handle_delete(screen_t *screen, mpdclient_t *c)
 }
 
 static int
-enqueue_and_play(screen_t *screen, mpdclient_t *c, filelist_entry_t *entry)
+enqueue_and_play(mpd_unused screen_t *screen, mpdclient_t *c,
+                filelist_entry_t *entry)
 {
        int idx;
        mpd_InfoEntity *entity = entry->entity;
@@ -483,7 +487,7 @@ browse_handle_select(screen_t *screen,
 int
 browse_handle_select_all (screen_t *screen,
                          mpdclient_t *c,
-                         list_window_t *local_lw,
+                         mpd_unused list_window_t *local_lw,
                          mpdclient_filelist_t *fl)
 {
        filelist_entry_t *entry;
@@ -578,7 +582,7 @@ browse_exit(void)
 }
 
 static void
-browse_open(screen_t *screen, mpdclient_t *c)
+browse_open(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        if( filelist == NULL ) {
                filelist = mpdclient_filelist_get(c, "");
@@ -615,7 +619,7 @@ browse_title(char *str, size_t size)
 }
 
 static void
-browse_paint(screen_t *screen, mpdclient_t *c)
+browse_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        lw->clear = 1;
 
index 681bc6cfe5198d81ee65ee39630dfef28b3a54eb..d225b3d6d396b08b6afab88ea450191c127a7b22 100644 (file)
@@ -24,6 +24,7 @@
 #include "command.h"
 #include "screen.h"
 #include "screen_utils.h"
+#include "gcc.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -147,7 +148,7 @@ static list_window_t *lw = NULL;
 
 
 static const char *
-list_callback(unsigned idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, mpd_unused void *data)
 {
        static char buf[512];
 
@@ -212,13 +213,13 @@ help_exit(void)
 
 
 static const char *
-help_title(char *str, size_t size)
+help_title(mpd_unused char *str, mpd_unused size_t size)
 {
        return _("Help");
 }
 
 static void
-help_paint(screen_t *screen, mpdclient_t *c)
+help_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        lw->clear = 1;
        list_window_paint(lw, list_callback, NULL);
@@ -226,7 +227,7 @@ help_paint(screen_t *screen, mpdclient_t *c)
 }
 
 static void
-help_update(screen_t *screen, mpdclient_t *c)
+help_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        if (lw->repaint) {
                list_window_paint(lw, list_callback, NULL);
@@ -237,7 +238,7 @@ help_update(screen_t *screen, mpdclient_t *c)
 
 
 static int
-help_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
+help_cmd(screen_t *screen, mpd_unused mpdclient_t *c, command_t cmd)
 {
        lw->repaint=1;
        lw->clear=1;
index 54a234961b83ef9a683ea9e3f43b861d983ba099..44c84ca42f0f8747f66e889acc92868c68e1fe9c 100644 (file)
@@ -28,6 +28,7 @@
 #include "command.h"
 #include "screen.h"
 #include "screen_utils.h"
+#include "gcc.h"
 
 #include <errno.h>
 #include <stdlib.h>
@@ -183,7 +184,7 @@ assign_new_key(WINDOW *w, int cmd_index, int key_index)
 }
 
 static const char *
-list_callback(unsigned idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, mpd_unused void *data)
 {
        static char buf[BUFSIZE];
 
@@ -241,7 +242,7 @@ keydef_exit(void)
 }
 
 static void 
-keydef_open(screen_t *screen, mpdclient_t *c)
+keydef_open(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
   if( cmds == NULL )
     {
@@ -286,7 +287,7 @@ keydef_title(char *str, size_t size)
 }
 
 static void 
-keydef_paint(screen_t *screen, mpdclient_t *c)
+keydef_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
   lw->clear = 1;
   list_window_paint(lw, list_callback, NULL);
@@ -294,7 +295,7 @@ keydef_paint(screen_t *screen, mpdclient_t *c)
 }
 
 static void 
-keydef_update(screen_t *screen, mpdclient_t *c)
+keydef_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {  
   if( lw->repaint )
     {
@@ -305,7 +306,7 @@ keydef_update(screen_t *screen, mpdclient_t *c)
 }
 
 static int
-keydef_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
+keydef_cmd(screen_t *screen, mpd_unused mpdclient_t *c, command_t cmd)
 {
        int length = LIST_LENGTH();
 
index fb45fd49da23c9945387b06f626ea8f29a45f0ff..59329694847d4fb00ef10c67441057e260fc361b 100644 (file)
@@ -31,6 +31,7 @@
 #include "easy_download.h"
 #include "strfsong.h"
 #include "src_lyrics.h"
+#include "gcc.h"
 
 #define _GNU_SOURCE
 #include <stdlib.h>
@@ -152,7 +153,7 @@ static gpointer get_lyr(void *c)
 }
 
 static const char *
-list_callback(unsigned idx, int *highlight, void *data)
+list_callback(unsigned idx, int *highlight, mpd_unused void *data)
 {
        static char buf[512];
 
@@ -205,7 +206,7 @@ lyrics_exit(void)
 
 
 static const char *
-lyrics_title(char *str, size_t size)
+lyrics_title(mpd_unused char *str, mpd_unused size_t size)
 {
        static GString *msg;
        if (msg == NULL)
@@ -244,7 +245,7 @@ lyrics_title(char *str, size_t size)
 }
 
 static void
-lyrics_paint(screen_t *screen, mpdclient_t *c)
+lyrics_paint(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        lw->clear = 1;
        list_window_paint(lw, list_callback, NULL);
@@ -253,7 +254,7 @@ lyrics_paint(screen_t *screen, mpdclient_t *c)
 
 
 static void
-lyrics_update(screen_t *screen, mpdclient_t *c)
+lyrics_update(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
        if( lw->repaint ) {
                list_window_paint(lw, list_callback, NULL);
index 6b68568eefc00cb8f88cf654e4897112415d40c7..2f9e6eba7c57e1ced68c37663f9208d7d89b2e10 100644 (file)
@@ -31,6 +31,7 @@
 #include "screen.h"
 #include "screen_utils.h"
 #include "screen_play.h"
+#include "gcc.h"
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -92,7 +93,7 @@ list_callback(unsigned idx, int *highlight, void *data)
 }
 
 static int
-center_playing_item(screen_t *screen, mpdclient_t *c)
+center_playing_item(mpdclient_t *c)
 {
        unsigned length = c->playlist.length;
        unsigned offset = lw->selected - lw->start;
@@ -123,7 +124,7 @@ center_playing_item(screen_t *screen, mpdclient_t *c)
 }
 
 static void
-save_pre_completion_cb(GCompletion *gcmp, gchar *line, void *data)
+save_pre_completion_cb(GCompletion *gcmp, mpd_unused gchar *line, void *data)
 {
        completion_callback_data_t *tmp = (completion_callback_data_t *)data;
        GList **list = tmp->list;
@@ -137,8 +138,8 @@ save_pre_completion_cb(GCompletion *gcmp, gchar *line, void *data)
 }
 
 static void
-save_post_completion_cb(GCompletion *gcmp, gchar *line, GList *items,
-                       void *data)
+save_post_completion_cb(mpd_unused GCompletion *gcmp, mpd_unused gchar *line,
+                       GList *items, void *data)
 {
        completion_callback_data_t *tmp = (completion_callback_data_t *)data;
        screen_t *screen = tmp->screen;
@@ -336,7 +337,7 @@ play_init(WINDOW *w, int cols, int rows)
 }
 
 static void
-play_open(screen_t *screen, mpdclient_t *c)
+play_open(mpd_unused screen_t *screen, mpdclient_t *c)
 {
        static gboolean install_cb = TRUE;
 
@@ -371,7 +372,7 @@ play_title(char *str, size_t size)
 }
 
 static void
-play_paint(screen_t *screen, mpdclient_t *c)
+play_paint(mpd_unused screen_t *screen, mpdclient_t *c)
 {
        lw->clear = 1;
 
@@ -395,7 +396,7 @@ play_update(screen_t *screen, mpdclient_t *c)
                static int prev_song_id = 0;
 
                if( c->song && prev_song_id != c->song->id ) {
-                       center_playing_item(screen, c);
+                       center_playing_item(c);
                        prev_song_id = c->song->id;
                }
        }
@@ -417,7 +418,7 @@ play_update(screen_t *screen, mpdclient_t *c)
 
 #ifdef HAVE_GETMOUSE
 static int
-handle_mouse_event(screen_t *screen, mpdclient_t *c)
+handle_mouse_event(mpd_unused screen_t *screen, mpdclient_t *c)
 {
        int row;
        unsigned selected;
@@ -473,7 +474,7 @@ play_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
                screen->painted = 0;
                lw->clear = 1;
                lw->repaint = 1;
-               center_playing_item(screen, c);
+               center_playing_item(c);
                return 1;
        case CMD_LIST_MOVE_UP:
                mpdclient_cmd_move(c, lw->selected, lw->selected-1);
index 2161b7914935ec2784b8f8c308b4bb5b609a9fd4..9ec189d0e23ae11fa6b5e340be484378560c7ff3 100644 (file)
@@ -31,6 +31,7 @@
 #include "utils.h"
 #include "screen_utils.h"
 #include "screen_browse.h"
+#include "gcc.h"
 
 #include <ctype.h>
 #include <stdlib.h>
@@ -116,7 +117,8 @@ static gboolean advanced_search_mode = FALSE;
 
 /* search info */
 static const char *
-lw_search_help_callback(unsigned idx, int *highlight, void *data)
+lw_search_help_callback(unsigned idx, mpd_unused int *highlight,
+                       mpd_unused void *data)
 {
        unsigned text_rows;
        static const char *text[] = {
@@ -143,7 +145,7 @@ lw_search_help_callback(unsigned idx, int *highlight, void *data)
 
 /* the playlist have been updated -> fix highlights */
 static void 
-playlist_changed_callback(mpdclient_t *c, int event, gpointer data)
+playlist_changed_callback(mpdclient_t *c, int event, mpd_unused gpointer data)
 {
   if( filelist==NULL )
     return;
@@ -174,7 +176,8 @@ search_check_mode(void)
 }
 
 static void
-search_clear(screen_t *screen, mpdclient_t *c, gboolean clear_pattern)
+search_clear(mpd_unused screen_t *screen, mpdclient_t *c,
+            gboolean clear_pattern)
 {
   if( filelist )
     {
@@ -190,7 +193,7 @@ search_clear(screen_t *screen, mpdclient_t *c, gboolean clear_pattern)
 
 #ifdef FUTURE
 static mpdclient_filelist_t *
-filelist_search(mpdclient_t *c, int exact_match, int table,
+filelist_search(mpdclient_t *c, mpd_unused int exact_match, int table,
                gchar *local_pattern)
 {
   mpdclient_filelist_t *list, *list2;
@@ -380,7 +383,7 @@ quit(void)
 }
 
 static void
-open(screen_t *screen, mpdclient_t *c)
+open(mpd_unused screen_t *screen, mpd_unused mpdclient_t *c)
 {
   //  if( pattern==NULL )
   //    search_new(screen, c);
@@ -403,7 +406,7 @@ close(void)
 }
 
 static void 
-paint(screen_t *screen, mpdclient_t *c)
+paint(mpd_unused screen_t *screen, mpdclient_t *c)
 {
   lw->clear = 1;