summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--generic/tclStringObj.c2
-rw-r--r--win/tclWinChan.c12
-rw-r--r--win/tclWinConsole.c2
-rw-r--r--win/tclWinNotify.c2
-rw-r--r--win/tclWinReg.c4
6 files changed, 18 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 9db322b..c2fa69a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-07 Jan Nijtmans <nijtmans@users.sf.net>
+
+ * win/tclWinChan.c: Fix various gcc warnings
+ * win/tclWinConsole.c: (discovered with latest
+ * win/tclWinNotify.c: mingw, based on gcc 4.6.1)
+ * win/tclWinReg.c:
+
2011-09-26 Jan Nijtmans <nijtmans@users.sf.net>
* win/rules.vc: Support Visual Studio 11
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 6a9d832..b5b3674 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -114,7 +114,7 @@ typedef struct String {
? (sizeof(String) - sizeof(Tcl_UniChar) + (ualloc)) \
: sizeof(String)))
#define stringCheckLimits(numChars) \
- if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
+ if ((unsigned)(numChars) > (unsigned)(STRING_MAXCHARS)) { \
Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
STRING_MAXCHARS); \
}
diff --git a/win/tclWinChan.c b/win/tclWinChan.c
index d06ff50..98de3b0 100644
--- a/win/tclWinChan.c
+++ b/win/tclWinChan.c
@@ -474,8 +474,8 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
int *errorCodePtr; /* To store error code. */
{
FileInfo *infoPtr = (FileInfo *) instanceData;
- DWORD moveMethod;
- LONG newPos, newPosHigh, oldPos, oldPosHigh;
+ DWORD moveMethod, newPos, oldPos;
+ LONG newPosHigh, oldPosHigh;
*errorCodePtr = 0;
if (mode == SEEK_SET) {
@@ -489,7 +489,7 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
/*
* Save our current place in case we need to roll-back the seek.
*/
- oldPosHigh = (DWORD)0;
+ oldPosHigh = (LONG)0;
oldPos = SetFilePointer(infoPtr->handle, (LONG)0, &oldPosHigh,
FILE_CURRENT);
if (oldPos == INVALID_SET_FILE_POINTER) {
@@ -501,7 +501,7 @@ FileSeekProc(instanceData, offset, mode, errorCodePtr)
}
}
- newPosHigh = (DWORD)(offset < 0 ? -1 : 0);
+ newPosHigh = (LONG)(offset < 0 ? -1 : 0);
newPos = SetFilePointer(infoPtr->handle, (LONG) offset, &newPosHigh,
moveMethod);
if (newPos == INVALID_SET_FILE_POINTER) {
@@ -550,8 +550,8 @@ FileWideSeekProc(instanceData, offset, mode, errorCodePtr)
int *errorCodePtr; /* To store error code. */
{
FileInfo *infoPtr = (FileInfo *) instanceData;
- DWORD moveMethod;
- LONG newPos, newPosHigh;
+ DWORD moveMethod, newPos;
+ LONG newPosHigh;
*errorCodePtr = 0;
if (mode == SEEK_SET) {
diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c
index f0dd62c..d036bda 100644
--- a/win/tclWinConsole.c
+++ b/win/tclWinConsole.c
@@ -1151,7 +1151,7 @@ ConsoleReaderThread(LPVOID arg)
DWORD err;
err = GetLastError();
- if (err == EOF) {
+ if (err == (DWORD)EOF) {
infoPtr->readFlags = CONSOLE_EOF;
}
}
diff --git a/win/tclWinNotify.c b/win/tclWinNotify.c
index 0ad9e49..3ac1c6c 100644
--- a/win/tclWinNotify.c
+++ b/win/tclWinNotify.c
@@ -481,7 +481,7 @@ Tcl_WaitForEvent(
PostQuitMessage((int) msg.wParam);
status = -1;
- } else if (result == -1) {
+ } else if (result == (DWORD)-1) {
/*
* We got an error from the system. I have no idea why this would
* happen, so we'll just unwind.
diff --git a/win/tclWinReg.c b/win/tclWinReg.c
index a73be77..d4c7292 100644
--- a/win/tclWinReg.c
+++ b/win/tclWinReg.c
@@ -669,7 +669,7 @@ GetType(
* If we don't know about the type, just use the numeric value.
*/
- if (type > lastType || type < 0) {
+ if (type > lastType) {
Tcl_SetIntObj(resultPtr, (int) type);
} else {
Tcl_SetStringObj(resultPtr, typeNames[type], -1);
@@ -1528,5 +1528,5 @@ ConvertDWORD(
*/
localType = (*((char*)(&order)) == 1) ? REG_DWORD : REG_DWORD_BIG_ENDIAN;
- return (type != localType) ? SWAPLONG(value) : value;
+ return (type != localType) ? (DWORD)SWAPLONG(value) : value;
}