[MPlayer-dev-eng] [PATCH] Unused variables in demux_mov.c

Aurelien Jacobs aurel at gnuage.org
Sun Jun 3 22:12:22 CEST 2007


On Sun, 03 Jun 2007 10:57:26 +0200
Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:

> Hi!
> 
> Attached patch removes a few warnings about unused variables in
> libmpdemux/demux_mov.c that are seen when compiling with -Wall.
> 
> 
> Index: libmpdemux/demux_mov.c
> ===================================================================
> --- libmpdemux/demux_mov.c	(Revision 23457)
> +++ libmpdemux/demux_mov.c	(Arbeitskopie)
> @@ -434,8 +434,8 @@
>  		  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 av_unused tmp=stream_read_dword(demuxer->stream);
> +		      int av_unused type=stream_read_dword_le(demuxer->stream);
>  	              int slen=stream_read_dword(demuxer->stream);
>  		      //char* s=malloc(slen+1);
>  		      //stream_read(demuxer->stream,s,slen);

IMO a better fix would look like this:

Index: libmpdemux/demux_mov.c
===================================================================
--- libmpdemux/demux_mov.c	(revision 23458)
+++ libmpdemux/demux_mov.c	(working copy)
@@ -434,9 +434,10 @@
 		  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);
+		      int slen;
+		      stream_read_dword(demuxer->stream);
+		      stream_read_dword_le(demuxer->stream);
+		      slen=stream_read_dword(demuxer->stream);
 		      //char* s=malloc(slen+1);
 		      //stream_read(demuxer->stream,s,slen);


This should obviously be applied to other hunks as well.

Aurel



More information about the MPlayer-dev-eng mailing list