diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-03-30 08:41:50 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-03-30 08:41:50 (GMT) |
| commit | 254025c6d682cfde6e1cada371c419af7c60087b (patch) | |
| tree | 80cef3a45304cecf6752d3c8c1d587ec3dc9974d /unix/tclUnixPipe.c | |
| parent | b915f649c229620e5a17add0e25b85ee99c9c91d (diff) | |
| download | tcl-254025c6d682cfde6e1cada371c419af7c60087b.zip tcl-254025c6d682cfde6e1cada371c419af7c60087b.tar.gz tcl-254025c6d682cfde6e1cada371c419af7c60087b.tar.bz2 | |
Fix some -Wconversion warningscore-conversion-warning
Diffstat (limited to 'unix/tclUnixPipe.c')
| -rw-r--r-- | unix/tclUnixPipe.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index 8d4a6b0..ca452d7 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -34,8 +34,8 @@ * the same as NULL. */ -#define MakeFile(fd) ((TclFile) INT2PTR(((int) (fd)) + 1)) -#define GetFd(file) (PTR2INT(file) - 1) +#define MakeFile(fd) ((TclFile)INT2PTR((fd) + 1)) +#define GetFd(file) ((int)PTR2INT(file) - 1) /* * This structure describes per-instance state of a pipe based channel. @@ -426,7 +426,8 @@ TclpCreateProcess( * process. */ { TclFile errPipeIn, errPipeOut; - int count, status, fd; + ssize_t count; + int status, fd; char errSpace[200 + TCL_INTEGER_SPACE]; Tcl_DString *volatile dsArray; char **volatile newArgv; @@ -630,7 +631,7 @@ TclpCreateProcess( char *end; errSpace[count] = 0; - errno = strtol(errSpace, &end, 10); + errno = (int)strtol(errSpace, &end, 10); Tcl_SetObjResult(interp, Tcl_ObjPrintf("%s: %s", end, Tcl_PosixError(interp))); goto error; @@ -1147,7 +1148,7 @@ PipeInputProc( int *errorCodePtr) /* Where to store error code. */ { PipeState *psPtr = (PipeState *)instanceData; - int bytesRead; /* How many bytes were actually read from the + ssize_t bytesRead; /* How many bytes were actually read from the * input device? */ *errorCodePtr = 0; @@ -1168,7 +1169,7 @@ PipeInputProc( *errorCodePtr = errno; return -1; } - return bytesRead; + return (int)bytesRead; } /* @@ -1197,7 +1198,7 @@ PipeOutputProc( int *errorCodePtr) /* Where to store error code. */ { PipeState *psPtr = (PipeState *)instanceData; - int written; + ssize_t written; *errorCodePtr = 0; @@ -1214,7 +1215,7 @@ PipeOutputProc( *errorCodePtr = errno; return -1; } - return written; + return (int)written; } /* |
