summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixChan.c
diff options
context:
space:
mode:
authordas <das>2006-11-13 08:23:06 (GMT)
committerdas <das>2006-11-13 08:23:06 (GMT)
commit14658604dc06848987405fc50bd939df33cd8796 (patch)
tree99d99df3c8e5314426464d9cf33cc3f090935734 /unix/tclUnixChan.c
parent28b521aa54b70b09061301be5da23d1b4bf33f8e (diff)
downloadtcl-14658604dc06848987405fc50bd939df33cd8796.zip
tcl-14658604dc06848987405fc50bd939df33cd8796.tar.gz
tcl-14658604dc06848987405fc50bd939df33cd8796.tar.bz2
* generic/tclCompExpr.c: fix gcc warnings about 'cast to/from
* generic/tclEncoding.c: pointer from/to integer of different * generic/tclEvent.c: size' on 64-bit platforms by casting to * generic/tclExecute.c: intermediate types intptr_t/uintptr_t * generic/tclHash.c: via new PTR2INT(), INT2PTR(), * generic/tclIO.c: PTR2UINT() and UINT2PTR() macros. * generic/tclInt.h: [Patch 1592791] * generic/tclProc.c: * generic/tclTest.c: * generic/tclThreadStorage.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/configure.in: * unix/tclUnixChan.c: * unix/tclUnixPipe.c: * unix/tclUnixPort.h: * unix/tclUnixTest.c: * unix/tclUnixThrd.c: * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
Diffstat (limited to 'unix/tclUnixChan.c')
-rw-r--r--unix/tclUnixChan.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index df51411..b737b09 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixChan.c,v 1.72 2006/09/07 09:17:33 vasiljevic Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.73 2006/11/13 08:23:11 das Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -729,7 +729,7 @@ FileGetHandleProc(
FileState *fsPtr = (FileState *) instanceData;
if (direction & fsPtr->validMask) {
- *handlePtr = (ClientData) fsPtr->fd;
+ *handlePtr = (ClientData) INT2PTR(fsPtr->fd);
return TCL_OK;
} else {
return TCL_ERROR;
@@ -1900,7 +1900,7 @@ Tcl_MakeFileChannel(
{
FileState *fsPtr;
char channelName[16 + TCL_INTEGER_SPACE];
- int fd = (int) handle;
+ int fd = PTR2INT(handle);
Tcl_ChannelType *channelTypePtr;
struct sockaddr sockaddr;
socklen_t sockaddrLen = sizeof(sockaddr);
@@ -1921,7 +1921,7 @@ Tcl_MakeFileChannel(
if (getsockname(fd, (struct sockaddr *)&sockaddr, &sockaddrLen) == 0
&& sockaddrLen > 0
&& sockaddr.sa_family == AF_INET) {
- return MakeTcpClientChannelMode((ClientData) fd, mode);
+ return MakeTcpClientChannelMode((ClientData) INT2PTR(fd), mode);
} else {
channelTypePtr = &fileChannelType;
fsPtr = (FileState *) ckalloc((unsigned) sizeof(FileState));
@@ -2423,7 +2423,7 @@ TcpGetHandleProc(
{
TcpState *statePtr = (TcpState *) instanceData;
- *handlePtr = (ClientData)statePtr->fd;
+ *handlePtr = (ClientData) INT2PTR(statePtr->fd);
return TCL_OK;
}
@@ -2792,7 +2792,7 @@ MakeTcpClientChannelMode(
char channelName[16 + TCL_INTEGER_SPACE];
statePtr = (TcpState *) ckalloc((unsigned) sizeof(TcpState));
- statePtr->fd = (int) sock;
+ statePtr->fd = PTR2INT(sock);
statePtr->flags = 0;
statePtr->acceptProc = NULL;
statePtr->acceptProcData = NULL;
@@ -2998,7 +2998,7 @@ TclpGetDefaultStdChannel(
#undef ZERO_OFFSET
#undef ERROR_OFFSET
- channel = Tcl_MakeFileChannel((ClientData) fd, mode);
+ channel = Tcl_MakeFileChannel((ClientData) INT2PTR(fd), mode);
if (channel == NULL) {
return NULL;
}
@@ -3088,7 +3088,7 @@ Tcl_GetOpenFile(
if (Tcl_GetChannelHandle(chan,
(forWriting ? TCL_WRITABLE : TCL_READABLE),
(ClientData*) &data) == TCL_OK) {
- fd = (int) data;
+ fd = PTR2INT(data);
/*
* The call to fdopen below is probably dangerous, since it will