From 9a5678a8a95c46913c15a5fc19f73c113e8ed036 Mon Sep 17 00:00:00 2001 From: rsc Date: Sat, 4 Nov 2006 20:41:42 +0000 Subject: Change GET/GBIT32 macros to explicitly cast final result to u32int. Otherwise, the type of the expression will be int, and if written to a uvlong (or just a ulong on most 64-bit systems), it will be sign-extended. This was going on in drawfcall with Mouse.msec, which is declared as a ulong. This fix assumes that the protocols only send unsigned numbers, which is true. --- include/drawfcall.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/drawfcall.h') diff --git a/include/drawfcall.h b/include/drawfcall.h index e8a8c9b2..0d5cd6d3 100644 --- a/include/drawfcall.h +++ b/include/drawfcall.h @@ -53,7 +53,7 @@ AUTOLIB(draw) (p)[3] = (x)&0xFF #define GET(p, x) \ - ((x) = (((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | ((p)[3]))) + ((x) = (u32int)(((p)[0] << 24) | ((p)[1] << 16) | ((p)[2] << 8) | ((p)[3]))) #define PUT2(p, x) \ (p)[0] = ((x) >> 8)&0xFF, \ -- cgit v1.2.3