summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-04 23:27:03 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-04 23:27:03 (GMT)
commitcdcd80aec2e8f345a9a491e82129ab8ae0f864ea (patch)
tree65782f89c2e4f7e5db621287edf4524c6b29ce21 /win/tkWinButton.c
parentfd6508a2a0aa568a36f853f326794536601769f0 (diff)
parent726546cf2742672ce6de89b0500b3e750c6fe3b7 (diff)
downloadtk-cdcd80aec2e8f345a9a491e82129ab8ae0f864ea.zip
tk-cdcd80aec2e8f345a9a491e82129ab8ae0f864ea.tar.gz
tk-cdcd80aec2e8f345a9a491e82129ab8ae0f864ea.tar.bz2
Merge 8.5
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index e46bcb3..9c72698 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -127,7 +127,7 @@ InitBoxes(void)
HRSRC hrsrc;
HGLOBAL hblk;
LPBITMAPINFOHEADER newBitmap;
- DWORD size;
+ size_t size;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
@@ -146,8 +146,9 @@ InitBoxes(void)
if (tsdPtr->boxesPtr != NULL && !(tsdPtr->boxesPtr->biWidth % 4)
&& !(tsdPtr->boxesPtr->biHeight % 2)) {
- size = tsdPtr->boxesPtr->biSize + (1 << tsdPtr->boxesPtr->biBitCount)
- * sizeof(RGBQUAD) + tsdPtr->boxesPtr->biSizeImage;
+ size = tsdPtr->boxesPtr->biSize
+ + (sizeof(RGBQUAD) << tsdPtr->boxesPtr->biBitCount)
+ + tsdPtr->boxesPtr->biSizeImage;
newBitmap = ckalloc(size);
memcpy(newBitmap, tsdPtr->boxesPtr, size);
tsdPtr->boxesPtr = newBitmap;
@@ -156,7 +157,7 @@ InitBoxes(void)
tsdPtr->boxesPalette = (DWORD*) (((LPSTR) tsdPtr->boxesPtr)
+ tsdPtr->boxesPtr->biSize);
tsdPtr->boxesBits = ((LPSTR) tsdPtr->boxesPalette)
- + ((1 << tsdPtr->boxesPtr->biBitCount) * sizeof(RGBQUAD));
+ + (sizeof(RGBQUAD) << tsdPtr->boxesPtr->biBitCount);
} else {
tsdPtr->boxesPtr = NULL;
}