summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-03 18:34:13 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-03 18:34:13 +0100
commitfa519319f3c31f7ca63740c953c35dd4dc9e4b4a (patch)
tree6ef9ed18d2db6c3a989d81f65f84c999c4b5e602 /plugins
parentde5bcbefc5817688baa32f85d7940ea8f41ba6e8 (diff)
compiler warning cleanup
Diffstat (limited to 'plugins')
-rw-r--r--plugins/alsa/alsa.c19
-rw-r--r--plugins/cdda/cdda.c14
-rw-r--r--plugins/flac/flac.c6
-rw-r--r--plugins/gtkui/callbacks.c10
-rw-r--r--plugins/gtkui/gtkplaylist.c1
-rw-r--r--plugins/lastfm/lastfm.c2
-rw-r--r--plugins/mpgmad/mpgmad.c23
-rw-r--r--plugins/sndfile/sndfile.c2
-rw-r--r--plugins/vfs_curl/vfs_curl.c11
-rw-r--r--plugins/vorbis/vorbis.c2
10 files changed, 32 insertions, 58 deletions
diff --git a/plugins/alsa/alsa.c b/plugins/alsa/alsa.c
index 9be03fe8..2a5b9b2c 100644
--- a/plugins/alsa/alsa.c
+++ b/plugins/alsa/alsa.c
@@ -61,12 +61,6 @@ static int
palsa_stop (void);
static int
-palsa_isstopped (void);
-
-static int
-palsa_ispaused (void);
-
-static int
palsa_pause (void);
static int
@@ -373,17 +367,6 @@ palsa_stop (void) {
}
int
-palsa_isstopped (void) {
- return (state == 0);
-}
-
-int
-palsa_ispaused (void) {
- // return pause state
- return (state == 2);
-}
-
-int
palsa_pause (void) {
if (state == 0 || !audio) {
return -1;
@@ -559,7 +542,7 @@ palsa_configchanged (DB_event_t *ev, uintptr_t data) {
void
palsa_enum_soundcards (void (*callback)(const char *name, const char *desc, void *), void *userdata) {
void **hints, **n;
- char *name, *descr, *descr1, *io;
+ char *name, *descr, *io;
const char *filter = "Output";
if (snd_device_name_hint(-1, "pcm", &hints) < 0)
return;
diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c
index 63b3edde..6137e37e 100644
--- a/plugins/cdda/cdda.c
+++ b/plugins/cdda/cdda.c
@@ -66,16 +66,6 @@ min (int a, int b) {
return a < b ? a : b;
}
-static char*
-trim (char* s)
-{
- char *h, *t;
-
- for ( h = s; *h == ' ' || *h == '\t'; h++ );
- for ( t = s + strlen(s); *t == ' ' || *t == '\t'; *t = 0, t-- );
- return h;
-}
-
static int
cda_init (DB_playItem_t *it) {
// trace ("CDA: initing %s\n", it->fname);
@@ -122,7 +112,6 @@ cda_init (DB_playItem_t *it) {
int
cda_read_int16 (char *bytes, int size) {
- int initsize = size;
int extrasize = 0;
if (tail_len > 0)
@@ -298,7 +287,6 @@ cddb_thread (void *items_i)
{
struct cddb_thread_params *params = (struct cddb_thread_params*)items_i;
DB_playItem_t **items = params->items;
- DB_playItem_t *item;
trace ("calling resolve_disc\n");
deadbeef->mutex_lock (mutex);
@@ -349,10 +337,8 @@ static DB_playItem_t *
cda_insert (DB_playItem_t *after, const char *fname) {
// trace ("CDA insert: %s\n", fname);
- int all = 0;
int track_nr;
DB_playItem_t *res;
- CdIo_t *cdio; //we need its local inst
const char* shortname = strrchr (fname, '/');
if (shortname) {
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c
index 75a8faf9..d3424831 100644
--- a/plugins/flac/flac.c
+++ b/plugins/flac/flac.c
@@ -69,6 +69,9 @@ FLAC__StreamDecoderReadStatus flac_read_cb (const FLAC__StreamDecoder *decoder,
FLAC__StreamDecoderSeekStatus flac_seek_cb (const FLAC__StreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data) {
cue_cb_data_t *cb = (cue_cb_data_t *)client_data;
int r = deadbeef->fseek (cb->file, absolute_byte_offset, SEEK_SET);
+ if (r) {
+ return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM;
+ }
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
@@ -100,7 +103,7 @@ cflac_write_callback (const FLAC__StreamDecoder *decoder, const FLAC__Frame *fra
}
int bitrate = -1;
float sec = ((float)frame->header.blocksize / frame->header.sample_rate);
- if (cb->bytesread != 0 && sec != 0) {
+ if (cb->bytesread != 0 && sec > 0) {
bitrate = cb->bytesread / sec * 8;
}
cb->bytesread = 0;
@@ -293,7 +296,6 @@ cflac_read_int16 (char *bytes, int size) {
}
}
int initsize = size;
- int nbytes_in = 0;
do {
if (remaining) {
int s = size * 2;
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index e860a92f..e302169a 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -464,7 +464,7 @@ on_add_folders_activate (GtkMenuItem *menuitem,
}
if (response == GTK_RESPONSE_OK)
{
- gchar *folder = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg));
+ //gchar *folder = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg));
GSList *lst = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER (dlg));
gtk_widget_destroy (dlg);
if (lst) {
@@ -858,7 +858,7 @@ on_playlist_load_activate (GtkMenuItem *menuitem,
gchar *fname = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dlg));
gtk_widget_destroy (dlg);
if (fname) {
- int res = deadbeef->pl_load (fname);
+ /*int res = */deadbeef->pl_load (fname);
g_free (fname);
gtkplaylist_t *ps = &main_playlist;
gtkpl_setup_scrollbar (ps);
@@ -925,7 +925,7 @@ on_playlist_save_activate (GtkMenuItem *menuitem,
save_playlist_as ();
}
else {
- int res = deadbeef->pl_save (last_playlist_save_name);
+ /*int res = */deadbeef->pl_save (last_playlist_save_name);
}
}
@@ -1578,9 +1578,9 @@ on_preferences_activate (GtkMenuItem *menuitem,
// list of plugins
GtkTreeView *tree = GTK_TREE_VIEW (lookup_widget (w, "pref_pluginlist"));
- GtkCellRenderer *rend_toggle = gtk_cell_renderer_toggle_new ();
GtkCellRenderer *rend_text = gtk_cell_renderer_text_new ();
#if 0
+ GtkCellRenderer *rend_toggle = gtk_cell_renderer_toggle_new ();
GtkListStore *store = gtk_list_store_new (3, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_BOOLEAN);
g_signal_connect ((gpointer)rend_toggle, "toggled",
G_CALLBACK (on_plugin_active_toggled),
@@ -2095,7 +2095,7 @@ plugin_configure (GtkWidget *parentwin, DB_plugin_t *p) {
nrows++;
gtk_table_resize (GTK_TABLE (tbl), nrows, 2);
GtkWidget *label;
- GtkWidget *prop;
+ GtkWidget *prop = NULL;
GtkWidget *cont = NULL;
label = gtk_label_new (labeltext);
if (!strcmp (type, "entry") || !strcmp (type, "password")) {
diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c
index 7dd65dcb..6b303c8a 100644
--- a/plugins/gtkui/gtkplaylist.c
+++ b/plugins/gtkui/gtkplaylist.c
@@ -898,7 +898,6 @@ main_refresh (void) {
int
gtkpl_keypress (gtkplaylist_t *ps, int keyval, int state) {
- GtkWidget *range = ps->scrollbar;
int prev = deadbeef->pl_get_cursor (ps->iterator);
int cursor = prev;
if (keyval == GDK_Down) {
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c
index 53814817..3a8de2c0 100644
--- a/plugins/lastfm/lastfm.c
+++ b/plugins/lastfm/lastfm.c
@@ -57,7 +57,7 @@ lastfm_load (DB_functions_t *api) {
#define MAX_REPLY 4096
static char lfm_reply[MAX_REPLY];
-static char lfm_reply_sz;
+static int lfm_reply_sz;
static char lfm_err[CURL_ERROR_SIZE];
static char lfm_nowplaying[2048]; // packet for nowplaying, or ""
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index 1fe58a9a..9bef2bc8 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -178,7 +178,7 @@ cmp3_scan_stream (buffer_t *buffer, int sample) {
for (;;) {
uint32_t hdr;
uint8_t sync;
- size_t pos = deadbeef->ftell (buffer->file);
+ //size_t pos = deadbeef->ftell (buffer->file);
if (deadbeef->fread (&sync, 1, 1, buffer->file) != 1) {
break; // eof
}
@@ -399,11 +399,13 @@ cmp3_scan_stream (buffer_t *buffer, int sample) {
deadbeef->fread (&lpf, 1, 1, buffer->file);
//3 floats: replay gain
deadbeef->fread (buf, 1, 4, buffer->file);
- float rg_peaksignalamp = extract_f32 (buf);
+ // float rg_peaksignalamp = extract_f32 (buf);
deadbeef->fread (buf, 1, 2, buffer->file);
- uint16_t rg_radio = extract_i16 (buf);
+ // uint16_t rg_radio = extract_i16 (buf);
+
deadbeef->fread (buf, 1, 2, buffer->file);
- uint16_t rg_audiophile = extract_i16 (buf);
+ // uint16_t rg_audiophile = extract_i16 (buf);
+
// skip
deadbeef->fseek (buffer->file, 2, SEEK_CUR);
deadbeef->fread (buf, 1, 3, buffer->file);
@@ -418,7 +420,8 @@ cmp3_scan_stream (buffer_t *buffer, int sample) {
deadbeef->fseek (buffer->file, 2, SEEK_CUR);
// musiclen
deadbeef->fread (buf, 1, 4, buffer->file);
- uint32_t musiclen = extract_i32 (buf);
+// uint32_t musiclen = extract_i32 (buf);
+
trace ("lpf: %d, peaksignalamp: %f, radiogain: %d, audiophile: %d, startdelay: %d, enddelay: %d, mp3gain: %d, musiclen: %d\n", lpf, rg_peaksignalamp, rg_radio, rg_audiophile, startdelay, enddelay, mp3gain, musiclen);
// skip crc
//deadbeef->fseek (buffer->file, 4, SEEK_CUR);
@@ -732,7 +735,7 @@ cmp3_stream_frame (void) {
}
int size = READBUFFER - buffer.remaining;
int bytesread = 0;
- char *bytes = buffer.input + buffer.remaining;
+ uint8_t *bytes = buffer.input + buffer.remaining;
bytesread = deadbeef->fread (bytes, 1, size, buffer.file);
if (!bytesread) {
// add guard
@@ -977,7 +980,7 @@ cmp3_insert (DB_playItem_t *after, const char *fname) {
return NULL;
}
- const char *ftype;
+ const char *ftype = NULL;
if (buffer.version == 1) {
switch (buffer.layer) {
case 1:
@@ -1022,9 +1025,9 @@ cmp3_insert (DB_playItem_t *after, const char *fname) {
it->fname = strdup (fname);
deadbeef->rewind (fp);
- int apeerr = deadbeef->junk_read_ape (it, fp);
- int v2err = deadbeef->junk_read_id3v2 (it, fp);
- int v1err = deadbeef->junk_read_id3v1 (it, fp);
+ /*int apeerr = */deadbeef->junk_read_ape (it, fp);
+ /*int v2err = */deadbeef->junk_read_id3v2 (it, fp);
+ /*int v1err = */deadbeef->junk_read_id3v1 (it, fp);
deadbeef->pl_add_meta (it, "title", NULL);
deadbeef->pl_set_item_duration (it, buffer.duration);
it->filetype = ftype;
diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c
index 4af7b108..99f717cc 100644
--- a/plugins/sndfile/sndfile.c
+++ b/plugins/sndfile/sndfile.c
@@ -113,7 +113,7 @@ sndfile_init (DB_playItem_t *it) {
}
// hack bitrate
float sec = (float)(sfctx.endsample-sfctx.startsample) / inf.samplerate;
- if (sec != 0) {
+ if (sec > 0) {
sfctx.bitrate = fsize / sec * 8 / 1000;
}
else {
diff --git a/plugins/vfs_curl/vfs_curl.c b/plugins/vfs_curl/vfs_curl.c
index 6e1611f2..3185df67 100644
--- a/plugins/vfs_curl/vfs_curl.c
+++ b/plugins/vfs_curl/vfs_curl.c
@@ -273,7 +273,6 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream)
trace ("http_content_header_handler\n");
assert (stream);
HTTP_FILE *fp = (HTTP_FILE *)stream;
- const uint8_t c_type_str[] ="Content-Type:";
const uint8_t *p = ptr;
const uint8_t *end = p + size*nmemb;
uint8_t key[256];
@@ -314,10 +313,10 @@ http_content_header_handler (void *ptr, size_t size, size_t nmemb, void *stream)
return size * nmemb;
}
-static size_t
-http_curl_write_abort (void *ptr, size_t size, size_t nmemb, void *stream) {
- return 0;
-}
+//static size_t
+//http_curl_write_abort (void *ptr, size_t size, size_t nmemb, void *stream) {
+// return 0;
+//}
static int
http_curl_control (void *stream, double dltotal, double dlnow, double ultotal, double ulnow) {
@@ -679,6 +678,7 @@ http_get_content_name (DB_FILE *stream) {
return fp->content_name;
}
+#if 0
static const char *
http_get_content_genre (DB_FILE *stream) {
trace ("http_get_content_genre\n");
@@ -699,6 +699,7 @@ http_get_content_genre (DB_FILE *stream) {
}
return fp->content_genre;
}
+#endif
static void
http_stop (DB_FILE *stream) {
diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c
index 8973ed25..1eb3f002 100644
--- a/plugins/vorbis/vorbis.c
+++ b/plugins/vorbis/vorbis.c
@@ -57,7 +57,7 @@ cvorbis_fread (void *ptr, size_t size, size_t nmemb, void *datasource) {
static int
cvorbis_fseek (void *datasource, ogg_int64_t offset, int whence) {
DB_FILE *f = (DB_FILE *)datasource;
- return deadbeef->fseek (datasource, offset, whence);
+ return deadbeef->fseek (f, offset, whence);
}
static int