[MPlayer-dev-eng] [PATCH] misc small fixes (mostly gcc warnings)

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Sat Nov 12 17:01:45 CET 2005


On Thursday, 10 November 2005 at 18:24, Rich Felker wrote:
> On Thu, Nov 10, 2005 at 05:53:24PM +0100, Dominik 'Rathann' Mierzejewski wrote:
> > > > 21. sysdep/pci_linux.c:93: warning: implicit declaration of function 'iopl'
> > > > 
> > > > Gabu said including <sys/perm.h> broke compilation on his libc5 system, but...
> > > 
> > > Let's try not to break libc5 systems unnecessarily...
> > 
> > Maybe so, but using undeclared function calls is not good either.
> 
> Then declare it yourself...

Updated patch attached.

R.

-- 
MPlayer RPMs maintainer: http://rpm.greysector.net/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"
-------------- next part --------------
--- MPlayer-20051109/libao2/ao_alsa.c.warn	2005-09-04 22:36:27.000000000 +0200
+++ MPlayer-20051109/libao2/ao_alsa.c	2005-11-12 16:57:41.000000000 +0100
@@ -112,7 +112,7 @@
 	 char *test_mix_index;
 
 	 mix_name = strdup(mixer_channel);
-	 if (test_mix_index = strchr(mix_name, ',')){
+	 if ((test_mix_index = strchr(mix_name, ','))){
 		*test_mix_index = 0;
 		test_mix_index++;
 		mix_index = strtol(test_mix_index, &test_mix_index, 0);
--- MPlayer-20051109/libdha/sysdep/pci_linux.c.warn	2004-07-09 21:22:28.000000000 +0200
+++ MPlayer-20051109/libdha/sysdep/pci_linux.c	2005-11-12 16:59:44.000000000 +0100
@@ -5,7 +5,8 @@
 */
 #include <errno.h>
 #ifdef __i386__
-// is this needed? #include <sys/perm.h>
+//#include <sys/perm.h> doesn't exist on libc5 systems, declare extern instead
+extern int iopl(int level);
 #else
 #if !defined(__sparc__) && !defined(__powerpc__) && !defined(__x86_64__)
 #include <sys/io.h>
--- MPlayer-20051109/libmpcodecs/vf_phase.c.warn	2004-09-03 03:42:04.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/vf_phase.c	2005-11-12 16:57:41.000000000 +0100
@@ -59,7 +59,7 @@
  * (the result is actually multiplied by 25)
  */
 
-#define diff(a, as, b, bs) (t=(*a-b[bs]<<2)+a[as<<1]-b[-bs], t*t)
+#define diff(a, as, b, bs) (t=((*a-b[bs])<<2)+a[as<<1]-b[-bs], t*t)
 
 /*
  * Find which field combination has the smallest average squared difference
--- MPlayer-20051109/libmpcodecs/ad_libvorbis.c.warn	2005-08-20 19:40:06.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/ad_libvorbis.c	2005-11-12 16:57:42.000000000 +0100
@@ -116,15 +116,15 @@
     hsizes[i] = length;
   }
 
-  headers[0] = &extradata[offset];
-  headers[1] = &extradata[offset + hsizes[0]];
-  headers[2] = &extradata[offset + hsizes[0] + hsizes[1]];
+  headers[0] = (unsigned int *)&extradata[offset];
+  headers[1] = (unsigned int *)&extradata[offset + hsizes[0]];
+  headers[2] = (unsigned int *)&extradata[offset + hsizes[0] + hsizes[1]];
   hsizes[2] = sh->wf->cbSize - offset - hsizes[0] - hsizes[1];
   mp_msg (MSGT_DEMUX, MSGL_V, "ad_vorbis, header sizes: %d %d %d\n", hsizes[0], hsizes[1], hsizes[2]);
 
   for(i=0; i<3; i++) {
     op.bytes = hsizes[i];
-    op.packet = headers[i];
+    op.packet = (unsigned char *)headers[i];
     op.b_o_s  = (i == 0);
     if(vorbis_synthesis_headerin(&ov->vi,&vc,&op) <0) {
       mp_msg(MSGT_DECAUDIO,MSGL_ERR,"OggVorbis: header n. %d broken! len=%d\n", i, op.bytes);
--- MPlayer-20051109/libmpcodecs/ae_lavc.c.warn	2005-05-17 23:49:48.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/ae_lavc.c	2005-11-12 16:57:42.000000000 +0100
@@ -26,6 +26,9 @@
 extern int  lavc_param_atag;
 extern int  avcodec_inited;
 static int compressed_frame_size = 0;
+#ifdef USE_LIBAVFORMAT
+extern unsigned int codec_get_wav_tag(int id);
+#endif
 
 static int bind_lavc(audio_encoder_t *encoder, muxer_stream_t *mux_a)
 {
--- MPlayer-20051109/libmpcodecs/ad_acm.c.warn	2005-09-04 22:36:28.000000000 +0200
+++ MPlayer-20051109/libmpcodecs/ad_acm.c	2005-11-12 16:57:42.000000000 +0100
@@ -11,6 +11,7 @@
 #include "wineacm.h"
 
 #include "ad_internal.h"
+#include "osdep/timer.h"
 
 static ad_info_t info = 
 {
--- MPlayer-20051109/libmpdemux/realrtsp/rtsp.c.warn	2005-09-04 22:36:29.000000000 +0200
+++ MPlayer-20051109/libmpdemux/realrtsp/rtsp.c	2005-11-12 16:57:42.000000000 +0100
@@ -52,6 +52,7 @@
 #include "../stream.h"
 #include "../demuxer.h"
 #include "rtsp_session.h"
+#include "osdep/timer.h"
 
 /*
 #define LOG
--- MPlayer-20051109/libmpdemux/tv.c.warn	2005-09-22 16:20:49.000000000 +0200
+++ MPlayer-20051109/libmpdemux/tv.c	2005-11-12 16:57:42.000000000 +0100
@@ -603,10 +603,10 @@
     return demuxer;
 }
 
-static int demux_close_tv(demuxer_t *demuxer)
+static void demux_close_tv(demuxer_t *demuxer)
 {
     tvi_handle_t *tvh=(tvi_handle_t*)(demuxer->priv);
-    return(tvh->functions->uninit(tvh->priv));
+    tvh->functions->uninit(tvh->priv);
 }
 
 /* ================== STREAM_TV ===================== */
--- MPlayer-20051109/libmpdemux/stream_livedotcom.c.warn	2005-10-03 03:10:17.000000000 +0200
+++ MPlayer-20051109/libmpdemux/stream_livedotcom.c	2005-11-12 16:57:42.000000000 +0100
@@ -56,7 +56,7 @@
 }
 
 static int open_live_sdp(stream_t *stream,int mode, void* opts, int* file_format) {
-  FILE *f;
+  int f;
   char *filename = stream->url;
   off_t len;
   char* sdpDescription;
@@ -93,6 +93,7 @@
     *file_format = DEMUXER_TYPE_RTP;
     return STREAM_OK;
   }
+  return STREAM_UNSUPORTED;
 }
 
 
--- MPlayer-20051109/libmpdemux/demux_ty.c.warn	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/demux_ty.c	2005-11-12 16:57:42.000000000 +0100
@@ -1360,7 +1360,7 @@
 }
 
 
-static int demux_close_ty( demuxer_t *demux )
+static void demux_close_ty( demuxer_t *demux )
 {
    TiVoInfo         *tivo = 0;
 
@@ -1371,7 +1371,6 @@
       demux->a_streams[ MAX_A_STREAMS - 1 ] = 0;
 	   sub_justify = 0;
    }
-   return( 0 );
 }
 
 
--- MPlayer-20051109/libmpdemux/demux_film.c.warn	2005-08-06 02:41:22.000000000 +0200
+++ MPlayer-20051109/libmpdemux/demux_film.c	2005-11-12 16:57:42.000000000 +0100
@@ -144,7 +144,7 @@
         memcpy( tmp, buf, film_chunk.chunk_size );
       }
       else {/* for 16bit */
-        unsigned short* tmp = dp->buffer;
+        unsigned short* tmp = (unsigned short *)(dp->buffer);
         unsigned short  buf[film_chunk.chunk_size/2];
         for(i = 0; i < film_chunk.chunk_size/4; i++) {
           buf[i*2] = tmp[i];
--- MPlayer-20051109/libmpdemux/demux_real.c.warn	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/demux_real.c	2005-11-12 16:57:42.000000000 +0100
@@ -1749,7 +1749,7 @@
 }
 
 /* please upload RV10 samples WITH INDEX CHUNK */
-static int demux_seek_real(demuxer_t *demuxer, float rel_seek_secs, int flags)
+static void demux_seek_real(demuxer_t *demuxer, float rel_seek_secs, int flags)
 {
     real_priv_t *priv = demuxer->priv;
     demux_stream_t *d_audio = demuxer->audio;
@@ -1771,7 +1771,7 @@
 //    printf("streams: %d\n", streams);
 
     if (!streams)
-	return 0;
+	return;
 
     if (flags & 1)
 	/* seek absolute */
@@ -1838,7 +1838,6 @@
         stream_seek(demuxer->stream, next_offset);
 
     demux_real_fill_buffer(demuxer, NULL);
-    return 1;
 }
 
 static int demux_real_control(demuxer_t *demuxer, int cmd, void *arg)
--- MPlayer-20051109/libmpdemux/muxer_mpeg.c.warn	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/muxer_mpeg.c	2005-11-12 16:57:42.000000000 +0100
@@ -19,6 +19,8 @@
 #include "stheader.h"
 #include "../m_option.h"
 #include "mpeg_hdr.h"
+#include "mp3_hdr.h"
+#include "liba52/a52.h"
 
 #define PACK_HEADER_START_CODE 0x01ba
 #define SYSTEM_HEADER_START_CODE 0x01bb
--- MPlayer-20051109/libmpdemux/demux_ogg.c.warn	2005-11-06 18:35:33.000000000 +0100
+++ MPlayer-20051109/libmpdemux/demux_ogg.c	2005-11-12 16:57:42.000000000 +0100
@@ -29,6 +29,7 @@
 
 #ifdef HAVE_OGGTHEORA
 #include <theora/theora.h>
+extern int _ilog (unsigned int); /* defined in many places in theora/lib/ */
 #endif
 
 #define BLOCK_SIZE 4096
--- MPlayer-20051109/libmpdemux/demux_pva.c.warn	2005-08-06 02:41:23.000000000 +0200
+++ MPlayer-20051109/libmpdemux/demux_pva.c	2005-11-12 16:57:42.000000000 +0100
@@ -466,7 +466,7 @@
 	return 1;
 }
 
-static int demux_seek_pva(demuxer_t * demuxer,float rel_seek_secs,int flags)
+static void demux_seek_pva(demuxer_t * demuxer,float rel_seek_secs,int flags)
 {
 	int total_bitrate=0;
 	off_t dest_offset;
@@ -490,7 +490,7 @@
 	if(!pva_sync(demuxer))
 	{
 		mp_msg(MSGT_DEMUX,MSGL_V,"demux_pva: Couldn't seek!\n");
-		return 0;
+		return;
 	}
 	
 	/*
@@ -501,8 +501,6 @@
 	
 	priv->last_video_pts=-1;
 	priv->last_audio_pts=-1;
-	
-	return 1;
 }
 
 
--- MPlayer-20051109/libmpdemux/pnm.c.warn	2005-09-04 22:36:28.000000000 +0200
+++ MPlayer-20051109/libmpdemux/pnm.c	2005-11-12 16:57:42.000000000 +0100
@@ -47,6 +47,7 @@
 #include "stream.h"
 #include "demuxer.h"
 #include "help_mp.h"
+#include "osdep/timer.h"
 
 #include "pnm.h"
 //#include "libreal/rmff.h"
--- MPlayer-20051109/libvo/sub.h.warn	2004-11-01 15:47:55.000000000 +0100
+++ MPlayer-20051109/libvo/sub.h	2005-11-12 16:57:42.000000000 +0100
@@ -117,6 +117,7 @@
 int vo_update_osd(int dxs,int dys);
 int vo_osd_changed(int new_value);
 int vo_osd_check_range_update(int,int,int,int);
+void free_osd_list();
 
 extern int vo_osd_changed_flag;
 
--- MPlayer-20051109/libvo/fastmemcpy.h.warn	2005-04-10 19:11:47.000000000 +0200
+++ MPlayer-20051109/libvo/fastmemcpy.h	2005-11-12 16:57:42.000000000 +0100
@@ -20,7 +20,7 @@
 #define mem2agpcpy(a,b,c) memcpy(a,b,c)
 #endif
 
-static inline void * mem2agpcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride)
+static inline void * mem2agpcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride)
 {
 	int i;
 	void *retval=dst;
@@ -48,7 +48,7 @@
 	return retval;
 }
 
-static inline void * memcpy_pic(void * dst, void * src, int bytesPerLine, int height, int dstStride, int srcStride)
+static inline void * memcpy_pic(void * dst, const void * src, int bytesPerLine, int height, int dstStride, int srcStride)
 {
 	int i;
 	void *retval=dst;
--- MPlayer-20051109/libfaad2/ps_dec.c.warn	2005-02-28 01:17:11.000000000 +0100
+++ MPlayer-20051109/libfaad2/ps_dec.c	2005-11-12 16:57:42.000000000 +0100
@@ -1935,8 +1935,8 @@
 /* main Parametric Stereo decoding function */
 uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
 {
-    qmf_t X_hybrid_left[32][32] = {{0}};
-    qmf_t X_hybrid_right[32][32] = {{0}};
+    qmf_t X_hybrid_left[32][32] = {{{0}}};
+    qmf_t X_hybrid_right[32][32] = {{{0}}};
 
     /* delta decoding of the bitstream data */
     ps_data_decode(ps);
--- MPlayer-20051109/libfaad2/sbr_dec.c.warn	2005-02-28 01:17:11.000000000 +0100
+++ MPlayer-20051109/libfaad2/sbr_dec.c	2005-11-12 16:57:42.000000000 +0100
@@ -527,8 +527,8 @@
     uint8_t l, k;
     uint8_t dont_process = 0;
     uint8_t ret = 0;
-    ALIGN qmf_t X_left[38][64] = {{0}};
-    ALIGN qmf_t X_right[38][64] = {{0}}; /* must set this to 0 */
+    ALIGN qmf_t X_left[38][64] = {{{0}}};
+    ALIGN qmf_t X_right[38][64] = {{{0}}}; /* must set this to 0 */
 
     if (sbr == NULL)
         return 20;
--- MPlayer-20051109/mplayer.c.warn	2005-11-09 01:05:33.000000000 +0100
+++ MPlayer-20051109/mplayer.c	2005-11-12 16:57:42.000000000 +0100
@@ -114,6 +114,7 @@
 #ifdef HAS_DVBIN_SUPPORT
 #include "libmpdemux/dvbin.h"
 static int last_dvb_step = 1;
+extern void cache_uninit(stream_t *s);
 #endif
 
 //**************************************************************************//
@@ -186,6 +187,7 @@
 #include "libmpcodecs/dec_video.h"
 #include "libmpcodecs/mp_image.h"
 #include "libmpcodecs/vf.h"
+#include "libmpcodecs/vd.h"
 
 extern void vf_list_plugins();
 


More information about the MPlayer-dev-eng mailing list