summaryrefslogtreecommitdiffstats
path: root/generic/tclFCmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclFCmd.c')
-rw-r--r--generic/tclFCmd.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/generic/tclFCmd.c b/generic/tclFCmd.c
index 2d24207..89550d9 100644
--- a/generic/tclFCmd.c
+++ b/generic/tclFCmd.c
@@ -47,7 +47,7 @@ static int FileForceOption(Tcl_Interp *interp,
int
TclFileRenameCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Interp for error reporting or recursive
* calls in the case of a tricky rename. */
int objc, /* Number of arguments. */
@@ -76,7 +76,7 @@ TclFileRenameCmd(
int
TclFileCopyCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for error reporting or recursive calls
* in the case of a tricky copy. */
int objc, /* Number of arguments. */
@@ -214,13 +214,14 @@ FileCopyRename(
int
TclFileMakeDirsCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for error reporting. */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
{
Tcl_Obj *errfile = NULL;
- int result, i, j, pobjc;
+ int result, i;
+ size_t j, pobjc;
Tcl_Obj *split = NULL;
Tcl_Obj *target = NULL;
Tcl_StatBuf statBuf;
@@ -338,7 +339,7 @@ TclFileMakeDirsCmd(
int
TclFileDeleteCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* Used for error reporting */
int objc, /* Number of arguments */
Tcl_Obj *const objv[]) /* Argument strings passed to Tcl_FileCmd. */
@@ -870,10 +871,10 @@ FileForceOption(
static Tcl_Obj *
FileBasename(
- Tcl_Interp *interp, /* Interp, for error return. */
+ TCL_UNUSED(Tcl_Interp *), /* Interp, for error return. */
Tcl_Obj *pathPtr) /* Path whose basename to extract. */
{
- int objc;
+ size_t objc;
Tcl_Obj *splitPtr;
Tcl_Obj *resultPtr = NULL;
@@ -881,17 +882,8 @@ FileBasename(
Tcl_IncrRefCount(splitPtr);
if (objc != 0) {
- if ((objc == 1) && (*TclGetString(pathPtr) == '~')) {
- Tcl_DecrRefCount(splitPtr);
- if (Tcl_FSConvertToPathType(interp, pathPtr) != TCL_OK) {
- return NULL;
- }
- splitPtr = Tcl_FSSplitPath(pathPtr, &objc);
- Tcl_IncrRefCount(splitPtr);
- }
-
- /*
- * Return the last component, unless it is the only component, and it
+ /*
+ * Return the last component, unless it is the only component, and it
* is the root of an absolute path.
*/
@@ -946,7 +938,7 @@ FileBasename(
int
TclFileAttrsCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp, /* The interpreter for error reporting. */
int objc, /* Number of command line arguments. */
Tcl_Obj *const objv[]) /* The command line objects. */
@@ -955,7 +947,7 @@ TclFileAttrsCmd(
const char *const *attributeStrings;
const char **attributeStringsAllocated = NULL;
Tcl_Obj *objStrings = NULL;
- int numObjStrings = -1;
+ size_t numObjStrings = TCL_INDEX_NONE;
Tcl_Obj *filePtr;
if (objc < 2) {
@@ -979,7 +971,7 @@ TclFileAttrsCmd(
attributeStrings = Tcl_FSFileAttrStrings(filePtr, &objStrings);
if (attributeStrings == NULL) {
- int index;
+ size_t index;
Tcl_Obj *objPtr;
if (objStrings == NULL) {
@@ -1162,7 +1154,7 @@ TclFileAttrsCmd(
int
TclFileLinkCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1313,7 +1305,7 @@ TclFileLinkCmd(
int
TclFileReadLinkCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1364,7 +1356,7 @@ TclFileReadLinkCmd(
int
TclFileTemporaryCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1389,9 +1381,9 @@ TclFileTemporaryCmd(
TclNewObj(nameObj);
}
if (objc > 2) {
- int length;
+ size_t length;
Tcl_Obj *templateObj = objv[2];
- const char *string = TclGetStringFromObj(templateObj, &length);
+ const char *string = Tcl_GetStringFromObj(templateObj, &length);
/*
* Treat an empty string as if it wasn't there.
@@ -1523,7 +1515,7 @@ TclFileTemporaryCmd(
int
TclFileTempDirCmd(
- TCL_UNUSED(ClientData),
+ TCL_UNUSED(void *),
Tcl_Interp *interp,
int objc,
Tcl_Obj *const objv[])
@@ -1543,7 +1535,7 @@ TclFileTempDirCmd(
if (objc > 1) {
int length;
Tcl_Obj *templateObj = objv[1];
- const char *string = TclGetStringFromObj(templateObj, &length);
+ const char *string = Tcl_GetStringFromObj(templateObj, &length);
const int onWindows = (tclPlatform == TCL_PLATFORM_WINDOWS);
/*