summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-04 22:41:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-01-04 22:41:10 (GMT)
commit726546cf2742672ce6de89b0500b3e750c6fe3b7 (patch)
treeab5bf107b006f50883a9e5232058778fa4d6ba6c /win/tkWinButton.c
parent93d974c265533cf2445446954346be8192e850a0 (diff)
downloadtk-726546cf2742672ce6de89b0500b3e750c6fe3b7.zip
tk-726546cf2742672ce6de89b0500b3e750c6fe3b7.tar.gz
tk-726546cf2742672ce6de89b0500b3e750c6fe3b7.tar.bz2
Fix a few minor compiler warnings, occurring in later gcc/clang versions.
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 9e1960d..c36932d 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 = (LPBITMAPINFOHEADER) 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;
}