diff options
-rw-r--r-- | ChangeLog | 19 | ||||
-rw-r--r-- | generic/tclBasic.c | 2 | ||||
-rw-r--r-- | generic/tclBinary.c | 2 | ||||
-rw-r--r-- | generic/tclHash.c | 4 | ||||
-rw-r--r-- | generic/tclTest.c | 4 | ||||
-rw-r--r-- | win/tclWinChan.c | 4 | ||||
-rw-r--r-- | win/tclWinConsole.c | 2 | ||||
-rw-r--r-- | win/tclWinDde.c | 6 | ||||
-rw-r--r-- | win/tclWinReg.c | 2 | ||||
-rw-r--r-- | win/tclWinSerial.c | 2 | ||||
-rw-r--r-- | win/tclWinSock.c | 2 | ||||
-rw-r--r-- | win/tclWinThrd.c | 2 |
12 files changed, 35 insertions, 16 deletions
@@ -1,3 +1,22 @@ +2011-08-16 Jan Nijtmans <nijtmans@users.sf.net> + + * generic/tclCmdAH.c: [Bug 3388350] mingw64 compiler warnings + * generic/tclFCmd.c In mingw, sys/stat.h must be included + * generic/tclFileName.c before winsock2.h, so make sure of that. + * generic/tclIOUtil.c + * generic/tclBasic.c + * generic/tclBinary.c + * generic/tclHash.c + * generic/tclTest.c + * win/tclWinChan.c + * win/tclWinConsole.c + * win/tclWinDde.c + * win/tclWinFile.c + * win/tclWinReg.c + * win/tclWinSerial.c + * win/tclWinSock.c + * win/tclWinThrd.c + 2011-08-15 Don Porter <dgp@users.sourceforge.net> * generic/tclBasic.c: [Bug 3390272] Leak of [info script] value. diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 764e0d9..954b2b3 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -6750,7 +6750,7 @@ ExprRandFunc( * to insure different seeds in different threads (bug #416643) */ - iPtr->randSeed = TclpGetClicks() + ((long)Tcl_GetCurrentThread()<<12); + iPtr->randSeed = TclpGetClicks() + (PTR2INT(Tcl_GetCurrentThread())<<12); /* * Make sure 1 <= randSeed <= (2^31) - 2. See below. diff --git a/generic/tclBinary.c b/generic/tclBinary.c index 90d392b..f321b28 100644 --- a/generic/tclBinary.c +++ b/generic/tclBinary.c @@ -1907,7 +1907,7 @@ ScanNumber( register Tcl_HashEntry *hPtr; int isNew; - hPtr = Tcl_CreateHashEntry(tablePtr, (char *)value, &isNew); + hPtr = Tcl_CreateHashEntry(tablePtr, INT2PTR(value), &isNew); if (!isNew) { return (Tcl_Obj *) Tcl_GetHashValue(hPtr); } diff --git a/generic/tclHash.c b/generic/tclHash.c index 00bfdf0..256b073 100644 --- a/generic/tclHash.c +++ b/generic/tclHash.c @@ -434,7 +434,7 @@ Tcl_DeleteHashEntry( #if TCL_HASH_KEY_STORE_HASH if (typePtr->hashKeyProc == NULL || typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { - index = RANDOM_INDEX (tablePtr, entryPtr->hash); + index = RANDOM_INDEX(tablePtr, PTR2UINT(entryPtr->hash)); } else { index = PTR2UINT(entryPtr->hash) & tablePtr->mask; } @@ -1064,7 +1064,7 @@ RebuildTable( #if TCL_HASH_KEY_STORE_HASH if (typePtr->hashKeyProc == NULL || typePtr->flags & TCL_HASH_KEY_RANDOMIZE_HASH) { - index = RANDOM_INDEX (tablePtr, hPtr->hash); + index = RANDOM_INDEX (tablePtr, PTR2UINT(hPtr->hash)); } else { index = PTR2UINT(hPtr->hash) & tablePtr->mask; } diff --git a/generic/tclTest.c b/generic/tclTest.c index 130bc38..e0a4ef5 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -5315,7 +5315,7 @@ TestmainthreadCmd( const char **argv) /* Argument strings. */ { if (argc == 1) { - Tcl_Obj *idObj = Tcl_NewLongObj((long)Tcl_GetCurrentThread()); + Tcl_Obj *idObj = Tcl_NewLongObj((long)(intptr_t)Tcl_GetCurrentThread()); Tcl_SetObjResult(interp, idObj); return TCL_OK; } else { @@ -6014,7 +6014,7 @@ TestChannelCmd( return TCL_ERROR; } - TclFormatInt(buf, (long) Tcl_GetChannelThread(chan)); + TclFormatInt(buf, (long)(intptr_t)Tcl_GetChannelThread(chan)); Tcl_AppendResult(interp, buf, NULL); return TCL_OK; } diff --git a/win/tclWinChan.c b/win/tclWinChan.c index b35c380..0f17834 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -1224,7 +1224,7 @@ TclpGetDefaultStdChannel( HANDLE handle; int mode = -1; char *bufMode = NULL; - DWORD handleId = (DWORD)INVALID_HANDLE_VALUE; + DWORD handleId = (DWORD)-1; /* Standard handle to retrieve. */ switch (type) { @@ -1337,7 +1337,7 @@ TclWinOpenFileChannel( infoPtr->flags = appendMode; infoPtr->handle = handle; infoPtr->dirty = 0; - wsprintfA(channelName, "file%lx", (int) infoPtr); + wsprintfA(channelName, "file%lx", PTR2INT(infoPtr)); infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index ebba41a..8be8e09 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -1362,7 +1362,7 @@ TclWinOpenConsoleChannel( * for instance). */ - wsprintfA(channelName, "file%lx", (int) infoPtr); + wsprintfA(channelName, "file%lx", PTR2INT(infoPtr)); infoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinDde.c b/win/tclWinDde.c index df6507b..9f39b37 100644 --- a/win/tclWinDde.c +++ b/win/tclWinDde.c @@ -211,7 +211,7 @@ Initialize(void) if (ddeInstance == 0) { Tcl_MutexLock(&ddeMutex); if (ddeInstance == 0) { - if (DdeInitialize(&ddeInstance, DdeServerProc, + if (DdeInitialize(&ddeInstance, (PFNCALLBACK) DdeServerProc, CBF_SKIP_REGISTRATIONS | CBF_SKIP_UNREGISTRATIONS | CBF_FAIL_POKES, 0) != DMLERR_NO_ERROR) { ddeInstance = 0; @@ -957,7 +957,7 @@ DdeClientWindowProc( (struct DdeEnumServices *) lpcs->lpCreateParams; #ifdef _WIN64 - SetWindowLongPtr(hwnd, GWLP_USERDATA, (long)es); + SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) es); #else SetWindowLong(hwnd, GWL_USERDATA, (long)es); #endif @@ -1032,7 +1032,7 @@ DdeEnumWindowsCallback( HWND hwndTarget, LPARAM lParam) { - DWORD dwResult = 0; + DWORD_PTR dwResult = 0; struct DdeEnumServices *es = (struct DdeEnumServices *) lParam; SendMessageTimeout(hwndTarget, WM_DDE_INITIATE, (WPARAM)es->hwnd, diff --git a/win/tclWinReg.c b/win/tclWinReg.c index f4bdd00..8eaf2a7 100644 --- a/win/tclWinReg.c +++ b/win/tclWinReg.c @@ -1437,7 +1437,7 @@ BroadcastValue( Tcl_Obj *CONST objv[]) /* Argument values. */ { LRESULT result; - DWORD sendResult; + DWORD_PTR sendResult; UINT timeout = 3000; int len; CONST char *str; diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index bb26e23..fb092ff 100644 --- a/win/tclWinSerial.c +++ b/win/tclWinSerial.c @@ -1499,7 +1499,7 @@ TclWinOpenSerialChannel( * are shared between multiple channels (stdin/stdout). */ - wsprintfA(channelName, "file%lx", (int) infoPtr); + wsprintfA(channelName, "file%lx", PTR2INT(infoPtr)); infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinSock.c b/win/tclWinSock.c index a365b49..1bf4f97 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1326,7 +1326,7 @@ Tcl_MakeTcpClientChannel( * Set kernel space buffering and non-blocking. */ - TclSockMinimumBuffers((int) sock, TCP_BUFFER_SIZE); + TclSockMinimumBuffers(PTR2INT(sock), TCP_BUFFER_SIZE); infoPtr = NewSocketInfo((SOCKET) sock); diff --git a/win/tclWinThrd.c b/win/tclWinThrd.c index 4a4e7f4..8544e71 100644 --- a/win/tclWinThrd.c +++ b/win/tclWinThrd.c @@ -260,7 +260,7 @@ TclpThreadExit( Tcl_ThreadId Tcl_GetCurrentThread(void) { - return (Tcl_ThreadId) GetCurrentThreadId(); + return (Tcl_ThreadId) INT2PTR(GetCurrentThreadId()); } /* |