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

Dominik Mierzejewski dominik at rangers.eu.org
Tue Dec 10 15:20:42 CET 2002


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"
-------------- next part --------------
--- 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 */
 
 // codec private shit:
 typedef void *GlobalsPtr;
@@ -153,22 +157,22 @@
 
 /* values for PixMap.pixelFormat*/
 enum {
-    k16LE555PixelFormat         = FOUR_CHAR_CODE('L555'),       /* 16 bit LE rgb 555 (PC)*/
-    k16LE5551PixelFormat        = FOUR_CHAR_CODE('5551'),       /* 16 bit LE rgb 5551*/
-    k16BE565PixelFormat         = FOUR_CHAR_CODE('B565'),       /* 16 bit BE rgb 565*/
-    k16LE565PixelFormat         = FOUR_CHAR_CODE('L565'),       /* 16 bit LE rgb 565*/
-    k24BGRPixelFormat           = FOUR_CHAR_CODE('24BG'),       /* 24 bit bgr */
-    k32BGRAPixelFormat          = FOUR_CHAR_CODE('BGRA'),       /* 32 bit bgra    (Matrox)*/
-    k32ABGRPixelFormat          = FOUR_CHAR_CODE('ABGR'),       /* 32 bit abgr    */
-    k32RGBAPixelFormat          = FOUR_CHAR_CODE('RGBA'),       /* 32 bit rgba    */
-    kYUVSPixelFormat            = FOUR_CHAR_CODE('yuvs'),       /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
-    kYUVUPixelFormat            = FOUR_CHAR_CODE('yuvu'),       /* YUV 4:2:2 byte ordering 16-signed*/
-    kYVU9PixelFormat            = FOUR_CHAR_CODE('YVU9'),       /* YVU9 Planar    9*/
-    kYUV411PixelFormat          = FOUR_CHAR_CODE('Y411'),       /* YUV 4:1:1 Interleaved  16*/
-    kYVYU422PixelFormat         = FOUR_CHAR_CODE('YVYU'),       /* YVYU 4:2:2 byte ordering   16*/
-    kUYVY422PixelFormat         = FOUR_CHAR_CODE('UYVY'),       /* UYVY 4:2:2 byte ordering   16*/
-    kYUV211PixelFormat          = FOUR_CHAR_CODE('Y211'),       /* YUV 2:1:1 Packed   8*/
-    k2vuyPixelFormat            = FOUR_CHAR_CODE('2vuy')        /* UYVY 4:2:2 byte ordering   16*/
+    k16LE555PixelFormat         = FOUR_CHAR_CODE('L','5','5','5'),       /* 16 bit LE rgb 555 (PC)*/
+    k16LE5551PixelFormat        = FOUR_CHAR_CODE('5','5','5','1'),       /* 16 bit LE rgb 5551*/
+    k16BE565PixelFormat         = FOUR_CHAR_CODE('B','5','6','5'),       /* 16 bit BE rgb 565*/
+    k16LE565PixelFormat         = FOUR_CHAR_CODE('L','5','6','5'),       /* 16 bit LE rgb 565*/
+    k24BGRPixelFormat           = FOUR_CHAR_CODE('2','4','B','G'),       /* 24 bit bgr */
+    k32BGRAPixelFormat          = FOUR_CHAR_CODE('B','G','R','A'),       /* 32 bit bgra    (Matrox)*/
+    k32ABGRPixelFormat          = FOUR_CHAR_CODE('A','B','G','R'),       /* 32 bit abgr    */
+    k32RGBAPixelFormat          = FOUR_CHAR_CODE('R','G','B','A'),       /* 32 bit rgba    */
+    kYUVSPixelFormat            = FOUR_CHAR_CODE('y','u','v','s'),       /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
+    kYUVUPixelFormat            = FOUR_CHAR_CODE('y','u','v','u'),       /* YUV 4:2:2 byte ordering 16-signed*/
+    kYVU9PixelFormat            = FOUR_CHAR_CODE('Y','V','U','9'),       /* YVU9 Planar    9*/
+    kYUV411PixelFormat          = FOUR_CHAR_CODE('Y','4','1','1'),       /* YUV 4:1:1 Interleaved  16*/
+    kYVYU422PixelFormat         = FOUR_CHAR_CODE('Y','V','Y','U'),       /* YVYU 4:2:2 byte ordering   16*/
+    kUYVY422PixelFormat         = FOUR_CHAR_CODE('U','Y','V','Y'),       /* UYVY 4:2:2 byte ordering   16*/
+    kYUV211PixelFormat          = FOUR_CHAR_CODE('Y','2','1','1'),       /* YUV 2:1:1 Packed   8*/
+    k2vuyPixelFormat            = FOUR_CHAR_CODE('2','v','u','y')        /* UYVY 4:2:2 byte ordering   16*/
 };
 
 struct __attribute__((__packed__)) PixMapExtension {


More information about the MPlayer-dev-eng mailing list