[MPlayer-dev-eng] [PATCH] remove some unused variables

timwoj at ieee.org timwoj at ieee.org
Mon May 28 04:27:53 CEST 2007


I ran a build the other day with -Wall.  This patch removes most of the 
unused variables that gcc copmlained about.

Tim
-------------- next part --------------
Index: libmpcodecs/vd_ffmpeg.c
===================================================================
--- libmpcodecs/vd_ffmpeg.c	(revision 23396)
+++ libmpcodecs/vd_ffmpeg.c	(working copy)
@@ -735,7 +735,6 @@
     AVCodecContext *avctx = ctx->avctx;
     mp_image_t* mpi=NULL;
     int dr1= ctx->do_dr1;
-    unsigned char *buf = NULL;
 
     if(len<=0) return NULL; // skipped frame
 
Index: libmpcodecs/ad_realaud.c
===================================================================
--- libmpcodecs/ad_realaud.c	(revision 23396)
+++ libmpcodecs/ad_realaud.c	(working copy)
@@ -202,8 +202,6 @@
   // let's check if the driver is available, return 0 if not.
   // (you should do that if you use external lib(s) which is optional)
   unsigned int result;
-  int len=0;
-  void* prop;
   char *path;
 
   path = malloc(strlen(REALCODEC_PATH)+strlen(sh->codec->dll)+2);
Index: libmpcodecs/vf_yadif.c
===================================================================
--- libmpcodecs/vf_yadif.c	(revision 23396)
+++ libmpcodecs/vf_yadif.c	(working copy)
@@ -347,7 +347,7 @@
 }
 
 static void filter(struct vf_priv_s *p, uint8_t *dst[3], int dst_stride[3], int width, int height, int parity, int tff){
-    int x, y, i;
+    int y, i;
 
     for(i=0; i<3; i++){
         int is_chroma= !!i;
Index: libmpcodecs/ad_hwmpa.c
===================================================================
--- libmpcodecs/ad_hwmpa.c	(revision 23396)
+++ libmpcodecs/ad_hwmpa.c	(working copy)
@@ -28,7 +28,7 @@
 
 static int mpa_sync(sh_audio_t *sh, int no_frames, int *n, int *chans, int *srate, int *spf, int *mpa_layer, int *br)
 {
-	int cnt = 0, x = 0, len, frames_count;
+	int cnt = 0, x = 0, len = 0, frames_count;
 
 	frames_count = 0;
 	do
@@ -122,7 +122,7 @@
 
 static int control(sh_audio_t *sh,int cmd,void* arg, ...)
 {
-	int start, len;
+	int start, len = 0;
 
 	switch(cmd)
 	{
Index: stream/stream_dvd.c
===================================================================
--- stream/stream_dvd.c	(revision 23396)
+++ stream/stream_dvd.c	(working copy)
@@ -652,7 +652,7 @@
 static int dvd_seek_to_time(stream_t *stream, ifo_handle_t *vts_file, double sec)
 {
     unsigned int i, j, k, timeunit, ac_time, tmap_sector=0, cell_sector=0, vobu_sector=0;
-    int t=0, t2=0;
+    int t=0;
     double tm, duration;
     off_t pos = -1;
     dvd_priv_t *d = stream->priv;
Index: stream/vcd_read_darwin.h
===================================================================
--- stream/vcd_read_darwin.h	(revision 23396)
+++ stream/vcd_read_darwin.h	(working copy)
@@ -45,7 +45,6 @@
 
 int vcd_seek_to_track(mp_vcd_priv_t* vcd, int track)
 {
-	dk_cd_read_track_info_t tocentry;
 	struct CDTrackInfo entry;
 
 	memset( &vcd->entry, 0, sizeof(vcd->entry));
@@ -69,7 +68,6 @@
 	dk_cd_read_disc_info_t tochdr;
 	struct CDDiscInfo hdr;
 	
-	dk_cd_read_track_info_t tocentry;
 	struct CDTrackInfo entry;
 	
 	//read toc header
Index: libfaad2/sbr_hfadj.c
===================================================================
--- libfaad2/sbr_hfadj.c	(revision 23396)
+++ libfaad2/sbr_hfadj.c	(working copy)
@@ -1170,7 +1170,6 @@
             real_t den = 0;
             real_t acc1 = 0;
             real_t acc2 = 0;
-            uint8_t current_res_band_size = 0;
 
             uint8_t ml1, ml2;
 
Index: libao2/ao_macosx.c
===================================================================
--- libao2/ao_macosx.c	(revision 23396)
+++ libao2/ao_macosx.c	(working copy)
@@ -173,7 +173,7 @@
 static int control(int cmd,void *arg){
 ao_control_vol_t *control_vol;
 OSStatus err;
-Float32 pan, vol;
+Float32 vol;
 	switch (cmd) {
 	case AOCONTROL_GET_VOLUME:
 		control_vol = (ao_control_vol_t*)arg;
@@ -237,7 +237,7 @@
 
 static int init(int rate,int channels,int format,int flags)
 {
-AudioStreamBasicDescription inDesc, outDesc;
+AudioStreamBasicDescription inDesc;
 ComponentDescription desc; 
 Component comp; 
 AURenderCallbackStruct renderCallback;
@@ -402,8 +402,6 @@
 /* unload plugin and deregister from coreaudio */
 static void uninit(int immed)
 {
-  int i;
-  OSErr status;
 
   if (!immed) {
     long long timeleft=(1000000LL*buf_used())/ao_data.bps;
Index: libvo/vo_macosx.m
===================================================================
--- libvo/vo_macosx.m	(revision 23396)
+++ libvo/vo_macosx.m	(working copy)
@@ -95,7 +95,6 @@
 
 static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
 {
-	int i;
 	
 	//init screen
 	screen_array = [NSScreen screens];
Index: libvo/vo_quartz.c
===================================================================
--- libvo/vo_quartz.c	(revision 23396)
+++ libvo/vo_quartz.c	(working copy)
@@ -99,7 +99,6 @@
 static GDHandle deviceHdl;
 
 static CGDataProviderRef dataProviderRef;
-static CGImageAlphaInfo alphaInfo;
 static CGImageRef image;
 
 static Rect imgRect; // size of the original image (unscaled)
Index: libvo/vo_gl.c
===================================================================
--- libvo/vo_gl.c	(revision 23396)
+++ libvo/vo_gl.c	(working copy)
@@ -261,7 +261,6 @@
   GLint scale_type = (scaled_osd) ? GL_LINEAR : GL_NEAREST;
   ass_image_t *img = imgs->imgs;
   ass_image_t *i;
-  int cnt;
 
   if (imgs->changed == 0) // there are elements, but they are unchanged
       return;
Index: libvo/vo_x11.c
===================================================================
--- libvo/vo_x11.c	(revision 23396)
+++ libvo/vo_x11.c	(working copy)
@@ -71,7 +71,7 @@
 
 /* X11 related variables */
 static XImage *myximage = NULL;
-static int depth, bpp, mode;
+static int depth, bpp;
 static XWindowAttributes attribs;
 
 static int int_pause;
Index: libmpdemux/demux_ty.c
===================================================================
--- libmpdemux/demux_ty.c	(revision 23396)
+++ libmpdemux/demux_ty.c	(working copy)
@@ -691,7 +691,6 @@
                
                if ( tivo->tmf != 1 )
                {
-                  off_t size;
                   off_t offset;
 
                   numberParts = demux->stream->end_pos / TIVO_PART_LENGTH;
Index: libmpdemux/demux_mov.c
===================================================================
--- libmpdemux/demux_mov.c	(revision 23396)
+++ libmpdemux/demux_mov.c	(working copy)
@@ -434,7 +434,6 @@
 		  case MOV_FOURCC('r','m','d','a'):
 		      continue;
 		  case MOV_FOURCC('r','d','r','f'): {
-		      int tmp=stream_read_dword(demuxer->stream);
 		      int type=stream_read_dword_le(demuxer->stream);
 	              int slen=stream_read_dword(demuxer->stream);
 		      //char* s=malloc(slen+1);
@@ -455,7 +454,6 @@
 		      len-=12+slen;i-=12+slen; break;
 		    }
 		  case MOV_FOURCC('r','m','d','r'): {
-		      int flags=stream_read_dword(demuxer->stream);
 		      int rate=stream_read_dword(demuxer->stream);
 		      mp_msg(MSGT_DEMUX,MSGL_V,"  min. data rate: %d bits/sec\n",rate);
 		      len-=8; i-=8; break;
@@ -1638,12 +1636,9 @@
       break;
     }
     case MOV_FOURCC('h','d','l','r'): {
-      unsigned int tmp = stream_read_dword(demuxer->stream);
       unsigned int type = stream_read_dword_le(demuxer->stream);
       unsigned int subtype = stream_read_dword_le(demuxer->stream);
       unsigned int manufact = stream_read_dword_le(demuxer->stream);
-      unsigned int comp_flags = stream_read_dword(demuxer->stream);
-      unsigned int comp_mask = stream_read_dword(demuxer->stream);
       int len = stream_read_char(demuxer->stream);
       char* str = malloc(len + 1);
       stream_read(demuxer->stream, str, len);
@@ -1723,7 +1718,6 @@
       break;
     }
     case MOV_FOURCC('s','t','t','s'): {
-      int temp = stream_read_dword(demuxer->stream);
       int len = stream_read_dword(demuxer->stream);
       int i;
       unsigned int pts = 0;
@@ -1782,7 +1776,6 @@
       break;
     }
     case MOV_FOURCC('s','t','c','o'): {
-      int temp = stream_read_dword(demuxer->stream);
       int len = stream_read_dword(demuxer->stream);
       int i;
       mp_msg(MSGT_DEMUX, MSGL_V, 
@@ -1799,7 +1792,6 @@
       break;
     }
     case MOV_FOURCC('c','o','6','4'): {
-      int temp = stream_read_dword(demuxer->stream);
       int len = stream_read_dword(demuxer->stream);
       int i;
       mp_msg(MSGT_DEMUX, MSGL_V,
Index: libmpdemux/demux_ogg.c
===================================================================
--- libmpdemux/demux_ogg.c	(revision 23396)
+++ libmpdemux/demux_ogg.c	(working copy)
@@ -166,8 +166,6 @@
 
 void demux_ogg_add_sub (ogg_stream_t* os,ogg_packet* pack) {
   int lcv;
-  int line_pos = 0;
-  int ignoring = 0;
   char *packet = pack->packet;
 
   if (pack->bytes < 4)
@@ -247,7 +245,6 @@
 
 static unsigned char* demux_ogg_read_packet(ogg_stream_t* os,ogg_packet* pack,void *context,float* pts,int* flags, int samplesize) {
   unsigned char* data = pack->packet;
-  ogg_demuxer_t *ogg_d = os->ogg_d;
 
   *pts = 0;
   *flags = 0;
Index: libmpdemux/asfheader.c
===================================================================
--- libmpdemux/asfheader.c	(revision 23396)
+++ libmpdemux/asfheader.c	(working copy)
@@ -201,7 +201,7 @@
   unsigned bitrate;
 
   while ((pos = find_asf_guid(buf, asf_ext_stream_header, pos, buf_len)) >= 0) {
-    int this_stream_num, stnamect, payct, i, objlen;
+    int this_stream_num, stnamect, payct, i;
     int buf_max_index=pos+50;
     if (buf_max_index > buf_len) return 0;
     buffer = &buf[pos];


More information about the MPlayer-dev-eng mailing list