diff options
author | scotty <scottypitcher@gmail.com> | 2018-02-09 12:52:48 (GMT) |
---|---|---|
committer | scotty <scottypitcher@gmail.com> | 2018-02-09 12:52:48 (GMT) |
commit | 861c3b79214beb32cdd3861a1054cbbdabd80b0d (patch) | |
tree | 6a721b829d436fedc880f8b93b3f8abe20a3f1c0 /generic | |
parent | 7d3936469b32a428c856cf6a45f3e889903fce41 (diff) | |
download | tk-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.c | 6 |
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 { |