summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2001-08-23 18:20:50 (GMT)
committerhobbs <hobbs>2001-08-23 18:20:50 (GMT)
commitd47a11a41d9e4135a144e498ff673ff43c5057d9 (patch)
treee95bc01518484622ad51ae701d0f9022d39b0a8e /generic
parentf319c32167c2c52995fe53b438ef4bc34e9a4914 (diff)
downloadtcl-d47a11a41d9e4135a144e498ff673ff43c5057d9.zip
tcl-d47a11a41d9e4135a144e498ff673ff43c5057d9.tar.gz
tcl-d47a11a41d9e4135a144e498ff673ff43c5057d9.tar.bz2
corrected minor compiler warnings
Diffstat (limited to 'generic')
-rw-r--r--generic/tclFileName.c29
-rw-r--r--generic/tclIOUtil.c6
2 files changed, 14 insertions, 21 deletions
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;