diff options
author | nijtmans <nijtmans@noemail.net> | 2009-01-22 06:42:32 (GMT) |
---|---|---|
committer | nijtmans <nijtmans@noemail.net> | 2009-01-22 06:42:32 (GMT) |
commit | cf4bcf4b21942c3c1a414cb2eb06b1a6ed03eb60 (patch) | |
tree | 6d0ba0d888c02ee1ac8ad6f7a50157036d96fbd9 /generic/tclFileName.c | |
parent | 82dc523db09ec9c6dfc25bb9676e6b83892d9bad (diff) | |
download | tcl-cf4bcf4b21942c3c1a414cb2eb06b1a6ed03eb60.zip tcl-cf4bcf4b21942c3c1a414cb2eb06b1a6ed03eb60.tar.gz tcl-cf4bcf4b21942c3c1a414cb2eb06b1a6ed03eb60.tar.bz2 |
CONSTify TclPrintInstruction and TclpNativeJoinPath (TIP #27)
{unix win} in *.decls is equivalent to {generic}
tclGetDate.y, tclDate.c: single internal const decoration
FossilOrigin-Name: b4d9520da5a0a5a222745f840e07616a462c2dac
Diffstat (limited to 'generic/tclFileName.c')
-rw-r--r-- | generic/tclFileName.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 2d62414..c621aff 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.95 2008/12/03 07:08:44 dgp Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.96 2009/01/22 06:42:33 nijtmans Exp $ */ #include "tclInt.h" @@ -211,7 +211,7 @@ ExtractWinRoot( Tcl_DStringAppend(resultPtr, path, 2); return &path[2]; } else { - char *tail = (char *) &path[3]; + const char *tail = &path[3]; /* * Skip separators. @@ -389,7 +389,7 @@ TclpGetNativePathType( { Tcl_PathType type = TCL_PATH_ABSOLUTE; int pathLen; - char *path = Tcl_GetStringFromObj(pathPtr, &pathLen); + const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen); if (path[0] == '~') { /* @@ -398,7 +398,7 @@ TclpGetNativePathType( */ if (driveNameLengthPtr != NULL) { - char *end = path + 1; + const char *end = path + 1; while ((*end != '\0') && (*end != '/')) { end++; } @@ -407,7 +407,7 @@ TclpGetNativePathType( } else { switch (tclPlatform) { case TCL_PLATFORM_UNIX: { - char *origPath = path; + const char *origPath = path; /* * Paths that begin with / are absolute. @@ -550,7 +550,8 @@ Tcl_SplitPath( Tcl_Obj *resultPtr = NULL; /* Needed only to prevent gcc warnings. */ Tcl_Obj *tmpPtr, *eltPtr; int i, size, len; - char *p, *str; + char *p; + const char *str; /* * Perform the splitting, using objectified, vfs-aware code. @@ -835,10 +836,12 @@ Tcl_FSJoinToPath( void TclpNativeJoinPath( Tcl_Obj *prefix, - char *joining) + const char *joining) { int length, needsSep; - char *dest, *p, *start; + char *dest; + const char *p; + const char *start; start = Tcl_GetStringFromObj(prefix, &length); @@ -962,7 +965,7 @@ Tcl_JoinPath( int i, len; Tcl_Obj *listObj = Tcl_NewObj(); Tcl_Obj *resultObj; - char *resultStr; + const char *resultStr; /* * Build the list of paths. @@ -1979,7 +1982,7 @@ TclGlob( Tcl_ListObjGetElements(NULL, filenamesObj, &objc, &objv); for (i = 0; i< objc; i++) { int len; - char *oldStr = Tcl_GetStringFromObj(objv[i], &len); + const char *oldStr = Tcl_GetStringFromObj(objv[i], &len); Tcl_Obj *elems[1]; if (len == prefixLen) { |