Warning fixes found under hardest mode of OpenWatcom. Seems clean in Borland, MinGW and DMC.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -69,7 +69,7 @@ static inline WORD GetNumberOfColours(WORD bitsPerPixel)
|
||||
{
|
||||
// only 1, 4 and 8bpp bitmaps use palettes (well, they could be used with
|
||||
// 24bpp ones too but we don't support this as I think it's quite uncommon)
|
||||
return bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0;
|
||||
return (WORD)(bitsPerPixel <= 8 ? 1 << bitsPerPixel : 0);
|
||||
}
|
||||
|
||||
// wrapper around ::GetObject() for DIB sections
|
||||
@@ -674,9 +674,9 @@ bool wxDIB::Create(const wxImage& image)
|
||||
// RGB order is reversed, and we need to premultiply
|
||||
// all channels by alpha value for use with ::AlphaBlend.
|
||||
const unsigned char a = *alpha++;
|
||||
*dst++ = (src[2] * a + 127) / 255;
|
||||
*dst++ = (src[1] * a + 127) / 255;
|
||||
*dst++ = (src[0] * a + 127) / 255;
|
||||
*dst++ = (unsigned char)((src[2] * a + 127) / 255);
|
||||
*dst++ = (unsigned char)((src[1] * a + 127) / 255);
|
||||
*dst++ = (unsigned char)((src[0] * a + 127) / 255);
|
||||
*dst++ = a;
|
||||
src += 3;
|
||||
}
|
||||
|
Reference in New Issue
Block a user