wined3d: Define WINED3DSTREAMSOURCE_INSTANCEDATA without invoking invoking overflow.

Gerald Pfeifer gerald at pfeifer.com
Sat Aug 8 18:20:46 CDT 2015


[ I did not see this appear in the web archives for some 
  40 hours, so resending... ]

2 << 30 requires 33 bits to represent, which GCC 6 is going to warn
about.  2U << 30 on the other hand is safe, since it does not require
that extra sign bit.

This avoids at least 6 warnings build Wine with current development
snapshots of GCC.

Gerald
---
 include/wine/wined3d.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 9786c3c..d8ebfc5 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -927,8 +927,8 @@ enum wined3d_display_rotation
 #define WINED3DCLEAR_STENCIL                                    0x00000004
 
 /* Stream source flags */
-#define WINED3DSTREAMSOURCE_INDEXEDDATA                         (1 << 30)
-#define WINED3DSTREAMSOURCE_INSTANCEDATA                        (2 << 30)
+#define WINED3DSTREAMSOURCE_INDEXEDDATA                         (1  << 30)
+#define WINED3DSTREAMSOURCE_INSTANCEDATA                        (2U << 30)
 
 /* SetPrivateData flags */
 #define WINED3DSPD_IUNKNOWN                                     0x00000001
-- 
2.4.6



More information about the wine-patches mailing list