Remove cpp_quote hackery from wined3d.idl (was: tools/widl: Split expr_int_const off from expr)

Gerald Pfeifer gerald at pfeifer.com
Thu Dec 24 03:22:08 CST 2009


On Mon, 21 Dec 2009, Henri Verbeet wrote:
>> How shall we best tackle this?
> At least for the wined3d ones, we might as well just add them to the
> enum, the macros aren't strictly necessary.

Done thusly.  We just need to move WINEMAKEFOURCC to a local header,
the rest of the cpp_quote can go and we lose a couple of dozen warning 
messages (rightfully) issued by GCC 4.5 snapshots.

Gerald

ChangeLog:
Move all values used for enum _WINED3DFORMAT into the enum itself.

diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index b74868d..5863161 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -44,6 +44,10 @@
 #include "wine/list.h"
 #include "wine/rbtree.h"
 
+#define WINEMAKEFOURCC(ch0, ch1, ch2, ch3) \
+  ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
+  ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
+
 /* Driver quirks */
 #define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT       0x00000001
 #define WINED3D_QUIRK_SET_TEXCOORD_W            0x00000002
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 27267c2..b88c6ef 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -254,26 +254,24 @@ typedef enum _WINED3DFORMAT
     WINED3DFMT_B8G8R8A8_UNORM,
     WINED3DFMT_B8G8R8X8_UNORM,
 
+    WINED3DFMT_UYVY         = 0x59565955 /* UYVY */,
+    WINED3DFMT_YUY2         = 0x32595559 /* YUY2 */,
+    WINED3DFMT_YV12         = 0x32315659 /* YV12 */,
+    WINED3DFMT_DXT1         = 0x31545844 /* DXT1 */,
+    WINED3DFMT_DXT2         = 0x32545844 /* DXT2 */,
+    WINED3DFMT_DXT3         = 0x33545844 /* DXT3 */,
+    WINED3DFMT_DXT4         = 0x34545844 /* DXT4 */,
+    WINED3DFMT_DXT5         = 0x35545844 /* DXT5 */,
+    WINED3DFMT_MULTI2_ARGB8 = 0x3154454d /* MET1 */,
+    WINED3DFMT_G8R8_G8B8    = 0x42475247 /* GRGB */,
+    WINED3DFMT_R8G8_B8G8    = 0x47424752 /* RGBG */,
+    /* Vendor specific formats */
+    WINED3DFMT_ATI2N        = 0x32495441 /* ATI2 */,
+    WINED3DFMT_NVHU         = 0x5548564e /* NVHU */,
+    WINED3DFMT_NVHS         = 0x5348564e /* NVHS */,
+
     WINED3DFMT_FORCE_DWORD = 0xffffffff
 } WINED3DFORMAT;
-cpp_quote("#define WINEMAKEFOURCC(ch0, ch1, ch2, ch3) \\")
-cpp_quote("        ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \\")
-cpp_quote("        ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))")
-cpp_quote("#define WINED3DFMT_UYVY         WINEMAKEFOURCC('U', 'Y', 'V', 'Y')")
-cpp_quote("#define WINED3DFMT_YUY2         WINEMAKEFOURCC('Y', 'U', 'Y', '2')")
-cpp_quote("#define WINED3DFMT_YV12         WINEMAKEFOURCC('Y', 'V', '1', '2')")
-cpp_quote("#define WINED3DFMT_DXT1         WINEMAKEFOURCC('D', 'X', 'T', '1')")
-cpp_quote("#define WINED3DFMT_DXT2         WINEMAKEFOURCC('D', 'X', 'T', '2')")
-cpp_quote("#define WINED3DFMT_DXT3         WINEMAKEFOURCC('D', 'X', 'T', '3')")
-cpp_quote("#define WINED3DFMT_DXT4         WINEMAKEFOURCC('D', 'X', 'T', '4')")
-cpp_quote("#define WINED3DFMT_DXT5         WINEMAKEFOURCC('D', 'X', 'T', '5')")
-cpp_quote("#define WINED3DFMT_MULTI2_ARGB8 WINEMAKEFOURCC('M', 'E', 'T', '1')")
-cpp_quote("#define WINED3DFMT_G8R8_G8B8    WINEMAKEFOURCC('G', 'R', 'G', 'B')")
-cpp_quote("#define WINED3DFMT_R8G8_B8G8    WINEMAKEFOURCC('R', 'G', 'B', 'G')")
-/* Vendor specific formats */
-cpp_quote("#define WINED3DFMT_ATI2N        WINEMAKEFOURCC('A', 'T', 'I', '2')")
-cpp_quote("#define WINED3DFMT_NVHU         WINEMAKEFOURCC('N', 'V', 'H', 'U')")
-cpp_quote("#define WINED3DFMT_NVHS         WINEMAKEFOURCC('N', 'V', 'H', 'S')")
 
 typedef enum _WINED3DRENDERSTATETYPE
 {



More information about the wine-patches mailing list