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

D Richard Felker III dalias at aerifal.cx
Tue Dec 10 19:07:24 CET 2002


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??!

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

It's not that hard!!!!!!!!! Why are you trying to use chars instead of
a string??

Rich




More information about the MPlayer-dev-eng mailing list