summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixSock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-02 15:55:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-06-02 15:55:28 (GMT)
commite5e69970a1b906c5b77c200e38c943b61a498315 (patch)
treec3921e87580e58764e15120e3d4f34c1a4daec4f /unix/tclUnixSock.c
parent209485eee104ea7c68f7c713a8371f35b2f59d85 (diff)
parent211f4f652248b5d40573bb51fbfe7ed687e5eded (diff)
downloadtcl-e5e69970a1b906c5b77c200e38c943b61a498315.zip
tcl-e5e69970a1b906c5b77c200e38c943b61a498315.tar.gz
tcl-e5e69970a1b906c5b77c200e38c943b61a498315.tar.bz2
Merge 8.6. Eliminate some (long) typecasts
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r--unix/tclUnixSock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 076678c..91d84f3 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -23,7 +23,7 @@
/* "sock" + a pointer in hex + \0 */
#define SOCK_CHAN_LENGTH (4 + sizeof(void *) * 2 + 1)
-#define SOCK_TEMPLATE "sock%lx"
+#define SOCK_TEMPLATE "sock%" TCL_Z_MODIFIER "x"
#undef SOCKET /* Possible conflict with win32 SOCKET */
@@ -1451,7 +1451,7 @@ Tcl_OpenTcpClient(
return NULL;
}
- sprintf(channelName, SOCK_TEMPLATE, (long) statePtr);
+ sprintf(channelName, SOCK_TEMPLATE, PTR2INT(statePtr));
statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
statePtr, TCL_READABLE | TCL_WRITABLE);
@@ -1518,7 +1518,7 @@ TclpMakeTcpClientChannelMode(
statePtr->fds.fd = PTR2INT(sock);
statePtr->flags = 0;
- sprintf(channelName, SOCK_TEMPLATE, (long)statePtr);
+ sprintf(channelName, SOCK_TEMPLATE, PTR2INT(statePtr));
statePtr->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
statePtr, mode);
@@ -1740,7 +1740,7 @@ Tcl_OpenTcpServerEx(
memset(statePtr, 0, sizeof(TcpState));
statePtr->acceptProc = acceptProc;
statePtr->acceptProcData = acceptProcData;
- sprintf(channelName, SOCK_TEMPLATE, (long) statePtr);
+ sprintf(channelName, SOCK_TEMPLATE, PTR2INT(statePtr));
newfds = &statePtr->fds;
} else {
newfds = (TcpFdList *)ckalloc(sizeof(TcpFdList));
@@ -1832,7 +1832,7 @@ TcpAccept(
newSockState->flags = 0;
newSockState->fds.fd = newsock;
- sprintf(channelName, SOCK_TEMPLATE, (long) newSockState);
+ sprintf(channelName, SOCK_TEMPLATE, PTR2INT(newSockState));
newSockState->channel = Tcl_CreateChannel(&tcpChannelType, channelName,
newSockState, TCL_READABLE | TCL_WRITABLE);