summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--generic/tkEntry.h2
-rw-r--r--generic/tkScale.h2
-rw-r--r--macosx/tkMacOSXXStubs.c2
-rw-r--r--win/tkWinButton.c9
-rw-r--r--win/tkWinEmbed.c2
-rw-r--r--win/tkWinImage.c2
6 files changed, 10 insertions, 9 deletions
diff --git a/generic/tkEntry.h b/generic/tkEntry.h
index 7f8aa1f..2ea7936 100644
--- a/generic/tkEntry.h
+++ b/generic/tkEntry.h
@@ -226,7 +226,7 @@ typedef struct {
* value that the users requests. Malloc'ed */
char *valueFormat; /* Sprintf conversion specifier used for the
* value. */
- char digitFormat[10]; /* Sprintf conversion specifier computed from
+ char digitFormat[16]; /* Sprintf conversion specifier computed from
* digits and other information; used for the
* value. */
diff --git a/generic/tkScale.h b/generic/tkScale.h
index a2c5f2b..a19695f 100644
--- a/generic/tkScale.h
+++ b/generic/tkScale.h
@@ -78,7 +78,7 @@ typedef struct TkScale {
* values. 0 means we get to choose the number
* based on resolution and/or the range of the
* scale. */
- char format[10]; /* Sprintf conversion specifier computed from
+ char format[16]; /* Sprintf conversion specifier computed from
* digits and other information. */
double bigIncrement; /* Amount to use for large increments to scale
* value. (0 means we pick a value). */
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index e928298..a541945 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -1371,7 +1371,7 @@ void
Tk_ResetUserInactiveTime(
Display *dpy)
{
- IOGPoint loc;
+ IOGPoint loc = {0};
kern_return_t kr;
NXEvent nullEvent = {NX_NULLEVENT, {0, 0}, 0, -1, 0};
enum { kNULLEventPostThrottle = 10 };
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;
}
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index a0670cc..1b0d2cf 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -300,7 +300,7 @@ TkpUseWindow(
char msg[256];
- sprintf(msg, "Unable to get information of window \"%.80s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string);
+ sprintf(msg, "Unable to get information of window \"%.79s\". Attach to this\nwindow may have unpredictable results if it is not a valid container.\n\nPress Ok to proceed or Cancel to abort attaching.", string);
if (IDCANCEL == MessageBox(hwnd, msg, "Tk Warning",
MB_OKCANCEL | MB_ICONWARNING)) {
Tcl_SetResult(interp, "Operation has been canceled", TCL_STATIC);
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index 8e6ef38..07aa1d3 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -348,7 +348,7 @@ XGetImageZPixmap(
size = sizeof(BITMAPINFO);
if (depth <= 8) {
- size += sizeof(unsigned short) * (1 << depth);
+ size += sizeof(unsigned short) << depth;
}
bmInfo = (BITMAPINFO *) ckalloc((unsigned)size);