summaryrefslogtreecommitdiffstats
path: root/generic/tclIOUtil.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIOUtil.c')
-rw-r--r--generic/tclIOUtil.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index 3a6233a..c366af9 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -539,7 +539,7 @@ TclFSCwdPointerEquals(
if (tsdPtr->cwdPathPtr == *pathPtrPtr) {
return 1;
} else {
- int len1, len2;
+ size_t len1, len2;
const char *str1, *str2;
str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1);
@@ -681,7 +681,7 @@ FsUpdateCwd(
Tcl_Obj *cwdObj,
ClientData clientData)
{
- int len = 0;
+ size_t len = 0;
const char *str = NULL;
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&fsDataKey);
@@ -1203,7 +1203,7 @@ FsAddMountsToGlobResult(
}
if (!found && dir) {
Tcl_Obj *norm;
- int len, mlen;
+ size_t len, mlen;
/*
* We know mElt is absolute normalized and lies inside pathPtr, so
@@ -1390,7 +1390,7 @@ TclFSNormalizeToUniquePath(
{
FilesystemRecord *fsRecPtr, *firstFsRecPtr;
- int i;
+ size_t i;
int isVfsPath = 0;
char *path;
@@ -1403,7 +1403,7 @@ TclFSNormalizeToUniquePath(
* We check these first to avoid useless calls to the native filesystem's
* normalizePathProc.
*/
- path = Tcl_GetStringFromObj(pathPtr, &i);
+ path = TclGetStringFromObj(pathPtr, &i);
if ( (i >= 3) && ( (path[0] == '/' && path[1] == '/')
|| (path[0] == '\\' && path[1] == '\\') ) ) {
@@ -1769,14 +1769,14 @@ Tcl_FSEvalFileEx(
Tcl_SetErrno(errno);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
return result;
}
chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
if (chan == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
return result;
}
@@ -1812,10 +1812,10 @@ Tcl_FSEvalFileEx(
Tcl_Close(interp, chan);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
goto end;
}
- string = Tcl_GetString(objPtr);
+ string = TclGetString(objPtr);
/*
* If first character is not a BOM, append the remaining characters,
@@ -1827,7 +1827,7 @@ Tcl_FSEvalFileEx(
Tcl_Close(interp, chan);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
goto end;
}
@@ -1903,17 +1903,17 @@ TclNREvalFile(
Tcl_SetErrno(errno);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
return TCL_ERROR;
}
chan = Tcl_FSOpenFileChannel(interp, pathPtr, "r", 0644);
if (chan == NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
return TCL_ERROR;
}
- TclPkgFileSeen(interp, Tcl_GetString(pathPtr));
+ TclPkgFileSeen(interp, TclGetString(pathPtr));
/*
* The eofchar is \32 (^Z). This is the usual on Windows, but we effect
@@ -1947,11 +1947,11 @@ TclNREvalFile(
Tcl_Close(interp, chan);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
- string = Tcl_GetString(objPtr);
+ string = TclGetString(objPtr);
/*
* If first character is not a BOM, append the remaining characters,
@@ -1963,7 +1963,7 @@ TclNREvalFile(
Tcl_Close(interp, chan);
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't read file \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
Tcl_DecrRefCount(objPtr);
return TCL_ERROR;
}
@@ -2017,14 +2017,14 @@ EvalFileCallback(
* Record information telling where the error occurred.
*/
- int length;
+ size_t length;
const char *pathString = TclGetStringFromObj(pathPtr, &length);
- const int limit = 150;
+ const unsigned int limit = 150;
int overflow = (length > limit);
Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf(
"\n (file \"%.*s%s\" line %d)",
- (overflow ? limit : length), pathString,
+ (overflow ? limit : (unsigned int)length), pathString,
(overflow ? "..." : ""), Tcl_GetErrorLine(interp)));
}
@@ -2301,7 +2301,7 @@ Tcl_FSOpenFileChannel(
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"could not seek to end of file while opening \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
}
Tcl_Close(NULL, retVal);
return NULL;
@@ -2320,7 +2320,7 @@ Tcl_FSOpenFileChannel(
if (interp != NULL) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't open \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
}
return NULL;
}
@@ -2868,7 +2868,7 @@ Tcl_FSGetCwd(
* bug when trying to normalize tsdPtr->cwdPathPtr.
*/
- int len1, len2;
+ size_t len1, len2;
const char *str1, *str2;
str1 = TclGetStringFromObj(tsdPtr->cwdPathPtr, &len1);
@@ -3228,7 +3228,7 @@ skipUnlink(
#ifndef AUFS_SUPER_MAGIC
#define AUFS_SUPER_MAGIC ('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
#endif /* AUFS_SUPER_MAGIC */
- if ((statfs(Tcl_GetString(shlibFile), &fs) == 0)
+ if ((statfs(TclGetString(shlibFile), &fs) == 0)
&& (fs.f_type == AUFS_SUPER_MAGIC)) {
return 1;
}
@@ -3304,7 +3304,7 @@ Tcl_LoadFile(
if (interp) {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"couldn't load library \"%s\": %s",
- Tcl_GetString(pathPtr), Tcl_PosixError(interp)));
+ TclGetString(pathPtr), Tcl_PosixError(interp)));
}
return TCL_ERROR;
}
@@ -4034,7 +4034,7 @@ Tcl_FSSplitPath(
if (sep != NULL) {
Tcl_IncrRefCount(sep);
- separator = Tcl_GetString(sep)[0];
+ separator = TclGetString(sep)[0];
Tcl_DecrRefCount(sep);
}
}
@@ -4046,7 +4046,7 @@ Tcl_FSSplitPath(
*/
result = Tcl_NewObj();
- p = Tcl_GetString(pathPtr);
+ p = TclGetString(pathPtr);
Tcl_ListObjAppendElement(NULL, result,
Tcl_NewStringObj(p, driveNameLength));
p += driveNameLength;
@@ -4123,7 +4123,7 @@ TclGetPathType(
* path, already with a refCount for the
* caller. */
{
- int pathLen;
+ size_t pathLen;
const char *path = TclGetStringFromObj(pathPtr, &pathLen);
Tcl_PathType type;
@@ -4231,16 +4231,16 @@ TclFSNonnativePathType(
}
while (numVolumes > 0) {
Tcl_Obj *vol;
- int len;
+ size_t len;
const char *strVol;
numVolumes--;
Tcl_ListObjIndex(NULL, thisFsVolumes, numVolumes, &vol);
strVol = TclGetStringFromObj(vol,&len);
- if (pathLen < len) {
+ if ((size_t) pathLen < len) {
continue;
}
- if (strncmp(strVol, path, (size_t) len) == 0) {
+ if (strncmp(strVol, path, len) == 0) {
type = TCL_PATH_ABSOLUTE;
if (filesystemPtrPtr != NULL) {
*filesystemPtrPtr = fsRecPtr->fsPtr;
@@ -4579,14 +4579,14 @@ Tcl_FSRemoveDirectory(
if (cwdPtr != NULL) {
const char *cwdStr, *normPathStr;
- int cwdLen, normLen;
+ size_t cwdLen, normLen;
Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);
if (normPath != NULL) {
normPathStr = TclGetStringFromObj(normPath, &normLen);
cwdStr = TclGetStringFromObj(cwdPtr, &cwdLen);
if ((cwdLen >= normLen) && (strncmp(normPathStr, cwdStr,
- (size_t) normLen) == 0)) {
+ normLen) == 0)) {
/*
* The cwd is inside the directory, so we perform a 'cd
* [file dirname $path]'.