summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-03-30 18:01:48 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-03-30 18:01:48 (GMT)
commit5a1359a5e8aa149cea117f4f34239cd3a23872f4 (patch)
tree85a0e53462d5b6da6b74451e0c3f9d59004369ed /unix
parentedb3e7b8d2efcb3a1282f910f1e7120d5d34c6f8 (diff)
downloadtcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.zip
tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.gz
tcl-5a1359a5e8aa149cea117f4f34239cd3a23872f4.tar.bz2
TIP 660. No compiler warnings. Tests suite pass on Win and Ubuntu
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixChan.c4
-rw-r--r--unix/tclUnixFCmd.c12
-rw-r--r--unix/tclUnixInit.c10
3 files changed, 13 insertions, 13 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index b81676e..0b4b6e3 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -596,7 +596,7 @@ TtySetOptionProc(
TtyState *fsPtr = (TtyState *)instanceData;
size_t len, vlen;
TtyAttrs tty;
- size_t argc;
+ Tcl_Size argc;
const char **argv;
struct termios iostate;
@@ -732,7 +732,7 @@ TtySetOptionProc(
if ((len > 4) && (strncmp(optionName, "-ttycontrol", len) == 0)) {
#if defined(TIOCMGET) && defined(TIOCMSET)
int control, flag;
- size_t i;
+ Tcl_Size i;
if (Tcl_SplitList(interp, value, &argc, &argv) == TCL_ERROR) {
return TCL_ERROR;
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index b8911df..10292f0 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -549,7 +549,7 @@ TclUnixCopyFile(
int srcFd, dstFd;
size_t blockSize; /* Optimal I/O blocksize for filesystem */
char *buffer; /* Data buffer for copy */
- size_t nread;
+ ssize_t nread;
#ifdef DJGPP
#define BINMODE |O_BINARY
@@ -606,18 +606,18 @@ TclUnixCopyFile(
buffer = (char *)Tcl_Alloc(blockSize);
while (1) {
nread = read(srcFd, buffer, blockSize);
- if ((nread == TCL_IO_FAILURE) || (nread == 0)) {
+ if ((nread == -1) || (nread == 0)) {
break;
}
- if ((size_t) write(dstFd, buffer, nread) != nread) {
- nread = TCL_IO_FAILURE;
+ if (write(dstFd, buffer, nread) != nread) {
+ nread = -1;
break;
}
}
Tcl_Free(buffer);
close(srcFd);
- if ((close(dstFd) != 0) || (nread == TCL_IO_FAILURE)) {
+ if ((close(dstFd) != 0) || (nread == -1)) {
unlink(dst); /* INTL: Native. */
return TCL_ERROR;
}
@@ -2052,7 +2052,7 @@ TclpObjNormalizePath(
nativePath = Tcl_UtfToExternalDString(NULL, path,nextCheckpoint, &ds);
if (Realpath(nativePath, normPath) != NULL) {
- size_t newNormLen;
+ Tcl_Size newNormLen;
wholeStringOk:
newNormLen = strlen(normPath);
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 71b059a..955609e 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -478,7 +478,7 @@ TclpInitLibraryPath(
if ((str != NULL) && (str[0] != '\0')) {
Tcl_DString ds;
- size_t pathc;
+ Tcl_Size pathc;
const char **pathv;
char installLib[LIBRARY_SIZE];
@@ -1002,7 +1002,7 @@ TclpSetVariables(
*
* Results:
* The return value is the index in environ of an entry with the name
- * "name", or TCL_INDEX_NONE if there is no such entry. The integer at *lengthPtr is
+ * "name", or -1 if there is no such entry. The integer at *lengthPtr is
* filled in with the length of name (if a matching entry is found) or
* the length of the environ array (if no matching entry is found).
*
@@ -1012,16 +1012,16 @@ TclpSetVariables(
*----------------------------------------------------------------------
*/
-size_t
+Tcl_Size
TclpFindVariable(
const char *name, /* Name of desired environment variable
* (native). */
- size_t *lengthPtr) /* Used to return length of name (for
+ Tcl_Size *lengthPtr) /* Used to return length of name (for
* successful searches) or number of non-NULL
* entries in environ (for unsuccessful
* searches). */
{
- size_t i, result = TCL_INDEX_NONE;
+ Tcl_Size i, result = -1;
const char *env, *p1, *p2;
Tcl_DString envString;