summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-03-07 14:39:25 (GMT)
committernijtmans <nijtmans>2010-03-07 14:39:25 (GMT)
commit646fc65d90e21ea34b47fee9ef22f8fbaf4e40ca (patch)
tree613fc83e151efdbb14c37fbfb42d5f8aa355642d /win
parente0f4b9aef0aed9b336779d768d41cf8fba52f137 (diff)
downloadtcl-646fc65d90e21ea34b47fee9ef22f8fbaf4e40ca.zip
tcl-646fc65d90e21ea34b47fee9ef22f8fbaf4e40ca.tar.gz
tcl-646fc65d90e21ea34b47fee9ef22f8fbaf4e40ca.tar.bz2
test that tclOO stubs are present in stub library
Applied missing part of [Patch 2961556] Change all tclWinProcs signatures to use TCHAR* in stead of WCHAR*. This is meant as preparation to make [Enh 2965056] possible at all.
Diffstat (limited to 'win')
-rw-r--r--win/tclWin32Dll.c52
-rw-r--r--win/tclWinDde.c8
-rw-r--r--win/tclWinFCmd.c16
-rw-r--r--win/tclWinFile.c28
-rw-r--r--win/tclWinInt.h24
-rw-r--r--win/tclWinPipe.c25
-rw-r--r--win/tclWinSock.c10
7 files changed, 79 insertions, 84 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 76fc642..50689bc 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.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: tclWin32Dll.c,v 1.61 2010/02/15 22:56:19 nijtmans Exp $
+ * RCS: @(#) $Id: tclWin32Dll.c,v 1.62 2010/03/07 14:39:25 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -130,24 +130,24 @@ static TclWinProcs asciiProcs = {
(BOOL (WINAPI *)(const TCHAR *)) DeleteFileA,
(HANDLE (WINAPI *)(const TCHAR *, WIN32_FIND_DATAT *)) FindFirstFileA,
(BOOL (WINAPI *)(HANDLE, WIN32_FIND_DATAT *)) FindNextFileA,
- (BOOL (WINAPI *)(WCHAR *, LPDWORD)) GetComputerNameA,
- (DWORD (WINAPI *)(DWORD, WCHAR *)) GetCurrentDirectoryA,
+ (BOOL (WINAPI *)(TCHAR *, LPDWORD)) GetComputerNameA,
+ (DWORD (WINAPI *)(DWORD, TCHAR *)) GetCurrentDirectoryA,
(DWORD (WINAPI *)(const TCHAR *)) GetFileAttributesA,
- (DWORD (WINAPI *)(const TCHAR *, DWORD nBufferLength, WCHAR *,
+ (DWORD (WINAPI *)(const TCHAR *, DWORD nBufferLength, TCHAR *,
TCHAR **)) GetFullPathNameA,
- (DWORD (WINAPI *)(HMODULE, WCHAR *, int)) GetModuleFileNameA,
- (DWORD (WINAPI *)(const TCHAR *, WCHAR *, DWORD)) GetShortPathNameA,
+ (DWORD (WINAPI *)(HMODULE, TCHAR *, int)) GetModuleFileNameA,
+ (DWORD (WINAPI *)(const TCHAR *, TCHAR *, DWORD)) GetShortPathNameA,
(UINT (WINAPI *)(const TCHAR *, const TCHAR *, UINT uUnique,
- WCHAR *)) GetTempFileNameA,
- (DWORD (WINAPI *)(DWORD, WCHAR *)) GetTempPathA,
- (BOOL (WINAPI *)(const TCHAR *, WCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD,
- WCHAR *, DWORD)) GetVolumeInformationA,
+ TCHAR *)) GetTempFileNameA,
+ (DWORD (WINAPI *)(DWORD, TCHAR *)) GetTempPathA,
+ (BOOL (WINAPI *)(const TCHAR *, TCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD,
+ TCHAR *, DWORD)) GetVolumeInformationA,
(HINSTANCE (WINAPI *)(const TCHAR *)) LoadLibraryA,
- (TCHAR (WINAPI *)(WCHAR *, const TCHAR *)) lstrcpyA,
+ (TCHAR (WINAPI *)(TCHAR *, const TCHAR *)) lstrcpyA,
(BOOL (WINAPI *)(const TCHAR *, const TCHAR *)) MoveFileA,
(BOOL (WINAPI *)(const TCHAR *)) RemoveDirectoryA,
(DWORD (WINAPI *)(const TCHAR *, const TCHAR *, const TCHAR *, DWORD,
- WCHAR *, TCHAR **)) SearchPathA,
+ TCHAR *, TCHAR **)) SearchPathA,
(BOOL (WINAPI *)(const TCHAR *)) SetCurrentDirectoryA,
(BOOL (WINAPI *)(const TCHAR *, DWORD)) SetFileAttributesA,
@@ -189,24 +189,24 @@ static TclWinProcs unicodeProcs = {
(BOOL (WINAPI *)(const TCHAR *)) DeleteFileW,
(HANDLE (WINAPI *)(const TCHAR *, WIN32_FIND_DATAT *)) FindFirstFileW,
(BOOL (WINAPI *)(HANDLE, WIN32_FIND_DATAT *)) FindNextFileW,
- (BOOL (WINAPI *)(WCHAR *, LPDWORD)) GetComputerNameW,
- (DWORD (WINAPI *)(DWORD, WCHAR *)) GetCurrentDirectoryW,
+ (BOOL (WINAPI *)(TCHAR *, LPDWORD)) GetComputerNameW,
+ (DWORD (WINAPI *)(DWORD, TCHAR *)) GetCurrentDirectoryW,
(DWORD (WINAPI *)(const TCHAR *)) GetFileAttributesW,
- (DWORD (WINAPI *)(const TCHAR *, DWORD nBufferLength, WCHAR *,
+ (DWORD (WINAPI *)(const TCHAR *, DWORD nBufferLength, TCHAR *,
TCHAR **)) GetFullPathNameW,
- (DWORD (WINAPI *)(HMODULE, WCHAR *, int)) GetModuleFileNameW,
- (DWORD (WINAPI *)(const TCHAR *, WCHAR *, DWORD)) GetShortPathNameW,
+ (DWORD (WINAPI *)(HMODULE, TCHAR *, int)) GetModuleFileNameW,
+ (DWORD (WINAPI *)(const TCHAR *, TCHAR *, DWORD)) GetShortPathNameW,
(UINT (WINAPI *)(const TCHAR *, const TCHAR *, UINT uUnique,
- WCHAR *)) GetTempFileNameW,
- (DWORD (WINAPI *)(DWORD, WCHAR *)) GetTempPathW,
- (BOOL (WINAPI *)(const TCHAR *, WCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD,
- WCHAR *, DWORD)) GetVolumeInformationW,
+ TCHAR *)) GetTempFileNameW,
+ (DWORD (WINAPI *)(DWORD, TCHAR *)) GetTempPathW,
+ (BOOL (WINAPI *)(const TCHAR *, TCHAR *, DWORD, LPDWORD, LPDWORD, LPDWORD,
+ TCHAR *, DWORD)) GetVolumeInformationW,
(HINSTANCE (WINAPI *)(const TCHAR *)) LoadLibraryW,
- (TCHAR (WINAPI *)(WCHAR *, const TCHAR *)) lstrcpyW,
+ (TCHAR (WINAPI *)(TCHAR *, const TCHAR *)) lstrcpyW,
(BOOL (WINAPI *)(const TCHAR *, const TCHAR *)) MoveFileW,
(BOOL (WINAPI *)(const TCHAR *)) RemoveDirectoryW,
(DWORD (WINAPI *)(const TCHAR *, const TCHAR *, const TCHAR *, DWORD,
- WCHAR *, TCHAR **)) SearchPathW,
+ TCHAR *, TCHAR **)) SearchPathW,
(BOOL (WINAPI *)(const TCHAR *)) SetCurrentDirectoryW,
(BOOL (WINAPI *)(const TCHAR *, DWORD)) SetFileAttributesW,
@@ -250,7 +250,7 @@ BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason,
*/
typedef struct MountPointMap {
- const WCHAR *volumeName; /* Native wide string volume name. */
+ const TCHAR *volumeName; /* Native wide string volume name. */
char driveLetter; /* Drive letter corresponding to the volume
* name. */
struct MountPointMap *nextPtr;
@@ -695,7 +695,7 @@ TclWinDriveLetterForVolMountPoint(
Tcl_MutexLock(&mountPointMap);
dlIter = driveLetterLookup;
while (dlIter != NULL) {
- if (wcscmp(dlIter->volumeName, mountPoint) == 0) {
+ if (wcscmp((WCHAR *)dlIter->volumeName, mountPoint) == 0) {
/*
* We need to check whether this information is still valid, since
* either the user or various programs could have adjusted the
@@ -794,7 +794,7 @@ TclWinDriveLetterForVolMountPoint(
for (dlIter = driveLetterLookup; dlIter != NULL;
dlIter = dlIter->nextPtr) {
- if (wcscmp(dlIter->volumeName, mountPoint) == 0) {
+ if (wcscmp((WCHAR *)dlIter->volumeName, mountPoint) == 0) {
Tcl_MutexUnlock(&mountPointMap);
return dlIter->driveLetter;
}
diff --git a/win/tclWinDde.c b/win/tclWinDde.c
index 6fc902d..3421510 100644
--- a/win/tclWinDde.c
+++ b/win/tclWinDde.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: tclWinDde.c,v 1.41 2010/02/25 23:39:50 dkf Exp $
+ * RCS: @(#) $Id: tclWinDde.c,v 1.42 2010/03/07 14:39:25 nijtmans Exp $
*/
#undef STATIC_BUILD
@@ -991,7 +991,7 @@ DdeServicesOnAck(
ATOM service = (ATOM)LOWORD(lParam);
ATOM topic = (ATOM)HIWORD(lParam);
struct DdeEnumServices *es;
- TCHAR sz[255];
+ char sz[255];
#ifdef _WIN64
es = (struct DdeEnumServices *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
@@ -1004,9 +1004,9 @@ DdeServicesOnAck(
Tcl_Obj *matchPtr = Tcl_NewListObj(0, NULL);
Tcl_Obj *resultPtr = Tcl_GetObjResult(es->interp);
- GlobalGetAtomName(service, sz, 255);
+ GlobalGetAtomNameA(service, sz, 255);
Tcl_ListObjAppendElement(NULL, matchPtr, Tcl_NewStringObj(sz, -1));
- GlobalGetAtomName(topic, sz, 255);
+ GlobalGetAtomNameA(topic, sz, 255);
Tcl_ListObjAppendElement(NULL, matchPtr, Tcl_NewStringObj(sz, -1));
/*
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c
index a60ea61..6fa7441 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.60 2010/02/15 23:10:47 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinFCmd.c,v 1.61 2010/03/07 14:39:25 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -328,8 +328,8 @@ DoRenameFile(
TCHAR *nativeSrcRest, *nativeDstRest;
const char **srcArgv, **dstArgv;
int size, srcArgc, dstArgc;
- WCHAR nativeSrcPath[MAX_PATH];
- WCHAR nativeDstPath[MAX_PATH];
+ TCHAR nativeSrcPath[MAX_PATH*2];
+ TCHAR nativeDstPath[MAX_PATH*2];
Tcl_DString srcString, dstString;
const char *src, *dst;
@@ -343,11 +343,11 @@ DoRenameFile(
if ((size == 0) || (size > MAX_PATH)) {
return TCL_ERROR;
}
- tclWinProcs->charLowerProc((TCHAR *) nativeSrcPath);
- tclWinProcs->charLowerProc((TCHAR *) nativeDstPath);
+ tclWinProcs->charLowerProc(nativeSrcPath);
+ tclWinProcs->charLowerProc(nativeDstPath);
- src = tclWinProcs->tchar2utf((TCHAR *) nativeSrcPath, -1, &srcString);
- dst = tclWinProcs->tchar2utf((TCHAR *) nativeDstPath, -1, &dstString);
+ src = tclWinProcs->tchar2utf(nativeSrcPath, -1, &srcString);
+ dst = tclWinProcs->tchar2utf(nativeDstPath, -1, &dstString);
/*
* Check whether the destination path is actually inside the
@@ -465,7 +465,7 @@ DoRenameFile(
TCHAR *nativeRest, *nativeTmp, *nativePrefix;
int result, size;
- WCHAR tempBuf[MAX_PATH];
+ TCHAR tempBuf[MAX_PATH*2];
size = tclWinProcs->getFullPathNameProc(nativeDst, MAX_PATH,
tempBuf, &nativeRest);
diff --git a/win/tclWinFile.c b/win/tclWinFile.c
index 9522c52..2785912 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.104 2010/02/15 23:10:47 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinFile.c,v 1.105 2010/03/07 14:39:25 nijtmans Exp $
*/
/* #define _WIN32_WINNT 0x0500 */
@@ -224,7 +224,7 @@ WinLink(
const TCHAR *linkTargetPath,
int linkAction)
{
- WCHAR tempFileName[MAX_PATH];
+ TCHAR tempFileName[MAX_PATH*2];
TCHAR *tempFilePart;
DWORD attr;
@@ -345,7 +345,7 @@ static Tcl_Obj *
WinReadLink(
const TCHAR *linkSourcePath)
{
- WCHAR tempFileName[MAX_PATH];
+ TCHAR tempFileName[MAX_PATH*2];
TCHAR *tempFilePart;
DWORD attr;
@@ -1946,7 +1946,7 @@ TclpGetCwd(
Tcl_DString *bufferPtr) /* Uninitialized or free DString filled with
* name of current directory. */
{
- WCHAR buffer[MAX_PATH];
+ TCHAR buffer[MAX_PATH*2];
char *p;
if (tclWinProcs->getCurrentDirectoryProc(MAX_PATH, buffer) == 0) {
@@ -1963,18 +1963,14 @@ TclpGetCwd(
*/
if (tclWinProcs->useWide) {
- WCHAR *native;
-
- native = (WCHAR *) buffer;
+ WCHAR *native = (WCHAR *) buffer;
if ((native[0] != '\0') && (native[1] == ':')
&& (native[2] == '\\') && (native[3] == '\\')) {
native += 2;
}
tclWinProcs->tchar2utf((TCHAR *) native, -1, bufferPtr);
} else {
- char *native;
-
- native = (char *) buffer;
+ char *native = (char *) buffer;
if ((native[0] != '\0') && (native[1] == ':')
&& (native[2] == '\\') && (native[3] == '\\')) {
native += 2;
@@ -2197,14 +2193,14 @@ NativeDev(
{
int dev;
Tcl_DString ds;
- WCHAR nativeFullPath[MAX_PATH];
+ TCHAR nativeFullPath[MAX_PATH*2];
TCHAR *nativePart;
const char *fullPath;
tclWinProcs->getFullPathNameProc(nativePath, MAX_PATH, nativeFullPath,
&nativePart);
- fullPath = tclWinProcs->tchar2utf((TCHAR *) nativeFullPath, -1, &ds);
+ fullPath = tclWinProcs->tchar2utf(nativeFullPath, -1, &ds);
if ((fullPath[0] == '\\') && (fullPath[1] == '\\')) {
const char *p;
@@ -2371,7 +2367,7 @@ ClientData
TclpGetNativeCwd(
ClientData clientData)
{
- WCHAR buffer[MAX_PATH];
+ TCHAR buffer[MAX_PATH*2];
if (tclWinProcs->getCurrentDirectoryProc(MAX_PATH, buffer) == 0) {
TclWinConvertError(GetLastError());
@@ -2489,7 +2485,7 @@ TclpFilesystemPathType(
{
#define VOL_BUF_SIZE 32
int found;
- WCHAR volType[VOL_BUF_SIZE];
+ TCHAR volType[VOL_BUF_SIZE*2];
char *firstSeparator;
const char *path;
Tcl_Obj *normPath = Tcl_FSGetNormalizedPath(NULL, pathPtr);
@@ -2506,14 +2502,14 @@ TclpFilesystemPathType(
if (firstSeparator == NULL) {
found = tclWinProcs->getVolumeInformationProc(
Tcl_FSGetNativePath(pathPtr), NULL, 0, NULL, NULL, NULL,
- (WCHAR *) volType, VOL_BUF_SIZE);
+ 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,
- (WCHAR *) volType, VOL_BUF_SIZE);
+ volType, VOL_BUF_SIZE);
Tcl_DecrRefCount(driveName);
}
diff --git a/win/tclWinInt.h b/win/tclWinInt.h
index 13d25ef..8d02d0e 100644
--- a/win/tclWinInt.h
+++ b/win/tclWinInt.h
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinInt.h,v 1.34 2010/02/15 22:56:19 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinInt.h,v 1.35 2010/03/07 14:39:25 nijtmans Exp $
*/
#ifndef _TCLWININT
@@ -54,24 +54,24 @@ typedef struct TclWinProcs {
BOOL (WINAPI *deleteFileProc)(const TCHAR *);
HANDLE (WINAPI *findFirstFileProc)(const TCHAR *, WIN32_FIND_DATAT *);
BOOL (WINAPI *findNextFileProc)(HANDLE, WIN32_FIND_DATAT *);
- BOOL (WINAPI *getComputerNameProc)(WCHAR *, LPDWORD);
- DWORD (WINAPI *getCurrentDirectoryProc)(DWORD, WCHAR *);
+ BOOL (WINAPI *getComputerNameProc)(TCHAR *, LPDWORD);
+ DWORD (WINAPI *getCurrentDirectoryProc)(DWORD, TCHAR *);
DWORD (WINAPI *getFileAttributesProc)(const TCHAR *);
- DWORD (WINAPI *getFullPathNameProc)(const TCHAR *, DWORD, WCHAR *,
+ DWORD (WINAPI *getFullPathNameProc)(const TCHAR *, DWORD, TCHAR *,
TCHAR **);
- DWORD (WINAPI *getModuleFileNameProc)(HMODULE, WCHAR *, int);
- DWORD (WINAPI *getShortPathNameProc)(const TCHAR *, WCHAR *, DWORD);
+ DWORD (WINAPI *getModuleFileNameProc)(HMODULE, TCHAR *, int);
+ DWORD (WINAPI *getShortPathNameProc)(const TCHAR *, TCHAR *, DWORD);
UINT (WINAPI *getTempFileNameProc)(const TCHAR *, const TCHAR *, UINT,
- WCHAR *);
- DWORD (WINAPI *getTempPathProc)(DWORD, WCHAR *);
- BOOL (WINAPI *getVolumeInformationProc)(const TCHAR *, WCHAR *, DWORD,
- LPDWORD, LPDWORD, LPDWORD, WCHAR *, DWORD);
+ TCHAR *);
+ DWORD (WINAPI *getTempPathProc)(DWORD, TCHAR *);
+ BOOL (WINAPI *getVolumeInformationProc)(const TCHAR *, TCHAR *, DWORD,
+ LPDWORD, LPDWORD, LPDWORD, TCHAR *, DWORD);
HINSTANCE (WINAPI *loadLibraryProc)(const TCHAR *);
- TCHAR (WINAPI *lstrcpyProc)(WCHAR *, const TCHAR *);
+ TCHAR (WINAPI *lstrcpyProc)(TCHAR *, const TCHAR *);
BOOL (WINAPI *moveFileProc)(const TCHAR *, const TCHAR *);
BOOL (WINAPI *removeDirectoryProc)(const TCHAR *);
DWORD (WINAPI *searchPathProc)(const TCHAR *, const TCHAR *,
- const TCHAR *, DWORD, WCHAR *, TCHAR **);
+ const TCHAR *, DWORD, TCHAR *, TCHAR **);
BOOL (WINAPI *setCurrentDirectoryProc)(const TCHAR *);
BOOL (WINAPI *setFileAttributesProc)(const TCHAR *, DWORD);
/*
diff --git a/win/tclWinPipe.c b/win/tclWinPipe.c
index 5d97915..a625ae8 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.76 2010/02/15 23:10:47 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinPipe.c,v 1.77 2010/03/07 14:39:25 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -196,7 +196,7 @@ static DWORD WINAPI PipeReaderThread(LPVOID arg);
static void PipeSetupProc(ClientData clientData, int flags);
static void PipeWatchProc(ClientData instanceData, int mask);
static DWORD WINAPI PipeWriterThread(LPVOID arg);
-static int TempFileName(WCHAR name[MAX_PATH]);
+static int TempFileName(TCHAR name[MAX_PATH*2]);
static int WaitForRead(PipeInfo *infoPtr, int blocking);
static void PipeThreadActionProc(ClientData instanceData,
int action);
@@ -474,15 +474,14 @@ TclWinMakeFile(
static int
TempFileName(
- WCHAR name[MAX_PATH]) /* Buffer in which name for temporary file
+ TCHAR name[MAX_PATH*2]) /* Buffer in which name for temporary file
* gets stored. */
{
TCHAR *prefix;
prefix = (tclWinProcs->useWide) ? (TCHAR *) L"TCL" : (TCHAR *) "TCL";
if (tclWinProcs->getTempPathProc(MAX_PATH, name) != 0) {
- if (tclWinProcs->getTempFileNameProc((TCHAR *) name, prefix, 0,
- name) != 0) {
+ if (tclWinProcs->getTempFileNameProc(name, prefix, 0, name) != 0) {
return 1;
}
}
@@ -493,7 +492,7 @@ TempFileName(
((char *) name)[0] = '.';
((char *) name)[1] = '\0';
}
- return tclWinProcs->getTempFileNameProc((TCHAR *) name, prefix, 0, name);
+ return tclWinProcs->getTempFileNameProc(name, prefix, 0, name);
}
/*
@@ -669,7 +668,7 @@ TclFile
TclpCreateTempFile(
const char *contents) /* String to write into temp file, or NULL. */
{
- WCHAR name[MAX_PATH];
+ TCHAR name[MAX_PATH*2];
const char *native;
Tcl_DString dstring;
HANDLE handle;
@@ -761,7 +760,7 @@ TclpCreateTempFile(
Tcl_Obj *
TclpTempFileName(void)
{
- WCHAR fileName[MAX_PATH];
+ TCHAR fileName[MAX_PATH*2];
if (TempFileName(fileName) == 0) {
return NULL;
@@ -1375,7 +1374,7 @@ ApplicationType(
IMAGE_DOS_HEADER header;
Tcl_DString nameBuf, ds;
const TCHAR *nativeName;
- WCHAR nativeFullPath[MAX_PATH];
+ TCHAR nativeFullPath[MAX_PATH*2];
static char extensions[][5] = {"", ".com", ".exe", ".bat"};
/*
@@ -1413,11 +1412,11 @@ ApplicationType(
* known type.
*/
- attr = tclWinProcs->getFileAttributesProc((TCHAR *) nativeFullPath);
+ attr = tclWinProcs->getFileAttributesProc(nativeFullPath);
if ((attr == 0xffffffff) || (attr & FILE_ATTRIBUTE_DIRECTORY)) {
continue;
}
- strcpy(fullName, tclWinProcs->tchar2utf((TCHAR *) nativeFullPath, -1, &ds));
+ strcpy(fullName, tclWinProcs->tchar2utf(nativeFullPath, -1, &ds));
Tcl_DStringFree(&ds);
ext = strrchr(fullName, '.');
@@ -1426,7 +1425,7 @@ ApplicationType(
break;
}
- hFile = tclWinProcs->createFileProc((TCHAR *) nativeFullPath,
+ hFile = tclWinProcs->createFileProc(nativeFullPath,
GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
@@ -3172,7 +3171,7 @@ TclpOpenTemporaryFile(
Tcl_Obj *extensionObj,
Tcl_Obj *resultingNameObj)
{
- WCHAR name[MAX_PATH];
+ TCHAR name[MAX_PATH*2];
char *namePtr;
HANDLE handle;
DWORD flags = FILE_ATTRIBUTE_TEMPORARY;
diff --git a/win/tclWinSock.c b/win/tclWinSock.c
index 933523a..27f7245 100644
--- a/win/tclWinSock.c
+++ b/win/tclWinSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWinSock.c,v 1.69 2010/02/15 23:10:47 nijtmans Exp $
+ * RCS: @(#) $Id: tclWinSock.c,v 1.70 2010/03/07 14:39:25 nijtmans Exp $
*/
#include "tclWinInt.h"
@@ -2423,16 +2423,16 @@ InitializeHostName(
int *lengthPtr,
Tcl_Encoding *encodingPtr)
{
- WCHAR wbuf[MAX_COMPUTERNAME_LENGTH + 1];
- DWORD length = sizeof(wbuf) / sizeof(WCHAR);
+ TCHAR tbuf[(MAX_COMPUTERNAME_LENGTH + 1)*2];
+ DWORD length = MAX_COMPUTERNAME_LENGTH + 1;
Tcl_DString ds;
- if (tclWinProcs->getComputerNameProc(wbuf, &length) != 0) {
+ if (tclWinProcs->getComputerNameProc(tbuf, &length) != 0) {
/*
* Convert string from native to UTF then change to lowercase.
*/
- Tcl_UtfToLower((char *) tclWinProcs->tchar2utf((TCHAR *) wbuf, -1, &ds));
+ Tcl_UtfToLower((char *) tclWinProcs->tchar2utf(tbuf, -1, &ds));
} else {
Tcl_DStringInit(&ds);