summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorscotty <scottypitcher@gmail.com>2018-02-09 12:52:48 (GMT)
committerscotty <scottypitcher@gmail.com>2018-02-09 12:52:48 (GMT)
commit861c3b79214beb32cdd3861a1054cbbdabd80b0d (patch)
tree6a721b829d436fedc880f8b93b3f8abe20a3f1c0 /generic
parent7d3936469b32a428c856cf6a45f3e889903fce41 (diff)
downloadtk-861c3b79214beb32cdd3861a1054cbbdabd80b0d.zip
tk-861c3b79214beb32cdd3861a1054cbbdabd80b0d.tar.gz
tk-861c3b79214beb32cdd3861a1054cbbdabd80b0d.tar.bz2
Add typecasts in DrawCanvas() to assist MS VC compiler.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkCanvas.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index cd03062..331b7e3 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -2820,9 +2820,9 @@ DrawCanvas(
#define R_OFFSET 0
#define B_OFFSET 2
#endif
- blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + R_OFFSET] = (pixel & visualPtr->red_mask) >> rshift;
- blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x +1] = (pixel & visualPtr->green_mask) >> gshift;
- blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + B_OFFSET] = (pixel & visualPtr->blue_mask) >> bshift;
+ blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + R_OFFSET] = (unsigned char)((pixel & visualPtr->red_mask) >> rshift);
+ blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x +1] = (unsigned char)((pixel & visualPtr->green_mask) >> gshift);
+ blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x + B_OFFSET] = (unsigned char)((pixel & visualPtr->blue_mask) >> bshift);
blockPtr.pixelPtr[blockPtr.pitch * y + blockPtr.pixelSize * x +3] = 0xFF;
#ifdef DEBUG_DRAWCANVAS
{