diff options
author | nijtmans <nijtmans> | 2010-04-22 11:40:31 (GMT) |
---|---|---|
committer | nijtmans <nijtmans> | 2010-04-22 11:40:31 (GMT) |
commit | 4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de (patch) | |
tree | b4c7c5b00f25f4e8cf1882d5b5e88eb39f9d3799 /win | |
parent | 833ea84043d927c416802983797aa3884a894012 (diff) | |
download | tcl-4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de.zip tcl-4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de.tar.gz tcl-4c3a083386d8c35e9a7d32b9f88b3ba9dc9fc9de.tar.bz2 |
Move TCHAR fallback typedef from tcl.h to tclPlatDecls.h (as suggested by dgp)
Eliminate various unnecessary type casts.
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinChan.c | 4 | ||||
-rw-r--r-- | win/tclWinFCmd.c | 8 | ||||
-rw-r--r-- | win/tclWinFile.c | 60 | ||||
-rw-r--r-- | win/tclWinLoad.c | 4 | ||||
-rw-r--r-- | win/tclWinPipe.c | 4 |
5 files changed, 40 insertions, 40 deletions
diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 6ab056d..400fb64 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.56 2010/03/16 16:18:35 nijtmans Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.57 2010/04/22 11:40:32 nijtmans Exp $ */ #include "tclWinInt.h" @@ -856,7 +856,7 @@ TclpOpenFileChannel( char channelName[16 + TCL_INTEGER_SPACE]; TclFile readFile = NULL, writeFile = NULL; - nativeName = (const TCHAR *) Tcl_FSGetNativePath(pathPtr); + nativeName = Tcl_FSGetNativePath(pathPtr); if (nativeName == NULL) { return NULL; } diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 6fa7441..89cb59f 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFCmd.c,v 1.61 2010/03/07 14:39:25 nijtmans Exp $ + * RCS: @(#) $Id: tclWinFCmd.c,v 1.62 2010/04/22 11:40:32 nijtmans Exp $ */ #include "tclWinInt.h" @@ -1188,7 +1188,7 @@ DoRemoveDirectory( * filled with UTF-8 name of file causing * error. */ { - int res = DoRemoveJustDirectory(Tcl_DStringValue(pathPtr), recursive, + int res = DoRemoveJustDirectory((const TCHAR *)Tcl_DStringValue(pathPtr), recursive, errorPtr); if ((res == TCL_ERROR) && (recursive != 0) && (Tcl_GetErrno() == EEXIST)) { @@ -1400,8 +1400,8 @@ TraverseWinTree( * files in that directory. */ - result = traverseProc(Tcl_DStringValue(sourcePtr), - (targetPtr == NULL ? NULL : Tcl_DStringValue(targetPtr)), + result = traverseProc((const TCHAR *)Tcl_DStringValue(sourcePtr), + (const TCHAR *)(targetPtr == NULL ? NULL : Tcl_DStringValue(targetPtr)), DOTREE_POSTD, errorPtr); } diff --git a/win/tclWinFile.c b/win/tclWinFile.c index b18aa1c..c38a86f 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.106 2010/04/13 13:37:29 nijtmans Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.107 2010/04/22 11:40:32 nijtmans Exp $ */ /* #define _WIN32_WINNT 0x0500 */ @@ -667,7 +667,7 @@ WinReadLinkDirectory( } } - tclWinProcs->tchar2utf((const char *) + tclWinProcs->tchar2utf((const TCHAR *) reparseBuffer->MountPointReparseBuffer.PathBuffer, (int) reparseBuffer->MountPointReparseBuffer .SubstituteNameLength, &ds); @@ -908,7 +908,7 @@ TclpMatchInDirectory( DWORD attr; const char *str = Tcl_GetStringFromObj(norm,&len); - native = (const TCHAR *) Tcl_FSGetNativePath(pathPtr); + native = Tcl_FSGetNativePath(pathPtr); if (tclWinProcs->getFileAttributesExProc == NULL) { attr = tclWinProcs->getFileAttributesProc(native); @@ -1851,7 +1851,7 @@ TclpObjChdir( Tcl_DString ds; #endif /* __CYGWIN__ */ - nativePath = (const TCHAR *) Tcl_FSGetNativePath(pathPtr); + nativePath = Tcl_FSGetNativePath(pathPtr); #ifdef __CYGWIN__ /* @@ -2003,7 +2003,7 @@ TclpObjStat( TclWinFlushDirtyChannels(); - return NativeStat((const TCHAR *) Tcl_FSGetNativePath(pathPtr), + return NativeStat(Tcl_FSGetNativePath(pathPtr), statPtr, 0); } @@ -2394,7 +2394,7 @@ TclpGetNativeCwd( } } - return TclNativeDupInternalRep((ClientData) buffer); + return TclNativeDupInternalRep(buffer); } int @@ -2402,7 +2402,7 @@ TclpObjAccess( Tcl_Obj *pathPtr, int mode) { - return NativeAccess((const TCHAR *) Tcl_FSGetNativePath(pathPtr), mode); + return NativeAccess(Tcl_FSGetNativePath(pathPtr), mode); } int @@ -2418,7 +2418,7 @@ TclpObjLstat( TclWinFlushDirtyChannels(); - return NativeStat((const TCHAR *) Tcl_FSGetNativePath(pathPtr), + return NativeStat(Tcl_FSGetNativePath(pathPtr), statPtr, 1); } @@ -2431,15 +2431,15 @@ TclpObjLink( { if (toPtr != NULL) { int res; - TCHAR *LinkTarget; - TCHAR *LinkSource = (TCHAR *) Tcl_FSGetNativePath(pathPtr); + const TCHAR *LinkTarget; + const TCHAR *LinkSource = Tcl_FSGetNativePath(pathPtr); Tcl_Obj *normalizedToPtr = Tcl_FSGetNormalizedPath(NULL, toPtr); if (normalizedToPtr == NULL) { return NULL; } - LinkTarget = (TCHAR *) Tcl_FSGetNativePath(normalizedToPtr); + LinkTarget = Tcl_FSGetNativePath(normalizedToPtr); if (LinkSource == NULL || LinkTarget == NULL) { return NULL; @@ -2451,7 +2451,7 @@ TclpObjLink( return NULL; } } else { - TCHAR *LinkSource = (TCHAR *) Tcl_FSGetNativePath(pathPtr); + const TCHAR *LinkSource = Tcl_FSGetNativePath(pathPtr); if (LinkSource == NULL) { return NULL; @@ -2501,14 +2501,14 @@ TclpFilesystemPathType( firstSeparator = strchr(path, '/'); if (firstSeparator == NULL) { found = tclWinProcs->getVolumeInformationProc( - Tcl_FSGetNativePath(pathPtr), NULL, 0, NULL, NULL, NULL, + Tcl_FSGetNativePath(pathPtr), NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE); } else { Tcl_Obj *driveName = Tcl_NewStringObj(path, firstSeparator - path+1); Tcl_IncrRefCount(driveName); found = tclWinProcs->getVolumeInformationProc( - Tcl_FSGetNativePath(driveName), NULL, 0, NULL, NULL, NULL, + Tcl_FSGetNativePath(driveName), NULL, 0, NULL, NULL, NULL, volType, VOL_BUF_SIZE); Tcl_DecrRefCount(driveName); } @@ -2519,7 +2519,7 @@ TclpFilesystemPathType( Tcl_DString ds; Tcl_Obj *objPtr; - tclWinProcs->tchar2utf((const char *) volType, -1, &ds); + tclWinProcs->tchar2utf(volType, -1, &ds); objPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); Tcl_DStringFree(&ds); @@ -2667,7 +2667,7 @@ TclpObjNormalizePath( * path segment and continue */ - Tcl_DStringAppend(&dsNorm, (TCHAR *) + Tcl_DStringAppend(&dsNorm, (const char *) (nativePath + Tcl_DStringLength(&ds)-dotLen), dotLen); } else { @@ -2675,7 +2675,7 @@ TclpObjNormalizePath( * Normal path. */ - WIN32_FIND_DATA fData; + WIN32_FIND_DATAA fData; HANDLE handle; handle = FindFirstFileA(nativePath, &fData); @@ -2746,7 +2746,7 @@ TclpObjNormalizePath( */ WIN32_FILE_ATTRIBUTE_DATA data; - const char *nativePath = tclWinProcs->utf2tchar(path, + const TCHAR *nativePath = tclWinProcs->utf2tchar(path, currentPathEndPosition - path, &ds); if (tclWinProcs->getFileAttributesExProc(nativePath, @@ -2773,7 +2773,7 @@ TclpObjNormalizePath( ((WCHAR *) nativePath)[i] = wc; } } - Tcl_DStringAppend(&dsNorm, nativePath, + Tcl_DStringAppend(&dsNorm, (const char *)nativePath, (int)(sizeof(WCHAR) * len)); lastValidPathEnd = currentPathEndPosition; } @@ -2855,7 +2855,7 @@ TclpObjNormalizePath( drive -= (L'a' - L'A'); ((WCHAR *) nativePath)[0] = drive; } - Tcl_DStringAppend(&dsNorm, nativePath, + Tcl_DStringAppend(&dsNorm, (const char *)nativePath, Tcl_DStringLength(&ds)); } else { char *checkDots = NULL; @@ -2880,8 +2880,8 @@ TclpObjNormalizePath( * path segment and continue. */ - Tcl_DStringAppend(&dsNorm, (TCHAR *) - ((WCHAR*)(nativePath + Tcl_DStringLength(&ds)) + Tcl_DStringAppend(&dsNorm, (const char *) + ((WCHAR *)(nativePath + Tcl_DStringLength(&ds)) - dotLen), (int)(dotLen * sizeof(WCHAR))); } else { /* @@ -2911,7 +2911,7 @@ TclpObjNormalizePath( FindClose(handle); Tcl_DStringAppend(&dsNorm, (const char *) L"/", sizeof(WCHAR)); - Tcl_DStringAppend(&dsNorm, (TCHAR *) nativeName, + Tcl_DStringAppend(&dsNorm, (const char *) nativeName, (int) (wcslen(nativeName)*sizeof(WCHAR))); } } @@ -2940,7 +2940,7 @@ TclpObjNormalizePath( if (1) { WCHAR wpath[MAX_PATH]; - const char *nativePath = + const TCHAR *nativePath = tclWinProcs->utf2tchar(path, lastValidPathEnd - path, &ds); DWORD wpathlen = tclWinProcs->getLongPathNameProc(nativePath, (TCHAR *) wpath, MAX_PATH); @@ -2952,7 +2952,7 @@ TclpObjNormalizePath( if (wpath[0] >= L'a') { wpath[0] -= (L'a' - L'A'); } - Tcl_DStringAppend(&dsNorm, (TCHAR*)wpath, wpathlen*sizeof(WCHAR)); + Tcl_DStringAppend(&dsNorm, (const char *)wpath, wpathlen*sizeof(WCHAR)); Tcl_DStringFree(&ds); } #endif @@ -2972,7 +2972,7 @@ TclpObjNormalizePath( Tcl_DString dsTemp; - tclWinProcs->tchar2utf(Tcl_DStringValue(&dsNorm), + tclWinProcs->tchar2utf((const TCHAR *)Tcl_DStringValue(&dsNorm), Tcl_DStringLength(&dsNorm), &dsTemp); nextCheckpoint = Tcl_DStringLength(&dsTemp); if (*lastValidPathEnd != 0) { @@ -3150,7 +3150,7 @@ TclpNativeToNormalized( int len; char *copy, *p; - tclWinProcs->tchar2utf((const char *) clientData, -1, &ds); + tclWinProcs->tchar2utf((const TCHAR *) clientData, -1, &ds); copy = Tcl_DStringValue(&ds); len = Tcl_DStringLength(&ds); @@ -3255,7 +3255,7 @@ TclNativeCreateNativeRep( memcpy(nativePathPtr, Tcl_DStringValue(&ds), (size_t) len); Tcl_DStringFree(&ds); - return (ClientData) nativePathPtr; + return nativePathPtr; } /* @@ -3302,7 +3302,7 @@ TclNativeDupInternalRep( copy = (char *) ckalloc(len); memcpy(copy, clientData, len); - return (ClientData) copy; + return copy; } /* @@ -3337,7 +3337,7 @@ TclpUtime( FromCTime(tval->actime, &lastAccessTime); FromCTime(tval->modtime, &lastModTime); - native = (const TCHAR *) Tcl_FSGetNativePath(pathPtr); + native = Tcl_FSGetNativePath(pathPtr); attr = tclWinProcs->getFileAttributesProc(native); diff --git a/win/tclWinLoad.c b/win/tclWinLoad.c index f1eb1e0..3eb0134 100644 --- a/win/tclWinLoad.c +++ b/win/tclWinLoad.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: tclWinLoad.c,v 1.28 2010/04/13 13:37:29 nijtmans Exp $ + * RCS: @(#) $Id: tclWinLoad.c,v 1.29 2010/04/22 11:40:32 nijtmans Exp $ */ #include "tclWinInt.h" @@ -347,7 +347,7 @@ TclpTempFileNameForLibrary(Tcl_Interp* interp, /* Tcl interpreter */ Tcl_AppendResult(interp, "couldn't create temporary directory: ", Tcl_PosixError(interp), NULL); } - fileName = TclpNativeToNormalized((ClientData) dllDirectoryName); + fileName = TclpNativeToNormalized(dllDirectoryName); tail = TclPathPart(interp, path, TCL_PATH_TAIL); if (tail == NULL) { Tcl_DecrRefCount(fileName); diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c index 2ee7310..7c19e38 100644 --- a/win/tclWinPipe.c +++ b/win/tclWinPipe.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinPipe.c,v 1.78 2010/03/20 12:00:42 nijtmans Exp $ + * RCS: @(#) $Id: tclWinPipe.c,v 1.79 2010/04/22 11:40:32 nijtmans Exp $ */ #include "tclWinInt.h" @@ -766,7 +766,7 @@ TclpTempFileName(void) return NULL; } - return TclpNativeToNormalized((ClientData) fileName); + return TclpNativeToNormalized(fileName); } /* |