changeset 1190:ed2d7787779e trunk

more warning elimination.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Thu, 21 Jun 2007 17:33:00 +0900
parents af5bd4592100
children 1cb26b6f7ba0
files configure.ac src/alac/plugin.c src/cdaudio/cdinfo.c src/curl/curl.c src/flac/plugin.c src/m3u/m3u.c src/mms/mms.c src/null/null.c src/pls/pls.c src/rocklight/sysled.c src/stdio/stdio.c src/tta/libtta.c src/tta/ttadec.c src/tta/ttalib.h src/vorbis/vorbis.c src/wma/libffwma/avio.c src/wma/libffwma/futils.c src/wma/wma.c
diffstat 18 files changed, 67 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed Jun 20 22:27:48 2007 +0300
+++ b/configure.ac	Thu Jun 21 17:33:00 2007 +0900
@@ -1306,7 +1306,7 @@
    [have_vorbisenc=yes], [have_vorbisenc=no])
    if test "$have_vorbisenc" = yes; then
       AC_DEFINE(FILEWRITER_VORBIS, 1, [Define if Vorbis output part should be built])
-      FILEWRITER_LIBS="$FILEWRITER_LIBS  -lvorbisenc"
+      FILEWRITER_LIBS="$FILEWRITER_LIBS  `pkg-config --libs vorbisenc`"
    fi
 fi
 
@@ -1322,7 +1322,7 @@
    )
    if test "$have_writer_flac" = yes; then
       AC_DEFINE(FILEWRITER_FLAC, 1, [Define if FLAC output part should be built])
-	  FILEWRITER_LIBS="$FILEWRITER_LIBS  -lFLAC"
+	  FILEWRITER_LIBS="$FILEWRITER_LIBS  `pkg-config --libs flac`"
    fi
 fi
 
--- a/src/alac/plugin.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/alac/plugin.c	Thu Jun 21 17:33:00 2007 +0900
@@ -145,7 +145,6 @@
     demux_res_t demux_res;
     VFSFile *input_file;
     stream_t *input_stream;
-    TitleInput *ti;
 
     input_file = vfs_fopen(filename, "rb");
     input_stream = stream_create_file(input_file, 1);
@@ -163,7 +162,7 @@
     if (!qtmovie_read(input_stream, &demux_res))
     {
         stream_destroy(input_stream);
-	vfs_fclose(input_file);
+        vfs_fclose(input_file);
         return NULL;
     }
 
@@ -200,14 +199,6 @@
     seek_to = time;
 }
 
-static gint get_time(InputPlayback *data)
-{
-    if (going)
-	return get_output_time();
-    else
-	return -1;
-}
-
 static int get_sample_info(demux_res_t *demux_res, uint32_t samplenum,
                            uint32_t *sample_duration,
                            uint32_t *sample_byte_size)
@@ -318,9 +309,7 @@
 gpointer decode_thread(void *args)
 {
     demux_res_t demux_res;
-    unsigned int output_size, i;
     gulong duration = 0;	/* samples added up */
-    gint framesize;
     VFSFile *input_file;
     stream_t *input_stream;
     TitleInput *ti;
--- a/src/cdaudio/cdinfo.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/cdaudio/cdinfo.c	Thu Jun 21 17:33:00 2007 +0900
@@ -19,14 +19,13 @@
  */
 
 #include "cdinfo.h"
+#include "cdaudio.h"
 
 #include <glib.h>
 #include <audacious/i18n.h>
-#include <glib/gprintf.h>
-
 #include <audacious/rcfile.h>
 
-#include "cdaudio.h"
+#include <stdlib.h>
 
 
 /*
--- a/src/curl/curl.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/curl/curl.c	Thu Jun 21 17:33:00 2007 +0900
@@ -175,8 +175,8 @@
   if (!((handle->wr_abs - handle->wr_index) % handle->buffer_length ==
 	(handle->rd_abs - handle->rd_index) % handle->buffer_length))
     printf("%p Not aligned! wr %d rd %d\n", handle,
-	   (handle->wr_abs - handle->wr_index) % handle->buffer_length,
-	   (handle->rd_abs - handle->rd_index) % handle->buffer_length);
+           (int)((handle->wr_abs - handle->wr_index) % handle->buffer_length),
+           (int)((handle->rd_abs - handle->rd_index) % handle->buffer_length));
 }
 
 static void update_length(CurlHandle *handle)
@@ -228,7 +228,7 @@
 static void got_header(CurlHandle *handle, ssize_t size)
 {
   if (DEBUG_HEADERS)
-    g_print("Got header %d bytes\n", size);
+    g_print("Got header %d bytes\n", (int)size);
   if (match_header(handle, size, ICY_NAME))
     {
       handle->name = get_value(handle, size, ICY_NAME);
@@ -251,7 +251,7 @@
       handle->icy_interval = atoi(value);
       g_free(value);
       if (DEBUG_HEADERS)
-	g_print("Metadata interval: %d\n", handle->icy_interval);
+        g_print("Metadata interval: %d\n", (int)handle->icy_interval);
     }
 }
 
@@ -263,7 +263,7 @@
   size_t len = strlen(name);
   size_t i;
   if (DEBUG_ICY_WRAP)
-    g_print("Posn=%d\n", posn);
+    g_print("Posn=%d\n", (int)posn);
   if (DEBUG_ICY_WRAP && posn + len > handle->buffer_length)
     g_print("Wrapped inline key\n");
   if (((handle->wr_index - posn + handle->buffer_length) %
@@ -358,7 +358,7 @@
 	      if (handle->icy_interval && !handle->icy_left)
 		{
 		  if (DEBUG_ICY)
-		    g_print("Metadata inline after %d\n", handle->wr_abs);
+        g_print("Metadata inline after %d\n", (int)handle->wr_abs);
 		  handle->in_icy_meta = 1;
 		  handle->icy_left = 1;
 		}
@@ -370,7 +370,7 @@
 	      handle->icy_left = 
 		((unsigned char)(handle->buffer[handle->wr_index])) * 16;
 	      if (DEBUG_ICY)
-		g_print("Metadata of size %d\n", handle->icy_left);
+          g_print("Metadata of size %d\n", (int)handle->icy_left);
 	      if (handle->icy_left)
 		{
 		  handle->in_icy_meta = 2;
@@ -461,7 +461,7 @@
 			    (handle->wr_index - handle->hdr_index + handle->buffer_length) % handle->buffer_length;
 			}
 		      if (DEBUG_ICY)
-			g_print("Left %d\n", handle->icy_left);
+            g_print("Left %d\n", (int)handle->icy_left);
 		      handle->in_icy_meta = 0;
 		      break;
 		    }
@@ -487,7 +487,7 @@
   else
     {
       if (DEBUG_CONNECTION)
-	g_print("Start from %d\n", handle->wr_abs);
+        g_print("Start from %d\n", (int)handle->wr_abs);
       curl_easy_setopt(handle->curl, CURLOPT_RESUME_FROM, handle->wr_abs);
 
       curl_easy_setopt(handle->curl, CURLOPT_NOBODY, 0);
@@ -535,7 +535,7 @@
       handle->rd_index = 0;
       handle->wr_abs = handle->rd_abs;
       if (DEBUG_CONNECTION)
-	g_print("Starting connection %p at %d\n", handle, handle->wr_abs);
+        g_print("Starting connection %p at %d\n", handle, (int)handle->wr_abs);
       handle->thread = g_thread_create(curl_manage_request, handle, 
 				       TRUE, NULL);
 
@@ -863,7 +863,7 @@
     handle->stream_stack = NULL;
   }
   if (DEBUG_SEEK)
-    g_print("Seek %p to %d %d\n", handle, offset, whence);
+    g_print("Seek %p to %d %d\n", handle, (int)offset, whence);
   if (whence == SEEK_END && handle->length == -1)
     {
       if (!handle->thread)
@@ -924,7 +924,7 @@
     }
 
   if (DEBUG_SEEK)
-    g_print("Seeked %p from %d to %d\n", handle, posn, handle->rd_abs);
+    g_print("Seeked %p from %d to %d\n", handle, (int)posn, (int)handle->rd_abs);
   return 0;
 }
 
--- a/src/flac/plugin.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/flac/plugin.c	Thu Jun 21 17:33:00 2007 +0900
@@ -145,7 +145,7 @@
 static FLAC__byte sample_buffer_[SAMPLE_BUFFER_SIZE];
 static unsigned sample_buffer_first_, sample_buffer_last_;
 
-static FLAC__StreamDecoder *decoder_ = 0, *decoder2 = 0;
+static FLAC__StreamDecoder *decoder_ = 0;
 static stream_data_struct stream_data_;
 static GThread *decode_thread_;
 static FLAC__bool audio_error_ = false;
@@ -166,6 +166,7 @@
 	}
 }
 
+#if 0
 static gchar* homedir()
 {
 	gchar *result;
@@ -183,12 +184,12 @@
 	}
 	return result;
 }
+#endif
 
 void FLAC_XMMS__init()
 {
 	ConfigDb *db;
 	FLAC__uint32 test = 1;
-	gchar *tmp = NULL;
 
 	is_big_endian_host_ = (*((FLAC__byte*)(&test)))? false : true;
 
--- a/src/m3u/m3u.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/m3u/m3u.c	Thu Jun 21 17:33:00 2007 +0900
@@ -37,6 +37,7 @@
 #include "audacious/playlist.h"
 #include "audacious/playlist_container.h"
 #include "audacious/plugin.h"
+#include "audacious/strings.h"
 
 static void
 parse_extm3u_info(const gchar * info, gchar ** title, gint * length)
--- a/src/mms/mms.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/mms/mms.c	Thu Jun 21 17:33:00 2007 +0900
@@ -139,7 +139,7 @@
     }
     else
     {
-        mms_read(NULL, handle->mms, &c, 1);
+        mms_read(NULL, handle->mms, (char *)&c, 1);
         return c;
     }
 
--- a/src/null/null.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/null/null.c	Thu Jun 21 17:33:00 2007 +0900
@@ -144,7 +144,9 @@
 
 static void null_write(void *ptr, int length)
 {
+#if 0
 	EffectPlugin *ep;
+#endif
 	if (timer && !started)
 	{
 		g_timer_start(timer);
--- a/src/pls/pls.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/pls/pls.c	Thu Jun 21 17:33:00 2007 +0900
@@ -37,6 +37,7 @@
 #include "audacious/playlist_container.h"
 #include "audacious/plugin.h"
 #include "audacious/vfs.h"
+#include "audacious/strings.h"
 
 static void
 playlist_load_pls(const gchar * filename, gint pos)
--- a/src/rocklight/sysled.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/rocklight/sysled.c	Thu Jun 21 17:33:00 2007 +0900
@@ -33,6 +33,8 @@
 int sysled_get(int fd) {
 	char buf[256];
 	int ret = read(fd, &buf, sizeof(buf));
+    if(!ret)
+        return 0; //dummy
 
 	return (strtol(buf, NULL, 10) == 255);
 }
--- a/src/stdio/stdio.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/stdio/stdio.c	Thu Jun 21 17:33:00 2007 +0900
@@ -18,6 +18,7 @@
 
 #include <audacious/vfs.h>
 #include <audacious/plugin.h>
+#include "audacious/strings.h"
 #include <stdio.h>
 
 #include <unistd.h>
--- a/src/tta/libtta.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/tta/libtta.c	Thu Jun 21 17:33:00 2007 +0900
@@ -209,7 +209,7 @@
 
 	while (playing)
 	{
-	    while ((read_samples = get_samples (sample_buffer)) > 0)
+	    while ((read_samples = get_samples ((unsigned char *)sample_buffer)) > 0)
 	    {
 
 		while ((playback->output->buffer_free () < bufsize)
@@ -433,13 +433,13 @@
 
 	if (open_tta_file (filename, &ttainfo, 0) >= 0)
 	{
-	    gtk_entry_set_text(GTK_ENTRY(title_entry), ttainfo.ID3.title);
-	    gtk_entry_set_text(GTK_ENTRY(artist_entry), ttainfo.ID3.artist);
-	    gtk_entry_set_text(GTK_ENTRY(album_entry), ttainfo.ID3.album);
-	    gtk_entry_set_text(GTK_ENTRY(year_entry), ttainfo.ID3.year);
-	    gtk_entry_set_text(GTK_ENTRY(tracknum_entry), ttainfo.ID3.track);
-	    gtk_entry_set_text(GTK_ENTRY(comment_entry), ttainfo.ID3.comment);
-	    gtk_entry_set_text(GTK_ENTRY(genre_entry), ttainfo.ID3.genre);
+	    gtk_entry_set_text(GTK_ENTRY(title_entry), (gchar *)ttainfo.ID3.title);
+	    gtk_entry_set_text(GTK_ENTRY(artist_entry), (gchar *)ttainfo.ID3.artist);
+	    gtk_entry_set_text(GTK_ENTRY(album_entry), (gchar *)ttainfo.ID3.album);
+	    gtk_entry_set_text(GTK_ENTRY(year_entry), (gchar *)ttainfo.ID3.year);
+	    gtk_entry_set_text(GTK_ENTRY(tracknum_entry), (gchar *)ttainfo.ID3.track);
+	    gtk_entry_set_text(GTK_ENTRY(comment_entry), (gchar *)ttainfo.ID3.comment);
+	    gtk_entry_set_text(GTK_ENTRY(genre_entry), (gchar *)ttainfo.ID3.genre);
 	}
 	close_tta_file (&ttainfo);
 
@@ -576,26 +576,26 @@
 			tuple->length = ttainfo->LENGTH * 1000;
 
 			if (ttainfo->ID3.id3has) {
-				if(ttainfo->ID3.artist && strlen(ttainfo->ID3.artist))
-					tuple->performer = g_strdup(ttainfo->ID3.artist);
+				if(ttainfo->ID3.artist && strlen((char *)ttainfo->ID3.artist))
+					tuple->performer = g_strdup((gchar *)ttainfo->ID3.artist);
 
-				if(ttainfo->ID3.album && strlen(ttainfo->ID3.album))
-					tuple->album_name = g_strdup(ttainfo->ID3.album);
+				if(ttainfo->ID3.album && strlen((char *)ttainfo->ID3.album))
+					tuple->album_name = g_strdup((gchar *)ttainfo->ID3.album);
 
-				if(ttainfo->ID3.title && strlen(ttainfo->ID3.title))
-					tuple->track_name = g_strdup(ttainfo->ID3.title);
+				if(ttainfo->ID3.title && strlen((char *)ttainfo->ID3.title))
+					tuple->track_name = g_strdup((gchar *)ttainfo->ID3.title);
 
-				if(ttainfo->ID3.year && strlen(ttainfo->ID3.year))
-					tuple->year = atoi(ttainfo->ID3.year);
+				if(ttainfo->ID3.year && strlen((char *)ttainfo->ID3.year))
+					tuple->year = atoi((char *)ttainfo->ID3.year);
 
-				if(ttainfo->ID3.track && strlen(ttainfo->ID3.track))
-					tuple->track_number = atoi(ttainfo->ID3.track);
+				if(ttainfo->ID3.track && strlen((char *)ttainfo->ID3.track))
+					tuple->track_number = atoi((char *)ttainfo->ID3.track);
 
-				if(ttainfo->ID3.genre && strlen(ttainfo->ID3.genre))
-					tuple->genre = g_strdup(ttainfo->ID3.genre);
+				if(ttainfo->ID3.genre && strlen((char *)ttainfo->ID3.genre))
+					tuple->genre = g_strdup((gchar *)ttainfo->ID3.genre);
 
-				if(ttainfo->ID3.comment && strlen(ttainfo->ID3.comment))
-					tuple->comment = g_strdup(ttainfo->ID3.comment);
+				if(ttainfo->ID3.comment && strlen((char *)ttainfo->ID3.comment))
+					tuple->comment = g_strdup((gchar *)ttainfo->ID3.comment);
 			}
 			close_tta_file (ttainfo);
 		}
@@ -758,7 +758,7 @@
     if (!frame)
         return NULL;
 
-    if (frame_name == ID3_FRAME_COMMENT)
+    if (!strcmp(frame_name, ID3_FRAME_COMMENT))
         field = id3_frame_field(frame, 3);
     else
         field = id3_frame_field(frame, 1);
@@ -766,7 +766,7 @@
     if (!field)
         return NULL;
 
-    if (frame_name == ID3_FRAME_COMMENT)
+    if (!strcmp(frame_name, ID3_FRAME_COMMENT))
         string_const = id3_field_getfullstring(field);
     else
         string_const = id3_field_getstrings(field, 0);
@@ -776,7 +776,7 @@
 
     string = tta_ucs4dup((id3_ucs4_t *)string_const);
 
-    if (frame_name == ID3_FRAME_GENRE) {
+    if (!strcmp(frame_name, ID3_FRAME_GENRE)) {
         id3_ucs4_t *string2 = NULL;
         string2 = tta_parse_genre(string);
         g_free((void *)string);
@@ -796,10 +796,10 @@
 #ifdef DEBUG
         g_message("aud-tta: flagutf!\n");
 #endif
-        rtn = id3_ucs4_utf8duplicate(string);
+        rtn = (gchar *)id3_ucs4_utf8duplicate(string);
     }
     else {
-        rtn = id3_ucs4_latin1duplicate(string);
+        rtn = (gchar *)id3_ucs4_latin1duplicate(string);
         rtn2 = str_to_utf8(rtn);
         free(rtn);
         rtn = rtn2;
@@ -830,38 +830,38 @@
 			id3v2_size = tag->paddedsize;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_ARTIST);
-			if(str) strncpy(ttainfo->ID3.artist, str, MAX_LINE);
+			if(str) strncpy((char *)ttainfo->ID3.artist, str, MAX_LINE);
 			free(str);
 			str = NULL;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_ALBUM);
-			if(str) strncpy(ttainfo->ID3.album, str, MAX_LINE);
+			if(str) strncpy((char *)ttainfo->ID3.album, str, MAX_LINE);
 			free(str);
 			str = NULL;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_TITLE);
-			if(str) strncpy(ttainfo->ID3.title, str, MAX_LINE);
+			if(str) strncpy((char *)ttainfo->ID3.title, str, MAX_LINE);
 			free(str);
 			str = NULL;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_YEAR);
 			if(!str) str = tta_input_id3_get_string (tag, "TYER");
-			if(str) strncpy(ttainfo->ID3.year, str, MAX_YEAR);
+			if(str) strncpy((char *)ttainfo->ID3.year, str, MAX_YEAR);
 			free(str);
 			str = NULL;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_TRACK);
-			if(str) strncpy(ttainfo->ID3.track, str, MAX_TRACK);
+			if(str) strncpy((char *)ttainfo->ID3.track, str, MAX_TRACK);
 			free(str);
 			str = NULL;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_GENRE);
-			if(str) strncpy(ttainfo->ID3.genre, str, MAX_GENRE);
+			if(str) strncpy((char *)ttainfo->ID3.genre, str, MAX_GENRE);
 			free(str);
 			str = NULL;
 
 			str = tta_input_id3_get_string (tag, ID3_FRAME_COMMENT);
-			if(str) strncpy(ttainfo->ID3.comment, str, MAX_LINE);
+			if(str) strncpy((char *)ttainfo->ID3.comment, str, MAX_LINE);
 			free(str);
 			str = NULL;
 		}
--- a/src/tta/ttadec.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/tta/ttadec.c	Thu Jun 21 17:33:00 2007 +0900
@@ -530,7 +530,8 @@
 			rice->k0++;
 		}
 
-		value = DEC(value);
+        // DEC is not defined??
+//		value = DEC(value);
 
 		// decompress stage 1: adaptive hybrid filter
 		hybrid_filter(fst, &value);
--- a/src/tta/ttalib.h	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/tta/ttalib.h	Thu Jun 21 17:33:00 2007 +0900
@@ -162,5 +162,7 @@
 
 int get_bitrate (void);		// RETURN VALUE: TTA dynamic bitrate
 
+int get_id3_tags (const char *filename, tta_info *ttainfo);
+
 #endif /* TTALIB_H_ */
 
--- a/src/vorbis/vorbis.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/vorbis/vorbis.c	Thu Jun 21 17:33:00 2007 +0900
@@ -147,7 +147,6 @@
 {
     VFSFile *stream;
     OggVorbis_File vfile;       /* avoid thread interaction */
-    char *ext;
     gint result;
     VFSVorbisFile *fd;
 
@@ -230,7 +229,6 @@
 vorbis_check_fd(char *filename, VFSFile *stream)
 {
     OggVorbis_File vfile;       /* avoid thread interaction */
-    char *ext;
     gint result;
     VFSVorbisFile *fd;
 
--- a/src/wma/libffwma/avio.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/wma/libffwma/avio.c	Thu Jun 21 17:33:00 2007 +0900
@@ -38,8 +38,6 @@
 {
     URLContext *uc;
     URLProtocol *up;
-    const char *p;
-    char proto_str[128], *q;
     int err = 0;
 
     up = first_protocol;
@@ -70,8 +68,6 @@
 {
     URLContext *uc;
     URLProtocol *up;
-    const char *p;
-    char proto_str[128], *q;
     int err;
 
     up = first_protocol;
--- a/src/wma/libffwma/futils.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/wma/libffwma/futils.c	Thu Jun 21 17:33:00 2007 +0900
@@ -1560,7 +1560,7 @@
  */
 void av_close_input_vfsfile(AVFormatContext *s)
 {
-    int i, must_open_file;
+    int i;
     AVStream *st;
 
     /* free previous packet */
--- a/src/wma/wma.c	Wed Jun 20 22:27:48 2007 +0300
+++ b/src/wma/wma.c	Thu Jun 21 17:33:00 2007 +0900
@@ -81,7 +81,6 @@
 static void wma_stop(InputPlayback *data);
 static void wma_seek(InputPlayback *data, int time);
 static void wma_do_pause(InputPlayback *data, short p);
-static int wma_get_time(InputPlayback *data);
 static void wma_get_song_info(char *filename, char **title, int *length);
 static TitleInput *wma_get_song_tuple(char *filename);
 static char *wsong_title;
@@ -235,13 +234,6 @@
     if(wma_pause) playback->output->pause(1);
 }
 
-static int wma_get_time(InputPlayback *playback)
-{
-    playback->output->buffer_free();
-    if(wma_decode) return playback->output->output_time();
-    return -1;
-}
-
 static gchar *extname(const char *filename)
 {
     gchar *ext = strrchr(filename, '.');
@@ -249,12 +241,6 @@
     return ext;
 }
 
-static char* w_getstr(char* str)
-{
-    if(str && strlen(str) > 0) return g_strdup(str);
-    return NULL;
-}
-
 static TitleInput *wma_get_song_tuple(gchar * filename)
 {
     TitleInput *tuple = NULL;