diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-07-08 10:23:47 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-07-08 10:23:47 (GMT) |
commit | 81e496741b55cf661f300b8eda4eba3a91010fb1 (patch) | |
tree | 303000502a24c6a65536babdabe15b4c9bfb6953 | |
parent | 8c652eebaacd8ebb77c256428a3cda8a1bf8b814 (diff) | |
download | tcl-81e496741b55cf661f300b8eda4eba3a91010fb1.zip tcl-81e496741b55cf661f300b8eda4eba3a91010fb1.tar.gz tcl-81e496741b55cf661f300b8eda4eba3a91010fb1.tar.bz2 |
add TCL_I_MODIFIER and use it in the correct places
-rw-r--r-- | win/tclWinChan.c | 2 | ||||
-rw-r--r-- | win/tclWinConsole.c | 2 | ||||
-rw-r--r-- | win/tclWinInt.h | 6 | ||||
-rw-r--r-- | win/tclWinPipe.c | 2 | ||||
-rw-r--r-- | win/tclWinSerial.c | 2 | ||||
-rw-r--r-- | win/tclWinSock.c | 8 |
6 files changed, 14 insertions, 8 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 0f17834..a20cb8f 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -1337,7 +1337,7 @@ TclWinOpenFileChannel( infoPtr->flags = appendMode; infoPtr->handle = handle; infoPtr->dirty = 0; - wsprintfA(channelName, "file%lx", PTR2INT(infoPtr)); + sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&fileChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinConsole.c b/win/tclWinConsole.c index 8be8e09..a86608c 100644 --- a/win/tclWinConsole.c +++ b/win/tclWinConsole.c @@ -1362,7 +1362,7 @@ TclWinOpenConsoleChannel( * for instance). */ - wsprintfA(channelName, "file%lx", PTR2INT(infoPtr)); + sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&consoleChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinInt.h b/win/tclWinInt.h index a76865d..2f6659c 100644 --- a/win/tclWinInt.h +++ b/win/tclWinInt.h @@ -35,6 +35,12 @@ #define VER_PLATFORM_WIN32_CE 3 #endif +#ifdef _WIN64 +# define TCL_I_MODIFIER "I" +#else +# define TCL_I_MODIFIER "" +#endif + /* * The following structure keeps track of whether we are using the * multi-byte or the wide-character interfaces to the operating system. diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 0ef8d19..9a529d2 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -1707,7 +1707,7 @@ TclpCreateCommandChannel( * unique, in case channels share handles (stdin/stdout). */ - wsprintfA(channelName, "file%lx", infoPtr); + sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&pipeChannelType, channelName, (ClientData) infoPtr, infoPtr->validMask); diff --git a/win/tclWinSerial.c b/win/tclWinSerial.c index fb092ff..1417c9c 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", PTR2INT(infoPtr)); + sprintf(channelName, "file" TCL_I_MODIFIER "x", (size_t)infoPtr); infoPtr->channel = Tcl_CreateChannel(&serialChannelType, channelName, (ClientData) infoPtr, permissions); diff --git a/win/tclWinSock.c b/win/tclWinSock.c index 9591163..0560bbe 100644 --- a/win/tclWinSock.c +++ b/win/tclWinSock.c @@ -1273,7 +1273,7 @@ Tcl_OpenTcpClient( return NULL; } - wsprintfA(channelName, "sock%d", infoPtr->socket); + sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE)); @@ -1338,7 +1338,7 @@ Tcl_MakeTcpClientChannel( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) infoPtr); - wsprintfA(channelName, "sock%d", infoPtr->socket); + sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, (TCL_READABLE | TCL_WRITABLE)); Tcl_SetChannelOption(NULL, infoPtr->channel, "-translation", "auto crlf"); @@ -1391,7 +1391,7 @@ Tcl_OpenTcpServer( infoPtr->acceptProc = acceptProc; infoPtr->acceptProcData = acceptProcData; - wsprintfA(channelName, "sock%d", infoPtr->socket); + sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)infoPtr->socket); infoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) infoPtr, 0); @@ -1497,7 +1497,7 @@ TcpAccept( SendMessage(tsdPtr->hwnd, SOCKET_SELECT, (WPARAM) SELECT, (LPARAM) newInfoPtr); - wsprintfA(channelName, "sock%d", newInfoPtr->socket); + sprintf(channelName, "sock" TCL_I_MODIFIER "u", (size_t)newInfoPtr->socket); newInfoPtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName, (ClientData) newInfoPtr, (TCL_READABLE | TCL_WRITABLE)); if (Tcl_SetChannelOption(NULL, newInfoPtr->channel, "-translation", |