[MPlayer-dev-eng] [PATCH] shut up warnings in qtxsdk/compone

Dominik Mierzejewski dominik at rangers.eu.org
Tue Dec 10 19:40:05 CET 2002


On Tuesday, 10 December 2002, D Richard Felker III wrote:
> On Tue, Dec 10, 2002 at 03:20:42PM +0100, Dominik Mierzejewski wrote:
> > On Friday, 06 December 2002, D Richard Felker III wrote:
> > [...] 
> > > No, you should either ignore the warning or figure out the right
> > > syntax for the type casting to make it go away.
> > 
> > How about this (stolen from loader/dshow/libwin32.h):
> > 
> > -- 
> > 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"
> 
> > --- MPlayer-20021209/loader/qtx/qtxsdk/components.h.loader	Tue Dec  3 20:58:42 2002
> > +++ MPlayer-20021209/loader/qtx/qtxsdk/components.h	Tue Dec 10 14:36:44 2002
> > @@ -18,7 +18,11 @@
> >  typedef unsigned long                   UInt32;
> >  typedef signed long                     SInt32;
> >  
> > -#define FOUR_CHAR_CODE(x)       ((unsigned long)(x)) /* otherwise compiler will complain about values with high bit set */
> > +#ifndef FOUR_CHAR_CODE
> > +#define FOUR_CHAR_CODE( ch0, ch1, ch2, ch3 )                                \
> > +                ( (unsigned long)(unsigned char)(ch0) | ( (unsigned long)(unsigned char)(ch1) << 8 ) |    \
> > +                ( (unsigned long)(unsigned char)(ch2) << 16 ) | ( (unsigned long)(unsigned char)(ch3) << 24 ) )
> > +#endif /* FOUR_CHAR_CODE */
> 
> Arrg!! How stupid can you be??!

Stupid? No. Lazy? Perhaps, because I did a shameless copy&paste.

> #define FOUR_CHAR_CODE(s) (s[0] | (s[1]<<8) | (s[2]<<16) | (s[3]<<24))

This doesn't compile.
 
> It's not that hard!!!!!!!!! Why are you trying to use chars instead of
> a string??

Ask the guy who wrote loader/dshow/libwin32.h.

-- 
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"



More information about the MPlayer-dev-eng mailing list