summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2011-08-13 21:51:23 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2011-08-13 21:51:23 (GMT)
commit8ef38a7e1335498220c1dad6109c3f035f878ffa (patch)
treee9c2b607fa747c61a49074514454eb483ac3ea93
parentb8d8c08583edeba5c3f7b6bce2e13c60c2323c47 (diff)
parent52482ab5023994148201c6b4e71c40b62809b205 (diff)
downloadtk-8ef38a7e1335498220c1dad6109c3f035f878ffa.zip
tk-8ef38a7e1335498220c1dad6109c3f035f878ffa.tar.gz
tk-8ef38a7e1335498220c1dad6109c3f035f878ffa.tar.bz2
[Bug 3388350] mingw64 compiler warnings
-rw-r--r--ChangeLog13
-rw-r--r--generic/tkBitmap.c4
-rw-r--r--generic/tkConsole.c9
-rw-r--r--unix/tkUnixMenubu.c2
-rw-r--r--win/tkWinButton.c1
-rw-r--r--win/tkWinEmbed.c2
-rw-r--r--win/tkWinFont.c4
-rw-r--r--win/tkWinImage.c26
-rw-r--r--win/tkWinKey.c2
-rw-r--r--win/tkWinTest.c3
-rw-r--r--win/tkWinWm.c2
11 files changed, 37 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 9de830c..e8c5f29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-08-13 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * generic/tkBitmap.c: [Bug 3388350] mingw64 compiler warnings
+ * generic/tkConsole.c
+ * unix/tkUnixMenubu.c
+ * win/tkWinButton.c
+ * win/tkWinEmbed.c
+ * win/tkWinFont.c
+ * win/tkWinImage.c
+ * win/tkWinKey.c
+ * win/tkWinTest.c
+ * win/tkWinWm.c
+
2011-08-03 Jan Nijtmans <nijtmans@users.sf.net>
* win/tkWinDialog.c: [Bug 3314770] regression - Windows file
diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c
index 81e9678..09545d6 100644
--- a/generic/tkBitmap.c
+++ b/generic/tkBitmap.c
@@ -23,7 +23,7 @@
* that warning message.
*/
-#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__GNUC__)
+#if defined(_MSC_VER)
#pragma warning (disable : 4305)
#endif
@@ -38,7 +38,7 @@
#include "question.xbm"
#include "warning.xbm"
-#if (defined(__WIN32__) || defined(_WIN32)) && !defined(__GNUC__)
+#if defined(_MSC_VER)
#pragma warning (default : 4305)
#endif
diff --git a/generic/tkConsole.c b/generic/tkConsole.c
index 4091255..b10aaaf 100644
--- a/generic/tkConsole.c
+++ b/generic/tkConsole.c
@@ -81,6 +81,7 @@ static Tcl_ChannelType consoleChannelType = {
NULL, /* handler proc. */
NULL, /* wide seek proc */
NULL, /* thread action proc */
+ NULL
};
#ifdef __WIN32__
@@ -111,25 +112,17 @@ ShouldUseConsoleChannel(
DCB dcb;
DWORD consoleParams;
DWORD fileType;
- int mode;
- char *bufMode;
HANDLE handle;
switch (type) {
case TCL_STDIN:
handleId = STD_INPUT_HANDLE;
- mode = TCL_READABLE;
- bufMode = "line";
break;
case TCL_STDOUT:
handleId = STD_OUTPUT_HANDLE;
- mode = TCL_WRITABLE;
- bufMode = "line";
break;
case TCL_STDERR:
handleId = STD_ERROR_HANDLE;
- mode = TCL_WRITABLE;
- bufMode = "none";
break;
default:
return 0;
diff --git a/unix/tkUnixMenubu.c b/unix/tkUnixMenubu.c
index c6a7141..48d3fb9 100644
--- a/unix/tkUnixMenubu.c
+++ b/unix/tkUnixMenubu.c
@@ -21,6 +21,8 @@
Tk_ClassProcs tkpMenubuttonClass = {
sizeof(Tk_ClassProcs), /* size */
TkMenuButtonWorldChanged, /* worldChangedProc */
+ NULL,
+ NULL
};
/*
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index ab551ca..af1058d 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -90,6 +90,7 @@ Tk_ClassProcs tkpButtonProcs = {
sizeof(Tk_ClassProcs), /* size */
TkButtonWorldChanged, /* worldChangedProc */
CreateProc, /* createProc */
+ NULL
};
diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c
index 4277978..bc86019 100644
--- a/win/tkWinEmbed.c
+++ b/win/tkWinEmbed.c
@@ -736,7 +736,7 @@ TkWinEmbeddedEventProc(
*/
if (topwinPtr) {
- if (wParam >= 0 && wParam <= 3) {
+ if (wParam <= 3) {
TkpWmSetState(topwinPtr, wParam);
}
result = 1+TkpWmGetState(topwinPtr);
diff --git a/win/tkWinFont.c b/win/tkWinFont.c
index 7228126..f209716 100644
--- a/win/tkWinFont.c
+++ b/win/tkWinFont.c
@@ -2326,7 +2326,7 @@ GetScreenFont(
* We can only store up to LF_FACESIZE wide characters
*/
- if (Tcl_DStringLength(&ds) >= (LF_FACESIZE * sizeof(WCHAR))) {
+ if ((size_t)Tcl_DStringLength(&ds) >= (LF_FACESIZE * sizeof(WCHAR))) {
Tcl_DStringSetLength(&ds, LF_FACESIZE);
}
src = (Tcl_UniChar *) Tcl_DStringValue(&ds);
@@ -2613,7 +2613,7 @@ LoadFontRanges(
}
n = GetFontData(hdc, cmapKey, 0, &cmapTable, sizeof(cmapTable));
- if (n != GDI_ERROR) {
+ if (n != (int)GDI_ERROR) {
if (swapped) {
SwapShort(&cmapTable.numTables);
}
diff --git a/win/tkWinImage.c b/win/tkWinImage.c
index d6a6d73..8e6ef38 100644
--- a/win/tkWinImage.c
+++ b/win/tkWinImage.c
@@ -68,7 +68,7 @@ ImageGetPixel(
int x, int y)
{
unsigned long pixel = 0;
- unsigned char *srcPtr = &(image->data[(y * image->bytes_per_line)
+ unsigned char *srcPtr = (unsigned char *) &(image->data[(y * image->bytes_per_line)
+ ((x * image->bits_per_pixel) / NBBY)]);
switch (image->bits_per_pixel) {
@@ -116,7 +116,7 @@ PutPixel(
int x, int y,
unsigned long pixel)
{
- unsigned char *destPtr = &(image->data[(y * image->bytes_per_line)
+ unsigned char *destPtr = (unsigned char *) &(image->data[(y * image->bytes_per_line)
+ ((x * image->bits_per_pixel) / NBBY)]);
switch (image->bits_per_pixel) {
@@ -368,16 +368,16 @@ XGetImageZPixmap(
unsigned char *p, *pend;
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS);
- data = ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, depth, ZPixmap, 0, (char *)data,
width, height, 32, (int) ((width + 31) >> 3) & ~1);
if (ret_image == NULL) {
- ckfree(data);
+ ckfree((char *)data);
goto cleanup;
}
@@ -404,13 +404,13 @@ XGetImageZPixmap(
unsigned char *p;
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_PAL_COLORS);
- data = ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, 8, ZPixmap, 0, (char *)data,
width, height, 8, (int) width);
if (ret_image == NULL) {
ckfree((char *) data);
@@ -435,13 +435,13 @@ XGetImageZPixmap(
}
} else if (depth == 16) {
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS);
- data = ckalloc(bmInfo->bmiHeader.biSizeImage);
+ data = (unsigned char *) ckalloc(bmInfo->bmiHeader.biSizeImage);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, (char *) data,
width, height, 16, 0 /* will be calc'ed from bitmap_pad */);
if (ret_image == NULL) {
ckfree((char *) data);
@@ -461,13 +461,13 @@ XGetImageZPixmap(
}
} else {
GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS);
- data = ckalloc(width * height * 4);
+ data = (unsigned char *) ckalloc(width * height * 4);
if (!data) {
/* printf("Failed to allocate data area for XImage.\n"); */
ret_image = NULL;
goto cleanup;
}
- ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, data,
+ ret_image = XCreateImage(display, NULL, 32, ZPixmap, 0, (char *) data,
width, height, 0, (int) width * 4);
if (ret_image == NULL) {
ckfree((char *) data);
@@ -484,7 +484,7 @@ XGetImageZPixmap(
unsigned int byte_width, h, w;
byte_width = ((width * 3 + 3) & ~(unsigned)3);
- smallBitBase = ckalloc(byte_width * height);
+ smallBitBase = (unsigned char *) ckalloc(byte_width * height);
if (!smallBitBase) {
ckfree((char *) ret_image->data);
ckfree((char *) ret_image);
@@ -511,7 +511,7 @@ XGetImageZPixmap(
*/
for (h = 0; h < height; h++) {
- bigBitData = ret_image->data + h * ret_image->bytes_per_line;
+ bigBitData = (unsigned char *) (ret_image->data + h * ret_image->bytes_per_line);
smallBitData = smallBitBase + h * byte_width;
for (w = 0; w < width; w++) {
diff --git a/win/tkWinKey.c b/win/tkWinKey.c
index dae3ed3..522bfba 100644
--- a/win/tkWinKey.c
+++ b/win/tkWinKey.c
@@ -328,7 +328,7 @@ KeycodeToKeysym(
*/
skipToAscii:
- if (keycode < 0 || keycode > MAX_KEYCODE) {
+ if (keycode > MAX_KEYCODE) {
return NoSymbol;
}
switch (keycode) {
diff --git a/win/tkWinTest.c b/win/tkWinTest.c
index 45647f0..ed2e3e5 100644
--- a/win/tkWinTest.c
+++ b/win/tkWinTest.c
@@ -303,9 +303,6 @@ TestwineventCmd(
}
}
message = TkFindStateNum(NULL, NULL, messageMap, argv[3]);
- if (message < 0) {
- message = strtol(argv[3], NULL, 0);
- }
wParam = 0;
lParam = 0;
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 7ea68a3..b3af26a 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -1724,7 +1724,7 @@ ReadIconOrCursorFromFile(
* Read it in.
*/
- dwBytesRead = Tcl_Read(channel, lpIR->IconImages[i].lpBits,
+ dwBytesRead = Tcl_Read(channel, (char *) lpIR->IconImages[i].lpBits,
(int) lpIDE[i].dwBytesInRes);
if (dwBytesRead != lpIDE[i].dwBytesInRes) {
Tcl_AppendResult(interp, "Error reading file", NULL);