summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixFile.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
commit4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f (patch)
treed5db4ca8a1fecbd63d9e72730fad2f404367daff /unix/tclUnixFile.c
parent63994a73e3f641451b26f48f697b6a069863751c (diff)
parent52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (diff)
downloadtcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.zip
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.gz
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.bz2
Merge 8.7
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r--unix/tclUnixFile.c35
1 files changed, 20 insertions, 15 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c
index 944bec8..83c194a 100644
--- a/unix/tclUnixFile.c
+++ b/unix/tclUnixFile.c
@@ -44,6 +44,8 @@ TclpFindExecutable(
size_t length;
wchar_t buf[PATH_MAX];
char name[PATH_MAX * 3 + 1];
+ (void)argv0;
+
GetModuleFileNameW(NULL, buf, PATH_MAX);
cygwin_conv_path(3, buf, name, PATH_MAX);
length = strlen(name);
@@ -249,9 +251,9 @@ TclpMatchInDirectory(
Tcl_Obj *tailPtr;
const char *nativeTail;
- native = Tcl_FSGetNativePath(pathPtr);
+ native = (const char *)Tcl_FSGetNativePath(pathPtr);
tailPtr = TclPathPart(interp, pathPtr, TCL_PATH_TAIL);
- nativeTail = Tcl_FSGetNativePath(tailPtr);
+ nativeTail = (const char *)Tcl_FSGetNativePath(tailPtr);
matchResult = NativeMatchType(interp, native, nativeTail, types);
if (matchResult == 1) {
Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
@@ -555,6 +557,8 @@ NativeMatchType(
return matchResult;
}
}
+#else
+ (void)interp;
#endif /* MAC_OSX_TCL */
return 1;
@@ -622,7 +626,7 @@ TclpObjAccess(
Tcl_Obj *pathPtr, /* Path of file to access */
int mode) /* Permission setting. */
{
- const char *path = Tcl_FSGetNativePath(pathPtr);
+ const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
@@ -650,7 +654,7 @@ int
TclpObjChdir(
Tcl_Obj *pathPtr) /* Path to new working directory */
{
- const char *path = Tcl_FSGetNativePath(pathPtr);
+ const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
@@ -679,7 +683,7 @@ TclpObjLstat(
Tcl_Obj *pathPtr, /* Path of file to stat */
Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */
{
- return TclOSlstat(Tcl_FSGetNativePath(pathPtr), bufPtr);
+ return TclOSlstat((const char *)Tcl_FSGetNativePath(pathPtr), bufPtr);
}
/*
@@ -720,7 +724,7 @@ TclpGetNativeCwd(
#endif /* USEGETWD */
if ((clientData == NULL) || strcmp(buffer, (const char *) clientData)) {
- char *newCd = Tcl_Alloc(strlen(buffer) + 1);
+ char *newCd = (char*)Tcl_Alloc(strlen(buffer) + 1);
strcpy(newCd, buffer);
return newCd;
@@ -847,7 +851,7 @@ TclpObjStat(
Tcl_Obj *pathPtr, /* Path of file to stat */
Tcl_StatBuf *bufPtr) /* Filled with results of stat call. */
{
- const char *path = Tcl_FSGetNativePath(pathPtr);
+ const char *path = (const char *)Tcl_FSGetNativePath(pathPtr);
if (path == NULL) {
return -1;
@@ -864,7 +868,7 @@ TclpObjLink(
int linkAction)
{
if (toPtr != NULL) {
- const char *src = Tcl_FSGetNativePath(pathPtr);
+ const char *src = (const char *)Tcl_FSGetNativePath(pathPtr);
const char *target = NULL;
if (src == NULL) {
@@ -910,7 +914,7 @@ TclpObjLink(
Tcl_DecrRefCount(absPtr);
Tcl_DecrRefCount(dirPtr);
} else {
- target = Tcl_FSGetNativePath(toPtr);
+ target = (const char*)Tcl_FSGetNativePath(toPtr);
if (target == NULL) {
return NULL;
}
@@ -983,7 +987,7 @@ TclpObjLink(
}
Tcl_DecrRefCount(transPtr);
- length = readlink(Tcl_FSGetNativePath(pathPtr), link, sizeof(link));
+ length = readlink((const char *)Tcl_FSGetNativePath(pathPtr), link, sizeof(link));
if (length < 0) {
return NULL;
}
@@ -1019,6 +1023,7 @@ Tcl_Obj *
TclpFilesystemPathType(
Tcl_Obj *pathPtr)
{
+ (void)pathPtr;
/*
* All native paths are of the same type.
*/
@@ -1116,7 +1121,7 @@ TclNativeCreateNativeRep(
return NULL;
}
Tcl_DecrRefCount(validPathPtr);
- nativePathPtr = Tcl_Alloc(len);
+ nativePathPtr = (char *)Tcl_Alloc(len);
memcpy(nativePathPtr, Tcl_DStringValue(&ds), len);
Tcl_DStringFree(&ds);
@@ -1157,7 +1162,7 @@ TclNativeDupInternalRep(
len = (strlen((const char*) clientData) + 1) * sizeof(char);
- copy = Tcl_Alloc(len);
+ copy = (char *)Tcl_Alloc(len);
memcpy(copy, clientData, len);
return copy;
}
@@ -1183,7 +1188,7 @@ TclpUtime(
Tcl_Obj *pathPtr, /* File to modify */
struct utimbuf *tval) /* New modification date structure */
{
- return utime(Tcl_FSGetNativePath(pathPtr), tval);
+ return utime((const char *)Tcl_FSGetNativePath(pathPtr), tval);
}
#ifdef __CYGWIN__
@@ -1194,7 +1199,7 @@ TclOSstat(
void *cygstat)
{
struct stat buf;
- Tcl_StatBuf *statBuf = cygstat;
+ Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
int result = stat(name, &buf);
statBuf->st_mode = buf.st_mode;
@@ -1217,7 +1222,7 @@ TclOSlstat(
void *cygstat)
{
struct stat buf;
- Tcl_StatBuf *statBuf = cygstat;
+ Tcl_StatBuf *statBuf = (Tcl_StatBuf *)cygstat;
int result = lstat(name, &buf);
statBuf->st_mode = buf.st_mode;