Gerald Pfeifer : wpp: Add explicit casts when mixing unsigned and signed integers.

Alexandre Julliard julliard at winehq.org
Thu Apr 7 07:36:53 CDT 2011


Module: wine
Branch: stable
Commit: 139cbe1a262c3078b85ecbb7821dcb3514e9ee5c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=139cbe1a262c3078b85ecbb7821dcb3514e9ee5c

Author: Gerald Pfeifer <gerald at pfeifer.com>
Date:   Sat Feb 26 21:01:02 2011 +0100

wpp: Add explicit casts when mixing unsigned and signed integers.
(cherry picked from commit 0d92426d2b5c45dad3f11d7b524726a931bb6b88)

---

 libs/wpp/ppy.y |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libs/wpp/ppy.y b/libs/wpp/ppy.y
index b50e120..a9c5a68 100644
--- a/libs/wpp/ppy.y
+++ b/libs/wpp/ppy.y
@@ -61,7 +61,7 @@
 	else if(cv_signed(v1) && !cv_signed(v2))	\
 		r.val.si = v1.val.si OP (signed) v2.val.ui; \
 	else if(!cv_signed(v1) && cv_signed(v2))	\
-		r.val.si = v1.val.ui OP v2.val.si;	\
+		r.val.si = (signed) v1.val.ui OP v2.val.si; \
 	else						\
 		r.val.ui = v1.val.ui OP v2.val.ui;
 
@@ -72,7 +72,7 @@
 	else if(cv_signed(v1) && !cv_signed(v2))	\
 		r.val.sl = v1.val.sl OP (signed long) v2.val.ul; \
 	else if(!cv_signed(v1) && cv_signed(v2))	\
-		r.val.sl = v1.val.ul OP v2.val.sl;	\
+		r.val.sl = (signed long) v1.val.ul OP v2.val.sl; \
 	else						\
 		r.val.ul = v1.val.ul OP v2.val.ul;
 
@@ -83,7 +83,7 @@
 	else if(cv_signed(v1) && !cv_signed(v2))	\
 		r.val.sll = v1.val.sll OP (wrc_sll_t) v2.val.ull; \
 	else if(!cv_signed(v1) && cv_signed(v2))	\
-		r.val.sll = v1.val.ull OP v2.val.sll;	\
+		r.val.sll = (wrc_sll_t) v1.val.ull OP v2.val.sll; \
 	else						\
 		r.val.ull = v1.val.ull OP v2.val.ull;
 




More information about the wine-cvs mailing list