summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclFileName.c29
-rw-r--r--generic/tclIOUtil.c6
-rw-r--r--unix/tclUnixFCmd.c3
4 files changed, 21 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 6984dca..88c8251 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2001-08-23 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * unix/tclUnixFCmd.c:
+ * generic/tclIOUtil.c:
+ * generic/tclFileName.c: corrected minor compiler warnings.
+
2001-08-24 Vince Darley <vincentdarley@users.sourceforge.net>
Variety of small filesystem and vfs issues fixed or improved.
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index d9d7b62..e4c484d 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclFileName.c,v 1.17 2001/08/23 17:37:07 vincentdarley Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.18 2001/08/23 18:20:50 hobbs Exp $
*/
#include "tclInt.h"
@@ -538,9 +538,9 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
* of pointers to path elements. */
{
Tcl_Obj *resultPtr = NULL; /* Needed only to prevent gcc warnings. */
- Tcl_Obj *tmpPtr;
- int i, size;
- char *p;
+ Tcl_Obj *tmpPtr, *eltPtr;
+ int i, size, len;
+ char *p, *str;
/*
* Perform the splitting, using objectified, vfs-aware code.
@@ -555,11 +555,8 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
size = 1;
for (i = 0; i < *argcPtr; i++) {
- int len;
- Tcl_Obj *elt;
-
- Tcl_ListObjIndex(NULL, resultPtr, i, &elt);
- Tcl_GetStringFromObj(elt, &len);
+ Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
+ Tcl_GetStringFromObj(eltPtr, &len);
size += len + 1;
}
@@ -578,13 +575,9 @@ Tcl_SplitPath(path, argcPtr, argvPtr)
p = (char *) &(*argvPtr)[(*argcPtr) + 1];
for (i = 0; i < *argcPtr; i++) {
- int len;
- Tcl_Obj *elt;
- char *str;
-
- Tcl_ListObjIndex(NULL, resultPtr, i, &elt);
- str = Tcl_GetStringFromObj(elt, &len);
- strncpy(p, str, len+1);
+ Tcl_ListObjIndex(NULL, resultPtr, i, &eltPtr);
+ str = Tcl_GetStringFromObj(eltPtr, &len);
+ memcpy((VOID *) p, (VOID *) str, (size_t) len+1);
p += len+1;
}
@@ -1048,7 +1041,7 @@ TclpNativeJoinPath(prefix, joining)
* slashes.
*/
- Tcl_SetObjLength(prefix, length + strlen(p));
+ Tcl_SetObjLength(prefix, length + (int) strlen(p));
dest = Tcl_GetString(prefix) + length;
for (; *p != '\0'; p++) {
@@ -1087,7 +1080,7 @@ TclpNativeJoinPath(prefix, joining)
* trailing slashes.
*/
- Tcl_SetObjLength(prefix, length + strlen(p));
+ Tcl_SetObjLength(prefix, length + (int) strlen(p));
dest = Tcl_GetString(prefix) + length;
for (; *p != '\0'; p++) {
if ((*p == '/') || (*p == '\\')) {
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index d191758..d5fa64c 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.15 2001/08/23 17:37:08 vincentdarley Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.16 2001/08/23 18:20:50 hobbs Exp $
*/
#include "tclInt.h"
@@ -2680,7 +2680,7 @@ Tcl_FSJoinPath(listObj, elements)
Tcl_AppendToObj(res, &separator, 1);
length++;
}
- Tcl_SetObjLength(res, length + strlen(strElt));
+ Tcl_SetObjLength(res, length + (int) strlen(strElt));
ptr = Tcl_GetString(res) + length;
for (; *strElt != '\0'; strElt++) {
@@ -2790,7 +2790,7 @@ GetPathType(pathObjPtr, filesystemPtrPtr, driveNameLengthPtr, driveNameRef)
if (pathLen < len) {
continue;
}
- if (strncmp(strVol, path, len) == 0) {
+ if (strncmp(strVol, path, (size_t) len) == 0) {
type = TCL_PATH_ABSOLUTE;
if (filesystemPtrPtr != NULL) {
*filesystemPtrPtr = fsRecPtr->fsPtr;
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 223f373..23eeda6 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixFCmd.c,v 1.9 2001/08/23 17:37:08 vincentdarley Exp $
+ * RCS: @(#) $Id: tclUnixFCmd.c,v 1.10 2001/08/23 18:20:50 hobbs Exp $
*
* Portions of this code were derived from NetBSD source code which has
* the following copyright notice:
@@ -1417,7 +1417,6 @@ SetPermissionsAttribute(interp, objIndex, fileName, attributePtr)
if (Tcl_GetLongFromObj(NULL, attributePtr, &mode) == TCL_OK) {
newMode = (mode_t) (mode & 0x00007FFF);
} else {
- Tcl_DString ds;
struct stat buf;
char *modeStringPtr = Tcl_GetString(attributePtr);