[MPlayer-dev-eng] [PATCHES] 4 small patches for various code improvements

Clément Bœsch ubitux at gmail.com
Thu Nov 25 16:16:27 CET 2010


On Thu, Nov 25, 2010 at 03:45:43PM +0100, Laurent Aimar wrote:
> Hi,
> 
> On Thu, Nov 25, 2010 at 09:22:21AM +0100, Alexander Roalter wrote:
> > Am 24.11.2010 22:01, schrieb Clément B??sch:
> >>   int
> >>   nop_streaming_seek( int fd, off_t pos, streaming_ctrl_t *stream_ctrl ) {
> >>   	return -1;
> >> -	// To shut up gcc warning
> >> -	fd++;
> >> -	pos++;
> >> -	stream_ctrl=NULL;
> >>   }
> >
> >
> > One can also shup up the warning by using a nameless declaration (only  
> > types):
>  I think that's valid only for C++.

It's not valid in C at least.

>  But another way (without side effects) is to cast using (void) like:
> (void)fd;
> 

The warning is not activated. It's the -Wunused-parameter option, included
in -Wextra, so we don't care.

And yes (void) trick is actually better than modifying the variables.

-- 
Clément B.
Not sent from a jesusPhone.


More information about the MPlayer-dev-eng mailing list