include: Avoid overflow (warning) in RGBA_MAKE.

Dmitry Timoshkov dmitry at baikal.ru
Tue Sep 6 01:41:33 CDT 2016


Gerald Pfeifer <gerald at pfeifer.com> wrote:

> --- a/include/d3dtypes.h
> +++ b/include/d3dtypes.h
> @@ -53,7 +53,7 @@ typedef LONG D3DFIXED;
>  #define RGBA_GETRED(rgb)        (((rgb) >> 16) & 0xff)
>  #define RGBA_GETGREEN(rgb)      (((rgb) >> 8) & 0xff)
>  #define RGBA_GETBLUE(rgb)       ((rgb) & 0xff)
> -#define RGBA_MAKE(r, g, b, a)   ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
> +#define RGBA_MAKE(r, g, b, a)   ((D3DCOLOR) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)))

This is a public header, probably you need to fix the callers of this macro
instead.

-- 
Dmitry.



More information about the wine-devel mailing list