[MPlayer-dev-eng] [PATCH] [REPOST] some minor errors and compiler warnings fixes

Dominik Mierzejewski dominik at rangers.eu.org
Wed Aug 28 02:09:10 CEST 2002


Attached are three patches.

mplayer-nodebug.patch:
	removes -g from CFLAGS
mplayer-warnings.patch:
	fixes missing declarations and #includes, unused variables,
	incompatible types in the rest of the code and also some errors

-- 
MPlayer RPMs maintainer: http://www.piorunek.pl/~dominik/linux/pkgs/mplayer/
"The Universe doesn't give you any points for doing things that are easy."
        -- Sheridan to Garibaldi in Babylon 5:"The Geometry of Shadows"
-------------- next part --------------
--- MPlayer-20020719/libavcodec/Makefile.nodebug	Fri Jul 19 13:03:56 2002
+++ MPlayer-20020719/libavcodec/Makefile	Fri Jul 19 13:07:26 2002
@@ -7,8 +7,8 @@
 VPATH=$(SRC_PATH)/libavcodec
 
 # NOTE: -I.. is needed to include config.h
-CFLAGS= $(OPTFLAGS) -Wall -g -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
-LDFLAGS= -g
+CFLAGS= $(OPTFLAGS) -Wall -DHAVE_AV_CONFIG_H -I.. -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
+LDFLAGS=
 
 OBJS= common.o utils.o mem.o allcodecs.o \
       mpegvideo.o h263.o jrevdct.o jfdctfst.o \
--- MPlayer-20020719/Makefile.nodebug	Fri Jul 19 13:06:51 2002
+++ MPlayer-20020719/Makefile	Fri Jul 19 13:06:51 2002
@@ -220,7 +220,7 @@
 $(MENCODER_DEP): version.h
 
 $(PRG_CFG): version.h codec-cfg.c codec-cfg.h
-	$(CC) $(CFLAGS) -g codec-cfg.c mp_msg.c -o $(PRG_CFG) -DCODECS2HTML
+	$(CC) $(CFLAGS) -Wall codec-cfg.c mp_msg.c -o $(PRG_CFG) -DCODECS2HTML
 
 install: $(ALL_PRG)
 ifeq ($(VIDIX),yes)
-------------- next part --------------
--- MPlayer-20020827/libmpcodecs/native/nuppelvideo.c.warn	Fri May 31 20:16:45 2002
+++ MPlayer-20020827/libmpcodecs/native/nuppelvideo.c	Tue Aug 27 22:52:04 2002
@@ -44,7 +44,7 @@
 		/* tables are in encoded */
 		if (encodedh->comptype == 'R')
 		{
-		    RTjpeg_init_decompress ( encoded+12, width, height );
+		    RTjpeg_init_decompress ( (unsigned long *)(encoded+12), width, height );
 		    mp_msg(MSGT_DECVIDEO, MSGL_V, "Found RTjpeg tables (size: %d, width: %d, height: %d)\n",
 			encoded_size-12, width, height);
 		}
--- MPlayer-20020827/libmpcodecs/vf.c.warn	Sat Aug 24 15:36:12 2002
+++ MPlayer-20020827/libmpcodecs/vf.c	Tue Aug 27 22:52:04 2002
@@ -2,11 +2,11 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "../config.h"
 #ifdef HAVE_MALLOC_H
 #include <malloc.h>
 #endif
 
-#include "../config.h"
 #include "../mp_msg.h"
 #include "../help_mp.h"
 
--- MPlayer-20020827/libmpcodecs/vd_svq1.c.warn	Sun Jun 23 13:34:54 2002
+++ MPlayer-20020827/libmpcodecs/vd_svq1.c	Tue Aug 27 22:52:04 2002
@@ -5,6 +5,9 @@
 #include "mp_msg.h"
 
 #include "vd_internal.h"
+#ifdef USE_LIBAVCODEC
+#include "../libavcodec/avcodec.h"
+#endif
 
 static vd_info_t info = {
 	"SVQ1 (Sorenson v1) Video decoder",
--- MPlayer-20020827/libmpcodecs/ve_divx4.c.warn	Sat Apr 27 19:49:11 2002
+++ MPlayer-20020827/libmpcodecs/ve_divx4.c	Tue Aug 27 22:52:04 2002
@@ -24,6 +24,7 @@
 
 extern int pass;
 extern char* passtmpfile;
+extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
 
 #include <encore2.h>
 
@@ -195,7 +196,7 @@
     vf->put_image=put_image;
     vf->priv=malloc(sizeof(struct vf_priv_s));
     memset(vf->priv,0,sizeof(struct vf_priv_s));
-    vf->priv->mux=args;
+    vf->priv->mux=(aviwrite_stream_t*)args;
 
     mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
--- MPlayer-20020827/libmpcodecs/ve_lavc.c.warn	Mon Aug 26 01:51:24 2002
+++ MPlayer-20020827/libmpcodecs/ve_lavc.c	Tue Aug 27 22:52:04 2002
@@ -26,6 +26,7 @@
 
 extern char* passtmpfile;
 extern int pass;
+extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
 
 //===========================================================================//
 
@@ -445,7 +446,7 @@
     vf->put_image=put_image;
     vf->priv=malloc(sizeof(struct vf_priv_s));
     memset(vf->priv,0,sizeof(struct vf_priv_s));
-    vf->priv->mux=args;
+    vf->priv->mux=(aviwrite_stream_t*)args;
 
     /* XXX: hack: some of the MJPEG decoder DLL's needs exported huffman
        table, so we define a zero-table, also lavc mjpeg encoder is putting
--- MPlayer-20020827/libmpcodecs/ve_libdv.c.warn	Sat Apr 13 21:14:31 2002
+++ MPlayer-20020827/libmpcodecs/ve_libdv.c	Tue Aug 27 22:52:04 2002
@@ -23,6 +23,8 @@
 
 #include <libdv/dv.h>
 
+extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
+
 #ifndef DV_WIDTH
 #define DV_WIDTH       720
 #define DV_PAL_HEIGHT  576
--- MPlayer-20020827/libmpcodecs/vf_pp.c.warn	Sun Aug  4 01:44:08 2002
+++ MPlayer-20020827/libmpcodecs/vf_pp.c	Tue Aug 27 22:52:04 2002
@@ -98,7 +98,7 @@
     IMGFMT_YV12,
     IMGFMT_I420,
     IMGFMT_IYUV,
-    NULL
+    0
 };
 
 static int open(vf_instance_t *vf, char* args){
--- MPlayer-20020827/libmpcodecs/ve_rawrgb.c.warn	Mon Apr 29 13:47:41 2002
+++ MPlayer-20020827/libmpcodecs/ve_rawrgb.c	Tue Aug 27 22:52:04 2002
@@ -16,6 +16,8 @@
 #include "mp_image.h"
 #include "vf.h"
 
+extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
+
 //===========================================================================//
 
 struct vf_priv_s {
@@ -58,7 +60,7 @@
     vf->put_image=put_image;
     vf->priv=malloc(sizeof(struct vf_priv_s));
     memset(vf->priv,0,sizeof(struct vf_priv_s));
-    vf->priv->mux=args;
+    vf->priv->mux=(aviwrite_stream_t*)args;
     
     mux_v->bih=malloc(sizeof(BITMAPINFOHEADER));
     mux_v->bih->biSize=sizeof(BITMAPINFOHEADER);
--- MPlayer-20020827/libmpcodecs/ve_vfw.c.warn	Tue May 28 17:51:22 2002
+++ MPlayer-20020827/libmpcodecs/ve_vfw.c	Tue Aug 27 22:52:04 2002
@@ -18,6 +18,8 @@
 #include "mp_image.h"
 #include "vf.h"
 
+extern void mencoder_write_chunk(aviwrite_stream_t *s,int len,unsigned int flags);
+
 //===========================================================================//
 
 #include "dll_init.h"
@@ -83,7 +85,7 @@
     vf->put_image=put_image;
     vf->priv=malloc(sizeof(struct vf_priv_s));
     memset(vf->priv,0,sizeof(struct vf_priv_s));
-    vf->priv->mux=args;
+    vf->priv->mux=(aviwrite_stream_t*)args;
 
     vfw_bih=malloc(sizeof(BITMAPINFOHEADER));
     vfw_bih->biSize=sizeof(BITMAPINFOHEADER);
--- MPlayer-20020827/libmpcodecs/vd_real.c.warn	Sun Aug 25 22:04:01 2002
+++ MPlayer-20020827/libmpcodecs/vd_real.c	Tue Aug 27 22:52:04 2002
@@ -11,6 +11,9 @@
 
 #include "vd_internal.h"
 
+#include "../loader/ldt_keeper.h"
+#include "../loader/wine/winbase.h"
+
 static vd_info_t info = {
 	"RealVideo decoder",
 	"real",
--- MPlayer-20020827/libmpcodecs/vf_rectangle.c.warn	Sun Aug  4 13:00:54 2002
+++ MPlayer-20020827/libmpcodecs/vf_rectangle.c	Tue Aug 27 22:52:04 2002
@@ -4,6 +4,8 @@
 #include "mp_image.h"
 #include "vf.h"
 
+#include "../libvo/fastmemcpy.h"
+
 struct vf_priv_s {
     int x, y, w, h;
 };
--- MPlayer-20020827/libmpcodecs/ad_a52.c.warn	Mon Apr  1 19:57:51 2002
+++ MPlayer-20020827/libmpcodecs/ad_a52.c	Tue Aug 27 22:52:04 2002
@@ -186,7 +186,7 @@
 		mp_msg(MSGT_DECAUDIO,MSGL_WARN,"a52: error at resampling\n");
 		break;
 	    }
-	    len+=2*a52_resample(a52_samples,&buf[len]);
+	    len+=2*a52_resample(a52_samples,(int16_t *)&buf[len]);
 	}
   return len;
 }
--- MPlayer-20020827/libmpcodecs/vf_lavc.c.warn	Thu Aug 15 15:59:18 2002
+++ MPlayer-20020827/libmpcodecs/vf_lavc.c	Tue Aug 27 22:52:04 2002
@@ -104,7 +104,7 @@
     vf->priv->pes.id=0x1E0;
     vf->priv->pes.timestamp=-1; // dunno
     
-    dmpi->planes[0]=&vf->priv->pes;
+    dmpi->planes[0]=(unsigned char*)&vf->priv->pes;
     
     vf_next_put_image(vf,dmpi);
 }
--- MPlayer-20020827/libmpcodecs/vf_palette.c.warn	Fri Jun 21 22:14:31 2002
+++ MPlayer-20020827/libmpcodecs/vf_palette.c	Tue Aug 27 22:52:04 2002
@@ -81,7 +81,7 @@
 	MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
 	mpi->w, mpi->h);
 
-    if(!mpi->planes[1]) mpi->planes[1]=gray_pal;
+    if(!mpi->planes[1]) mpi->planes[1]=(unsigned char*)gray_pal;
 
     if(mpi->w==mpi->stride[0] && dmpi->w*(dmpi->bpp>>3)==dmpi->stride[0]){
 	// no stride conversion needed
--- MPlayer-20020827/libmpcodecs/vd_ffmpeg.c.warn	Sat Aug 24 15:36:12 2002
+++ MPlayer-20020827/libmpcodecs/vd_ffmpeg.c	Tue Aug 27 22:52:04 2002
@@ -248,7 +248,7 @@
         }
     }else
 #endif
-        mpcodecs_draw_slice (sh,src, stride, width, height, 0, y);
+        mpcodecs_draw_slice (sh,(unsigned char*)src, stride, width, height, 0, y);
 }
 
 static int init_vo(sh_video_t *sh){
--- MPlayer-20020827/libmpdemux/aviprint.c.warn	Mon Apr 29 19:18:35 2002
+++ MPlayer-20020827/libmpdemux/aviprint.c	Tue Aug 27 22:52:04 2002
@@ -61,7 +61,7 @@
   printf("bits/sample: %d\n",h->wBitsPerSample);
   printf("cbSize: %d\n",h->cbSize);
   if(h->wFormatTag==0x55 && h->cbSize>=12){
-      MPEGLAYER3WAVEFORMAT* h2=h;
+      MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h;
       printf("mp3.wID=%d\n",h2->wID);
       printf("mp3.fdwFlags=0x%X\n",h2->fdwFlags);
       printf("mp3.nBlockSize=%d\n",h2->nBlockSize);
--- MPlayer-20020827/loader/dshow/allocator.c.warn	Wed Dec 12 00:29:24 2001
+++ MPlayer-20020827/loader/dshow/allocator.c	Tue Aug 27 22:52:04 2002
@@ -204,7 +204,7 @@
 					      /* [out] */ IMediaSample **ppBuffer,
 					      /* [in] */ REFERENCE_TIME *pStartTime,
 					      /* [in] */ REFERENCE_TIME *pEndTime,
-					      /* [in] */ DWORD dwFlags)
+					      /* [in] */ unsigned long dwFlags)
 {
     MemAllocator* me = (MemAllocator*)This;
     CMediaSample* sample;
--- MPlayer-20020827/loader/dshow/DS_Filter.c.warn	Thu Jul 25 22:59:18 2002
+++ MPlayer-20020827/loader/dshow/DS_Filter.c	Tue Aug 27 22:52:04 2002
@@ -113,7 +113,7 @@
 	struct IUnknown* object = NULL;
 	IEnumPins* enum_pins = 0;
 	IPin* array[256];
-	ULONG fetched;
+	unsigned long fetched;
         unsigned int i;
 
 	This->m_iHandle = LoadLibraryA(dllname);
--- MPlayer-20020827/loader/dshow/outputpin.c.warn	Wed Dec 12 00:29:24 2001
+++ MPlayer-20020827/loader/dshow/outputpin.c	Tue Aug 27 22:52:04 2002
@@ -26,9 +26,9 @@
 
 
 static HRESULT STDCALL CEnumMediaTypes_Next(IEnumMediaTypes * This,
-					    /* [in] */ ULONG cMediaTypes,
+					    /* [in] */ unsigned long cMediaTypes,
 					    /* [size_is][out] */ AM_MEDIA_TYPE **ppMediaTypes,
-					    /* [out] */ ULONG *pcFetched)
+					    /* [out] */ unsigned long *pcFetched)
 {
     AM_MEDIA_TYPE* type = &((CEnumMediaTypes*)This)->type;
     Debug printf("CEnumMediaTypes::Next(%p) called\n", This);
@@ -56,7 +56,7 @@
 
 /* I expect that these methods are unused. */
 static HRESULT STDCALL CEnumMediaTypes_Skip(IEnumMediaTypes * This,
-					    /* [in] */ ULONG cMediaTypes)
+					    /* [in] */ unsigned long cMediaTypes)
 {
     Debug unimplemented("CEnumMediaTypes::Skip", This);
     return E_NOTIMPL;
@@ -254,7 +254,7 @@
 
 static HRESULT STDCALL COutputPin_QueryInternalConnections(IPin * This,
 						     /* [out] */ IPin **apPin,
-						     /* [out][in] */ ULONG *nPin)
+						     /* [out][in] */ unsigned long *nPin)
 {
     Debug unimplemented("COutputPin_QueryInternalConnections", This);
     return E_NOTIMPL;
--- MPlayer-20020827/loader/win32.c.warn	Fri Jun 14 14:14:51 2002
+++ MPlayer-20020827/loader/win32.c	Tue Aug 27 23:04:04 2002
@@ -4201,7 +4201,7 @@
 
     /* ok, this is a hack, and a big memory leak. should be fixed. - alex */
     {
-	HMODULE *hand;
+	HMODULE hand;
 	WINE_MODREF *wm;
 	void *func;
 
--- MPlayer-20020827/vidix/drivers/mga_vid.c.warn	Sun Aug  4 01:44:09 2002
+++ MPlayer-20020827/vidix/drivers/mga_vid.c	Tue Aug 27 22:52:04 2002
@@ -87,7 +87,7 @@
 
 /* mapped physical addresses */
 static uint8_t *mga_mmio_base = 0;
-static uint32_t mga_mem_base = 0; 
+static uint32_t *mga_mem_base = 0; 
 
 static int mga_src_base = 0; /* YUV buffer position in video memory */
 
@@ -685,7 +685,7 @@
 
 int vixConfigPlayback(vidix_playback_t *config)
 {
-	int i;
+	unsigned int i;
 	int x, y, sw, sh, dw, dh;
 	int besleft, bestop, ifactor, ofsleft, ofstop, baseadrofs, weight, weights;
 #ifdef CRTC2
@@ -1179,7 +1179,7 @@
 
 	is_g400 = -1;
 
-	err = pci_scan(&lst, &num_pci);
+	err = pci_scan(lst, &num_pci);
 	if (err)
 	{
 	    printf("[mga] Error occured during pci scan: %s\n", strerror(err));
--- MPlayer-20020827/libavcodec/i386/mpegvideo_mmx.c.warn	Tue May 28 17:43:12 2002
+++ MPlayer-20020827/libavcodec/i386/mpegvideo_mmx.c	Tue Aug 27 22:52:04 2002
@@ -195,7 +195,7 @@
     const UINT16 *quant_matrix;
     
     if(s->alternate_scan) nCoeffs= 64;
-    else nCoeffs= nCoeffs= zigzag_end[ s->block_last_index[n] ];
+    else nCoeffs= zigzag_end[ s->block_last_index[n] ];
 
     if (s->mb_intra) {
         int block0;
@@ -321,7 +321,7 @@
     const UINT16 *quant_matrix;
     
     if(s->alternate_scan) nCoeffs= 64;
-    else nCoeffs= nCoeffs= zigzag_end[ s->block_last_index[n] ];
+    else nCoeffs= zigzag_end[ s->block_last_index[n] ];
 
     if (s->mb_intra) {
         int block0;
--- MPlayer-20020827/libavcodec/h263.c.warn	Tue Aug 27 22:49:02 2002
+++ MPlayer-20020827/libavcodec/h263.c	Tue Aug 27 22:52:04 2002
@@ -3778,13 +3778,13 @@
             s->scalability= get_bits1(&s->gb);
             if(s->workaround_bugs==1) s->scalability=0;
             if (s->scalability) {
-                int dummy= s->hierachy_type= get_bits1(&s->gb);
+                /*int dummy= s->hierachy_type= get_bits1(&s->gb);
                 int ref_layer_id= get_bits(&s->gb, 4);
                 int ref_layer_sampling_dir= get_bits1(&s->gb);
                 int h_sampling_factor_n= get_bits(&s->gb, 5);
                 int h_sampling_factor_m= get_bits(&s->gb, 5);
                 int v_sampling_factor_n= get_bits(&s->gb, 5);
-                int v_sampling_factor_m= get_bits(&s->gb, 5);
+                int v_sampling_factor_m= get_bits(&s->gb, 5);*/
                 s->enhancement_type= get_bits1(&s->gb);
                 // bin shape stuff FIXME
                 printf("scalability not supported\n");
--- MPlayer-20020827/libavcodec/motion_est.c.warn	Mon Aug 26 01:54:55 2002
+++ MPlayer-20020827/libavcodec/motion_est.c	Tue Aug 27 22:52:04 2002
@@ -1399,7 +1399,7 @@
     int mx, my, mx2, my2;
     uint8_t *ref_picture= s->me_scratchpad - (mb_x - 1 + (mb_y - 1)*s->linesize)*16;
     int16_t (*mv_table)[2]= s->b_direct_mv_table;
-    uint16_t *mv_penalty= s->mv_penalty[s->f_code] + MAX_MV; // f_code of the prev frame
+/*    uint16_t *mv_penalty= s->mv_penalty[s->f_code] + MAX_MV; */ // f_code of the prev frame
 
     /* thanks to iso-mpeg the rounding is different for the zero vector, so we need to handle that ... */
     motion_fx= (motion_px*time_pb)/time_pp;
--- MPlayer-20020827/libavcodec/mpeg12.c.warn	Tue Aug 27 01:33:00 2002
+++ MPlayer-20020827/libavcodec/mpeg12.c	Tue Aug 27 22:52:04 2002
@@ -62,7 +62,7 @@
 
 static void init_2d_vlc_rl(RLTable *rl)
 {
-    int i, q;
+    int i/*, q*/;
     
     init_vlc(&rl->vlc, TEX_VLC_BITS, rl->n + 2, 
              &rl->table_vlc[0][1], 4, 2,
--- MPlayer-20020827/libavcodec/ratecontrol.c.warn	Tue Aug 27 01:33:00 2002
+++ MPlayer-20020827/libavcodec/ratecontrol.c	Tue Aug 27 22:52:04 2002
@@ -279,7 +279,7 @@
         "avgTex",
         NULL
     };
-    double (*func1[])(void *, double)={
+    static double (*func1[])(void *, double)={
         bits2qp,
         qp2bits,
         NULL
--- MPlayer-20020827/dll_init.c.warn	Sun Jun 23 22:55:58 2002
+++ MPlayer-20020827/dll_init.c	Tue Aug 27 22:52:04 2002
@@ -542,7 +542,7 @@
 
   ret = ICCompressGetFormat(encoder_hic, input_bih, output_bih);
   if(ret < 0){
-    unsigned char* temp=output_bih;
+    unsigned char* temp=(unsigned char*)output_bih;
     mp_msg(MSGT_WIN32,MSGL_ERR,"ICCompressGetFormat failed: Error %d  (0x%X)\n", (int)ret, (int)ret);
     for (i=0; i < temp_len; i++) mp_msg(MSGT_WIN32, MSGL_DBG2, "%02x ", temp[i]);
     return 0;
@@ -551,7 +551,7 @@
   
   if (temp_len > sizeof(BITMAPINFOHEADER))
   {
-    unsigned char* temp=output_bih;
+    unsigned char* temp=(unsigned char*)output_bih;
     mp_msg(MSGT_WIN32, MSGL_V, "Extra info in o_bih (%d bytes)!\n",
 	temp_len-sizeof(BITMAPINFOHEADER));
     for(i=sizeof(output_bih);i<temp_len;i++) mp_msg(MSGT_WIN32, MSGL_DBG2, "%02X ",temp[i]);


More information about the MPlayer-dev-eng mailing list