changeset 1718:44c3711dd049 trunk

[svn] Fixed a LOT of warnings showing up with -Wall. This is the first step towards making Audacious compile with -Wall -Werror, but it's still far from beeing finished. PS: *sigh* I even had to patch C++ (therefore ugly) files!
author js
date Sat, 16 Sep 2006 17:17:22 -0700
parents 837983bac90f
children ac675d98a2c5
files ChangeLog Plugins/Input/aac/src/libmp4.c Plugins/Input/console/Audacious_Config.cxx Plugins/Input/console/Dual_Resampler.cxx Plugins/Input/console/Fir_Resampler.cxx Plugins/Input/console/Gb_Apu.cxx Plugins/Input/console/Gb_Cpu.h Plugins/Input/console/Nes_Cpu.h Plugins/Input/console/Nsfe_Emu.cxx Plugins/Input/console/Nsfe_Emu.h Plugins/Input/cue/cuesheet.c Plugins/Input/wma/libffwma/avio.c Plugins/Input/wma/libffwma/futils.c
diffstat 13 files changed, 40 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 16 16:26:54 2006 -0700
+++ b/ChangeLog	Sat Sep 16 17:17:22 2006 -0700
@@ -1,3 +1,18 @@
+2006-09-16 23:26:54 +0000  Jonathan Schleifer <js@h3c.de>
+  revision [2371]
+  Fixed a lot of warnings that only showed up on *BSD.
+
+  Changes:        Modified:
+  +4 -4           trunk/Plugins/General/scrobbler/fmt.c  
+  +1 -1           trunk/Plugins/General/scrobbler/xmms_scrobbler.c  
+  +5 -2           trunk/Plugins/Input/wma/libffwma/mms.c  
+  +1 -1           trunk/Plugins/Visualization/paranormal/pn/pnbooleanoption.c  
+  +5 -4           trunk/Plugins/Visualization/paranormal/pn/pnscriptparser.y  
+  +2 -1           trunk/audacious/getopt.c  
+  +1 -1           trunk/audacious/util.c  
+  +1 -1           trunk/audacious/widgets/textbox.c  
+
+
 2006-09-16 22:21:56 +0000  Tony Vroon <chainsaw@gentoo.org>
   revision [2369]
   Our code is clean enough to not need -Wno-strict-aliasing, with the exception of playlist_list.c (so set that flag for widgets dir only).
--- a/Plugins/Input/aac/src/libmp4.c	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/aac/src/libmp4.c	Sat Sep 16 17:17:22 2006 -0700
@@ -242,7 +242,7 @@
 		gint numSamples = mp4ff_num_samples(mp4file, mp4track);
 		guint framesize = 1024;
 		gulong samplerate;
-		gchar channels;
+		guchar channels;
 		gint msDuration;
 		mp4AudioSpecificConfig mp4ASC;
 		gchar *tmpval;
--- a/Plugins/Input/console/Audacious_Config.cxx	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Audacious_Config.cxx	Sat Sep 16 17:17:22 2006 -0700
@@ -108,7 +108,7 @@
 	GtkWidget *configwin_gen_playback_deflen_hbox, *configwin_gen_playback_deflen_spbt;
 	GtkWidget *configwin_nsf_nsfeoptpl_cbt;
 	GtkWidget *configwin_spc_ignorespclen_cbt;
-	GtkWidget *hseparator, *hbuttonbox, *button_ok, *button_cancel;
+	GtkWidget /* *hseparator, */ *hbuttonbox, *button_ok, *button_cancel;
 	GtkWidget *configwin_notebook;
 	GtkTooltips *tips;
 
--- a/Plugins/Input/console/Dual_Resampler.cxx	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Dual_Resampler.cxx	Sat Sep 16 17:17:22 2006 -0700
@@ -19,7 +19,7 @@
 
 #include BLARGG_SOURCE_BEGIN
 
-int const resampler_extra = 256;
+const unsigned resampler_extra = 256;
 
 Dual_Resampler::Dual_Resampler()
 {
--- a/Plugins/Input/console/Fir_Resampler.cxx	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Fir_Resampler.cxx	Sat Sep 16 17:17:22 2006 -0700
@@ -80,10 +80,12 @@
 	}
 }
 
+/*
 static double plain_sinc( double a )
 {
 	return fabs( a ) < 0.00001 ? 1.0 : sin( a ) / a;
 }
+*/
 
 // Fir_Resampler
 
--- a/Plugins/Input/console/Gb_Apu.cxx	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Gb_Apu.cxx	Sat Sep 16 17:17:22 2006 -0700
@@ -18,8 +18,8 @@
 
 #include BLARGG_SOURCE_BEGIN
 
-int const vol_reg    = 0xFF24;
-int const status_reg = 0xFF26;
+const unsigned vol_reg    = 0xFF24;
+const unsigned status_reg = 0xFF26;
 
 Gb_Apu::Gb_Apu()
 {
--- a/Plugins/Input/console/Gb_Cpu.h	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Gb_Cpu.h	Sat Sep 16 17:17:22 2006 -0700
@@ -51,7 +51,7 @@
 	
 	// Game Boy Z80 registers. *Not* kept updated during a call to run().
 	struct registers_t {
-		long pc; // more than 16 bits to allow overflow detection
+		gb_addr_t pc; // more than 16 bits to allow overflow detection
 		BOOST::uint16_t sp;
 		uint8_t flags;
 		uint8_t a;
--- a/Plugins/Input/console/Nes_Cpu.h	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Nes_Cpu.h	Sat Sep 16 17:17:22 2006 -0700
@@ -55,7 +55,7 @@
 	
 	// NES 6502 registers. *Not* kept updated during a call to run().
 	struct registers_t {
-		long pc; // more than 16 bits to allow overflow detection
+		nes_addr_t pc; // more than 16 bits to allow overflow detection
 		BOOST::uint8_t a;
 		BOOST::uint8_t x;
 		BOOST::uint8_t y;
--- a/Plugins/Input/console/Nsfe_Emu.cxx	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Nsfe_Emu.cxx	Sat Sep 16 17:17:22 2006 -0700
@@ -47,7 +47,7 @@
 	Nsf_Emu::start_track( remap_track( i ) );
 }
 
-const char* Nsfe_Info::track_name( int i ) const
+const char* Nsfe_Info::track_name( unsigned i ) const
 {
 	i = remap_track( i );
 	if ( i < track_names.size() )
@@ -56,7 +56,7 @@
 	return "";
 }
 
-long Nsfe_Info::track_time( int i ) const
+long Nsfe_Info::track_time( unsigned i ) const
 {
 	i = remap_track( i );
 	if ( i < track_times.size() )
@@ -205,7 +205,7 @@
 			
 			case NSFE_TAG('t','i','m','e'): {
 				track_times.resize( size / 4 );
-				for ( int i = 0; i < track_times.size(); i++ )
+				for ( unsigned i = 0; i < track_times.size(); i++ )
 					BLARGG_RETURN_ERR( read_le32( in, &track_times [i] ) );
 				break;
 			}
--- a/Plugins/Input/console/Nsfe_Emu.h	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/console/Nsfe_Emu.h	Sat Sep 16 17:17:22 2006 -0700
@@ -43,10 +43,10 @@
 	// All track indicies are 0-based
 	
 	// Name of track [i], or "" if none available
-	const char* track_name( int i ) const;
+	const char* track_name( unsigned i ) const;
 	
 	// Duration of track [i] in milliseconds, negative if endless, or 0 if none available
-	long track_time( int i ) const;
+	long track_time( unsigned i ) const;
 	
 	// Optional playlist consisting of track indicies
 	int playlist_size() const { return playlist.size(); }
--- a/Plugins/Input/cue/cuesheet.c	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/cue/cuesheet.c	Sat Sep 16 17:17:22 2006 -0700
@@ -347,14 +347,14 @@
 		if (vfs_fgets(line, MAX_CUE_LINE_LENGTH+1, file) == NULL)
 			return;
 
-		for (p = 0; line[p] && isspace(line[p]); p++);
+		for (p = 0; line[p] && isspace((int) line[p]); p++);
 		if (!line[p])
 			continue;
-		for (q = p; line[q] && !isspace(line[q]); q++);
+		for (q = p; line[q] && !isspace((int) line[q]); q++);
 		if (!line[q])
 			continue;
 		line[q] = '\0';
-		for (q++; line[q] && isspace(line[q]); q++);
+		for (q++; line[q] && isspace((int) line[q]); q++);
 
 		if (strcasecmp(line+p, "PERFORMER") == 0) {
 			fix_cue_argument(line+q);
@@ -394,7 +394,7 @@
 			gint track;
 
 			fix_cue_argument(line+q);
-			for (p = q; line[p] && isdigit(line[p]); p++);
+			for (p = q; line[p] && isdigit((int) line[p]); p++);
 			line[p] = '\0';
 			for (; line[q] && line[q] == '0'; q++);
 			if (!line[q])
@@ -408,11 +408,11 @@
 			cue_tracks[last_cue_track-1].title = NULL;
 		}
 		else if (strcasecmp(line+p, "INDEX") == 0) {
-			for (p = q; line[p] && !isspace(line[p]); p++);
+			for (p = q; line[p] && !isspace((int) line[p]); p++);
 			if (!line[p])
 				continue;
-			for (p++; line[p] && isspace(line[p]); p++);
-			for (q = p; line[q] && !isspace(line[q]); q++);
+			for (p++; line[p] && isspace((int) line[p]); p++);
+			for (q = p; line[q] && !isspace((int) line[q]); q++);
 			if (q-p >= 8 && line[p+2] == ':' && line[p+5] == ':') {
 				cue_tracks[last_cue_track-1].index =
 						((line[p+0]-'0')*10 + (line[p+1]-'0')) * 60000 +
--- a/Plugins/Input/wma/libffwma/avio.c	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/wma/libffwma/avio.c	Sat Sep 16 17:17:22 2006 -0700
@@ -46,7 +46,7 @@
     q = proto_str;
     while (*p != '\0' && *p != ':') {
         /* protocols can only contain alphabetic chars */
-        if (!isalpha(*p))
+        if (!isalpha((int) *p))
             goto file_proto;
         if ((size_t)(q - proto_str) < sizeof(proto_str) - 1)
             *q++ = *p;
--- a/Plugins/Input/wma/libffwma/futils.c	Sat Sep 16 16:26:54 2006 -0700
+++ b/Plugins/Input/wma/libffwma/futils.c	Sat Sep 16 17:17:22 2006 -0700
@@ -1865,7 +1865,7 @@
         int val, n;
         q++;
         for (val = 0, n = 100000; n >= 1; n /= 10, q++) {
-            if (!isdigit(*q)) 
+            if (!isdigit((int) *q)) 
                 break;
             val += n * (*q - '0');
         }
@@ -1935,11 +1935,11 @@
         if (c == '%') {
             do {
                 nd = 0;
-                while (isdigit(*p)) {
+                while (isdigit((int) *p)) {
                     nd = nd * 10 + *p++ - '0';
                 }
                 c = *p++;
-            } while (isdigit(c));
+            } while (isdigit((int) c));
 
             switch(c) {
             case '%':