From 8091425c93b8846adbfd2667a6b30120241d1552 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 29 May 2023 16:27:28 +0000 Subject: int -> Tcl_Size, for full Tcl 9 support --- unix/tclUnixChan.c | 15 ++++++++------- win/tclWinChan.c | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index f9a054a..f66e3c4 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -286,7 +286,7 @@ FileInputProc( */ do { - bytesRead = read(fsPtr->fd, buf, (size_t) toRead); + bytesRead = read(fsPtr->fd, buf, (size_t)toRead); } while ((bytesRead < 0) && (errno == EINTR)); if (bytesRead < 0) { @@ -335,7 +335,7 @@ FileOutputProc( return 0; } - written = write(fsPtr->fd, buf, (size_t) toWrite); + written = write(fsPtr->fd, buf, (size_t)toWrite); if (written >= 0) { return written; } @@ -748,7 +748,7 @@ FileGetOptionProc( if ((len > 1) && (strncmp(optionName, "-stat", len) == 0)) { Tcl_Obj *dictObj = StatOpenFile(fsPtr); const char *dictContents; - int dictLength; + Tcl_Size dictLength; if (dictObj == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -836,9 +836,9 @@ TtySetOptionProc( const char *value) /* New value for option. */ { TtyState *fsPtr = (TtyState *)instanceData; - unsigned int len, vlen; + size_t len, vlen; TtyAttrs tty; - int argc; + Tcl_Size argc; const char **argv; struct termios iostate; @@ -973,7 +973,8 @@ TtySetOptionProc( if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) { #if defined(TIOCMGET) && defined(TIOCMSET) - int i, control, flag; + int control, flag; + Tcl_Size i; if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) { return TCL_ERROR; @@ -1175,7 +1176,7 @@ TtyGetOptionProc( Tcl_DString *dsPtr) /* Where to store value(s). */ { TtyState *fsPtr = (TtyState *)instanceData; - unsigned int len; + size_t len; char buf[3*TCL_INTEGER_SPACE + 16]; int valid = 0; /* Flag if valid option parsed. */ struct termios iostate; diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 6774634..545aa2d 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -1010,7 +1010,7 @@ FileGetOptionProc( if (valid) { Tcl_Obj *dictObj = StatOpenFile(infoPtr); const char *dictContents; - int dictLength; + Tcl_Size dictLength; if (dictObj == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( -- cgit v0.12