diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-20 09:46:14 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-12-20 09:46:14 (GMT) |
commit | 0dd06785462fa4b6236f6e4b904cb852d75db8ac (patch) | |
tree | 2206551d9434c9ab017193f88a6445c8a57c23a8 /unix/tclUnixFile.c | |
parent | 3d1095d3487c556c156ea88136c5eed62c03b542 (diff) | |
download | tcl-0dd06785462fa4b6236f6e4b904cb852d75db8ac.zip tcl-0dd06785462fa4b6236f6e4b904cb852d75db8ac.tar.gz tcl-0dd06785462fa4b6236f6e4b904cb852d75db8ac.tar.bz2 |
more internal use of size_t in stead of int.
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 886b5ad..5f5bfe0 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -262,14 +262,15 @@ TclpMatchInDirectory( DIR *d; Tcl_DirEntry *entryPtr; const char *dirName; - int dirLength, nativeDirLen; + size_t dirLength, nativeDirLen; int matchHidden, matchHiddenPat; Tcl_StatBuf statBuf; Tcl_DString ds; /* native encoding of dir */ Tcl_DString dsOrig; /* utf-8 encoding of dir */ Tcl_DStringInit(&dsOrig); - dirName = TclGetStringFromObj(fileNamePtr, &dirLength); + dirName = TclGetString(fileNamePtr); + dirLength = fileNamePtr->length; Tcl_DStringAppend(&dsOrig, dirName, dirLength); /* @@ -937,7 +938,6 @@ TclpObjLink( */ if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { - int targetLen; Tcl_DString ds; Tcl_Obj *transPtr; @@ -951,8 +951,8 @@ TclpObjLink( if (transPtr == NULL) { return NULL; } - target = TclGetStringFromObj(transPtr, &targetLen); - target = Tcl_UtfToExternalDString(NULL, target, targetLen, &ds); + target = TclGetString(transPtr); + target = Tcl_UtfToExternalDString(NULL, target, transPtr->length, &ds); Tcl_DecrRefCount(transPtr); if (symlink(target, src) != 0) { @@ -1080,7 +1080,7 @@ TclNativeCreateNativeRep( const char *str; Tcl_DString ds; Tcl_Obj *validPathPtr; - int len; + size_t len; if (TclFSCwdIsNative()) { /* @@ -1105,7 +1105,8 @@ TclNativeCreateNativeRep( Tcl_IncrRefCount(validPathPtr); } - str = TclGetStringFromObj(validPathPtr, &len); + str = TclGetString(validPathPtr); + len = validPathPtr->length; Tcl_UtfToExternalDString(NULL, str, len, &ds); len = Tcl_DStringLength(&ds) + sizeof(char); if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) { |