d3d8: Redefine D3DVSD_MAKETOKENTYPE to avoid shift overflow (warnings).

Gerald Pfeifer gerald at pfeifer.com
Sat Oct 24 18:17:59 CDT 2015


At first I tried to make the token constants unsigned, but them
being in an enum, it doesn not actually work in standard C. Hence
this cast.

Gerald

Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
---
 include/d3d8types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/d3d8types.h b/include/d3d8types.h
index 088938b..d8ccd85 100644
--- a/include/d3d8types.h
+++ b/include/d3d8types.h
@@ -267,7 +267,7 @@ typedef enum _D3DVSDT_TYPE {
 
 
 #define D3DVSD_MAKETOKENTYPE(TokenType) \
-  ((TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
+  (((unsigned)TokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK)
 
 #define D3DVSD_CONST(ConstantAddress, Count) \
   (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | ((Count) << D3DVSD_CONSTCOUNTSHIFT) | (ConstantAddress))
-- 
2.6.1



More information about the wine-patches mailing list