diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-04-01 08:13:35 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2025-04-01 08:13:35 (GMT) |
| commit | 79ed51d25a48dce0d084a2c57f199821e58eac99 (patch) | |
| tree | 8de2f1cd37877eb5773cd0106a1de4e42703d936 /unix/tclUnixFCmd.c | |
| parent | b915f649c229620e5a17add0e25b85ee99c9c91d (diff) | |
| parent | 254025c6d682cfde6e1cada371c419af7c60087b (diff) | |
| download | tcl-79ed51d25a48dce0d084a2c57f199821e58eac99.zip tcl-79ed51d25a48dce0d084a2c57f199821e58eac99.tar.gz tcl-79ed51d25a48dce0d084a2c57f199821e58eac99.tar.bz2 | |
Fix some -Wconversion warnings
Diffstat (limited to 'unix/tclUnixFCmd.c')
| -rw-r--r-- | unix/tclUnixFCmd.c | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index db45999..df0cd00 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -452,11 +452,11 @@ DoCopyFile( } } - switch ((int) (statBufPtr->st_mode & S_IFMT)) { + switch ((int)(statBufPtr->st_mode & S_IFMT)) { #ifndef DJGPP case S_IFLNK: { char linkBuf[MAXPATHLEN+1]; - int length; + ssize_t length; length = readlink(src, linkBuf, MAXPATHLEN); /* INTL: Native. */ if (length == -1) { @@ -1069,7 +1069,7 @@ TraverseUnixTree( while ((ent = fts_read(fts)) != NULL) { unsigned short info = ent->fts_info; char *path = ent->fts_path + sourceLen; - unsigned short pathlen = ent->fts_pathlen - sourceLen; + Tcl_Size pathlen = ent->fts_pathlen - sourceLen; int type; Tcl_StatBuf *statBufPtr = NULL; @@ -1432,10 +1432,10 @@ GetOwnerAttribute( static int GetPermissionsAttribute( - Tcl_Interp *interp, /* The interp we are using for errors. */ + Tcl_Interp *interp, /* The interp we are using for errors. */ TCL_UNUSED(int) /*objIndex*/, - Tcl_Obj *fileName, /* The name of the file (UTF-8). */ - Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ + Tcl_Obj *fileName, /* The name of the file (UTF-8). */ + Tcl_Obj **attributePtrPtr) /* A pointer to return the object with. */ { Tcl_StatBuf statBuf; int result; @@ -1626,7 +1626,7 @@ SetPermissionsAttribute( int result = TCL_ERROR; const char *native; const char *modeStringPtr = TclGetString(attributePtr); - int scanned = TclParseAllWhiteSpace(modeStringPtr, -1); + Tcl_Size scanned = TclParseAllWhiteSpace(modeStringPtr, -1); /* * First supply support for octal number format @@ -1740,7 +1740,7 @@ TclpObjListVolumes(void) static int GetModeFromPermString( TCL_UNUSED(Tcl_Interp *), - const char *modeStringPtr, /* Permissions string */ + const char *modeStringPtr, /* Permissions string */ mode_t *modePtr) /* pointer to the mode value */ { mode_t newMode; @@ -1933,8 +1933,7 @@ TclpObjNormalizePath( * be 0 or the offset of a directory separator * at the end of a path part that is already * normalized. I.e. this is not the index of - * the byte just after the separator. */ - + * the byte just after the separator. */ { const char *currentPathEndPosition; char cur; @@ -1978,7 +1977,7 @@ TclpObjNormalizePath( * routine should be reviewed and cleaed up. */ } else { - nextCheckpoint = lastDir - path; + nextCheckpoint = (int)(lastDir - path); goto wholeStringOk; } } @@ -2021,7 +2020,7 @@ TclpObjNormalizePath( * Assign the end of the current component to nextCheckpoint */ - nextCheckpoint = currentPathEndPosition - path; + nextCheckpoint = (int)(currentPathEndPosition - path); } else if (cur == 0) { /* * The end of the string. @@ -2096,7 +2095,7 @@ TclpObjNormalizePath( * Append the remaining path components. */ - int normLen = Tcl_DStringLength(&ds); + Tcl_Size normLen = Tcl_DStringLength(&ds); Tcl_DStringAppend(&ds, path + nextCheckpoint, pathLen - nextCheckpoint); @@ -2106,13 +2105,13 @@ TclpObjNormalizePath( * been processed */ - nextCheckpoint = normLen + 1; + nextCheckpoint = (int)normLen + 1; } else { /* * We recognise the whole string. */ - nextCheckpoint = Tcl_DStringLength(&ds); + nextCheckpoint = (int)Tcl_DStringLength(&ds); } Tcl_SetStringObj(pathPtr, Tcl_DStringValue(&ds), @@ -2214,7 +2213,7 @@ TclUnixOpenTemporaryFile( return -1; } TclDStringAppendDString(&templ, &tmp); - fd = mkstemps(Tcl_DStringValue(&templ), Tcl_DStringLength(&tmp)); + fd = mkstemps(Tcl_DStringValue(&templ), (int)Tcl_DStringLength(&tmp)); Tcl_DStringFree(&tmp); } else #endif @@ -2387,7 +2386,7 @@ static WCHAR * winPathFromObj( Tcl_Obj *fileName) { - size_t size; + int size; const char *native = (const char *)Tcl_FSGetNativePath(fileName); WCHAR *winPath; @@ -2462,10 +2461,10 @@ GetUnixFileAttributes( static int SetUnixFileAttributes( - Tcl_Interp *interp, /* The interp we are using for errors. */ - int objIndex, /* The index of the attribute. */ - Tcl_Obj *fileName, /* The name of the file (UTF-8). */ - Tcl_Obj *attributePtr) /* The attribute to set. */ + Tcl_Interp *interp, /* The interp we are using for errors. */ + int objIndex, /* The index of the attribute. */ + Tcl_Obj *fileName, /* The name of the file (UTF-8). */ + Tcl_Obj *attributePtr) /* The attribute to set. */ { int yesNo, fileAttributes, old; WCHAR *winPath; |
