diff options
author | das <das> | 2006-11-13 08:23:06 (GMT) |
---|---|---|
committer | das <das> | 2006-11-13 08:23:06 (GMT) |
commit | 14658604dc06848987405fc50bd939df33cd8796 (patch) | |
tree | 99d99df3c8e5314426464d9cf33cc3f090935734 /unix/tclUnixPipe.c | |
parent | 28b521aa54b70b09061301be5da23d1b4bf33f8e (diff) | |
download | tcl-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/tclUnixPipe.c')
-rw-r--r-- | unix/tclUnixPipe.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index c177f67..7cf9e2b 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.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: tclUnixPipe.c,v 1.35 2006/08/02 20:04:11 das Exp $ + * RCS: @(#) $Id: tclUnixPipe.c,v 1.36 2006/11/13 08:23:11 das Exp $ */ #include "tclInt.h" @@ -25,8 +25,8 @@ * the same as NULL. */ -#define MakeFile(fd) ((TclFile)(((int)fd)+1)) -#define GetFd(file) (((int)file)-1) +#define MakeFile(fd) ((TclFile)INT2PTR(((int)(fd))+1)) +#define GetFd(file) (PTR2INT(file)-1) /* * This structure describes per-instance state of a pipe based channel. @@ -113,7 +113,7 @@ TclpMakeFile( if (Tcl_GetChannelHandle(channel, direction, (ClientData *) &data) == TCL_OK) { - return MakeFile((int) data); + return MakeFile(PTR2INT(data)); } else { return (TclFile) NULL; } @@ -513,7 +513,7 @@ TclpCreateProcess( } TclpCloseFile(errPipeIn); - *pidPtr = (Tcl_Pid) pid; + *pidPtr = (Tcl_Pid) INT2PTR(pid); return TCL_OK; error: @@ -525,7 +525,7 @@ TclpCreateProcess( * here, since this is the error case. [Bug: 6148] */ - Tcl_WaitPid((Tcl_Pid) pid, &status, 0); + Tcl_WaitPid((Tcl_Pid) INT2PTR(pid), &status, 0); } if (errPipeIn) { @@ -964,7 +964,7 @@ PipeCloseProc( if (pipePtr->errorFile) { errChan = Tcl_MakeFileChannel( - (ClientData) GetFd(pipePtr->errorFile), TCL_READABLE); + (ClientData) INT2PTR(GetFd(pipePtr->errorFile)), TCL_READABLE); } else { errChan = NULL; } @@ -1157,11 +1157,11 @@ PipeGetHandleProc( PipeState *psPtr = (PipeState *) instanceData; if (direction == TCL_READABLE && psPtr->inFile) { - *handlePtr = (ClientData) GetFd(psPtr->inFile); + *handlePtr = (ClientData) INT2PTR(GetFd(psPtr->inFile)); return TCL_OK; } if (direction == TCL_WRITABLE && psPtr->outFile) { - *handlePtr = (ClientData) GetFd(psPtr->outFile); + *handlePtr = (ClientData) INT2PTR(GetFd(psPtr->outFile)); return TCL_OK; } return TCL_ERROR; @@ -1192,11 +1192,11 @@ Tcl_WaitPid( int result; pid_t real_pid; - real_pid = (pid_t) pid; + real_pid = (pid_t) PTR2INT(pid); while (1) { result = (int) waitpid(real_pid, statPtr, options); if ((result != -1) || (errno != EINTR)) { - return (Tcl_Pid) result; + return (Tcl_Pid) INT2PTR(result); } } } |