aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-07-17 13:05:57 +1000
committernyamatongwe <unknown>2012-07-17 13:05:57 +1000
commit7f1fed72f2c9af337444a7bc954e0a5e6d733551 (patch)
tree0481e3112e07c249dce6889f6848a2cba1a88e64 /win32/PlatWin.cxx
parentefedd005163aaa07073eac0f9fa7ac56f199ab39 (diff)
downloadscintilla-mirror-7f1fed72f2c9af337444a7bc954e0a5e6d733551.tar.gz
Avoid loss of precision warnings from Borland.
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index ffb129d49..507567bb8 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -848,10 +848,10 @@ void SurfaceGDI::DrawRGBAImage(PRectangle rc, int width, int height, const unsig
unsigned char *pixel = image + (y*width+x) * 4;
unsigned char alpha = pixelsImage[3];
// Input is RGBA, output is BGRA with premultiplied alpha
- pixel[2] = (*pixelsImage++) * alpha / 255;
- pixel[1] = (*pixelsImage++) * alpha / 255;
- pixel[0] = (*pixelsImage++) * alpha / 255;
- pixel[3] = *pixelsImage++;
+ pixel[2] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255);
+ pixel[1] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255);
+ pixel[0] = static_cast<unsigned char>((*pixelsImage++) * alpha / 255);
+ pixel[3] = static_cast<unsigned char>(*pixelsImage++);
}
}