summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-04 23:29:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-04 23:29:00 (GMT)
commit42fd6e444439b14a0575fb678c01742dc622ccf5 (patch)
treed5d142452d592ec824c5df945986603e12219cf9 /win/tkWinButton.c
parent25dc6318ede3ac345dd0c7266edb3915db9687de (diff)
parentcdcd80aec2e8f345a9a491e82129ab8ae0f864ea (diff)
downloadtk-42fd6e444439b14a0575fb678c01742dc622ccf5.zip
tk-42fd6e444439b14a0575fb678c01742dc622ccf5.tar.gz
tk-42fd6e444439b14a0575fb678c01742dc622ccf5.tar.bz2
Merge 8.6
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 9cd13a7..e0f9857 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;
}