- added rules for building asm code in the gcc makefiles
[dosdemo] / src / gfxutil.h
index 15f8b66..c0a1fde 100644 (file)
@@ -4,7 +4,9 @@
 #include "inttypes.h"
 
 #define PACK_RGB16(r, g, b) \
-       (((r) << 8) & 0xf800) | (((g) << 3) & 0x7e0) | (((b) >> 3) & 0x1f)
+       ((((uint16_t)(r) << 8) & 0xf800) | \
+        (((uint16_t)(g) << 3) & 0x7e0) | \
+        (((uint16_t)(b) >> 3) & 0x1f))
 
 #define UNPACK_R16(c)  (((c) >> 8) & 0xf8)
 #define UNPACK_G16(c)  (((c) >> 3) & 0xfc)